All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 1/3] ACPI: platform: Constify properties parameter in acpi_create_platform_device()
@ 2022-02-23 23:56 Andy Shevchenko
  2022-02-23 23:56 ` [PATCH v1 2/3] ACPI: lpss: Constify properties member in struct lpss_device_desc Andy Shevchenko
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Andy Shevchenko @ 2022-02-23 23:56 UTC (permalink / raw)
  To: Andy Shevchenko, Rafael J. Wysocki, linux-acpi, linux-kernel
  Cc: Rafael J. Wysocki, Len Brown

Properties are not and should not be changed in the callee, hence constify
properties parameter in acpi_create_platform_device().

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/acpi/acpi_platform.c | 2 +-
 include/linux/acpi.h         | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/acpi/acpi_platform.c b/drivers/acpi/acpi_platform.c
index 78d621290a35..de3cbf152dee 100644
--- a/drivers/acpi/acpi_platform.c
+++ b/drivers/acpi/acpi_platform.c
@@ -95,7 +95,7 @@ static void acpi_platform_fill_resource(struct acpi_device *adev,
  * Name of the platform device will be the same as @adev's.
  */
 struct platform_device *acpi_create_platform_device(struct acpi_device *adev,
-					struct property_entry *properties)
+						    const struct property_entry *properties)
 {
 	struct platform_device *pdev = NULL;
 	struct platform_device_info pdevinfo;
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 6274758648e3..9ac545379447 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -691,7 +691,7 @@ int acpi_device_uevent_modalias(struct device *, struct kobj_uevent_env *);
 int acpi_device_modalias(struct device *, char *, int);
 
 struct platform_device *acpi_create_platform_device(struct acpi_device *,
-						    struct property_entry *);
+						    const struct property_entry *);
 #define ACPI_PTR(_ptr)	(_ptr)
 
 static inline void acpi_device_set_enumerated(struct acpi_device *adev)
@@ -930,7 +930,7 @@ static inline int acpi_device_modalias(struct device *dev,
 
 static inline struct platform_device *
 acpi_create_platform_device(struct acpi_device *adev,
-			    struct property_entry *properties)
+			    const struct property_entry *properties)
 {
 	return NULL;
 }
-- 
2.34.1


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

* [PATCH v1 2/3] ACPI: lpss: Constify properties member in struct lpss_device_desc
  2022-02-23 23:56 [PATCH v1 1/3] ACPI: platform: Constify properties parameter in acpi_create_platform_device() Andy Shevchenko
@ 2022-02-23 23:56 ` Andy Shevchenko
  2022-02-23 23:56 ` [PATCH v1 3/3] ACPI: lpss: Provide an SSP type to the driver Andy Shevchenko
  2022-03-01 19:38 ` [PATCH v1 1/3] ACPI: platform: Constify properties parameter in acpi_create_platform_device() Rafael J. Wysocki
  2 siblings, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2022-02-23 23:56 UTC (permalink / raw)
  To: Andy Shevchenko, Rafael J. Wysocki, linux-acpi, linux-kernel
  Cc: Rafael J. Wysocki, Len Brown

The properties are static and not supposed to be modified, constify them.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/acpi/acpi_lpss.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/acpi/acpi_lpss.c b/drivers/acpi/acpi_lpss.c
index bcae0f03572b..c28954411af9 100644
--- a/drivers/acpi/acpi_lpss.c
+++ b/drivers/acpi/acpi_lpss.c
@@ -82,7 +82,7 @@ struct lpss_device_desc {
 	const char *clk_con_id;
 	unsigned int prv_offset;
 	size_t prv_size_override;
-	struct property_entry *properties;
+	const struct property_entry *properties;
 	void (*setup)(struct lpss_private_data *pdata);
 	bool resume_from_noirq;
 };
-- 
2.34.1


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

* [PATCH v1 3/3] ACPI: lpss: Provide an SSP type to the driver
  2022-02-23 23:56 [PATCH v1 1/3] ACPI: platform: Constify properties parameter in acpi_create_platform_device() Andy Shevchenko
  2022-02-23 23:56 ` [PATCH v1 2/3] ACPI: lpss: Constify properties member in struct lpss_device_desc Andy Shevchenko
@ 2022-02-23 23:56 ` Andy Shevchenko
  2022-03-01 19:38 ` [PATCH v1 1/3] ACPI: platform: Constify properties parameter in acpi_create_platform_device() Rafael J. Wysocki
  2 siblings, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2022-02-23 23:56 UTC (permalink / raw)
  To: Andy Shevchenko, Rafael J. Wysocki, linux-acpi, linux-kernel
  Cc: Rafael J. Wysocki, Len Brown

The SPI driver wants to know the exact type of the controller. Provide this
information to it, hence allow to fix Intel Wildcat Point case in the future.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/acpi/acpi_lpss.c | 31 +++++++++++++++++++++++++------
 1 file changed, 25 insertions(+), 6 deletions(-)

diff --git a/drivers/acpi/acpi_lpss.c b/drivers/acpi/acpi_lpss.c
index c28954411af9..fbe0756259c5 100644
--- a/drivers/acpi/acpi_lpss.c
+++ b/drivers/acpi/acpi_lpss.c
@@ -21,6 +21,7 @@
 #include <linux/pm_domain.h>
 #include <linux/pm_runtime.h>
 #include <linux/pwm.h>
+#include <linux/pxa2xx_ssp.h>
 #include <linux/suspend.h>
 #include <linux/delay.h>
 
@@ -219,10 +220,16 @@ static void bsw_pwm_setup(struct lpss_private_data *pdata)
 	pwm_add_table(bsw_pwm_lookup, ARRAY_SIZE(bsw_pwm_lookup));
 }
 
-static const struct lpss_device_desc lpt_dev_desc = {
+static const struct property_entry lpt_spi_properties[] = {
+	PROPERTY_ENTRY_U32("intel,spi-pxa2xx-type", LPSS_LPT_SSP),
+	{ }
+};
+
+static const struct lpss_device_desc lpt_spi_dev_desc = {
 	.flags = LPSS_CLK | LPSS_CLK_GATE | LPSS_CLK_DIVIDER | LPSS_LTR
 			| LPSS_SAVE_CTX,
 	.prv_offset = 0x800,
+	.properties = lpt_spi_properties,
 };
 
 static const struct lpss_device_desc lpt_i2c_dev_desc = {
@@ -282,9 +289,15 @@ static const struct lpss_device_desc bsw_uart_dev_desc = {
 	.properties = uart_properties,
 };
 
+static const struct property_entry byt_spi_properties[] = {
+	PROPERTY_ENTRY_U32("intel,spi-pxa2xx-type", LPSS_BYT_SSP),
+	{ }
+};
+
 static const struct lpss_device_desc byt_spi_dev_desc = {
 	.flags = LPSS_CLK | LPSS_CLK_GATE | LPSS_CLK_DIVIDER | LPSS_SAVE_CTX,
 	.prv_offset = 0x400,
+	.properties = byt_spi_properties,
 };
 
 static const struct lpss_device_desc byt_sdio_dev_desc = {
@@ -305,11 +318,17 @@ static const struct lpss_device_desc bsw_i2c_dev_desc = {
 	.resume_from_noirq = true,
 };
 
+static const struct property_entry bsw_spi_properties[] = {
+	PROPERTY_ENTRY_U32("intel,spi-pxa2xx-type", LPSS_BSW_SSP),
+	{ }
+};
+
 static const struct lpss_device_desc bsw_spi_dev_desc = {
 	.flags = LPSS_CLK | LPSS_CLK_GATE | LPSS_CLK_DIVIDER | LPSS_SAVE_CTX
 			| LPSS_NO_D3_DELAY,
 	.prv_offset = 0x400,
 	.setup = lpss_deassert_reset,
+	.properties = bsw_spi_properties,
 };
 
 static const struct x86_cpu_id lpss_cpu_ids[] = {
@@ -329,8 +348,8 @@ static const struct acpi_device_id acpi_lpss_device_ids[] = {
 	{ "INTL9C60", LPSS_ADDR(lpss_dma_desc) },
 
 	/* Lynxpoint LPSS devices */
-	{ "INT33C0", LPSS_ADDR(lpt_dev_desc) },
-	{ "INT33C1", LPSS_ADDR(lpt_dev_desc) },
+	{ "INT33C0", LPSS_ADDR(lpt_spi_dev_desc) },
+	{ "INT33C1", LPSS_ADDR(lpt_spi_dev_desc) },
 	{ "INT33C2", LPSS_ADDR(lpt_i2c_dev_desc) },
 	{ "INT33C3", LPSS_ADDR(lpt_i2c_dev_desc) },
 	{ "INT33C4", LPSS_ADDR(lpt_uart_dev_desc) },
@@ -356,8 +375,8 @@ static const struct acpi_device_id acpi_lpss_device_ids[] = {
 	{ "808622C1", LPSS_ADDR(bsw_i2c_dev_desc) },
 
 	/* Broadwell LPSS devices */
-	{ "INT3430", LPSS_ADDR(lpt_dev_desc) },
-	{ "INT3431", LPSS_ADDR(lpt_dev_desc) },
+	{ "INT3430", LPSS_ADDR(lpt_spi_dev_desc) },
+	{ "INT3431", LPSS_ADDR(lpt_spi_dev_desc) },
 	{ "INT3432", LPSS_ADDR(lpt_i2c_dev_desc) },
 	{ "INT3433", LPSS_ADDR(lpt_i2c_dev_desc) },
 	{ "INT3434", LPSS_ADDR(lpt_uart_dev_desc) },
@@ -366,7 +385,7 @@ static const struct acpi_device_id acpi_lpss_device_ids[] = {
 	{ "INT3437", },
 
 	/* Wildcat Point LPSS devices */
-	{ "INT3438", LPSS_ADDR(lpt_dev_desc) },
+	{ "INT3438", LPSS_ADDR(lpt_spi_dev_desc) },
 
 	{ }
 };
-- 
2.34.1


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

* Re: [PATCH v1 1/3] ACPI: platform: Constify properties parameter in acpi_create_platform_device()
  2022-02-23 23:56 [PATCH v1 1/3] ACPI: platform: Constify properties parameter in acpi_create_platform_device() Andy Shevchenko
  2022-02-23 23:56 ` [PATCH v1 2/3] ACPI: lpss: Constify properties member in struct lpss_device_desc Andy Shevchenko
  2022-02-23 23:56 ` [PATCH v1 3/3] ACPI: lpss: Provide an SSP type to the driver Andy Shevchenko
@ 2022-03-01 19:38 ` Rafael J. Wysocki
  2 siblings, 0 replies; 4+ messages in thread
