Add "i2c-at34c02" AT34C02 EEPROM. This is compatible with the AT24C02

EEPROM, apart from software write protection (not supported in our driver).
This commit is contained in:
jdc 2013-10-25 14:32:10 +00:00
parent dbe78631e3
commit 71885a597a
2 changed files with 7 additions and 4 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: at24cxx.c,v 1.15 2013/10/25 14:23:15 jdc Exp $ */
/* $NetBSD: at24cxx.c,v 1.16 2013/10/25 14:32:10 jdc Exp $ */
/*
* Copyright (c) 2003 Wasabi Systems, Inc.
@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: at24cxx.c,v 1.15 2013/10/25 14:23:15 jdc Exp $");
__KERNEL_RCSID(0, "$NetBSD: at24cxx.c,v 1.16 2013/10/25 14:32:10 jdc Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -102,6 +102,7 @@ static int seeprom_wait_idle(struct seeprom_softc *);
static const char * seeprom_compats[] = {
"i2c-at24c64",
"i2c-at34c02",
NULL
};

View File

@ -1,4 +1,4 @@
/* $NetBSD: ofw_subr.c,v 1.22 2013/09/24 18:04:53 jdc Exp $ */
/* $NetBSD: ofw_subr.c,v 1.23 2013/10/25 14:32:10 jdc Exp $ */
/*
* Copyright 1998
@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ofw_subr.c,v 1.22 2013/09/24 18:04:53 jdc Exp $");
__KERNEL_RCSID(0, "$NetBSD: ofw_subr.c,v 1.23 2013/10/25 14:32:10 jdc Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -384,6 +384,8 @@ of_enter_i2c_devs(prop_dictionary_t props, int ofnode, size_t cell_size)
/* Set size for EEPROM's that we know about */
if (strcmp(compatible, "i2c-at24c64") == 0)
prop_dictionary_set_uint32(dev, "size", 8192);
if (strcmp(compatible, "i2c-at34c02") == 0)
prop_dictionary_set_uint32(dev, "size", 256);
}
prop_array_add(array, dev);
prop_object_release(dev);