Re: [PATCH] ARM/pxa/mfd/power/sound: Switch Tosa to GPIO descriptors
From: Sebastian Reichel <sre@kernel.org>
Date: 2021-07-19 14:36:57
Also in:
linux-gpio
Hi, On Thu, Jul 15, 2021 at 05:16:25PM +0200, Linus Walleij wrote:
The Tosa device (Sharp SL-6000) has a mishmash driver set-up for the Toshiba TC6393xb MFD that includes a battery charger and touchscreen and has some kind of relationship to the SoC sound driver for the AC97 codec. Other devices define a chip like this but seem only half-implemented, not really handling battery charging etc. This patch switches the Toshiba MFD device to provide GPIO descriptors to the battery charger and SoC codec. As a result some descriptors need to be moved out of the Tosa boardfile and new one added: all SoC GPIO resources to these drivers now comes from the main boardfile, while the MFD provide GPIOs for its portions. As a result we can request one GPIO from our own GPIO chip and drop two hairy callbacks into the board file. This platform badly needs to have its drivers split up and converted to device tree probing to handle this quite complex relationship in an orderly manner. I just do my best in solving the GPIO descriptor part of the puzzle. Please don't ask me to fix everything that is wrong with these driver to todays standards, I am just trying to fix one aspect. I do try to use modern devres resource management and handle deferred probe using new functions where appropriate.
Yeah, the wm97xx-battery situation is a huge mess with two different drivers for the same hardware on different platforms :(
Cc: Dmitry Eremin-Solenikov <redacted> Cc: Dirk Opfer <redacted> Cc: Robert Jarzmik <robert.jarzmik@free.fr> Cc: Daniel Mack <daniel@zonque.org> Cc: Haojian Zhuang <haojian.zhuang@gmail.com> Cc: Lee Jones <redacted> Cc: Sebastian Reichel <sre@kernel.org> Cc: Liam Girdwood <lgirdwood@gmail.com> Cc: Mark Brown <broonie@kernel.org> Signed-off-by: Linus Walleij <redacted> --- Dmitry/Dirk: it'd be great if you could test this patch on the Tosa and try to help me iron out any bugs. Merging strategy: please provide ACKs and I will attempt to merge this through the SoC tree. --- drivers/power/supply/tosa_battery.c | 171 ++++++++++++++++---------- [...]
Acked-by: Sebastian Reichel <redacted> -- Sebastian