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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, May 7, 2022 at 2:33 PM Linus Walleij <linus.walleij@xxxxxxxxxx> 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@xxxxxxxxxx>
> Cc: Dmitry Eremin-Solenikov <dbaryshkov@xxxxxxxxx>
> Cc: Dirk Opfer <dirk@xxxxxxxxxxxxxxx>
> Cc: Robert Jarzmik <robert.jarzmik@xxxxxxx>
> Cc: Daniel Mack <daniel@xxxxxxxxxx>
> Cc: Haojian Zhuang <haojian.zhuang@xxxxxxxxx>
> Cc: Lee Jones <lee.jones@xxxxxxxxxx>
> Cc: Liam Girdwood <lgirdwood@xxxxxxxxx>
> Reviewed-by: Dmitry Baryshkov <dbaryshkov@xxxxxxxxx>
> Acked-by: Mark Brown <broonie@xxxxxxxxxx>
> Acked-by: Sebastian Reichel <sebastian.reichel@xxxxxxxxxxxxx>
> Signed-off-by: Linus Walleij <linus.walleij@xxxxxxxxxx>

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;



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux