Hi, On 11/29/21 10:28, Andy Shevchenko wrote: > 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) Ack, will fix. > >> "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? Ack, will fix. > >> 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()? Interesting I did not know about that one. I see that it expands to exactly the same code though and I find the current version more readable, so I'm going to keep this as is. > >> + 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. Right, I did this this way to not make the lines too long. Regards, Hans > >> + goto error_put_devs; >> + } >