Home | History | Annotate | Download | only in i2c
History log of /src/sys/dev/i2c/as3722.c
RevisionDateAuthorComments
 1.27  17-Sep-2025  thorpej These drivers conditionally support FDT (with an #ifdef). Rather than
blindly assume that i2c_attach_args::ia_cookie is an FDT phandle, consult
self's devhandle and, if the type is DEVHANDLE_TYPE_OF, exctract the phandle
from there.

XXX These drivers should probably become FDT-only (like many others already
are) because the functionality is questionable without information from the
device tree.
 1.26  08-Sep-2025  thorpej Garbage-collect fdtbus_todr_attach(); todr_attach() does all the
necessary work now.

kern/59630
 1.25  07-Sep-2025  thorpej Change todr_chip_handle::cookie -> todr_chip_handle::todr_dev, and
make it a device_t. Upcoming functional changes will require the
device_t associated with a TODR device.

Change todr_chip_handle::bus_cookie -> todr_chip_handle::todr_devaux.
Nothing was using the old field, but I decided to keep it around just
in cause something needs it in the future.

And with these largely mechanical yet semantically meaningful changes,
thus spake the Oracle: "Welcome to NetBSD 11.99.2."
 1.24  07-Aug-2021  thorpej branches: 1.24.2;
Merge thorpej-cfargs2.
 1.23  24-Apr-2021  thorpej branches: 1.23.2; 1.23.8;
Merge thorpej-cfargs branch:

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?).
 1.22  27-Jan-2021  thorpej branches: 1.22.2;
Use DEVICE_COMPAT_EOL.
 1.21  25-Jan-2021  thorpej Since we're using designated initialisers for compat data, we should
use a completely empty initializer for the sentinel.
 1.20  17-Jan-2021  thorpej Use designated initializers and a consistent termination style in
compat_data[].
 1.19  04-Jan-2020  thorpej branches: 1.19.8;
No need to use I2C_F_POLL here.
 1.18  23-Dec-2019  thorpej In as3722_poweroff and as3722_reboot(), check for errors from iic_acquire_bus()
before proceeding with writing to the device.
 1.17  23-Dec-2019  thorpej No need to do the poll-during-autoconfiguration dance; the i2c code
does the right thing for us.
 1.16  27-Jul-2019  thorpej No need to check cold to add I2C_F_POLL; the i2c API does it for us now.
 1.15  26-Jun-2018  thorpej branches: 1.15.2;
In my quest to make device_compatible_entry (and associated goo)
super-general, it turns out I also made it a little to cumbersome
to use (if my tired fingers are any indication). So, this is a
course-correction -- one string per entry (like of_compat_data,
which it will soon replace), and remove the over-verbose macros.
 1.14  18-Jun-2018  thorpej - Rename iic_compat_match() to iic_compatible_match() and change it
to use the new device_compatible_match() routine. A pointer to
the matching device_compatible_entry is returned if a match is
found.
- Adjust iic_use_direct_match() accordingly.
- i2c drivers now provide device_compatible_entry tables when performing
direct-config matching.
- In the dsrtc driver, take advantage of this new capability to greatly
simplify model selection.

(I'm coming for you next, of_compat_data...)
 1.13  16-Jun-2018  thorpej More cleanup to i2c autoconfiguration:

- Get all of the drivers onto the new match quality constants.
- Introduce a new helper function, iic_use_direct_match(), that has
all of the logic for direct-config matching. If it returns true,
the driver returns the match result (which may be 0). If it returns
false, the driver does indirect-config matching.
- iic_compat_match() now returns a weighted match quality; matches to
lower-indexed "compatible" device property are more-specific matches,
and return a better match quality accordingly.
 1.12  28-May-2017  jmcneill branches: 1.12.8; 1.12.10;
Add facility for fdt devices to register reset and poweroff handlers.
Use this to remove as3722-specific code in tegra_machdep.c
 1.11  29-Apr-2017  jakllsch - Recognize the AS3722 sd0_v_minus_200mV bit, which is 1 on my Jetson TK1.
- Reduce intended core voltage for Tegra K1 124 by 200mV to 1.2V.

The actual value programmed into the SD0 regulator remains the same (0x50),
a value corresponding to 1.20V.
 1.10  29-Apr-2017  jakllsch Add AS3722 SD4 regulator frobbing bits.

Reduces aprint_error counter with TEGRA kernel on Jetson TK1 to 1 from 3.
 1.9  22-Apr-2017  jmcneill branches: 1.9.2;
remove unused field in softc
 1.8  22-Apr-2017  jmcneill Add SD0 regulator.
 1.7  22-Apr-2017  jmcneill Add LDO6 regulator support.
 1.6  22-Apr-2017  jmcneill Add support for AS3722 RTC.
 1.5  23-Jul-2016  jakllsch Fix typo in string.

This is a driver for the AS3722 PMIC, not the AS3822 LED driver.
 1.4  13-Dec-2015  jmcneill branches: 1.4.2; 1.4.4;
Support direct config.
 1.3  21-Nov-2015  jmcneill expose pmic reset functionality
 1.2  21-Nov-2015  jmcneill add watchdog support
 1.1  11-Nov-2015  jmcneill Add basic driver for AMS AS3722 power management IC
 1.4.4.2  26-Apr-2017  pgoyette Sync with HEAD
 1.4.4.1  26-Jul-2016  pgoyette Sync with HEAD
 1.4.2.4  28-Aug-2017  skrll Sync with HEAD
 1.4.2.3  05-Oct-2016  skrll Sync with HEAD
 1.4.2.2  27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.4.2.1  13-Dec-2015  skrll file as3722.c was added on branch nick-nhusb on 2015-12-27 12:09:49 +0000
 1.9.2.1  02-May-2017  pgoyette Sync with HEAD - tag prg-localcount2-base1
 1.12.10.2  28-Jul-2018  pgoyette Sync with HEAD
 1.12.10.1  25-Jun-2018  pgoyette Sync with HEAD
 1.12.8.2  03-Dec-2017  jdolecek update from HEAD
 1.12.8.1  28-May-2017  jdolecek file as3722.c was added on branch tls-maxphys on 2017-12-03 11:37:02 +0000
 1.15.2.2  13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.15.2.1  08-Apr-2020  martin Merge changes from current as of 20200406
 1.19.8.1  03-Apr-2021  thorpej Sync with HEAD.
 1.22.2.1  21-Mar-2021  thorpej Give config_found() the same variadic arguments treatment as
config_search(). This commit only adds the CFARG_EOL sentinel
to the existing config_found() calls. Conversion of config_found_sm_loc()
and config_found_ia() call sites will be in subsequent commits.
 1.23.8.1  04-Aug-2021  thorpej Adapt to CFARGS().
 1.23.2.1  08-May-2021  thorpej ia->ia_cookie -> devhandle_to_of(device_handle(self))
 1.24.2.1  09-Aug-2021  thorpej Port over the changes from thorpej-i2c-spi-conf to thorpej-i2c-spi-conf2,
which is based on a newer HEAD revision.

RSS XML Feed