Re: [PATCH 5/5] platform/x86: lenovo-yogabook-wmi: Add support for hall sensor on the back

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

 



On Sun, Nov 28, 2021 at 9:00 PM Hans de Goede <hdegoede@xxxxxxxxxx> wrote:
>
> On the back of the device there is a hall sensor connected to the

Hall (it's name)

> "INT33FF:02" GPIO controller pin 18, which gets triggered when the
> device is fully folded into tablet-mode (when the back of the display
> touched the back of the keyboard).

touches?

> Use this to disable both the touch-keyboard and the digitizer when
> the tablet is fully folded into tablet-mode.

...

> +static irqreturn_t yogabook_backside_hall_irq(int irq, void *_data)
> +{
> +       struct yogabook_wmi *data = _data;

> +       if (gpiod_get_value(data->backside_hall_gpio))
> +               set_bit(YB_TABLET_MODE, &data->flags);
> +       else
> +               clear_bit(YB_TABLET_MODE, &data->flags);

assign_bit()?

> +       schedule_work(&data->work);
> +
> +       return IRQ_HANDLED;
> +}

...

> +       data->backside_hall_gpio =
> +               devm_gpiod_get(&wdev->dev, "backside_hall_sw", GPIOD_IN);
> +       if (IS_ERR(data->backside_hall_gpio)) {

> +               r = PTR_ERR(data->backside_hall_gpio);
> +               dev_err_probe(&wdev->dev, r, "Getting backside_hall_sw GPIO\n");

Can be

  r = dev_err_probe(...);

but I think you did that on purpose to make lines shorter.

> +               goto error_put_devs;
> +       }

-- 
With Best Regards,
Andy Shevchenko



[Index of Archives]     [Linux Kernel Development]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux