[PATCH v2 00/11] x86-android-tablets: convert to use GPIO references

Dmitry Torokhov posted 11 patches 1 month, 3 weeks ago
drivers/platform/x86/x86-android-tablets/asus.c    | 102 ++++----
drivers/platform/x86/x86-android-tablets/core.c    | 109 +++++---
drivers/platform/x86/x86-android-tablets/lenovo.c  | 279 +++++++++++---------
drivers/platform/x86/x86-android-tablets/other.c   | 289 ++++++++++-----------
.../x86/x86-android-tablets/shared-psy-info.c      |  20 --
.../x86/x86-android-tablets/shared-psy-info.h      |   5 -
.../x86/x86-android-tablets/x86-android-tablets.h  |  23 +-
7 files changed, 436 insertions(+), 391 deletions(-)
[PATCH v2 00/11] x86-android-tablets: convert to use GPIO references
Posted by Dmitry Torokhov 1 month, 3 weeks ago
This series came about because now software nodes can be used to
describe GPIOs (via PROPERTY_ENTRY_GPIO() macros) and I would like to
eventually get rid of gpio_keys_platform_data structure.

So while I was doing the conversions from GPIO_LOOKUP() tables for
gpio_keys devices I decided to convert the rest of them as well. Maybe
some time in the future we can drop support for GPIO_LOOKUP() and rely
on device properties exclusively.

This is completely untested.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
Changes in v2:
- Reworked on top of the current linux-next
- Link to v1: https://lore.kernel.org/r/20230512001815.591817-1-dmitry.torokhov@gmail.com

---
Dmitry Torokhov (11):
      platform/x86: x86-android-tablets: convert Goodix devices to GPIO references
      platform/x86: x86-android-tablets: convert Wacom devices to GPIO references
      platform/x86: x86-android-tablets: convert HiDeep devices to GPIO references
      platform/x86: x86-android-tablets: convert Novatek devices to GPIO references
      platform/x86: x86-android-tablets: convert EDT devices to GPIO references
      platform/x86: x86-android-tablets: convert int3496 devices to GPIO references
      platform/x86: x86-android-tablets: convert wm1502 devices to GPIO references
      platform/x86: x86-android-tablets: convert HID-I2C devices to GPIO references
      platform/x86: x86-android-tablets: convert Yoga Tab2 fast charger to GPIO references
      platform/x86: x86-android-tablets: remove support for GPIO lookup tables
      platform/x86: x86-android-tablets: convert gpio_keys devices to GPIO references

 drivers/platform/x86/x86-android-tablets/asus.c    | 102 ++++----
 drivers/platform/x86/x86-android-tablets/core.c    | 109 +++++---
 drivers/platform/x86/x86-android-tablets/lenovo.c  | 279 +++++++++++---------
 drivers/platform/x86/x86-android-tablets/other.c   | 289 ++++++++++-----------
 .../x86/x86-android-tablets/shared-psy-info.c      |  20 --
 .../x86/x86-android-tablets/shared-psy-info.h      |   5 -
 .../x86/x86-android-tablets/x86-android-tablets.h  |  23 +-
 7 files changed, 436 insertions(+), 391 deletions(-)
---
base-commit: b1549501188cc9eba732c25b033df7a53ccc341f
change-id: 20250810-x86-andoroid-tablet-df93908b426b

Best regards,
--  
Dmitry
Re: [PATCH v2 00/11] x86-android-tablets: convert to use GPIO references
Posted by Hans de Goede 2 weeks, 1 day ago
Hi,

On 11-Aug-25 4:22 AM, Dmitry Torokhov wrote:
> This series came about because now software nodes can be used to
> describe GPIOs (via PROPERTY_ENTRY_GPIO() macros) and I would like to
> eventually get rid of gpio_keys_platform_data structure.
> 
> So while I was doing the conversions from GPIO_LOOKUP() tables for
> gpio_keys devices I decided to convert the rest of them as well. Maybe
> some time in the future we can drop support for GPIO_LOOKUP() and rely
> on device properties exclusively.
> 
> This is completely untested.
> 
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

Thank you for this series. While reviewing this I've found
a couple of issues. I've fixed these in my own tree and
I'll send out a v3 with this fixed + some extra patches.

The issues which I've found and fixed are:

- lenovo_yoga_tab2_830_1050_init_codec() is missing a pinctrl_put()
  in error-exit paths after the pinctrl_get_select() succeeds

- Adding a swnode to the yt3 spi device changes the name of the SPI/codec
  device and the sound/soc/intel/boards/bytcr_wm5102.c machine driver looks
  up the code by name, update the machine driver to use the new name.

- In the "convert Yoga Tab2 fast charger to GPIO references" references
  the fwnode is added to the wrong device. The node should be added to
  the "serial0-0" device but that gets instantiated by
  drivers/platform/x86/lenovo/yoga-tab2-pro-1380-fastcharger.c
  I've made yoga-tab2-pro-1380-fastcharger.c propagate the fwnode set on
  the platform-device to the serdev it creates to fix this.

- Fix the commit message of "platform/x86: x86-android-tablets: convert
  gpio_keys devices to GPIO references" which contained a stray reference
  to wm5102.

I've also added some follow-up patches with some cleanups, see the v3
cover-letter for details.

I'll also add a rebased version of my patches to add support for
the Acer A1-840 tablet to v3, now using software-nodes for the GPIOs.

Regards,

Hans






> ---
> Changes in v2:
> - Reworked on top of the current linux-next
> - Link to v1: https://lore.kernel.org/r/20230512001815.591817-1-dmitry.torokhov@gmail.com
> 
> ---
> Dmitry Torokhov (11):
>       platform/x86: x86-android-tablets: convert Goodix devices to GPIO references
>       platform/x86: x86-android-tablets: convert Wacom devices to GPIO references
>       platform/x86: x86-android-tablets: convert HiDeep devices to GPIO references
>       platform/x86: x86-android-tablets: convert Novatek devices to GPIO references
>       platform/x86: x86-android-tablets: convert EDT devices to GPIO references
>       platform/x86: x86-android-tablets: convert int3496 devices to GPIO references
>       platform/x86: x86-android-tablets: convert wm1502 devices to GPIO references
>       platform/x86: x86-android-tablets: convert HID-I2C devices to GPIO references
>       platform/x86: x86-android-tablets: convert Yoga Tab2 fast charger to GPIO references
>       platform/x86: x86-android-tablets: remove support for GPIO lookup tables
>       platform/x86: x86-android-tablets: convert gpio_keys devices to GPIO references
> 
>  drivers/platform/x86/x86-android-tablets/asus.c    | 102 ++++----
>  drivers/platform/x86/x86-android-tablets/core.c    | 109 +++++---
>  drivers/platform/x86/x86-android-tablets/lenovo.c  | 279 +++++++++++---------
>  drivers/platform/x86/x86-android-tablets/other.c   | 289 ++++++++++-----------
>  .../x86/x86-android-tablets/shared-psy-info.c      |  20 --
>  .../x86/x86-android-tablets/shared-psy-info.h      |   5 -
>  .../x86/x86-android-tablets/x86-android-tablets.h  |  23 +-
>  7 files changed, 436 insertions(+), 391 deletions(-)
> ---
> base-commit: b1549501188cc9eba732c25b033df7a53ccc341f
> change-id: 20250810-x86-andoroid-tablet-df93908b426b
> 
> Best regards,
> --  
> Dmitry
>
Re: [PATCH v2 00/11] x86-android-tablets: convert to use GPIO references
Posted by Dmitry Torokhov 2 weeks, 1 day ago
Hi Hans,

On Fri, Sep 19, 2025 at 09:53:53PM +0200, Hans de Goede wrote:
> Hi,
> 
> On 11-Aug-25 4:22 AM, Dmitry Torokhov wrote:
> > This series came about because now software nodes can be used to
> > describe GPIOs (via PROPERTY_ENTRY_GPIO() macros) and I would like to
> > eventually get rid of gpio_keys_platform_data structure.
> > 
> > So while I was doing the conversions from GPIO_LOOKUP() tables for
> > gpio_keys devices I decided to convert the rest of them as well. Maybe
> > some time in the future we can drop support for GPIO_LOOKUP() and rely
> > on device properties exclusively.
> > 
> > This is completely untested.
> > 
> > Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> 
> Thank you for this series. While reviewing this I've found
> a couple of issues. I've fixed these in my own tree and
> I'll send out a v3 with this fixed + some extra patches.
> 
> The issues which I've found and fixed are:
> 
> - lenovo_yoga_tab2_830_1050_init_codec() is missing a pinctrl_put()
>   in error-exit paths after the pinctrl_get_select() succeeds
> 
> - Adding a swnode to the yt3 spi device changes the name of the SPI/codec
>   device and the sound/soc/intel/boards/bytcr_wm5102.c machine driver looks
>   up the code by name, update the machine driver to use the new name.
> 
> - In the "convert Yoga Tab2 fast charger to GPIO references" references
>   the fwnode is added to the wrong device. The node should be added to
>   the "serial0-0" device but that gets instantiated by
>   drivers/platform/x86/lenovo/yoga-tab2-pro-1380-fastcharger.c
>   I've made yoga-tab2-pro-1380-fastcharger.c propagate the fwnode set on
>   the platform-device to the serdev it creates to fix this.
> 
> - Fix the commit message of "platform/x86: x86-android-tablets: convert
>   gpio_keys devices to GPIO references" which contained a stray reference
>   to wm5102.

