Hi, On 5/6/23 13:26, Hans de Goede wrote: > 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@xxxxxxxxxxxxxx> 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 ? I've decided to go ahead and go this route. So I've modified this patch to drop the pwm_lookup_table from it and changed the con_id passed to pwm_get() to: "pwm_soc_lpss_2". And then merged patches 2-19 (1) into the pdx86/review-hans (2). I'll also submit an acpi_lpss.c patch soon to add a lookup-table entry for the "pwm_soc_lpss_2" con_id there. Regards, Hans 1) All the patches except for patch 1 which exported pwm_add_table() / pwm_remove_table() 2) Patches pending for pdx86/for-next