diff mbox series

platform/x86: x86-android-tablets: Fix Lenovo Yoga Tablet 2 830F/L vs 1050F/L detection

Message ID 20230915214933.62595-1-hdegoede@redhat.com (mailing list archive)
State Accepted, archived
Headers show
Series platform/x86: x86-android-tablets: Fix Lenovo Yoga Tablet 2 830F/L vs 1050F/L detection | expand

Commit Message

Hans de Goede Sept. 15, 2023, 9:49 p.m. UTC
gpio_crystalcove pin 10 is already in input mode and passing GPIOD_IN
when requesting the GPIO changes its pull-up/-down settings causing
the 830F/L to get misdetected as 1050F/L.

Switch to using GPIOD_ASIS when requesting the GPIO to fix
the misdetection.

Fixes: 4014ae236b1d ("platform/x86: x86-android-tablets: Stop using gpiolib private APIs")
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/platform/x86/x86-android-tablets/lenovo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Hans de Goede Sept. 18, 2023, 1:43 p.m. UTC | #1
Hi,

On 9/15/23 23:49, Hans de Goede wrote:
> gpio_crystalcove pin 10 is already in input mode and passing GPIOD_IN
> when requesting the GPIO changes its pull-up/-down settings causing
> the 830F/L to get misdetected as 1050F/L.
> 
> Switch to using GPIOD_ASIS when requesting the GPIO to fix
> the misdetection.
> 
> Fixes: 4014ae236b1d ("platform/x86: x86-android-tablets: Stop using gpiolib private APIs")
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>

I've added this to my review-hans (soon to be for-next) branch now.

Regards,

Hans



> ---
>  drivers/platform/x86/x86-android-tablets/lenovo.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/platform/x86/x86-android-tablets/lenovo.c b/drivers/platform/x86/x86-android-tablets/lenovo.c
> index 904290526173..585f10a57810 100644
> --- a/drivers/platform/x86/x86-android-tablets/lenovo.c
> +++ b/drivers/platform/x86/x86-android-tablets/lenovo.c
> @@ -454,7 +454,7 @@ static int __init lenovo_yoga_tab2_830_1050_init_touchscreen(void)
>  
>  	/* Use PMIC GPIO 10 bootstrap pin to differentiate 830 vs 1050 */
>  	ret = x86_android_tablet_get_gpiod("gpio_crystalcove", 10, "yoga_bootstrap",
> -					   false, GPIOD_IN, &gpiod);
> +					   false, GPIOD_ASIS, &gpiod);
>  	if (ret)
>  		return ret;
>
diff mbox series

Patch

diff --git a/drivers/platform/x86/x86-android-tablets/lenovo.c b/drivers/platform/x86/x86-android-tablets/lenovo.c
index 904290526173..585f10a57810 100644
--- a/drivers/platform/x86/x86-android-tablets/lenovo.c
+++ b/drivers/platform/x86/x86-android-tablets/lenovo.c
@@ -454,7 +454,7 @@  static int __init lenovo_yoga_tab2_830_1050_init_touchscreen(void)
 
 	/* Use PMIC GPIO 10 bootstrap pin to differentiate 830 vs 1050 */
 	ret = x86_android_tablet_get_gpiod("gpio_crystalcove", 10, "yoga_bootstrap",
-					   false, GPIOD_IN, &gpiod);
+					   false, GPIOD_ASIS, &gpiod);
 	if (ret)
 		return ret;