mbox series

[0/8] x86-android-tablets: Stop using gpiolib private APIs

Message ID 20230909141816.58358-1-hdegoede@redhat.com
Headers show
Series x86-android-tablets: Stop using gpiolib private APIs | expand

Message

Hans de Goede Sept. 9, 2023, 2:18 p.m. UTC
Hi Bart, et. al.,

As promised here is a patch-series to make the x86-android-tablets code
stop using gpiolib private APIs.

Patches 1-2 are (small) gpiolib-acpi.c patches to add a quirk
(using the existing quirk mechanisms) to allow removing
x86-android-tablets' acpi_gpiochip_free_interrupts() usage.

Since patches 3-4 depend on these I plan to add these to
the platform-drivers-x86-android-tablets immutable-branch / pull
with the entire set for you.

May I please have your (or Andy's or Mika's) Acked-by for
merging these 2 patches through this branch?

Patches 3-6 deal with actually removing the private gpiolib API usage.

Patches 7-8 are some small improvements on top.

My plan is to let these patches sit on the list for review for
a couple of days and then I'll prepare an immutable-branch
with 6.6-rc1 + this series and send you a pull-req for that
based on a signed tag.

Then you can base future versions of your
"gpio: convert users to gpio_device_find() and remove gpiochip_find()"
series on top and drop any workarounds for the x86-android-tablets
code from that patch-series.

Regards,

Hans


Hans de Goede (8):
  gpiolib: acpi: Check if a GPIO is listed in ignore_interrupt earlier
  gpiolib: acpi: Add a ignore interrupt quirk for Peaq C1010
  platform/x86: x86-android-tablets: Remove invalid_aei_gpiochip from
    Peaq C1010
  platform/x86: x86-android-tablets: Remove invalid_aei_gpiochip support
  platform/x86: x86-android-tablets: Create a platform_device from
    module_init()
  platform/x86: x86-android-tablets: Stop using gpiolib private APIs
  platform/x86: x86-android-tablets: Use platform-device as gpio-keys
    parent
  platform/x86: x86-android-tablets: Drop "linux,power-supply-name" from
    lenovo_yt3_bq25892_0_props[]

 drivers/gpio/gpiolib-acpi.c                   |  30 ++++-
 .../platform/x86/x86-android-tablets/asus.c   |   1 +
 .../platform/x86/x86-android-tablets/core.c   | 123 +++++++++++-------
 .../platform/x86/x86-android-tablets/lenovo.c |  29 ++---
 .../platform/x86/x86-android-tablets/other.c  |  11 +-
 .../x86-android-tablets/x86-android-tablets.h |   7 +-
 6 files changed, 124 insertions(+), 77 deletions(-)

Comments

Andy Shevchenko Sept. 10, 2023, 7:56 a.m. UTC | #1
On Sat, Sep 9, 2023 at 5:18 PM Hans de Goede <hdegoede@redhat.com> wrote:
>
> x86_dev_info.invalid_aei_gpiochip is no longer used by any boards
> and the x86-android-tablets code should not use the gpiolib private
> acpi_gpiochip_free_interrupts() function.

Shouldn't this patch remove the private header inclusion as well?
Andy Shevchenko Sept. 10, 2023, 7:57 a.m. UTC | #2
On Sun, Sep 10, 2023 at 10:56 AM Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
> On Sat, Sep 9, 2023 at 5:18 PM Hans de Goede <hdegoede@redhat.com> wrote:
> >
> > x86_dev_info.invalid_aei_gpiochip is no longer used by any boards
> > and the x86-android-tablets code should not use the gpiolib private
> > acpi_gpiochip_free_interrupts() function.
>
> Shouldn't this patch remove the private header inclusion as well?

Ah, it seems it uses more than that...
Hans de Goede Sept. 10, 2023, 11:28 a.m. UTC | #3
Hi Andy,

I missed 1 remark:

On 9/10/23 10:24, Andy Shevchenko wrote:
>> -       ret = x86_android_tablet_get_gpiod("INT33FF:02", 22, &gpiod);
>> +       ret = x86_android_tablet_get_gpiod("INT33FF:02", 22, "bq25892_0_ce",
>> +                                          true, GPIOD_OUT_HIGH, NULL);
>>         if (ret < 0)
>>                 return ret;
> 
> Hmm... Maybe better this function to return an error pointer or valid
> pointer, and in the code you choose what to do with that?
> 
> ...
> 
>>         /* OTG pin */
>> -       ret = x86_android_tablet_get_gpiod("INT33FF:03", 19, &gpiod);
>> +       ret = x86_android_tablet_get_gpiod("INT33FF:03", 19, "bq25892_0_otg",
>> +                                          false, GPIOD_OUT_LOW, NULL);
> 
> Ditto.

Yes I did consider that, but x86_android_tablet_get_gpiod() already followed
the return-by-reference model and I did not want to add changing that into
the changes this patch already makes.

Regards,

Hans
Linus Walleij Sept. 11, 2023, 8:18 a.m. UTC | #4
On Sat, Sep 9, 2023 at 4:18 PM Hans de Goede <hdegoede@redhat.com> wrote:

> As promised here is a patch-series to make the x86-android-tablets code
> stop using gpiolib private APIs.

This looks very helpful to me!
Acked-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij