Re: [PATCH v3 2/2] power: supply: Add driver for TI BQ25630 charger

Sebastian Reichel <[email protected]>
Newsgroups org.kernel.vger.linux-pm,org.kernel.vger.linux-kernel
Message-ID <amQD4oydNkzlOIeC@venus>
Hi,

On Mon, Jun 29, 2026 at 12:01:19AM +0200, Waqar Hameed wrote:
> TI BQ25630 is a battery charger that is I2C controlled. Despite its
> model name, it is rather different from the other devices in the BQ256xx
> family; it has a completely different register layout and some other
> additional functionality (see the datasheet for more details [1]).
> 
> The most "annoying" thing is that it has two different register lengths:
> 8-bit and 16-bit. Moreover, the 16-bit registers are further partitioned
> into either being little- or big-endian... Luckily, `regmap` has support
> for multiple `regmap_config`s (by setting unique names). Therefore, use
> three different `regmap_config`s for the corresponding registers. ADC
> functionality has been left out, due to it not having any real-world
> use-cases.
> 
> The `enum power_supply_property` values are straightforward to map. Some
> properties are clamped (e.g. voltage/current ranges). Common
> `bq25630_read/write_limit()` functions for this are therefore suitable.
> 
> Interrupts are sent whenever a state change is detected. Save the state
> status registers in `bq25630_data` and `memcmp()` this in order to
> decide if `power_supply_changed()` should be called or not. The actual
> state values are in (and fetched from) the other
> `power_supply_property`-mapped registers.
> 
> [1] https://www.ti.com/lit/gpn/bq25630
> 
> Signed-off-by: Waqar Hameed <[email protected]>
> ---
>  drivers/power/supply/Kconfig           |    7 +
>  drivers/power/supply/Makefile          |    1 +
>  drivers/power/supply/bq25630_charger.c | 1073 ++++++++++++++++++++++++
>  3 files changed, 1081 insertions(+)
>  create mode 100644 drivers/power/supply/bq25630_charger.c
> 

[...]

> +static const struct power_supply_desc bq25630_charger_psy_desc = {
> +	.name = BQ25630_DRV_NAME,
> +	.type = POWER_SUPPLY_TYPE_USB_TYPE_C,

Just POWER_SUPPLY_TYPE_USB, other USB details should be done via
USB_TYPES (as you do already). I just cannot remove those types
because they are used by some old drivers and exposed to userspace
and thus ABI. I guesss I should add a _DEPRECATED to the in-kernel
name.

I will fix that up while applying.

Greetings,

-- Sebastian
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEE72YNB0Y/i3JqeVQT2O7X88g7+poFAmpkCgsACgkQ2O7X88g7
+pq/sxAAow06EJ79auZhgPrPXjc8zh8OUDAtxvtmLoUU61nmDGxpEDHzLlh83wZ6
F117WY91PRrP9GsvmlshAxIXPn1v7ePyAhDaFxtb3KGkhYuOXvDcEcVHMo+NfA5p
Hc5US/5H+FvQXts2ZU7KuKuJlo1h0AvMbikVLDTNq7OroewMXO0DdcKRYnnycLZ1
zrjWpfFkCpxBUWKiKlnKQmlrOYkl+T0/JpbURQpr3BoClYr+qKiy5ssqv/91onMg
8TdOy0igj+sNqwUGfEcDtwS8w4zmyZaPWcGuZ57WZRFgWoCINvktMEGRYYk0k8ZO
SeXcpeeSStiXgmahNFic4zJkbQ4tWNxhVjfOKGY60MfXFP9Poim7ECXee49CFh8O
bqfVjg4fyMsqji2EhUqGTDl1cmXZ6fRAMz1XZJk4jl6dAgXR7E5xb26xV7YSCH78
GgotqE1BQJ7Q55YoBlid5nlofD1P2ZTCJFbsCLXtHBhyexXEYB75HyiinCiy5bnI
FvHcGDpC1znuAWC5hsX9B0XzWg/tX0db7Wo13kGjDrp1DaYsiWAMnmMSPzh5bJ3n
Wniqz0SQ6K7sJBgqtKxN7smnh5ukPGIRUyBQqyeIIlYTbicsyaTPtz3x4xwiPepl
awvU8kO25EbP0hSum+q00oAhzJsDDkUjWZZcy/n2Dg5fDyWVhaU=
=lp4S
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.