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>,
	Daniel Scally <djrscally@gmail.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	platform-driver-x86@vger.kernel.org,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Kate Hsuan <hpa@redhat.com>,
	Mark Pearson <markpearson@lenovo.com>,
	linux-media@vger.kernel.org
Subject: Re: [PATCH 3/6] platform/x86: int3472/discrete: Treat privacy LED as regular GPIO
Date: Wed, 30 Nov 2022 13:04:02 +0200	[thread overview]
Message-ID: <Y4c4oveumdtSJ8Py@smile.fi.intel.com> (raw)
In-Reply-To: <f54e3235-b146-ed4d-4848-edfbeb97bbe6@redhat.com>

On Wed, Nov 30, 2022 at 11:34:57AM +0100, Hans de Goede wrote:
> On 11/30/22 10:54, Andy Shevchenko wrote:
> > On Wed, Nov 30, 2022 at 1:12 AM Hans de Goede <hdegoede@redhat.com> wrote:
> >>
> >> On some systems, e.g. the Lenovo ThinkPad X1 Yoga gen 7 and the ThinkPad
> >> X1 Nano gen 2 there is no clock-enable pin, triggering the:
> >> "No clk GPIO. The privacy LED won't work" warning and causing the privacy
> >> LED to not work.
> >>
> >> Fix this by treating the privacy LED as a regular GPIO rather then
> >> integrating it with the registered clock.
> >>
> >> Note this relies on the ov5693 driver change to support an (optional)
> >> privacy-led GPIO to avoid the front cam privacy LED regressing on some
> >> models.
> > 
> > ...
> > 
> >> -       case INT3472_GPIO_TYPE_PRIVACY_LED:
> >> -               gpio = acpi_get_and_request_gpiod(path, pin, "int3472,privacy-led");
> >> -               if (IS_ERR(gpio))
> >> -                       return (PTR_ERR(gpio));
> >>
> >> -               int3472->clock.led_gpio = gpio;
> >> -               break;
> > 
> > I'm not sure how the previous patch makes this one work without
> > regressions. We have a "privacy-led" GPIO name there and here it used
> > to be with a prefix. Maybe I'm missing something...
> 
> The GPIO used to be controlled as part of the clk-provider,
> and the "int3472,privacy-led" name was the name of the consumer
> of the GPIO shown in /sys/kernel/debug/gpio. The "int3472,privacy-led"
> name has no lookup meaning since the pin is directly looked up by
> GPIO chip ACPI path + pin offset here.
> 
> Since not all devices with a privacy LED also have a clk-enable GPIO
> and thus a clk provider this did not work anywhere.
> 
> So this patch removes the code which controls the privacy LED
> through the clk-provider (which used the "int3472,privacy-led"
> and instead now adds an entry to the GPIO lookup table attached
> to the sensor. That new GPIO lookup table entry uses the name
> "privacy-led" since the LED no now longer is controlled by
> the INT3472 code (*).  The matching sensor driver patch
> (patch 1/6) to make the sensor driver directly control the
> privacy-led also uses "privacy-led" when calling gpiod_get()
> for it.
> 
> I hope this helps explain.

Definitely, thanks!

> *) all the INT3472 code now does is add the lookup table entry
> gpio lookup table

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2022-11-30 11:04 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-29 23:11 [PATCH 0/6] ov5693/int3472: Privacy LED handling changes + IPU6 compatibility Hans de Goede
2022-11-29 23:11 ` [PATCH 1/6] media: ov5693: Add support for a privacy-led GPIO Hans de Goede
2022-11-30 13:41   ` Sakari Ailus
2022-11-30 13:56     ` Hans de Goede
2022-11-30 14:52       ` Sakari Ailus
2022-11-30 15:20         ` Laurent Pinchart
2022-11-30 16:07           ` Andy Shevchenko
2022-11-30 16:23             ` Laurent Pinchart
2022-11-30 16:29           ` Hans de Goede
2022-11-30 16:34         ` Hans de Goede
2022-12-02 10:54           ` Laurent Pinchart
2022-12-02 11:21             ` Hans de Goede
2022-12-02 11:49               ` Laurent Pinchart
2022-12-02 11:53                 ` Andy Shevchenko
2022-12-02 12:14                   ` Laurent Pinchart
2022-12-02 12:23                     ` Andy Shevchenko
2022-12-02 13:46                     ` Sakari Ailus
2022-12-02 15:55                 ` Hans de Goede
2022-12-02 13:49           ` Sakari Ailus
2022-11-29 23:11 ` [PATCH 2/6] platform/x86: int3472/discrete: Refactor GPIO to sensor mapping Hans de Goede
2022-11-30  9:49   ` Andy Shevchenko
2022-11-30 10:37     ` Hans de Goede
2022-11-29 23:11 ` [PATCH 3/6] platform/x86: int3472/discrete: Treat privacy LED as regular GPIO Hans de Goede
2022-11-30  9:54   ` Andy Shevchenko
2022-11-30 10:34     ` Hans de Goede
2022-11-30 11:04       ` Andy Shevchenko [this message]
2022-11-29 23:11 ` [PATCH 4/6] platform/x86: int3472/discrete: Move GPIO request to skl_int3472_register_clock() Hans de Goede
2022-11-29 23:11 ` [PATCH 5/6] platform/x86: int3472/discrete: Ensure the clk/power enable pins are in output mode Hans de Goede
2022-11-30  9:59   ` Andy Shevchenko
2022-11-30 10:37     ` Hans de Goede
2022-11-29 23:11 ` [PATCH 6/6] platform/x86: int3472/discrete: Get the polarity from the _DSM entry Hans de Goede
2022-11-30 10:01   ` Andy Shevchenko
2022-11-30 10:39     ` Hans de Goede
2022-11-30 11:06       ` Andy Shevchenko
2022-11-30 11:10         ` Andy Shevchenko
2022-12-02 23:51         ` Hans de Goede
2022-11-30 10:03 ` [PATCH 0/6] ov5693/int3472: Privacy LED handling changes + IPU6 compatibility Andy Shevchenko
2022-11-30 10:40   ` Hans de Goede
2022-11-30 11:07 ` Andy Shevchenko
2022-12-02 13:50 ` Sakari Ailus
2022-12-07 17:34 ` Hans de Goede
2022-12-07 17:36   ` Andy Shevchenko

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=Y4c4oveumdtSJ8Py@smile.fi.intel.com \
    --to=andy.shevchenko@gmail.com \
    --cc=djrscally@gmail.com \
    --cc=hdegoede@redhat.com \
    --cc=hpa@redhat.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=markgross@kernel.org \
    --cc=markpearson@lenovo.com \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    /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.