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.diff -r1.29 -r1.30 src/sys/dev/i2c/at24cxx.c
(thorpej)
--- src/sys/dev/i2c/at24cxx.c 2018/06/26 06:21:23 1.29
+++ src/sys/dev/i2c/at24cxx.c 2018/06/26 06:34:55 1.30
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: at24cxx.c,v 1.29 2018/06/26 06:21:23 thorpej Exp $ */ | 1 | /* $NetBSD: at24cxx.c,v 1.30 2018/06/26 06:34:55 thorpej Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 2003 Wasabi Systems, Inc. | 4 | * Copyright (c) 2003 Wasabi Systems, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * Written by Steve C. Woodford and Jason R. Thorpe for Wasabi Systems, Inc. | 7 | * Written by Steve C. Woodford and Jason R. Thorpe for Wasabi Systems, Inc. | |
8 | * | 8 | * | |
9 | * Redistribution and use in source and binary forms, with or without | 9 | * Redistribution and use in source and binary forms, with or without | |
10 | * modification, are permitted provided that the following conditions | 10 | * modification, are permitted provided that the following conditions | |
11 | * are met: | 11 | * are met: | |
12 | * 1. Redistributions of source code must retain the above copyright | 12 | * 1. Redistributions of source code must retain the above copyright | |
13 | * notice, this list of conditions and the following disclaimer. | 13 | * notice, this list of conditions and the following disclaimer. | |
14 | * 2. Redistributions in binary form must reproduce the above copyright | 14 | * 2. Redistributions in binary form must reproduce the above copyright | |
@@ -26,27 +26,27 @@ | @@ -26,27 +26,27 @@ | |||
26 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | 26 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | |
27 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 27 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
28 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC | 28 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC | |
29 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 29 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
30 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 30 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
31 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 31 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
32 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 32 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
33 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 33 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
34 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 34 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
35 | * POSSIBILITY OF SUCH DAMAGE. | 35 | * POSSIBILITY OF SUCH DAMAGE. | |
36 | */ | 36 | */ | |
37 | 37 | |||
38 | #include <sys/cdefs.h> | 38 | #include <sys/cdefs.h> | |
39 | __KERNEL_RCSID(0, "$NetBSD: at24cxx.c,v 1.29 2018/06/26 06:21:23 thorpej Exp $"); | 39 | __KERNEL_RCSID(0, "$NetBSD: at24cxx.c,v 1.30 2018/06/26 06:34:55 thorpej Exp $"); | |
40 | 40 | |||
41 | #include <sys/param.h> | 41 | #include <sys/param.h> | |
42 | #include <sys/systm.h> | 42 | #include <sys/systm.h> | |
43 | #include <sys/device.h> | 43 | #include <sys/device.h> | |
44 | #include <sys/kernel.h> | 44 | #include <sys/kernel.h> | |
45 | #include <sys/fcntl.h> | 45 | #include <sys/fcntl.h> | |
46 | #include <sys/uio.h> | 46 | #include <sys/uio.h> | |
47 | #include <sys/conf.h> | 47 | #include <sys/conf.h> | |
48 | #include <sys/proc.h> | 48 | #include <sys/proc.h> | |
49 | #include <sys/event.h> | 49 | #include <sys/event.h> | |
50 | 50 | |||
51 | #include <sys/bus.h> | 51 | #include <sys/bus.h> | |
52 | 52 | |||
@@ -159,28 +159,26 @@ seeprom_attach(device_t parent, device_t | @@ -159,28 +159,26 @@ seeprom_attach(device_t parent, device_t | |||
159 | * AT24C04/08/16 decode fewer of the i2c address bits, | 159 | * AT24C04/08/16 decode fewer of the i2c address bits, | |
160 | * using the bottom 1, 2, or 3 to select the 256-byte | 160 | * using the bottom 1, 2, or 3 to select the 256-byte | |
161 | * super-page. | 161 | * super-page. | |
162 | * | 162 | * | |
163 | * The AT24C32/64/128/256/512 EEPROMs use a 2 byte command | 163 | * The AT24C32/64/128/256/512 EEPROMs use a 2 byte command | |
164 | * word and decode all of the i2c address bits. | 164 | * word and decode all of the i2c address bits. | |
165 | * | 165 | * | |
166 | * The AT24C1024 EEPROMs use a 2 byte command and also do bank | 166 | * The AT24C1024 EEPROMs use a 2 byte command and also do bank | |
167 | * switching to select the proper super-page. This isn't | 167 | * switching to select the proper super-page. This isn't | |
168 | * supported by this driver. | 168 | * supported by this driver. | |
169 | */ | 169 | */ | |
170 | if (device_cfdata(self)->cf_flags) | 170 | if (device_cfdata(self)->cf_flags) | |
171 | sc->sc_size = (device_cfdata(self)->cf_flags << 7); | 171 | sc->sc_size = (device_cfdata(self)->cf_flags << 7); | |
172 | else | |||
173 | sc->sc_size = ia->ia_size; | |||
174 | 172 | |||
175 | if (sc->sc_size <= 0 && ia->ia_ncompat > 0) { | 173 | if (sc->sc_size <= 0 && ia->ia_ncompat > 0) { | |
176 | if (iic_compatible_match(ia, compat_data, &dce)) | 174 | if (iic_compatible_match(ia, compat_data, &dce)) | |
177 | sc->sc_size = dce->data; | 175 | sc->sc_size = dce->data; | |
178 | } | 176 | } | |
179 | 177 | |||
180 | switch (sc->sc_size) { | 178 | switch (sc->sc_size) { | |
181 | case 128: /* 1Kbit */ | 179 | case 128: /* 1Kbit */ | |
182 | case 256: /* 2Kbit */ | 180 | case 256: /* 2Kbit */ | |
183 | case 512: /* 4Kbit */ | 181 | case 512: /* 4Kbit */ | |
184 | case 1024: /* 8Kbit */ | 182 | case 1024: /* 8Kbit */ | |
185 | case 2048: /* 16Kbit */ | 183 | case 2048: /* 16Kbit */ | |
186 | sc->sc_cmdlen = 1; | 184 | sc->sc_cmdlen = 1; |
--- src/sys/dev/i2c/files.i2c 2018/05/27 05:31:20 1.92
+++ src/sys/dev/i2c/files.i2c 2018/06/26 06:34:55 1.93
@@ -1,20 +1,20 @@ | @@ -1,20 +1,20 @@ | |||
1 | # $NetBSD: files.i2c,v 1.92 2018/05/27 05:31:20 thorpej Exp $ | 1 | # $NetBSD: files.i2c,v 1.93 2018/06/26 06:34:55 thorpej Exp $ | |
2 | 2 | |||
3 | obsolete defflag opt_i2cbus.h I2C_SCAN | 3 | obsolete defflag opt_i2cbus.h I2C_SCAN | |
4 | define i2cbus { } | 4 | define i2cbus { } | |
5 | define i2cexec | 5 | define i2cexec | |
6 | 6 | |||
7 | device iic { [addr = -1], [size = -1] } : i2c_bitbang | 7 | device iic { [addr = -1] } : i2c_bitbang | |
8 | attach iic at i2cbus | 8 | attach iic at i2cbus | |
9 | file dev/i2c/i2c.c iic | 9 | file dev/i2c/i2c.c iic | |
10 | file dev/i2c/i2c_exec.c iic | i2cbus | i2cexec | 10 | file dev/i2c/i2c_exec.c iic | i2cbus | i2cexec | |
11 | file dev/i2c/i2c_subr.c i2cbus | 11 | file dev/i2c/i2c_subr.c i2cbus | |
12 | defparam opt_i2c.h I2C_MAX_ADDR | 12 | defparam opt_i2c.h I2C_MAX_ADDR | |
13 | 13 | |||
14 | # Common module for bit-bang'ing an I2C bus | 14 | # Common module for bit-bang'ing an I2C bus | |
15 | define i2c_bitbang | 15 | define i2c_bitbang | |
16 | file dev/i2c/i2c_bitbang.c i2c_bitbang | 16 | file dev/i2c/i2c_bitbang.c i2c_bitbang | |
17 | 17 | |||
18 | # Auvitek AU8522 decoder | 18 | # Auvitek AU8522 decoder | |
19 | define au8522: i2cexec | 19 | define au8522: i2cexec | |
20 | file dev/i2c/au8522.c au8522 | 20 | file dev/i2c/au8522.c au8522 |
--- src/sys/dev/i2c/i2c.c 2018/06/26 04:32:35 1.65
+++ src/sys/dev/i2c/i2c.c 2018/06/26 06:34:55 1.66
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: i2c.c,v 1.65 2018/06/26 04:32:35 thorpej Exp $ */ | 1 | /* $NetBSD: i2c.c,v 1.66 2018/06/26 06:34:55 thorpej Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 2003 Wasabi Systems, Inc. | 4 | * Copyright (c) 2003 Wasabi Systems, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * Written by Jason R. Thorpe for Wasabi Systems, Inc. | 7 | * Written by Jason R. Thorpe for Wasabi Systems, Inc. | |
8 | * | 8 | * | |
9 | * Redistribution and use in source and binary forms, with or without | 9 | * Redistribution and use in source and binary forms, with or without | |
10 | * modification, are permitted provided that the following conditions | 10 | * modification, are permitted provided that the following conditions | |
11 | * are met: | 11 | * are met: | |
12 | * 1. Redistributions of source code must retain the above copyright | 12 | * 1. Redistributions of source code must retain the above copyright | |
13 | * notice, this list of conditions and the following disclaimer. | 13 | * notice, this list of conditions and the following disclaimer. | |
14 | * 2. Redistributions in binary form must reproduce the above copyright | 14 | * 2. Redistributions in binary form must reproduce the above copyright | |
@@ -30,27 +30,27 @@ | @@ -30,27 +30,27 @@ | |||
30 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 30 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
31 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 31 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
32 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 32 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
33 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 33 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
34 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 34 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
35 | * POSSIBILITY OF SUCH DAMAGE. | 35 | * POSSIBILITY OF SUCH DAMAGE. | |
36 | */ | 36 | */ | |
37 | 37 | |||
38 | #ifdef _KERNEL_OPT | 38 | #ifdef _KERNEL_OPT | |
39 | #include "opt_i2c.h" | 39 | #include "opt_i2c.h" | |
40 | #endif | 40 | #endif | |
41 | 41 | |||
42 | #include <sys/cdefs.h> | 42 | #include <sys/cdefs.h> | |
43 | __KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.65 2018/06/26 04:32:35 thorpej Exp $"); | 43 | __KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.66 2018/06/26 06:34:55 thorpej Exp $"); | |
44 | 44 | |||
45 | #include <sys/param.h> | 45 | #include <sys/param.h> | |
46 | #include <sys/systm.h> | 46 | #include <sys/systm.h> | |
47 | #include <sys/device.h> | 47 | #include <sys/device.h> | |
48 | #include <sys/event.h> | 48 | #include <sys/event.h> | |
49 | #include <sys/conf.h> | 49 | #include <sys/conf.h> | |
50 | #include <sys/malloc.h> | 50 | #include <sys/malloc.h> | |
51 | #include <sys/kmem.h> | 51 | #include <sys/kmem.h> | |
52 | #include <sys/kthread.h> | 52 | #include <sys/kthread.h> | |
53 | #include <sys/proc.h> | 53 | #include <sys/proc.h> | |
54 | #include <sys/kernel.h> | 54 | #include <sys/kernel.h> | |
55 | #include <sys/fcntl.h> | 55 | #include <sys/fcntl.h> | |
56 | #include <sys/module.h> | 56 | #include <sys/module.h> | |
@@ -275,27 +275,26 @@ iic_search(device_t parent, cfdata_t cf, | @@ -275,27 +275,26 @@ iic_search(device_t parent, cfdata_t cf, | |||
275 | } else if (prop_string_equals_cstring(pstr, | 275 | } else if (prop_string_equals_cstring(pstr, | |
276 | I2C_PROBE_STRATEGY_NONE)) { | 276 | I2C_PROBE_STRATEGY_NONE)) { | |
277 | probe_func = iic_probe_none; | 277 | probe_func = iic_probe_none; | |
278 | } else { | 278 | } else { | |
279 | aprint_error_dev(sc->sc_dev, | 279 | aprint_error_dev(sc->sc_dev, | |
280 | "unknown probe strategy '%s'; defaulting to '%s'\n", | 280 | "unknown probe strategy '%s'; defaulting to '%s'\n", | |
281 | prop_string_cstring_nocopy(pstr), | 281 | prop_string_cstring_nocopy(pstr), | |
282 | I2C_PROBE_STRATEGY_QUICK_WRITE); | 282 | I2C_PROBE_STRATEGY_QUICK_WRITE); | |
283 | 283 | |||
284 | /* Use the default. */ | 284 | /* Use the default. */ | |
285 | } | 285 | } | |
286 | 286 | |||
287 | ia.ia_tag = sc->sc_tag; | 287 | ia.ia_tag = sc->sc_tag; | |
288 | ia.ia_size = cf->cf_loc[IICCF_SIZE]; | |||
289 | ia.ia_type = sc->sc_type; | 288 | ia.ia_type = sc->sc_type; | |
290 | 289 | |||
291 | ia.ia_name = NULL; | 290 | ia.ia_name = NULL; | |
292 | ia.ia_ncompat = 0; | 291 | ia.ia_ncompat = 0; | |
293 | ia.ia_compat = NULL; | 292 | ia.ia_compat = NULL; | |
294 | ia.ia_prop = NULL; | 293 | ia.ia_prop = NULL; | |
295 | 294 | |||
296 | if (cf->cf_loc[IICCF_ADDR] == IICCF_ADDR_DEFAULT) { | 295 | if (cf->cf_loc[IICCF_ADDR] == IICCF_ADDR_DEFAULT) { | |
297 | /* | 296 | /* | |
298 | * This particular config directive has | 297 | * This particular config directive has | |
299 | * wildcarded the address, so we will | 298 | * wildcarded the address, so we will | |
300 | * scan the entire bus for it. | 299 | * scan the entire bus for it. | |
301 | */ | 300 | */ | |
@@ -431,59 +430,54 @@ iic_attach(device_t parent, device_t sel | @@ -431,59 +430,54 @@ iic_attach(device_t parent, device_t sel | |||
431 | indirect_config = false; | 430 | indirect_config = false; | |
432 | } else { | 431 | } else { | |
433 | props = device_properties(parent); | 432 | props = device_properties(parent); | |
434 | if (!prop_dictionary_get_bool(props, "i2c-indirect-config", | 433 | if (!prop_dictionary_get_bool(props, "i2c-indirect-config", | |
435 | &indirect_config)) | 434 | &indirect_config)) | |
436 | indirect_config = true; | 435 | indirect_config = true; | |
437 | child_devices = prop_dictionary_get(props, "i2c-child-devices"); | 436 | child_devices = prop_dictionary_get(props, "i2c-child-devices"); | |
438 | } | 437 | } | |
439 | 438 | |||
440 | if (child_devices) { | 439 | if (child_devices) { | |
441 | unsigned int i, count; | 440 | unsigned int i, count; | |
442 | prop_dictionary_t dev; | 441 | prop_dictionary_t dev; | |
443 | prop_data_t cdata; | 442 | prop_data_t cdata; | |
444 | uint32_t addr, size; | 443 | uint32_t addr; | |
445 | uint64_t cookie; | 444 | uint64_t cookie; | |
446 | const char *name; | 445 | const char *name; | |
447 | struct i2c_attach_args ia; | 446 | struct i2c_attach_args ia; | |
448 | int loc[IICCF_NLOCS]; | 447 | int loc[IICCF_NLOCS]; | |
449 | 448 | |||
450 | memset(loc, 0, sizeof loc); | 449 | memset(loc, 0, sizeof loc); | |
451 | count = prop_array_count(child_devices); | 450 | count = prop_array_count(child_devices); | |
452 | for (i = 0; i < count; i++) { | 451 | for (i = 0; i < count; i++) { | |
453 | dev = prop_array_get(child_devices, i); | 452 | dev = prop_array_get(child_devices, i); | |
454 | if (!dev) continue; | 453 | if (!dev) continue; | |
455 | if (!prop_dictionary_get_cstring_nocopy( | 454 | if (!prop_dictionary_get_cstring_nocopy( | |
456 | dev, "name", &name)) { | 455 | dev, "name", &name)) { | |
457 | /* "name" property is optional. */ | 456 | /* "name" property is optional. */ | |
458 | name = NULL; | 457 | name = NULL; | |
459 | } | 458 | } | |
460 | if (!prop_dictionary_get_uint32(dev, "addr", &addr)) | 459 | if (!prop_dictionary_get_uint32(dev, "addr", &addr)) | |
461 | continue; | 460 | continue; | |
462 | if (!prop_dictionary_get_uint64(dev, "cookie", &cookie)) | 461 | if (!prop_dictionary_get_uint64(dev, "cookie", &cookie)) | |
463 | cookie = 0; | 462 | cookie = 0; | |
464 | loc[IICCF_ADDR] = addr; | 463 | loc[IICCF_ADDR] = addr; | |
465 | if (prop_dictionary_get_uint32(dev, "size", &size)) | |||
466 | loc[IICCF_SIZE] = size; | |||
467 | else | |||
468 | size = loc[IICCF_SIZE] = IICCF_SIZE_DEFAULT; | |||
469 | 464 | |||
470 | memset(&ia, 0, sizeof ia); | 465 | memset(&ia, 0, sizeof ia); | |
471 | ia.ia_addr = addr; | 466 | ia.ia_addr = addr; | |
472 | ia.ia_type = sc->sc_type; | 467 | ia.ia_type = sc->sc_type; | |
473 | ia.ia_tag = ic; | 468 | ia.ia_tag = ic; | |
474 | ia.ia_name = name; | 469 | ia.ia_name = name; | |
475 | ia.ia_cookie = cookie; | 470 | ia.ia_cookie = cookie; | |
476 | ia.ia_size = size; | |||
477 | ia.ia_prop = dev; | 471 | ia.ia_prop = dev; | |
478 | 472 | |||
479 | buf = NULL; | 473 | buf = NULL; | |
480 | cdata = prop_dictionary_get(dev, "compatible"); | 474 | cdata = prop_dictionary_get(dev, "compatible"); | |
481 | if (cdata) | 475 | if (cdata) | |
482 | iic_fill_compat(&ia, | 476 | iic_fill_compat(&ia, | |
483 | prop_data_data_nocopy(cdata), | 477 | prop_data_data_nocopy(cdata), | |
484 | prop_data_size(cdata), &buf); | 478 | prop_data_size(cdata), &buf); | |
485 | 479 | |||
486 | if (name == NULL && cdata == NULL) { | 480 | if (name == NULL && cdata == NULL) { | |
487 | aprint_error_dev(self, | 481 | aprint_error_dev(self, | |
488 | "WARNING: ignoring bad child device entry " | 482 | "WARNING: ignoring bad child device entry " | |
489 | "for address 0x%02x\n", addr); | 483 | "for address 0x%02x\n", addr); |
--- src/sys/dev/i2c/i2cvar.h 2018/06/26 04:32:35 1.16
+++ src/sys/dev/i2c/i2cvar.h 2018/06/26 06:34:55 1.17
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: i2cvar.h,v 1.16 2018/06/26 04:32:35 thorpej Exp $ */ | 1 | /* $NetBSD: i2cvar.h,v 1.17 2018/06/26 06:34:55 thorpej Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 2003 Wasabi Systems, Inc. | 4 | * Copyright (c) 2003 Wasabi Systems, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * Written by Steve C. Woodford and Jason R. Thorpe for Wasabi Systems, Inc. | 7 | * Written by Steve C. Woodford and Jason R. Thorpe for Wasabi Systems, Inc. | |
8 | * | 8 | * | |
9 | * Redistribution and use in source and binary forms, with or without | 9 | * Redistribution and use in source and binary forms, with or without | |
10 | * modification, are permitted provided that the following conditions | 10 | * modification, are permitted provided that the following conditions | |
11 | * are met: | 11 | * are met: | |
12 | * 1. Redistributions of source code must retain the above copyright | 12 | * 1. Redistributions of source code must retain the above copyright | |
13 | * notice, this list of conditions and the following disclaimer. | 13 | * notice, this list of conditions and the following disclaimer. | |
14 | * 2. Redistributions in binary form must reproduce the above copyright | 14 | * 2. Redistributions in binary form must reproduce the above copyright | |
@@ -123,27 +123,26 @@ typedef struct i2c_controller { | @@ -123,27 +123,26 @@ typedef struct i2c_controller { | |||
123 | #define I2C_TYPE_SMBUS 1 | 123 | #define I2C_TYPE_SMBUS 1 | |
124 | 124 | |||
125 | /* Used to attach the i2c framework to the controller. */ | 125 | /* Used to attach the i2c framework to the controller. */ | |
126 | struct i2cbus_attach_args { | 126 | struct i2cbus_attach_args { | |
127 | i2c_tag_t iba_tag; /* the controller */ | 127 | i2c_tag_t iba_tag; /* the controller */ | |
128 | int iba_type; /* bus type */ | 128 | int iba_type; /* bus type */ | |
129 | prop_array_t iba_child_devices; /* child devices (direct config) */ | 129 | prop_array_t iba_child_devices; /* child devices (direct config) */ | |
130 | }; | 130 | }; | |
131 | 131 | |||
132 | /* Used to attach devices on the i2c bus. */ | 132 | /* Used to attach devices on the i2c bus. */ | |
133 | struct i2c_attach_args { | 133 | struct i2c_attach_args { | |
134 | i2c_tag_t ia_tag; /* our controller */ | 134 | i2c_tag_t ia_tag; /* our controller */ | |
135 | i2c_addr_t ia_addr; /* address of device */ | 135 | i2c_addr_t ia_addr; /* address of device */ | |
136 | int ia_size; /* size (for EEPROMs) */ | |||
137 | int ia_type; /* bus type */ | 136 | int ia_type; /* bus type */ | |
138 | /* only set if using direct config */ | 137 | /* only set if using direct config */ | |
139 | const char * ia_name; /* name of the device */ | 138 | const char * ia_name; /* name of the device */ | |
140 | int ia_ncompat; /* number of pointers in the | 139 | int ia_ncompat; /* number of pointers in the | |
141 | ia_compat array */ | 140 | ia_compat array */ | |
142 | const char ** ia_compat; /* chip names */ | 141 | const char ** ia_compat; /* chip names */ | |
143 | prop_dictionary_t ia_prop; /* dictionnary for this device */ | 142 | prop_dictionary_t ia_prop; /* dictionnary for this device */ | |
144 | /* | 143 | /* | |
145 | * The following is of limited usefulness and should only be used | 144 | * The following is of limited usefulness and should only be used | |
146 | * in rare cases where we really know what we are doing. Example: | 145 | * in rare cases where we really know what we are doing. Example: | |
147 | * a machine dependent i2c driver (located in sys/arch/$arch/dev) | 146 | * a machine dependent i2c driver (located in sys/arch/$arch/dev) | |
148 | * needing to access some firmware properties. | 147 | * needing to access some firmware properties. | |
149 | * Depending on the firmware in use, an identifier for the device | 148 | * Depending on the firmware in use, an identifier for the device |