summaryrefslogtreecommitdiff
path: root/sys/dev/gpio/gpioiic.c
AgeCommit message (Collapse)Author
2023-05-10gpioiic(4): Use config_detach_children.riastradh
2021-08-07Merge thorpej-cfargs2.thorpej
2021-04-24Merge thorpej-cfargs branch:thorpej
Simplify and make extensible the config_search() / config_found() / config_attach() interfaces: rather than having different variants for which arguments you want pass along, just have a single call that takes a variadic list of tag-value arguments. Adjust all call sites: - Simplify wherever possible; don't pass along arguments that aren't actually needed. - Don't be explicit about what interface attribute is attaching if the device only has one. (More simplification.) - Add a config_probe() function to be used in indirect configuiration situations, making is visibly easier to see when indirect config is in play, and allowing for future change in semantics. (As of now, this is just a wrapper around config_match(), but that is an implementation detail.) Remove unnecessary or redundant interface attributes where they're not needed. There are currently 5 "cfargs" defined: - CFARG_SUBMATCH (submatch function for direct config) - CFARG_SEARCH (search function for indirect config) - CFARG_IATTR (interface attribte) - CFARG_LOCATORS (locators array) - CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles) ...and a sentinel value CFARG_EOL. Add some extra sanity checking to ensure that interface attributes aren't ambiguous. Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark ports to associate those device handles with device_t instance. This will trickle trough to more places over time (need back-end for pre-OFW Sun OBP; any others?).
2019-12-22Cleanup i2c bus acquire / release, centralizing all of the logic intothorpej
iic_acquire_bus() / iic_release_bus(). "acquire" and "release" hooks no longer need to be provided by back-end controller drivers (only if they need special handling, e.g. powering on the i2c controller). This results in the removal of a bunch of rendundant code from each back-end controller driver. Assert that we are not in hard interrupt context in iic_acquire_bus(), iic_exec(), and iic_release_bus().
2017-10-28Kill some more extern struct cfdriver declarations.riastradh
Down with externs in .c!
2015-09-01i2c_acquire_bus() should return 0 on success.phx
Fixed bug in gpioiic_bb_set_bits(), which was introduced with the SDA/SCL- reverse feature. Now the driver is confirmed to work. Tested with Raspberry Pi GPIO.
2012-10-27split device_t/softc for all remaining drivers.chs
replace "struct device *" with "device_t". use device_xname(), device_unit(), etc.
2011-10-02Add a ga_flags field to the gpio_attach structure to hand drivermbalmer
specific flags to drivers being attached at gpio pins. gpioiic(4) uses this to reverse the SDA/SCL signal order. gpioctl(8) accepts the flag values as optional argument to the attach command. While here, make sure we retain backwards compatability and wrap compat code in #ifdef COMPAT_50/#endif.
2011-08-31Switch von u_int_XY to uintXYmbalmer
2011-07-23When reading the bits from the I2C bus, also report SCL. Fixes PR43275.mbalmer
Fix originally from Maxim Weber, thanks.
2009-12-06Delete unnecessary device-activation hooks. Simplify the rest.dyoung
2009-08-09gpioiic(4), a driver to do use GPIO pins in bit-banging mode to form an I2Cmbalmer
bus. Ported from OpenBSD.