Message ID | 20230509115226.287318-1-hdegoede@redhat.com |
---|---|
State | Superseded |
Headers | show |
Series | ACPI: LPSS: Add pwm_lookup_table entry for second PWM on CHT/BSW devices | expand |
On Tue, May 9, 2023 at 2:52 PM Hans de Goede <hdegoede@redhat.com> wrote: > > BSW PWM2 is used for backlight control for fixed (etched into the glass) > touch controls on some models. > > Add an entry for the second PWM controller to bsw_pwm_lookup, > so that drivers can use pwm_get() to get a referene to it. reference > These touch-controls have specialized drivers which bind to different > devices on different models, so the consumer-device-name in the lookup > table entry is set to NULL, so that only con-id matching is used. > > The con-id is set to "pwm_soc_lpss_2" which describes the PWM controller > rather then the usual approach of describing its function. than > The specialized (model specific) drivers which need access to the PWM > controller know they need the "pwm_soc_lpss_2" con-id. Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> > Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> > Signed-off-by: Hans de Goede <hdegoede@redhat.com> > --- > drivers/acpi/acpi_lpss.c | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > > diff --git a/drivers/acpi/acpi_lpss.c b/drivers/acpi/acpi_lpss.c > index 77186f084d3a..539e700de4d2 100644 > --- a/drivers/acpi/acpi_lpss.c > +++ b/drivers/acpi/acpi_lpss.c > @@ -201,11 +201,19 @@ static void byt_i2c_setup(struct lpss_private_data *pdata) > writel(0, pdata->mmio_base + LPSS_I2C_ENABLE); > } > > -/* BSW PWM used for backlight control by the i915 driver */ > +/* > + * BSW PWM1 is used for backlight control by the i915 driver > + * BSW PWM2 is used for backlight control for fixed (etched into the glass) > + * touch controls on some models. These touch-controls have specialized > + * drivers which know they need the "pwm_soc_lpss_2" con-id. > + */ > static struct pwm_lookup bsw_pwm_lookup[] = { > PWM_LOOKUP_WITH_MODULE("80862288:00", 0, "0000:00:02.0", > "pwm_soc_backlight", 0, PWM_POLARITY_NORMAL, > "pwm-lpss-platform"), > + PWM_LOOKUP_WITH_MODULE("80862289:00", 0, NULL, > + "pwm_soc_lpss_2", 0, PWM_POLARITY_NORMAL, > + "pwm-lpss-platform"), > }; > > static void bsw_pwm_setup(struct lpss_private_data *pdata) > -- > 2.40.1 >
diff --git a/drivers/acpi/acpi_lpss.c b/drivers/acpi/acpi_lpss.c index 77186f084d3a..539e700de4d2 100644 --- a/drivers/acpi/acpi_lpss.c +++ b/drivers/acpi/acpi_lpss.c @@ -201,11 +201,19 @@ static void byt_i2c_setup(struct lpss_private_data *pdata) writel(0, pdata->mmio_base + LPSS_I2C_ENABLE); } -/* BSW PWM used for backlight control by the i915 driver */ +/* + * BSW PWM1 is used for backlight control by the i915 driver + * BSW PWM2 is used for backlight control for fixed (etched into the glass) + * touch controls on some models. These touch-controls have specialized + * drivers which know they need the "pwm_soc_lpss_2" con-id. + */ static struct pwm_lookup bsw_pwm_lookup[] = { PWM_LOOKUP_WITH_MODULE("80862288:00", 0, "0000:00:02.0", "pwm_soc_backlight", 0, PWM_POLARITY_NORMAL, "pwm-lpss-platform"), + PWM_LOOKUP_WITH_MODULE("80862289:00", 0, NULL, + "pwm_soc_lpss_2", 0, PWM_POLARITY_NORMAL, + "pwm-lpss-platform"), }; static void bsw_pwm_setup(struct lpss_private_data *pdata)
BSW PWM2 is used for backlight control for fixed (etched into the glass) touch controls on some models. Add an entry for the second PWM controller to bsw_pwm_lookup, so that drivers can use pwm_get() to get a referene to it. These touch-controls have specialized drivers which bind to different devices on different models, so the consumer-device-name in the lookup table entry is set to NULL, so that only con-id matching is used. The con-id is set to "pwm_soc_lpss_2" which describes the PWM controller rather then the usual approach of describing its function. The specialized (model specific) drivers which need access to the PWM controller know they need the "pwm_soc_lpss_2" con-id. Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Hans de Goede <hdegoede@redhat.com> --- drivers/acpi/acpi_lpss.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)