2023-09-27 03:52:33

by Andy Shevchenko

[permalink] [raw]
Subject: [PATCH v1 1/4] mfd: lpc_ich: Make struct lpc_ich_priv use enum for chipset member

We have a specific enum for the supported chipsets.
Make struct lpc_ich_priv use better type for the chipset member.

Signed-off-by: Andy Shevchenko <[email protected]>
---
drivers/mfd/lpc_ich.c | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/mfd/lpc_ich.c b/drivers/mfd/lpc_ich.c
index 7b1c597b6879..58da6c95c462 100644
--- a/drivers/mfd/lpc_ich.c
+++ b/drivers/mfd/lpc_ich.c
@@ -85,19 +85,6 @@
#define wdt_mem_res(i) wdt_res(ICH_RES_MEM_OFF, i)
#define wdt_res(b, i) (&wdt_ich_res[(b) + (i)])

-struct lpc_ich_priv {
- int chipset;
-
- int abase; /* ACPI base */
- int actrl_pbase; /* ACPI control or PMC base */
- int gbase; /* GPIO base */
- int gctrl; /* GPIO control */
-
- int abase_save; /* Cached ACPI base value */
- int actrl_pbase_save; /* Cached ACPI control or PMC base value */
- int gctrl_save; /* Cached GPIO control value */
-};
-
static struct resource wdt_ich_res[] = {
/* ACPI - TCO */
{
@@ -293,6 +280,19 @@ enum lpc_chipsets {
LPC_COUGARMOUNTAIN,/* Cougar Mountain SoC*/
};

+struct lpc_ich_priv {
+ enum lpc_chipsets chipset;
+
+ int abase; /* ACPI base */
+ int actrl_pbase; /* ACPI control or PMC base */
+ int gbase; /* GPIO base */
+ int gctrl; /* GPIO control */
+
+ int abase_save; /* Cached ACPI base value */
+ int actrl_pbase_save; /* Cached ACPI control or PMC base value */
+ int gctrl_save; /* Cached GPIO control value */
+};
+
static struct lpc_ich_info lpc_chipset_info[] = {
[LPC_ICH] = {
.name = "ICH",
--
2.40.0.1.gaa8946217a0b


2023-09-27 05:12:33

by Andy Shevchenko

[permalink] [raw]
Subject: [PATCH v1 2/4] mfd: lpc_ich: Convert gpio_version to be enum

We have an anonymous enum for the GPIO versions. Make it named
and use this type for the gpio_version member of struct lpc_ich_info.

Signed-off-by: Andy Shevchenko <[email protected]>
---
include/linux/mfd/lpc_ich.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/mfd/lpc_ich.h b/include/linux/mfd/lpc_ich.h
index ea4a4b1b246a..83621e0ccf33 100644
--- a/include/linux/mfd/lpc_ich.h
+++ b/include/linux/mfd/lpc_ich.h
@@ -15,7 +15,7 @@
#define ICH_RES_GPE0 1

/* GPIO compatibility */
-enum {
+enum lpc_gpio_versions {
ICH_I3100_GPIO,
ICH_V5_GPIO,
ICH_V6_GPIO,
@@ -29,7 +29,7 @@ enum {
struct lpc_ich_info {
char name[32];
unsigned int iTCO_version;
- unsigned int gpio_version;
+ enum lpc_gpio_versions gpio_version;
enum intel_spi_type spi_type;
u8 use_gpio;
};
--
2.40.0.1.gaa8946217a0b

2023-09-28 14:10:36

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH v1 1/4] mfd: lpc_ich: Make struct lpc_ich_priv use enum for chipset member

On Tue, 26 Sep 2023 22:08:31 +0300, Andy Shevchenko wrote:
> We have a specific enum for the supported chipsets.
> Make struct lpc_ich_priv use better type for the chipset member.
>
>

Applied, thanks!

[1/4] mfd: lpc_ich: Make struct lpc_ich_priv use enum for chipset member
commit: be05b4a42901fc3bee6f84719178508f8cd82b9c
[2/4] mfd: lpc_ich: Convert gpio_version to be enum
commit: a7c5e755ef3d14fcf201660531261ab650812baf
[3/4] mfd: lpc_ich: Move APL GPIO resources to a custom structure
commit: 123a58d7c429d30f6e0e615b20c1b74e1e1e6616
[4/4] mfd: lpc_ich: Add a platform device for pinctrl Denverton
commit: 032d77aada6e56f8232d836a006b541045297d82

--
Lee Jones [李琼斯]