mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ACPI / LPSS: override SDIO device's private register space size
@ 2013-06-18 13:51 Mika Westerberg
  2013-06-20  0:03 ` Rafael J. Wysocki
  0 siblings, 1 reply; 2+ messages in thread
From: Mika Westerberg @ 2013-06-18 13:51 UTC (permalink / raw)
  To: linux-acpi; +Cc: Rafael J. Wysocki, Len Brown, Mika Westerberg, linux-kernel

The SDIO device in Lynxpoint has its LTR registers allocated for a WiFi
device (a child of the SDIO device) instead in ACPI namespace even though
they physically belong to the SDIO device. In order to be able to access
the LTR registers from the ACPI LPSS driver for diagnostic purposes we need
to enlarge size of this private register space.

Work around this by adding a possibility to override size of the private
register space in the ACPI LPSS driver and set correct size for the SDIO
device.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
---
Applies on top of https://patchwork.kernel.org/patch/2742521/ (ACPI / LPSS:
Power up LPSS devices during enumeration)

 drivers/acpi/acpi_lpss.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/acpi/acpi_lpss.c b/drivers/acpi/acpi_lpss.c
index a14d997..539aeae 100644
--- a/drivers/acpi/acpi_lpss.c
+++ b/drivers/acpi/acpi_lpss.c
@@ -44,6 +44,7 @@ struct lpss_device_desc {
 	const char *clkdev_name;
 	bool ltr_required;
 	unsigned int prv_offset;
+	size_t prv_size_override;
 	bool clk_gate;
 	struct lpss_shared_clock *shared_clock;
 };
@@ -69,6 +70,7 @@ static struct lpss_device_desc lpt_dev_desc = {
 
 static struct lpss_device_desc lpt_sdio_dev_desc = {
 	.prv_offset = 0x1000,
+	.prv_size_override = 0x1018,
 	.ltr_required = true,
 };
 
@@ -226,7 +228,10 @@ static int acpi_lpss_create_device(struct acpi_device *adev,
 
 	list_for_each_entry(rentry, &resource_list, node)
 		if (resource_type(&rentry->res) == IORESOURCE_MEM) {
-			pdata->mmio_size = resource_size(&rentry->res);
+			if (dev_desc->prv_size_override)
+				pdata->mmio_size = dev_desc->prv_size_override;
+			else
+				pdata->mmio_size = resource_size(&rentry->res);
 			pdata->mmio_base = ioremap(rentry->res.start,
 						   pdata->mmio_size);
 			pdata->dev_desc = dev_desc;
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] ACPI / LPSS: override SDIO device's private register space size
  2013-06-18 13:51 [PATCH] ACPI / LPSS: override SDIO device's private register space size Mika Westerberg
@ 2013-06-20  0:03 ` Rafael J. Wysocki
  0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2013-06-20  0:03 UTC (permalink / raw)
  To: Mika Westerberg; +Cc: linux-acpi, Rafael J. Wysocki, Len Brown, linux-kernel

On Tuesday, June 18, 2013 04:51:35 PM Mika Westerberg wrote:
> The SDIO device in Lynxpoint has its LTR registers allocated for a WiFi
> device (a child of the SDIO device) instead in ACPI namespace even though
> they physically belong to the SDIO device. In order to be able to access
> the LTR registers from the ACPI LPSS driver for diagnostic purposes we need
> to enlarge size of this private register space.
> 
> Work around this by adding a possibility to override size of the private
> register space in the ACPI LPSS driver and set correct size for the SDIO
> device.
> 
> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
> ---
> Applies on top of https://patchwork.kernel.org/patch/2742521/ (ACPI / LPSS:
> Power up LPSS devices during enumeration)

Queued up for 3.11.

Thanks,
Rafael


>  drivers/acpi/acpi_lpss.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/acpi/acpi_lpss.c b/drivers/acpi/acpi_lpss.c
> index a14d997..539aeae 100644
> --- a/drivers/acpi/acpi_lpss.c
> +++ b/drivers/acpi/acpi_lpss.c
> @@ -44,6 +44,7 @@ struct lpss_device_desc {
>  	const char *clkdev_name;
>  	bool ltr_required;
>  	unsigned int prv_offset;
> +	size_t prv_size_override;
>  	bool clk_gate;
>  	struct lpss_shared_clock *shared_clock;
>  };
> @@ -69,6 +70,7 @@ static struct lpss_device_desc lpt_dev_desc = {
>  
>  static struct lpss_device_desc lpt_sdio_dev_desc = {
>  	.prv_offset = 0x1000,
> +	.prv_size_override = 0x1018,
>  	.ltr_required = true,
>  };
>  
> @@ -226,7 +228,10 @@ static int acpi_lpss_create_device(struct acpi_device *adev,
>  
>  	list_for_each_entry(rentry, &resource_list, node)
>  		if (resource_type(&rentry->res) == IORESOURCE_MEM) {
> -			pdata->mmio_size = resource_size(&rentry->res);
> +			if (dev_desc->prv_size_override)
> +				pdata->mmio_size = dev_desc->prv_size_override;
> +			else
> +				pdata->mmio_size = resource_size(&rentry->res);
>  			pdata->mmio_base = ioremap(rentry->res.start,
>  						   pdata->mmio_size);
>  			pdata->dev_desc = dev_desc;
> 
-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-06-19 23:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-18 13:51 [PATCH] ACPI / LPSS: override SDIO device's private register space size Mika Westerberg
2013-06-20  0:03 ` 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

Powered by JetHome