[PATCH v3] ARM/pxa/mfd/power/sound: Switch Tosa to GPIO descriptors

Arnd Bergmann arnd at kernel.org
Sat May 7 13:58:40 PDT 2022


On Sat, May 7, 2022 at 2:33 PM Linus Walleij <linus.walleij at linaro.org> 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.
>
> Cc: Arnd Bergmann <arnd at kernel.org>
> Cc: Dmitry Eremin-Solenikov <dbaryshkov at gmail.com>
> Cc: Dirk Opfer <dirk at opfer-online.de>
> Cc: Robert Jarzmik <robert.jarzmik at free.fr>
> Cc: Daniel Mack <daniel at zonque.org>
> Cc: Haojian Zhuang <haojian.zhuang at gmail.com>
> Cc: Lee Jones <lee.jones at linaro.org>
> Cc: Liam Girdwood <lgirdwood at gmail.com>
> Reviewed-by: Dmitry Baryshkov <dbaryshkov at gmail.com>
> Acked-by: Mark Brown <broonie at kernel.org>
> Acked-by: Sebastian Reichel <sebastian.reichel at collabora.com>
> Signed-off-by: Linus Walleij <linus.walleij at linaro.org>

I've inserted into the right place in my series now, after making sure
that your patch does everything that mine had. This included
the simple fixup for an uninitialized variable use you left behind, and
removing two unneeded headers that would otherwise break later.

         Arnd

index 272d3ee44769..73d4aca4c386 100644
--- a/drivers/power/supply/tosa_battery.c
+++ b/drivers/power/supply/tosa_battery.c
@@ -15,7 +15,6 @@
 #include <linux/gpio/consumer.h>

 #include <asm/mach-types.h>
-#include <mach/tosa.h>

 static DEFINE_MUTEX(bat_lock); /* protects gpio pins */
 static struct work_struct bat_work;
diff --git a/sound/soc/pxa/tosa.c b/sound/soc/pxa/tosa.c
index c2b05896e284..098fffd69161 100644
--- a/sound/soc/pxa/tosa.c
+++ b/sound/soc/pxa/tosa.c
@@ -23,7 +23,6 @@
 #include <sound/soc.h>

 #include <asm/mach-types.h>
-#include <mach/tosa.h>
 #include <mach/audio.h>

 #define TOSA_HP        0
@@ -228,8 +227,6 @@ static int tosa_probe(struct platform_device *pdev)
                return dev_err_probe(&pdev->dev, PTR_ERR(tosa_mute),
                                     "failed to get L_MUTE GPIO\n");
        gpiod_set_consumer_name(tosa_mute, "Headphone Jack");
-       if (ret)
-               return ret;

        card->dev = &pdev->dev;



More information about the linux-arm-kernel mailing list