* [PATCH v2] ACPI: LPSS: Add 80862289 ACPI _HID for second PWM controller on Cherry Trail
@ 2023-04-18 8:54 Hans de Goede
2023-04-18 15:43 ` Rafael J. Wysocki
0 siblings, 1 reply; 2+ messages in thread
From: Hans de Goede @ 2023-04-18 8:54 UTC (permalink / raw)
To: Rafael J . Wysocki
Cc: Hans de Goede, Andy Shevchenko, Mika Westerberg, linux-acpi
On some Cherry Trail devices the second PWM controller uses
80862289 as ACPI _HID, rather then using 80862288 as is done
for both controllers on most models.
Add the missing 80862289 ACPI _HID, note this uses its own
lpss_device_desc, without ".setup = bsw_pwm_setup" so that
the pwm_lookup is not added for it.
On devices where both controllers use the 80862288 _HID bsw_pwm_setup()
does a UID check to avoid registering the lookup for the second
controller but that will not work here.
Adding the missing id fixes the second PWM controller no longer
working after the entire LPSS1 island has been in D3 at least
once, which causes the contents of the LPSS private registers
to get lost. Adding the _HID makes acpi_lpss restore these
when the controller moves from D3 to D0.
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
Changes in v2:
- s/HID/_HID/
- Add Mika's Reviewed-by
---
drivers/acpi/acpi_lpss.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/acpi/acpi_lpss.c b/drivers/acpi/acpi_lpss.c
index f08ffa75f4a7..77186f084d3a 100644
--- a/drivers/acpi/acpi_lpss.c
+++ b/drivers/acpi/acpi_lpss.c
@@ -271,6 +271,12 @@ static const struct lpss_device_desc bsw_pwm_dev_desc = {
.resume_from_noirq = true,
};
+static const struct lpss_device_desc bsw_pwm2_dev_desc = {
+ .flags = LPSS_SAVE_CTX_ONCE | LPSS_NO_D3_DELAY,
+ .prv_offset = 0x800,
+ .resume_from_noirq = true,
+};
+
static const struct lpss_device_desc byt_uart_dev_desc = {
.flags = LPSS_CLK | LPSS_CLK_GATE | LPSS_CLK_DIVIDER | LPSS_SAVE_CTX,
.clk_con_id = "baudclk",
@@ -368,6 +374,7 @@ static const struct acpi_device_id acpi_lpss_device_ids[] = {
/* Braswell LPSS devices */
{ "80862286", LPSS_ADDR(lpss_dma_desc) },
{ "80862288", LPSS_ADDR(bsw_pwm_dev_desc) },
+ { "80862289", LPSS_ADDR(bsw_pwm2_dev_desc) },
{ "8086228A", LPSS_ADDR(bsw_uart_dev_desc) },
{ "8086228E", LPSS_ADDR(bsw_spi_dev_desc) },
{ "808622C0", LPSS_ADDR(lpss_dma_desc) },
--
2.39.2
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH v2] ACPI: LPSS: Add 80862289 ACPI _HID for second PWM controller on Cherry Trail
2023-04-18 8:54 [PATCH v2] ACPI: LPSS: Add 80862289 ACPI _HID for second PWM controller on Cherry Trail Hans de Goede
@ 2023-04-18 15:43 ` Rafael J. Wysocki
0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2023-04-18 15:43 UTC (permalink / raw)
To: Hans de Goede
Cc: Rafael J . Wysocki, Andy Shevchenko, Mika Westerberg, linux-acpi
On Tue, Apr 18, 2023 at 10:54 AM Hans de Goede <hdegoede@redhat.com> wrote:
>
> On some Cherry Trail devices the second PWM controller uses
> 80862289 as ACPI _HID, rather then using 80862288 as is done
> for both controllers on most models.
>
> Add the missing 80862289 ACPI _HID, note this uses its own
> lpss_device_desc, without ".setup = bsw_pwm_setup" so that
> the pwm_lookup is not added for it.
> On devices where both controllers use the 80862288 _HID bsw_pwm_setup()
> does a UID check to avoid registering the lookup for the second
> controller but that will not work here.
>
> Adding the missing id fixes the second PWM controller no longer
> working after the entire LPSS1 island has been in D3 at least
> once, which causes the contents of the LPSS private registers
> to get lost. Adding the _HID makes acpi_lpss restore these
> when the controller moves from D3 to D0.
>
> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
> Changes in v2:
> - s/HID/_HID/
> - Add Mika's Reviewed-by
> ---
> drivers/acpi/acpi_lpss.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/drivers/acpi/acpi_lpss.c b/drivers/acpi/acpi_lpss.c
> index f08ffa75f4a7..77186f084d3a 100644
> --- a/drivers/acpi/acpi_lpss.c
> +++ b/drivers/acpi/acpi_lpss.c
> @@ -271,6 +271,12 @@ static const struct lpss_device_desc bsw_pwm_dev_desc = {
> .resume_from_noirq = true,
> };
>
> +static const struct lpss_device_desc bsw_pwm2_dev_desc = {
> + .flags = LPSS_SAVE_CTX_ONCE | LPSS_NO_D3_DELAY,
> + .prv_offset = 0x800,
> + .resume_from_noirq = true,
> +};
> +
> static const struct lpss_device_desc byt_uart_dev_desc = {
> .flags = LPSS_CLK | LPSS_CLK_GATE | LPSS_CLK_DIVIDER | LPSS_SAVE_CTX,
> .clk_con_id = "baudclk",
> @@ -368,6 +374,7 @@ static const struct acpi_device_id acpi_lpss_device_ids[] = {
> /* Braswell LPSS devices */
> { "80862286", LPSS_ADDR(lpss_dma_desc) },
> { "80862288", LPSS_ADDR(bsw_pwm_dev_desc) },
> + { "80862289", LPSS_ADDR(bsw_pwm2_dev_desc) },
> { "8086228A", LPSS_ADDR(bsw_uart_dev_desc) },
> { "8086228E", LPSS_ADDR(bsw_spi_dev_desc) },
> { "808622C0", LPSS_ADDR(lpss_dma_desc) },
> --
Applied as 6.4 material, thanks!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-04-18 15:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-18 8:54 [PATCH v2] ACPI: LPSS: Add 80862289 ACPI _HID for second PWM controller on Cherry Trail Hans de Goede
2023-04-18 15:43 ` Rafael J. Wysocki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox