diff mbox series

[v2,20/44] x86: pinctrl: Add multi-ACPI control

Message ID 20200707213233.v2.20.I4f722d76cfa910b97ecad2c968d4bef1f9ea12f8@changeid
State Accepted
Commit a9331a3388badf8a4f203d54c238f4e6bc76f247
Headers show
Series x86: Programmatic generation of ACPI tables (Part C) | expand

Commit Message

Simon Glass July 8, 2020, 3:32 a.m. UTC
Add a Kconfig to control whether pinctrl is represented as a single ACPI
device or as multiple devices. In the latter case (the default) we should
return the pin number relative to the pinctrl device.

Signed-off-by: Simon Glass <sjg at chromium.org>
Reviewed-by: Bin Meng <bmeng.cn at gmail.com>
Reviewed-by: Wolfgang Wallner <wolfgang.wallner at br-automation.com>
---

Changes in v2:
- Add help for CONFIG_INTEL_PINCTRL_MULTI_ACPI_DEVICES

 drivers/pinctrl/intel/Kconfig   | 12 ++++++++++++
 drivers/pinctrl/intel/pinctrl.c |  2 ++
 2 files changed, 14 insertions(+)

Comments

Wolfgang Wallner July 8, 2020, 7:21 a.m. UTC | #1
Hi Simon,

-----"Simon Glass" <sjg at chromium.org> schrieb: -----
> Betreff: [PATCH v2 20/44] x86: pinctrl: Add multi-ACPI control
> 
> Add a Kconfig to control whether pinctrl is represented as a single ACPI
> device or as multiple devices. In the latter case (the default) we should
> return the pin number relative to the pinctrl device.
> 
> Signed-off-by: Simon Glass <sjg at chromium.org>
> Reviewed-by: Bin Meng <bmeng.cn at gmail.com>
> Reviewed-by: Wolfgang Wallner <wolfgang.wallner at br-automation.com>
> ---
> 
> Changes in v2:
> - Add help for CONFIG_INTEL_PINCTRL_MULTI_ACPI_DEVICES

Thanks for adding the help text. There is a typo though, see below.

> 
>  drivers/pinctrl/intel/Kconfig   | 12 ++++++++++++
>  drivers/pinctrl/intel/pinctrl.c |  2 ++
>  2 files changed, 14 insertions(+)
> 
> diff --git a/drivers/pinctrl/intel/Kconfig b/drivers/pinctrl/intel/Kconfig
> index e62a2e0349..1acc5dabb0 100644
> --- a/drivers/pinctrl/intel/Kconfig
> +++ b/drivers/pinctrl/intel/Kconfig
> @@ -15,6 +15,18 @@ config INTEL_PINCTRL_IOSTANDBY
>  	bool
>  	default y
>  
> +config INTEL_PINCTRL_MULTI_ACPI_DEVICES
> +	bool
> +	default y
> +	help
> +	  Enable this if the pinctrl devices are modelled as multiple,
> +	  separate ACPI devices in the ACPI tables. If enabled, the ACPI
> +	  devices match the U-Boot pinctrl devices and the pin 'offset' is
> +	  relatove to a particular pinctrl device. If disabled, there is a

Typo: relative

> +	  single ACPI pinctrl device which includes all U-Boot pinctrl devices
> +	  and the pin 'offset' is in effect a global pin number.
> +
> +
>  config PINCTRL_INTEL_APL
>  	bool "Support Intel Apollo Lake (APL)"
>  	help
> diff --git a/drivers/pinctrl/intel/pinctrl.c b/drivers/pinctrl/intel/pinctrl.c
> index bf3989bf32..32ca303b27 100644
> --- a/drivers/pinctrl/intel/pinctrl.c
> +++ b/drivers/pinctrl/intel/pinctrl.c
> @@ -427,6 +427,8 @@ int intel_pinctrl_get_acpi_pin(struct udevice *dev, uint offset)
>  	const struct pad_community *comm = priv->comm;
>  	int group;
>  
> +	if (IS_ENABLED(CONFIG_INTEL_PINCTRL_MULTI_ACPI_DEVICES))
> +		return offset;
>  	group = pinctrl_group_index(comm, offset);
>  
>  	/* If pad base is not set then use GPIO number as ACPI pin number */
> -- 
> 2.27.0.383.g050319c2ae-goog

regards, Wolfgang
diff mbox series

Patch

diff --git a/drivers/pinctrl/intel/Kconfig b/drivers/pinctrl/intel/Kconfig
index e62a2e0349..1acc5dabb0 100644
--- a/drivers/pinctrl/intel/Kconfig
+++ b/drivers/pinctrl/intel/Kconfig
@@ -15,6 +15,18 @@  config INTEL_PINCTRL_IOSTANDBY
 	bool
 	default y
 
+config INTEL_PINCTRL_MULTI_ACPI_DEVICES
+	bool
+	default y
+	help
+	  Enable this if the pinctrl devices are modelled as multiple,
+	  separate ACPI devices in the ACPI tables. If enabled, the ACPI
+	  devices match the U-Boot pinctrl devices and the pin 'offset' is
+	  relatove to a particular pinctrl device. If disabled, there is a
+	  single ACPI pinctrl device which includes all U-Boot pinctrl devices
+	  and the pin 'offset' is in effect a global pin number.
+
+
 config PINCTRL_INTEL_APL
 	bool "Support Intel Apollo Lake (APL)"
 	help
diff --git a/drivers/pinctrl/intel/pinctrl.c b/drivers/pinctrl/intel/pinctrl.c
index bf3989bf32..32ca303b27 100644
--- a/drivers/pinctrl/intel/pinctrl.c
+++ b/drivers/pinctrl/intel/pinctrl.c
@@ -427,6 +427,8 @@  int intel_pinctrl_get_acpi_pin(struct udevice *dev, uint offset)
 	const struct pad_community *comm = priv->comm;
 	int group;
 
+	if (IS_ENABLED(CONFIG_INTEL_PINCTRL_MULTI_ACPI_DEVICES))
+		return offset;
 	group = pinctrl_group_index(comm, offset);
 
 	/* If pad base is not set then use GPIO number as ACPI pin number */