All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Hans de Goede <hdegoede@redhat.com>
Cc: Mark Gross <markgross@kernel.org>,
	Andy Shevchenko <andy@infradead.org>,
	Yauhen Kharuzhy <jekhor@gmail.com>,
	Platform Driver <platform-driver-x86@vger.kernel.org>
Subject: Re: [PATCH 5/5] platform/x86: lenovo-yogabook-wmi: Add support for hall sensor on the back
Date: Mon, 29 Nov 2021 11:28:09 +0200	[thread overview]
Message-ID: <CAHp75Veuaoq9htGpUPCgFzr1Ysc+6d-Li-OBqiE-ZqUbXzqMrA@mail.gmail.com> (raw)
In-Reply-To: <20211128190031.405620-5-hdegoede@redhat.com>

On Sun, Nov 28, 2021 at 9:00 PM Hans de Goede <hdegoede@redhat.com> 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

  parent reply	other threads:[~2021-11-29  9:50 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-28 19:00 [PATCH 1/5] platform/x86: wmi: Replace read_takes_no_args with a flags field Hans de Goede
2021-11-28 19:00 ` [PATCH 2/5] platform/x86: wmi: Fix driver->notify() vs ->probe() race Hans de Goede
2021-11-28 19:00 ` [PATCH 3/5] platform/x86: wmi: Add no_notify_data flag to struct wmi_driver Hans de Goede
2021-11-28 19:00 ` [PATCH 4/5] platform/x86: lenovo-yogabook-wmi: Add driver for Lenovo Yoga Book Hans de Goede
2021-11-28 19:07   ` Hans de Goede
2021-11-28 19:00 ` [PATCH 5/5] platform/x86: lenovo-yogabook-wmi: Add support for hall sensor on the back Hans de Goede
2021-11-28 21:09   ` Yauhen Kharuzhy
2021-11-29  8:28     ` Hans de Goede
2021-11-29  9:28   ` Andy Shevchenko [this message]
2021-11-29  9:47     ` Hans de Goede
2021-11-30 14:52 ` [PATCH 1/5] platform/x86: wmi: Replace read_takes_no_args with a flags field Andy Shevchenko
2021-12-06 21:36   ` Hans de Goede

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAHp75Veuaoq9htGpUPCgFzr1Ysc+6d-Li-OBqiE-ZqUbXzqMrA@mail.gmail.com \
    --to=andy.shevchenko@gmail.com \
    --cc=andy@infradead.org \
    --cc=hdegoede@redhat.com \
    --cc=jekhor@gmail.com \
    --cc=markgross@kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.