Thank you Hans for looking over the series and fixing up all the issues
that I introduced.

> 
> I've also added some follow-up patches with some cleanups, see the v3
> cover-letter for details.

I've reviewed ones that I felt comfortable reviewing, thanks again.

-- 
Dmitry
Re: [PATCH v2 00/11] x86-android-tablets: convert to use GPIO references
Posted by Hans de Goede 1 month, 3 weeks ago
Hi Dmitry,

On 11-Aug-25 4:22 AM, Dmitry Torokhov wrote:
> This series came about because now software nodes can be used to
> describe GPIOs (via PROPERTY_ENTRY_GPIO() macros) and I would like to
> eventually get rid of gpio_keys_platform_data structure.
> 
> So while I was doing the conversions from GPIO_LOOKUP() tables for
> gpio_keys devices I decided to convert the rest of them as well. Maybe
> some time in the future we can drop support for GPIO_LOOKUP() and rely
> on device properties exclusively.
> 
> This is completely untested.
> 
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> ---
> Changes in v2:
> - Reworked on top of the current linux-next
> - Link to v1: https://lore.kernel.org/r/20230512001815.591817-1-dmitry.torokhov@gmail.com

Thanks this is an interesting series. I don't know why I missed / dropped
the ball on v1.

It will be a while before I can get around to this due to travel, but
I'll take a look and either provide a Tested-by or fixup any issues
I encounter and then post a fixed v3 myself.

Regards,

Hans







> 
> ---
> Dmitry Torokhov (11):
>       platform/x86: x86-android-tablets: convert Goodix devices to GPIO references
>       platform/x86: x86-android-tablets: convert Wacom devices to GPIO references
>       platform/x86: x86-android-tablets: convert HiDeep devices to GPIO references
>       platform/x86: x86-android-tablets: convert Novatek devices to GPIO references
>       platform/x86: x86-android-tablets: convert EDT devices to GPIO references
>       platform/x86: x86-android-tablets: convert int3496 devices to GPIO references
>       platform/x86: x86-android-tablets: convert wm1502 devices to GPIO references
>       platform/x86: x86-android-tablets: convert HID-I2C devices to GPIO references
>       platform/x86: x86-android-tablets: convert Yoga Tab2 fast charger to GPIO references
>       platform/x86: x86-android-tablets: remove support for GPIO lookup tables
>       platform/x86: x86-android-tablets: convert gpio_keys devices to GPIO references
> 
>  drivers/platform/x86/x86-android-tablets/asus.c    | 102 ++++----
>  drivers/platform/x86/x86-android-tablets/core.c    | 109 +++++---
>  drivers/platform/x86/x86-android-tablets/lenovo.c  | 279 +++++++++++---------
>  drivers/platform/x86/x86-android-tablets/other.c   | 289 ++++++++++-----------
>  .../x86/x86-android-tablets/shared-psy-info.c      |  20 --
>  .../x86/x86-android-tablets/shared-psy-info.h      |   5 -
>  .../x86/x86-android-tablets/x86-android-tablets.h  |  23 +-
>  7 files changed, 436 insertions(+), 391 deletions(-)
> ---
> base-commit: b1549501188cc9eba732c25b033df7a53ccc341f
> change-id: 20250810-x86-andoroid-tablet-df93908b426b
> 
> Best regards,
> --  
> Dmitry
>
Re: [PATCH v2 00/11] x86-android-tablets: convert to use GPIO references
Posted by Dmitry Torokhov 1 month, 3 weeks ago
Hi Hans,

On Mon, Aug 11, 2025 at 11:41:46AM +0200, Hans de Goede wrote:
> Hi Dmitry,
> 
> On 11-Aug-25 4:22 AM, Dmitry Torokhov wrote:
> > This series came about because now software nodes can be used to
> > describe GPIOs (via PROPERTY_ENTRY_GPIO() macros) and I would like to
> > eventually get rid of gpio_keys_platform_data structure.
> > 
> > So while I was doing the conversions from GPIO_LOOKUP() tables for
> > gpio_keys devices I decided to convert the rest of them as well. Maybe
> > some time in the future we can drop support for GPIO_LOOKUP() and rely
> > on device properties exclusively.
> > 
> > This is completely untested.
> > 
> > Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> > ---
> > Changes in v2:
> > - Reworked on top of the current linux-next
> > - Link to v1: https://lore.kernel.org/r/20230512001815.591817-1-dmitry.torokhov@gmail.com
> 
> Thanks this is an interesting series. I don't know why I missed / dropped
> the ball on v1.

It's actually on me: I sent it as you were reworking/adding more devices
to the driver and I was supposed to update the series but did not have
time.

> 
> It will be a while before I can get around to this due to travel, but
> I'll take a look and either provide a Tested-by or fixup any issues
> I encounter and then post a fixed v3 myself.

Thanks!

-- 
Dmitry