From: Rafael J. Wysocki @ 2022-03-01 19:38 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Rafael J. Wysocki, ACPI Devel Maling List,
	Linux Kernel Mailing List, Rafael J. Wysocki, Len Brown

On Thu, Feb 24, 2022 at 12:56 AM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> Properties are not and should not be changed in the callee, hence constify
> properties parameter in acpi_create_platform_device().
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/acpi/acpi_platform.c | 2 +-
>  include/linux/acpi.h         | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/acpi/acpi_platform.c b/drivers/acpi/acpi_platform.c
> index 78d621290a35..de3cbf152dee 100644
> --- a/drivers/acpi/acpi_platform.c
> +++ b/drivers/acpi/acpi_platform.c
> @@ -95,7 +95,7 @@ static void acpi_platform_fill_resource(struct acpi_device *adev,
>   * Name of the platform device will be the same as @adev's.
>   */
>  struct platform_device *acpi_create_platform_device(struct acpi_device *adev,
> -                                       struct property_entry *properties)
> +                                                   const struct property_entry *properties)
>  {
>         struct platform_device *pdev = NULL;
>         struct platform_device_info pdevinfo;
> diff --git a/include/linux/acpi.h b/include/linux/acpi.h
> index 6274758648e3..9ac545379447 100644
> --- a/include/linux/acpi.h
> +++ b/include/linux/acpi.h
> @@ -691,7 +691,7 @@ int acpi_device_uevent_modalias(struct device *, struct kobj_uevent_env *);
>  int acpi_device_modalias(struct device *, char *, int);
>
>  struct platform_device *acpi_create_platform_device(struct acpi_device *,
> -                                                   struct property_entry *);
> +                                                   const struct property_entry *);
>  #define ACPI_PTR(_ptr) (_ptr)
>
>  static inline void acpi_device_set_enumerated(struct acpi_device *adev)
> @@ -930,7 +930,7 @@ static inline int acpi_device_modalias(struct device *dev,
>
>  static inline struct platform_device *
>  acpi_create_platform_device(struct acpi_device *adev,
> -                           struct property_entry *properties)
> +                           const struct property_entry *properties)
>  {
>         return NULL;
>  }
> --

Applied as 5.18 material along with the rest of the series, thanks!

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

end of thread, other threads:[~2022-03-01 19:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-23 23:56 [PATCH v1 1/3] ACPI: platform: Constify properties parameter in acpi_create_platform_device() Andy Shevchenko
2022-02-23 23:56 ` [PATCH v1 2/3] ACPI: lpss: Constify properties member in struct lpss_device_desc Andy Shevchenko
2022-02-23 23:56 ` [PATCH v1 3/3] ACPI: lpss: Provide an SSP type to the driver Andy Shevchenko
2022-03-01 19:38 ` [PATCH v1 1/3] ACPI: platform: Constify properties parameter in acpi_create_platform_device() Rafael J. Wysocki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.