Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/i2c Remove the i2c "size" locator and corresponding ...
details: https://anonhg.NetBSD.org/src/rev/09d90ccacca8
branches: trunk
changeset: 320203:09d90ccacca8
user: thorpej <thorpej%NetBSD.org@localhost>
date: Tue Jun 26 06:34:55 2018 +0000
description:
Remove the i2c "size" locator and corresponding property / attach arg.
It was a hack meant only for EEPROMs, which have another way to specify
size in the config directive ("flag" paramter), as well as a better way
to detect size based on "compatible" string.
diffstat:
sys/dev/i2c/at24cxx.c | 6 ++----
sys/dev/i2c/files.i2c | 4 ++--
sys/dev/i2c/i2c.c | 12 +++---------
sys/dev/i2c/i2cvar.h | 3 +--
4 files changed, 8 insertions(+), 17 deletions(-)
diffs (114 lines):
diff -r b0e859279683 -r 09d90ccacca8 sys/dev/i2c/at24cxx.c
--- a/sys/dev/i2c/at24cxx.c Tue Jun 26 06:24:52 2018 +0000
+++ b/sys/dev/i2c/at24cxx.c Tue Jun 26 06:34:55 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: at24cxx.c,v 1.29 2018/06/26 06:21:23 thorpej Exp $ */
+/* $NetBSD: at24cxx.c,v 1.30 2018/06/26 06:34:55 thorpej Exp $ */
/*
* Copyright (c) 2003 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: at24cxx.c,v 1.29 2018/06/26 06:21:23 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: at24cxx.c,v 1.30 2018/06/26 06:34:55 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -169,8 +169,6 @@
*/
if (device_cfdata(self)->cf_flags)
sc->sc_size = (device_cfdata(self)->cf_flags << 7);
- else
- sc->sc_size = ia->ia_size;
if (sc->sc_size <= 0 && ia->ia_ncompat > 0) {
if (iic_compatible_match(ia, compat_data, &dce))
diff -r b0e859279683 -r 09d90ccacca8 sys/dev/i2c/files.i2c
--- a/sys/dev/i2c/files.i2c Tue Jun 26 06:24:52 2018 +0000
+++ b/sys/dev/i2c/files.i2c Tue Jun 26 06:34:55 2018 +0000
@@ -1,10 +1,10 @@
-# $NetBSD: files.i2c,v 1.92 2018/05/27 05:31:20 thorpej Exp $
+# $NetBSD: files.i2c,v 1.93 2018/06/26 06:34:55 thorpej Exp $
obsolete defflag opt_i2cbus.h I2C_SCAN
define i2cbus { }
define i2cexec
-device iic { [addr = -1], [size = -1] } : i2c_bitbang
+device iic { [addr = -1] } : i2c_bitbang
attach iic at i2cbus
file dev/i2c/i2c.c iic
file dev/i2c/i2c_exec.c iic | i2cbus | i2cexec
diff -r b0e859279683 -r 09d90ccacca8 sys/dev/i2c/i2c.c
--- a/sys/dev/i2c/i2c.c Tue Jun 26 06:24:52 2018 +0000
+++ b/sys/dev/i2c/i2c.c Tue Jun 26 06:34:55 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: i2c.c,v 1.65 2018/06/26 04:32:35 thorpej Exp $ */
+/* $NetBSD: i2c.c,v 1.66 2018/06/26 06:34:55 thorpej Exp $ */
/*
* Copyright (c) 2003 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
#endif
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.65 2018/06/26 04:32:35 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.66 2018/06/26 06:34:55 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -285,7 +285,6 @@
}
ia.ia_tag = sc->sc_tag;
- ia.ia_size = cf->cf_loc[IICCF_SIZE];
ia.ia_type = sc->sc_type;
ia.ia_name = NULL;
@@ -441,7 +440,7 @@
unsigned int i, count;
prop_dictionary_t dev;
prop_data_t cdata;
- uint32_t addr, size;
+ uint32_t addr;
uint64_t cookie;
const char *name;
struct i2c_attach_args ia;
@@ -462,10 +461,6 @@
if (!prop_dictionary_get_uint64(dev, "cookie", &cookie))
cookie = 0;
loc[IICCF_ADDR] = addr;
- if (prop_dictionary_get_uint32(dev, "size", &size))
- loc[IICCF_SIZE] = size;
- else
- size = loc[IICCF_SIZE] = IICCF_SIZE_DEFAULT;
memset(&ia, 0, sizeof ia);
ia.ia_addr = addr;
@@ -473,7 +468,6 @@
ia.ia_tag = ic;
ia.ia_name = name;
ia.ia_cookie = cookie;
- ia.ia_size = size;
ia.ia_prop = dev;
buf = NULL;
diff -r b0e859279683 -r 09d90ccacca8 sys/dev/i2c/i2cvar.h
--- a/sys/dev/i2c/i2cvar.h Tue Jun 26 06:24:52 2018 +0000
+++ b/sys/dev/i2c/i2cvar.h Tue Jun 26 06:34:55 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: i2cvar.h,v 1.16 2018/06/26 04:32:35 thorpej Exp $ */
+/* $NetBSD: i2cvar.h,v 1.17 2018/06/26 06:34:55 thorpej Exp $ */
/*
* Copyright (c) 2003 Wasabi Systems, Inc.
@@ -133,7 +133,6 @@
struct i2c_attach_args {
i2c_tag_t ia_tag; /* our controller */
i2c_addr_t ia_addr; /* address of device */
- int ia_size; /* size (for EEPROMs) */
int ia_type; /* bus type */
/* only set if using direct config */
const char * ia_name; /* name of the device */
Home |
Main Index |
Thread Index |
Old Index