Linux PWM subsystem development
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Andy Shevchenko" <andy.shevchenko@gmail.com>
Cc: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	"Andy Shevchenko" <andy@kernel.org>,
	"Thierry Reding" <thierry.reding@gmail.com>,
	"Yauhen Kharuzhy" <jekhor@gmail.com>,
	platform-driver-x86@vger.kernel.org, linux-pwm@vger.kernel.org
Subject: Re: [PATCH v2 18/19] platform/x86: lenovo-yogabook: Add keyboard backlight control to platform driver
Date: Sat, 6 May 2023 13:26:02 +0200	[thread overview]
Message-ID: <b61d7ca2-a1db-05a1-fee5-b68e0e94b99f@redhat.com> (raw)
In-Reply-To: <20230505092111.qknupa2vooi7mqwl@pengutronix.de>

Hi Uwe, Andy,

On 5/5/23 11:21, Uwe Kleine-König wrote:
> On Fri, May 05, 2023 at 12:07:02PM +0300, Andy Shevchenko wrote:
>> On Thu, May 4, 2023 at 7:53 PM Uwe Kleine-König
>> <u.kleine-koenig@pengutronix.de> wrote:
>>> On Sun, Apr 30, 2023 at 06:58:06PM +0200, Hans de Goede wrote:
>>
>> ...
>>
>>> I don't know much about x86, but I think the table belongs to where this
>>> "80862289:00" device is created.
>>
>> Just for your information, it's in drivers/acpi/acpi_lpss.c.
> 
> Compared to drivers/platform/x86/lenovo-yogabook-wmi.c this file is
> never compiled as a module and so patch #1 would become unnecessary.
> 
> That file also already has a pwm_lookup table.

Right, the Cherry Trail SoCs in question have 2 PWM controllers
the first controller is pretty much always used to control
the brightness of the LCD screen. So we have a fixed pwm_lookup
table for it there using the SoC's builtin display controller's
device_name() as consumer-device-name.

The second PWM controller however is different it is mostly unused
I'm aware of 2 cases where it is used and in both cases it is used
to control the brightness of a backlight for fixed (etched into the
glass) touch controls.

The problem is that in these cases there will be 2 totally different
consumer devices. Looking at the lookup tabel checks in pwm_get()
I see that it is possible to add a lookup which matches only by
dev_id. So I could use this here and this would then also be in
place for when I get around to writing a driver for the second
case (that I'm ware of) which needs access to the second PWM controller.

So this then just leaves the question of what to name the con-id,
since we won't be specifying a consumer-device-name I think it is
best to keep the con_id quite generic, e.g.:

"pwm_soc_lpss_2"

to match with the existing:

"pwm_soc_backlight"

for the first PWM controller.

Uwe, Andy, is using a pwm_lookup with only a con_id match on
"pwm_soc_lpss_2" ok with you ?

Regards,
Hans



  parent reply	other threads:[~2023-05-06 11:26 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-30 16:57 [PATCH v2 00/19] platform/x86: lenovo-yogabook: Modify to also work on Android version Hans de Goede
2023-04-30 16:57 ` [PATCH v2 01/19] pwm: Export pwm_add_table() / pwm_remove_table() Hans de Goede
2023-04-30 16:57 ` [PATCH v2 02/19] platform/x86: lenovo-yogabook: Fix work race on remove() Hans de Goede
2023-04-30 16:57 ` [PATCH v2 03/19] platform/x86: lenovo-yogabook: Reprobe devices " Hans de Goede
2023-04-30 16:57 ` [PATCH v2 04/19] platform/x86: lenovo-yogabook: Set default keyboard backligh brightness on probe() Hans de Goede
2023-04-30 16:57 ` [PATCH v2 05/19] platform/x86: lenovo-yogabook: Simplify gpio lookup table cleanup Hans de Goede
2023-04-30 16:57 ` [PATCH v2 06/19] platform/x86: lenovo-yogabook: Switch to DEFINE_SIMPLE_DEV_PM_OPS() Hans de Goede
2023-04-30 16:57 ` [PATCH v2 07/19] platform/x86: lenovo-yogabook: Store dev instead of wdev in drvdata struct Hans de Goede
2023-04-30 16:57 ` [PATCH v2 08/19] platform/x86: lenovo-yogabook: Add dev local variable to probe() Hans de Goede
2023-04-30 16:57 ` [PATCH v2 09/19] platform/x86: lenovo-yogabook: Use PMIC LED driver for pen icon LED control Hans de Goede
2023-04-30 16:57 ` [PATCH v2 10/19] platform/x86: lenovo-yogabook: Split probe() into generic and WMI specific parts Hans de Goede
2023-05-01  9:53   ` Andy Shevchenko
2023-05-09 10:32     ` Hans de Goede
2023-04-30 16:57 ` [PATCH v2 11/19] platform/x86: lenovo-yogabook: Stop checking adev->power.state Hans de Goede
2023-04-30 16:58 ` [PATCH v2 12/19] platform/x86: lenovo-yogabook: Abstract kbd backlight setting Hans de Goede
2023-04-30 16:58 ` [PATCH v2 13/19] platform/x86: lenovo-yogabook: Add a yogabook_toggle_digitizer_mode() helper function Hans de Goede
2023-04-30 16:58 ` [PATCH v2 14/19] platform/x86: lenovo-yogabook: Drop _wmi_ from remaining generic symbols Hans de Goede
2023-04-30 16:58 ` [PATCH v2 15/19] platform/x86: lenovo-yogabook: Group WMI specific code together Hans de Goede
2023-04-30 16:58 ` [PATCH v2 16/19] platform/x86: lenovo-yogabook: Add YB_KBD_BL_MAX define Hans de Goede
2023-04-30 16:58 ` [PATCH v2 17/19] platform/x86: lenovo-yogabook: Add platform driver support Hans de Goede
2023-04-30 16:58 ` [PATCH v2 18/19] platform/x86: lenovo-yogabook: Add keyboard backlight control to platform driver Hans de Goede
2023-05-04 16:53   ` Uwe Kleine-König
2023-05-05  9:07     ` Andy Shevchenko
2023-05-05  9:21       ` Uwe Kleine-König
2023-05-05 11:43         ` Andy Shevchenko
2023-05-06 11:26         ` Hans de Goede [this message]
2023-05-09 10:39           ` Hans de Goede
2023-04-30 16:58 ` [PATCH v2 19/19] platform/x86: lenovo-yogabook: Rename lenovo-yogabook-wmi to lenovo-yogabook 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=b61d7ca2-a1db-05a1-fee5-b68e0e94b99f@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=andy@kernel.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=jekhor@gmail.com \
    --cc=linux-pwm@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=thierry.reding@gmail.com \
    --cc=u.kleine-koenig@pengutronix.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox