linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RESEND][PATCH v1 1/9] mfd: intel_soc_pmic_crc: Use devm_regmap_add_irq_chip()
@ 2022-07-18 12:23 Andy Shevchenko
  2022-07-18 12:23 ` [RESEND][PATCH v1 2/9] mfd: intel_soc_pmic_crc: Convert to use i2c_get/set_clientdata() Andy Shevchenko
                   ` (8 more replies)
  0 siblings, 9 replies; 15+ messages in thread
From: Andy Shevchenko @ 2022-07-18 12:23 UTC (permalink / raw)
  To: Lee Jones, Andy Shevchenko, linux-kernel; +Cc: Andy Shevchenko, Hans de Goede

Use devm_regmap_add_irq_chip() to simplify the code.

While at it, replace -1 magic parameter by PLATFORM_DEVID_NONE when
calling mfd_add_devices().

Note, the mfd_add_devices() left in non-devm variant here due to
potentially increased churn while wrapping pwm_remove_table().

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Hans de Goede <hdegoede@redhat.com>
Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/intel_soc_pmic_crc.c | 24 +++++-------------------
 1 file changed, 5 insertions(+), 19 deletions(-)

diff --git a/drivers/mfd/intel_soc_pmic_crc.c b/drivers/mfd/intel_soc_pmic_crc.c
index b5974dfcc603..187a4ede1148 100644
--- a/drivers/mfd/intel_soc_pmic_crc.c
+++ b/drivers/mfd/intel_soc_pmic_crc.c
@@ -189,10 +189,9 @@ static int intel_soc_pmic_i2c_probe(struct i2c_client *i2c,
 
 	pmic->irq = i2c->irq;
 
-	ret = regmap_add_irq_chip(pmic->regmap, pmic->irq,
-				  config->irq_flags | IRQF_ONESHOT,
-				  0, config->irq_chip,
-				  &pmic->irq_chip_data);
+	ret = devm_regmap_add_irq_chip(dev, pmic->regmap, pmic->irq,
+				       config->irq_flags | IRQF_ONESHOT,
+				       0, config->irq_chip, &pmic->irq_chip_data);
 	if (ret)
 		return ret;
 
@@ -207,25 +206,12 @@ static int intel_soc_pmic_i2c_probe(struct i2c_client *i2c,
 	irq_domain_update_bus_token(regmap_irq_get_domain(pmic->irq_chip_data),
 				    DOMAIN_BUS_NEXUS);
 
-	ret = mfd_add_devices(dev, -1, config->cell_dev,
-			      config->n_cell_devs, NULL, 0,
-			      regmap_irq_get_domain(pmic->irq_chip_data));
-	if (ret)
-		goto err_del_irq_chip;
-
-	return 0;
-
-err_del_irq_chip:
-	regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data);
-	return ret;
+	return mfd_add_devices(dev, PLATFORM_DEVID_NONE, config->cell_dev, config->n_cell_devs,
+			       NULL, 0, regmap_irq_get_domain(pmic->irq_chip_data));
 }
 
 static int intel_soc_pmic_i2c_remove(struct i2c_client *i2c)
 {
-	struct intel_soc_pmic *pmic = dev_get_drvdata(&i2c->dev);
-
-	regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data);
-
 	/* remove crc-pwm lookup table */
 	pwm_remove_table(crc_pwm_lookup, ARRAY_SIZE(crc_pwm_lookup));
 
-- 
2.35.1


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

* [RESEND][PATCH v1 2/9] mfd: intel_soc_pmic_crc: Convert to use i2c_get/set_clientdata()
  2022-07-18 12:23 [RESEND][PATCH v1 1/9] mfd: intel_soc_pmic_crc: Use devm_regmap_add_irq_chip() Andy Shevchenko
@ 2022-07-18 12:23 ` Andy Shevchenko
  2022-07-18 12:23 ` [RESEND][PATCH v1 3/9] mfd: intel_soc_pmic_crc: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc Andy Shevchenko
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 15+ messages in thread
From: Andy Shevchenko @ 2022-07-18 12:23 UTC (permalink / raw)
  To: Lee Jones, Andy Shevchenko, linux-kernel; +Cc: Andy Shevchenko, Hans de Goede

We have the specific helpers for I2C device to set and get its driver data.
Convert driver to use them instead of open coded variants.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Hans de Goede <hdegoede@redhat.com>
Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/intel_soc_pmic_crc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mfd/intel_soc_pmic_crc.c b/drivers/mfd/intel_soc_pmic_crc.c
index 187a4ede1148..165f686132f6 100644
--- a/drivers/mfd/intel_soc_pmic_crc.c
+++ b/drivers/mfd/intel_soc_pmic_crc.c
@@ -181,7 +181,7 @@ static int intel_soc_pmic_i2c_probe(struct i2c_client *i2c,
 	if (!pmic)
 		return -ENOMEM;
 
-	dev_set_drvdata(dev, pmic);
+	i2c_set_clientdata(i2c, pmic);
 
 	pmic->regmap = devm_regmap_init_i2c(i2c, config->regmap_config);
 	if (IS_ERR(pmic->regmap))
@@ -222,7 +222,7 @@ static int intel_soc_pmic_i2c_remove(struct i2c_client *i2c)
 
 static void intel_soc_pmic_shutdown(struct i2c_client *i2c)
 {
-	struct intel_soc_pmic *pmic = dev_get_drvdata(&i2c->dev);
+	struct intel_soc_pmic *pmic = i2c_get_clientdata(i2c);
 
 	disable_irq(pmic->irq);
 
-- 
2.35.1


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

* [RESEND][PATCH v1 3/9] mfd: intel_soc_pmic_crc: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc
  2022-07-18 12:23 [RESEND][PATCH v1 1/9] mfd: intel_soc_pmic_crc: Use devm_regmap_add_irq_chip() Andy Shevchenko
  2022-07-18 12:23 ` [RESEND][PATCH v1 2/9] mfd: intel_soc_pmic_crc: Convert to use i2c_get/set_clientdata() Andy Shevchenko
@ 2022-07-18 12:23 ` Andy Shevchenko
  2022-07-18 12:23 ` [RESEND][PATCH v1 4/9] mfd: intel_soc_pmic_crc: Drop redundant ACPI_PTR() and ifdeffery Andy Shevchenko
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 15+ messages in thread
From: Andy Shevchenko @ 2022-07-18 12:23 UTC (permalink / raw)
  To: Lee Jones, Andy Shevchenko, linux-kernel; +Cc: Andy Shevchenko, Hans de Goede

Letting the compiler remove these functions when the kernel is built
without CONFIG_PM_SLEEP support is simpler and less error prone than the
use of #ifdef based kernel configuration guards.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Hans de Goede <hdegoede@redhat.com>
Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/intel_soc_pmic_crc.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/mfd/intel_soc_pmic_crc.c b/drivers/mfd/intel_soc_pmic_crc.c
index 165f686132f6..c034e226a0bb 100644
--- a/drivers/mfd/intel_soc_pmic_crc.c
+++ b/drivers/mfd/intel_soc_pmic_crc.c
@@ -229,7 +229,6 @@ static void intel_soc_pmic_shutdown(struct i2c_client *i2c)
 	return;
 }
 
-#if defined(CONFIG_PM_SLEEP)
 static int intel_soc_pmic_suspend(struct device *dev)
 {
 	struct intel_soc_pmic *pmic = dev_get_drvdata(dev);
@@ -247,10 +246,8 @@ static int intel_soc_pmic_resume(struct device *dev)
 
 	return 0;
 }
-#endif
 
-static SIMPLE_DEV_PM_OPS(intel_soc_pmic_pm_ops, intel_soc_pmic_suspend,
-			 intel_soc_pmic_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(crystal_cove_pm_ops, intel_soc_pmic_suspend, intel_soc_pmic_resume);
 
 static const struct i2c_device_id intel_soc_pmic_i2c_id[] = {
 	{ }
@@ -268,7 +265,7 @@ MODULE_DEVICE_TABLE(acpi, intel_soc_pmic_acpi_match);
 static struct i2c_driver intel_soc_pmic_i2c_driver = {
 	.driver = {
 		.name = "intel_soc_pmic_i2c",
-		.pm = &intel_soc_pmic_pm_ops,
+		.pm = pm_sleep_ptr(&crystal_cove_pm_ops),
 		.acpi_match_table = ACPI_PTR(intel_soc_pmic_acpi_match),
 	},
 	.probe = intel_soc_pmic_i2c_probe,
-- 
2.35.1


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

* [RESEND][PATCH v1 4/9] mfd: intel_soc_pmic_crc: Drop redundant ACPI_PTR() and ifdeffery
  2022-07-18 12:23 [RESEND][PATCH v1 1/9] mfd: intel_soc_pmic_crc: Use devm_regmap_add_irq_chip() Andy Shevchenko
  2022-07-18 12:23 ` [RESEND][PATCH v1 2/9] mfd: intel_soc_pmic_crc: Convert to use i2c_get/set_clientdata() Andy Shevchenko
  2022-07-18 12:23 ` [RESEND][PATCH v1 3/9] mfd: intel_soc_pmic_crc: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc Andy Shevchenko
@ 2022-07-18 12:23 ` Andy Shevchenko
  2022-07-18 12:23 ` [RESEND][PATCH v1 5/9] mfd: intel_soc_pmic_crc: Convert driver to use ->probe_new() Andy Shevchenko
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 15+ messages in thread
From: Andy Shevchenko @ 2022-07-18 12:23 UTC (permalink / raw)
  To: Lee Jones, Andy Shevchenko, linux-kernel; +Cc: Andy Shevchenko, Hans de Goede

The driver depends on ACPI, ACPI_PTR() resolution is always the same.
Otherwise a compiler may produce a warning.

That said, the rule of thumb either ugly ifdeffery with ACPI_PTR or
none should be used in a driver.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Hans de Goede <hdegoede@redhat.com>
Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/Kconfig              | 4 ++--
 drivers/mfd/intel_soc_pmic_crc.c | 6 ++----
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 3b59456f5545..2bbfeeac6f8e 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -588,8 +588,8 @@ config LPC_SCH
 
 config INTEL_SOC_PMIC
 	bool "Support for Crystal Cove PMIC"
-	depends on ACPI && HAS_IOMEM && I2C=y && GPIOLIB && COMMON_CLK
-	depends on X86 || COMPILE_TEST
+	depends on HAS_IOMEM && I2C=y && GPIOLIB && COMMON_CLK
+	depends on (X86 && ACPI) || COMPILE_TEST
 	depends on I2C_DESIGNWARE_PLATFORM=y
 	select MFD_CORE
 	select REGMAP_I2C
diff --git a/drivers/mfd/intel_soc_pmic_crc.c b/drivers/mfd/intel_soc_pmic_crc.c
index c034e226a0bb..f1e5fdd846b3 100644
--- a/drivers/mfd/intel_soc_pmic_crc.c
+++ b/drivers/mfd/intel_soc_pmic_crc.c
@@ -8,9 +8,9 @@
  * Author: Zhu, Lejun <lejun.zhu@linux.intel.com>
  */
 
-#include <linux/acpi.h>
 #include <linux/i2c.h>
 #include <linux/interrupt.h>
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
 #include <linux/mfd/core.h>
 #include <linux/mfd/intel_soc_pmic.h>
@@ -254,19 +254,17 @@ static const struct i2c_device_id intel_soc_pmic_i2c_id[] = {
 };
 MODULE_DEVICE_TABLE(i2c, intel_soc_pmic_i2c_id);
 
-#if defined(CONFIG_ACPI)
 static const struct acpi_device_id intel_soc_pmic_acpi_match[] = {
 	{ "INT33FD" },
 	{ },
 };
 MODULE_DEVICE_TABLE(acpi, intel_soc_pmic_acpi_match);
-#endif
 
 static struct i2c_driver intel_soc_pmic_i2c_driver = {
 	.driver = {
 		.name = "intel_soc_pmic_i2c",
 		.pm = pm_sleep_ptr(&crystal_cove_pm_ops),
-		.acpi_match_table = ACPI_PTR(intel_soc_pmic_acpi_match),
+		.acpi_match_table = intel_soc_pmic_acpi_match,
 	},
 	.probe = intel_soc_pmic_i2c_probe,
 	.remove = intel_soc_pmic_i2c_remove,
-- 
2.35.1


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

* [RESEND][PATCH v1 5/9] mfd: intel_soc_pmic_crc: Convert driver to use ->probe_new()
  2022-07-18 12:23 [RESEND][PATCH v1 1/9] mfd: intel_soc_pmic_crc: Use devm_regmap_add_irq_chip() Andy Shevchenko
                   ` (2 preceding siblings ...)
  2022-07-18 12:23 ` [RESEND][PATCH v1 4/9] mfd: intel_soc_pmic_crc: Drop redundant ACPI_PTR() and ifdeffery Andy Shevchenko
@ 2022-07-18 12:23 ` Andy Shevchenko
  2022-07-18 12:23 ` [RESEND][PATCH v1 6/9] mfd: intel_soc_pmic_crc: Replace intel_soc_pmic with crystal_cove Andy Shevchenko
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 15+ messages in thread
From: Andy Shevchenko @ 2022-07-18 12:23 UTC (permalink / raw)
  To: Lee Jones, Andy Shevchenko, linux-kernel; +Cc: Andy Shevchenko, Hans de Goede

Use the ->probe_new() callback.

The driver does not use const struct i2c_device_id * argument,
so convert it to utilise the simplified I²C driver registration.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Hans de Goede <hdegoede@redhat.com>
Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/intel_soc_pmic_crc.c | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/drivers/mfd/intel_soc_pmic_crc.c b/drivers/mfd/intel_soc_pmic_crc.c
index f1e5fdd846b3..edadc07d473e 100644
--- a/drivers/mfd/intel_soc_pmic_crc.c
+++ b/drivers/mfd/intel_soc_pmic_crc.c
@@ -164,8 +164,7 @@ static const struct intel_soc_pmic_config intel_soc_pmic_config_cht_crc = {
 	.irq_chip = &crystal_cove_irq_chip,
 };
 
-static int intel_soc_pmic_i2c_probe(struct i2c_client *i2c,
-				    const struct i2c_device_id *i2c_id)
+static int intel_soc_pmic_i2c_probe(struct i2c_client *i2c)
 {
 	const struct intel_soc_pmic_config *config;
 	struct device *dev = &i2c->dev;
@@ -249,11 +248,6 @@ static int intel_soc_pmic_resume(struct device *dev)
 
 static DEFINE_SIMPLE_DEV_PM_OPS(crystal_cove_pm_ops, intel_soc_pmic_suspend, intel_soc_pmic_resume);
 
-static const struct i2c_device_id intel_soc_pmic_i2c_id[] = {
-	{ }
-};
-MODULE_DEVICE_TABLE(i2c, intel_soc_pmic_i2c_id);
-
 static const struct acpi_device_id intel_soc_pmic_acpi_match[] = {
 	{ "INT33FD" },
 	{ },
@@ -266,9 +260,8 @@ static struct i2c_driver intel_soc_pmic_i2c_driver = {
 		.pm = pm_sleep_ptr(&crystal_cove_pm_ops),
 		.acpi_match_table = intel_soc_pmic_acpi_match,
 	},
-	.probe = intel_soc_pmic_i2c_probe,
+	.probe_new = intel_soc_pmic_i2c_probe,
 	.remove = intel_soc_pmic_i2c_remove,
-	.id_table = intel_soc_pmic_i2c_id,
 	.shutdown = intel_soc_pmic_shutdown,
 };
 
-- 
2.35.1


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

* [RESEND][PATCH v1 6/9] mfd: intel_soc_pmic_crc: Replace intel_soc_pmic with crystal_cove
  2022-07-18 12:23 [RESEND][PATCH v1 1/9] mfd: intel_soc_pmic_crc: Use devm_regmap_add_irq_chip() Andy Shevchenko
                   ` (3 preceding siblings ...)
  2022-07-18 12:23 ` [RESEND][PATCH v1 5/9] mfd: intel_soc_pmic_crc: Convert driver to use ->probe_new() Andy Shevchenko
@ 2022-07-18 12:23 ` Andy Shevchenko
  2022-07-18 12:23 ` [RESEND][PATCH v1 7/9] mfd: intel_soc_pmic_crc: Update the copyright year Andy Shevchenko
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 15+ messages in thread
From: Andy Shevchenko @ 2022-07-18 12:23 UTC (permalink / raw)
  To: Lee Jones, Andy Shevchenko, linux-kernel; +Cc: Andy Shevchenko, Hans de Goede

To reflect the point that this driver is only for one type of the PMICs,
replace intel_soc_pmic with crystal_cove (avoid using crc for possible
namespace collisions with CRC library APIs).

Note, also rename the driver name since we don't expect any user
that enumerates by it, only ACPI known so far.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Hans de Goede <hdegoede@redhat.com>
Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/mfd/intel_soc_pmic_crc.c | 42 ++++++++++++++++----------------
 1 file changed, 21 insertions(+), 21 deletions(-)

diff --git a/drivers/mfd/intel_soc_pmic_crc.c b/drivers/mfd/intel_soc_pmic_crc.c
index edadc07d473e..bb3cc1a808f0 100644
--- a/drivers/mfd/intel_soc_pmic_crc.c
+++ b/drivers/mfd/intel_soc_pmic_crc.c
@@ -140,7 +140,7 @@ static struct pwm_lookup crc_pwm_lookup[] = {
 	PWM_LOOKUP("crystal_cove_pwm", 0, "0000:00:02.0", "pwm_pmic_backlight", 0, PWM_POLARITY_NORMAL),
 };
 
-struct intel_soc_pmic_config {
+struct crystal_cove_config {
 	unsigned long irq_flags;
 	struct mfd_cell *cell_dev;
 	int n_cell_devs;
@@ -148,7 +148,7 @@ struct intel_soc_pmic_config {
 	const struct regmap_irq_chip *irq_chip;
 };
 
-static const struct intel_soc_pmic_config intel_soc_pmic_config_byt_crc = {
+static const struct crystal_cove_config crystal_cove_config_byt_crc = {
 	.irq_flags = IRQF_TRIGGER_RISING,
 	.cell_dev = crystal_cove_byt_dev,
 	.n_cell_devs = ARRAY_SIZE(crystal_cove_byt_dev),
@@ -156,7 +156,7 @@ static const struct intel_soc_pmic_config intel_soc_pmic_config_byt_crc = {
 	.irq_chip = &crystal_cove_irq_chip,
 };
 
-static const struct intel_soc_pmic_config intel_soc_pmic_config_cht_crc = {
+static const struct crystal_cove_config crystal_cove_config_cht_crc = {
 	.irq_flags = IRQF_TRIGGER_RISING,
 	.cell_dev = crystal_cove_cht_dev,
 	.n_cell_devs = ARRAY_SIZE(crystal_cove_cht_dev),
@@ -164,17 +164,17 @@ static const struct intel_soc_pmic_config intel_soc_pmic_config_cht_crc = {
 	.irq_chip = &crystal_cove_irq_chip,
 };
 
-static int intel_soc_pmic_i2c_probe(struct i2c_client *i2c)
+static int crystal_cove_i2c_probe(struct i2c_client *i2c)
 {
-	const struct intel_soc_pmic_config *config;
+	const struct crystal_cove_config *config;
 	struct device *dev = &i2c->dev;
 	struct intel_soc_pmic *pmic;
 	int ret;
 
 	if (soc_intel_is_byt())
-		config = &intel_soc_pmic_config_byt_crc;
+		config = &crystal_cove_config_byt_crc;
 	else
-		config = &intel_soc_pmic_config_cht_crc;
+		config = &crystal_cove_config_cht_crc;
 
 	pmic = devm_kzalloc(dev, sizeof(*pmic), GFP_KERNEL);
 	if (!pmic)
@@ -209,7 +209,7 @@ static int intel_soc_pmic_i2c_probe(struct i2c_client *i2c)
 			       NULL, 0, regmap_irq_get_domain(pmic->irq_chip_data));
 }
 
-static int intel_soc_pmic_i2c_remove(struct i2c_client *i2c)
+static int crystal_cove_i2c_remove(struct i2c_client *i2c)
 {
 	/* remove crc-pwm lookup table */
 	pwm_remove_table(crc_pwm_lookup, ARRAY_SIZE(crc_pwm_lookup));
@@ -219,7 +219,7 @@ static int intel_soc_pmic_i2c_remove(struct i2c_client *i2c)
 	return 0;
 }
 
-static void intel_soc_pmic_shutdown(struct i2c_client *i2c)
+static void crystal_cove_shutdown(struct i2c_client *i2c)
 {
 	struct intel_soc_pmic *pmic = i2c_get_clientdata(i2c);
 
@@ -228,7 +228,7 @@ static void intel_soc_pmic_shutdown(struct i2c_client *i2c)
 	return;
 }
 
-static int intel_soc_pmic_suspend(struct device *dev)
+static int crystal_cove_suspend(struct device *dev)
 {
 	struct intel_soc_pmic *pmic = dev_get_drvdata(dev);
 
@@ -237,7 +237,7 @@ static int intel_soc_pmic_suspend(struct device *dev)
 	return 0;
 }
 
-static int intel_soc_pmic_resume(struct device *dev)
+static int crystal_cove_resume(struct device *dev)
 {
 	struct intel_soc_pmic *pmic = dev_get_drvdata(dev);
 
@@ -246,26 +246,26 @@ static int intel_soc_pmic_resume(struct device *dev)
 	return 0;
 }
 
-static DEFINE_SIMPLE_DEV_PM_OPS(crystal_cove_pm_ops, intel_soc_pmic_suspend, intel_soc_pmic_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(crystal_cove_pm_ops, crystal_cove_suspend, crystal_cove_resume);
 
-static const struct acpi_device_id intel_soc_pmic_acpi_match[] = {
+static const struct acpi_device_id crystal_cove_acpi_match[] = {
 	{ "INT33FD" },
 	{ },
 };
-MODULE_DEVICE_TABLE(acpi, intel_soc_pmic_acpi_match);
+MODULE_DEVICE_TABLE(acpi, crystal_cove_acpi_match);
 
-static struct i2c_driver intel_soc_pmic_i2c_driver = {
+static struct i2c_driver crystal_cove_i2c_driver = {
 	.driver = {
-		.name = "intel_soc_pmic_i2c",
+		.name = "crystal_cove_i2c",
 		.pm = pm_sleep_ptr(&crystal_cove_pm_ops),
-		.acpi_match_table = intel_soc_pmic_acpi_match,
+		.acpi_match_table = crystal_cove_acpi_match,
 	},
-	.probe_new = intel_soc_pmic_i2c_probe,
-	.remove = intel_soc_pmic_i2c_remove,
-	.shutdown = intel_soc_pmic_shutdown,
+	.probe_new = crystal_cove_i2c_probe,
+	.remove = crystal_cove_i2c_remove,
+	.shutdown = crystal_cove_shutdown,
 };
 
-module_i2c_driver(intel_soc_pmic_i2c_driver);
+module_i2c_driver(crystal_cove_i2c_driver);
 
 MODULE_DESCRIPTION("I2C driver for Intel SoC PMIC");
 MODULE_LICENSE("GPL v2");
-- 
2.35.1


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

* [RESEND][PATCH v1 7/9] mfd: intel_soc_pmic_crc: Update the copyright year
  2022-07-18 12:23 [RESEND][PATCH v1 1/9] mfd: intel_soc_pmic_crc: Use devm_regmap_add_irq_chip() Andy Shevchenko
                   ` (4 preceding siblings ...)
  2022-07-18 12:23 ` [RESEND][PATCH v1 6/9] mfd: intel_soc_pmic_crc: Replace intel_soc_pmic with crystal_cove Andy Shevchenko
@ 2022-07-18 12:23 ` Andy Shevchenko
  2022-07-18 12:23 ` [RESEND][PATCH v1 8/9] mfd: intel_soc_pmic_bxtwc: Support IRQ chip hierarchy Andy Shevchenko
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 15+ messages in thread
From: Andy Shevchenko @ 2022-07-18 12:23 UTC (permalink / raw)
  To: Lee Jones, Andy Shevchenko, linux-kernel; +Cc: Andy Shevchenko, Hans de Goede

Update the copyright year to be 2012-2014, 2022.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/mfd/intel_soc_pmic_crc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mfd/intel_soc_pmic_crc.c b/drivers/mfd/intel_soc_pmic_crc.c
index bb3cc1a808f0..0e5aae7ae9ad 100644
--- a/drivers/mfd/intel_soc_pmic_crc.c
+++ b/drivers/mfd/intel_soc_pmic_crc.c
@@ -2,7 +2,7 @@
 /*
  * Device access for Crystal Cove PMIC
  *
- * Copyright (C) 2012-2014 Intel Corporation. All rights reserved.
+ * Copyright (C) 2012-2014, 2022 Intel Corporation. All rights reserved.
  *
  * Author: Yang, Bin <bin.yang@intel.com>
  * Author: Zhu, Lejun <lejun.zhu@linux.intel.com>
-- 
2.35.1


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

* [RESEND][PATCH v1 8/9] mfd: intel_soc_pmic_bxtwc: Support IRQ chip hierarchy
  2022-07-18 12:23 [RESEND][PATCH v1 1/9] mfd: intel_soc_pmic_crc: Use devm_regmap_add_irq_chip() Andy Shevchenko
                   ` (5 preceding siblings ...)
  2022-07-18 12:23 ` [RESEND][PATCH v1 7/9] mfd: intel_soc_pmic_crc: Update the copyright year Andy Shevchenko
@ 2022-07-18 12:23 ` Andy Shevchenko
  2022-08-08 15:20   ` Lee Jones
  2022-07-18 12:23 ` [RESEND][PATCH v1 9/9] Revert "mfd: intel_soc_pmic_bxtwc: Support IRQ chip hierarchy" Andy Shevchenko
  2022-08-08 15:21 ` [RESEND][PATCH v1 1/9] mfd: intel_soc_pmic_crc: Use devm_regmap_add_irq_chip() Lee Jones
  8 siblings, 1 reply; 15+ messages in thread
From: Andy Shevchenko @ 2022-07-18 12:23 UTC (permalink / raw)
  To: Lee Jones, Andy Shevchenko, linux-kernel; +Cc: Andy Shevchenko

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/mfd/intel_soc_pmic_bxtwc.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c
index 8dac0d41f64f..f9842ff44b3f 100644
--- a/drivers/mfd/intel_soc_pmic_bxtwc.c
+++ b/drivers/mfd/intel_soc_pmic_bxtwc.c
@@ -422,8 +422,10 @@ static int bxtwc_add_chained_irq_chip(struct intel_soc_pmic *pmic,
 		return dev_err_probe(pmic->dev, irq, "Failed to get parent vIRQ(%d) for chip %s\n",
 				     pirq, chip->name);
 
-	return devm_regmap_add_irq_chip(pmic->dev, pmic->regmap, irq, irq_flags,
-					0, chip, data);
+	return __devm_regmap_add_irq_chip(pmic->dev, pmic->regmap, irq,
+					  irq_flags, 0,
+					  regmap_irq_get_domain(pdata),
+					  chip, data);
 }
 
 static int bxtwc_probe(struct platform_device *pdev)
-- 
2.35.1


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

* [RESEND][PATCH v1 9/9] Revert "mfd: intel_soc_pmic_bxtwc: Support IRQ chip hierarchy"
  2022-07-18 12:23 [RESEND][PATCH v1 1/9] mfd: intel_soc_pmic_crc: Use devm_regmap_add_irq_chip() Andy Shevchenko
                   ` (6 preceding siblings ...)
  2022-07-18 12:23 ` [RESEND][PATCH v1 8/9] mfd: intel_soc_pmic_bxtwc: Support IRQ chip hierarchy Andy Shevchenko
@ 2022-07-18 12:23 ` Andy Shevchenko
  2022-08-08 15:20   ` Lee Jones
  2022-08-08 15:21 ` [RESEND][PATCH v1 1/9] mfd: intel_soc_pmic_crc: Use devm_regmap_add_irq_chip() Lee Jones
  8 siblings, 1 reply; 15+ messages in thread
From: Andy Shevchenko @ 2022-07-18 12:23 UTC (permalink / raw)
  To: Lee Jones, Andy Shevchenko, linux-kernel; +Cc: Andy Shevchenko

This reverts commit 4a34dfdfcc185efea44da958b2e4a6005a70e7d4.
---
 drivers/mfd/intel_soc_pmic_bxtwc.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c
index f9842ff44b3f..8dac0d41f64f 100644
--- a/drivers/mfd/intel_soc_pmic_bxtwc.c
+++ b/drivers/mfd/intel_soc_pmic_bxtwc.c
@@ -422,10 +422,8 @@ static int bxtwc_add_chained_irq_chip(struct intel_soc_pmic *pmic,
 		return dev_err_probe(pmic->dev, irq, "Failed to get parent vIRQ(%d) for chip %s\n",
 				     pirq, chip->name);
 
-	return __devm_regmap_add_irq_chip(pmic->dev, pmic->regmap, irq,
-					  irq_flags, 0,
-					  regmap_irq_get_domain(pdata),
-					  chip, data);
+	return devm_regmap_add_irq_chip(pmic->dev, pmic->regmap, irq, irq_flags,
+					0, chip, data);
 }
 
 static int bxtwc_probe(struct platform_device *pdev)
-- 
2.35.1


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

* Re: [RESEND][PATCH v1 8/9] mfd: intel_soc_pmic_bxtwc: Support IRQ chip hierarchy
  2022-07-18 12:23 ` [RESEND][PATCH v1 8/9] mfd: intel_soc_pmic_bxtwc: Support IRQ chip hierarchy Andy Shevchenko
@ 2022-08-08 15:20   ` Lee Jones
  0 siblings, 0 replies; 15+ messages in thread
From: Lee Jones @ 2022-08-08 15:20 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: linux-kernel, Andy Shevchenko, Lee Jones

On Mon, 18 Jul 2022, Andy Shevchenko wrote:

No commit message.

Probably needs to justify why it's calling a function denoted for
internal use only.

> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/mfd/intel_soc_pmic_bxtwc.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c
> index 8dac0d41f64f..f9842ff44b3f 100644
> --- a/drivers/mfd/intel_soc_pmic_bxtwc.c
> +++ b/drivers/mfd/intel_soc_pmic_bxtwc.c
> @@ -422,8 +422,10 @@ static int bxtwc_add_chained_irq_chip(struct intel_soc_pmic *pmic,
>  		return dev_err_probe(pmic->dev, irq, "Failed to get parent vIRQ(%d) for chip %s\n",
>  				     pirq, chip->name);
>  
> -	return devm_regmap_add_irq_chip(pmic->dev, pmic->regmap, irq, irq_flags,
> -					0, chip, data);
> +	return __devm_regmap_add_irq_chip(pmic->dev, pmic->regmap, irq,
> +					  irq_flags, 0,
> +					  regmap_irq_get_domain(pdata),
> +					  chip, data);
>  }
>  
>  static int bxtwc_probe(struct platform_device *pdev)

-- 
DEPRECATED: Please use lee@kernel.org

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

* Re: [RESEND][PATCH v1 9/9] Revert "mfd: intel_soc_pmic_bxtwc: Support IRQ chip hierarchy"
  2022-07-18 12:23 ` [RESEND][PATCH v1 9/9] Revert "mfd: intel_soc_pmic_bxtwc: Support IRQ chip hierarchy" Andy Shevchenko
@ 2022-08-08 15:20   ` Lee Jones
  2022-08-08 15:21     ` Lee Jones
  0 siblings, 1 reply; 15+ messages in thread
From: Lee Jones @ 2022-08-08 15:20 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: linux-kernel, Andy Shevchenko, Lee Jones

On Mon, 18 Jul 2022, Andy Shevchenko wrote:

> This reverts commit 4a34dfdfcc185efea44da958b2e4a6005a70e7d4.

Sign-off?

Commit message?

> ---
>  drivers/mfd/intel_soc_pmic_bxtwc.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c
> index f9842ff44b3f..8dac0d41f64f 100644
> --- a/drivers/mfd/intel_soc_pmic_bxtwc.c
> +++ b/drivers/mfd/intel_soc_pmic_bxtwc.c
> @@ -422,10 +422,8 @@ static int bxtwc_add_chained_irq_chip(struct intel_soc_pmic *pmic,
>  		return dev_err_probe(pmic->dev, irq, "Failed to get parent vIRQ(%d) for chip %s\n",
>  				     pirq, chip->name);
>  
> -	return __devm_regmap_add_irq_chip(pmic->dev, pmic->regmap, irq,
> -					  irq_flags, 0,
> -					  regmap_irq_get_domain(pdata),
> -					  chip, data);
> +	return devm_regmap_add_irq_chip(pmic->dev, pmic->regmap, irq, irq_flags,
> +					0, chip, data);
>  }
>  
>  static int bxtwc_probe(struct platform_device *pdev)

-- 
DEPRECATED: Please use lee@kernel.org

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

* Re: [RESEND][PATCH v1 9/9] Revert "mfd: intel_soc_pmic_bxtwc: Support IRQ chip hierarchy"
  2022-08-08 15:20   ` Lee Jones
@ 2022-08-08 15:21     ` Lee Jones
  2022-08-08 15:35       ` Andy Shevchenko
  0 siblings, 1 reply; 15+ messages in thread
From: Lee Jones @ 2022-08-08 15:21 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: linux-kernel, Andy Shevchenko, Lee Jones

On Mon, 08 Aug 2022, Lee Jones wrote:

> On Mon, 18 Jul 2022, Andy Shevchenko wrote:
> 
> > This reverts commit 4a34dfdfcc185efea44da958b2e4a6005a70e7d4.
> 
> Sign-off?
> 
> Commit message?

My guess is that you didn't mean to send 8 and 9, right?

> > ---
> >  drivers/mfd/intel_soc_pmic_bxtwc.c | 6 ++----
> >  1 file changed, 2 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/mfd/intel_soc_pmic_bxtwc.c b/drivers/mfd/intel_soc_pmic_bxtwc.c
> > index f9842ff44b3f..8dac0d41f64f 100644
> > --- a/drivers/mfd/intel_soc_pmic_bxtwc.c
> > +++ b/drivers/mfd/intel_soc_pmic_bxtwc.c
> > @@ -422,10 +422,8 @@ static int bxtwc_add_chained_irq_chip(struct intel_soc_pmic *pmic,
> >  		return dev_err_probe(pmic->dev, irq, "Failed to get parent vIRQ(%d) for chip %s\n",
> >  				     pirq, chip->name);
> >  
> > -	return __devm_regmap_add_irq_chip(pmic->dev, pmic->regmap, irq,
> > -					  irq_flags, 0,
> > -					  regmap_irq_get_domain(pdata),
> > -					  chip, data);
> > +	return devm_regmap_add_irq_chip(pmic->dev, pmic->regmap, irq, irq_flags,
> > +					0, chip, data);
> >  }
> >  
> >  static int bxtwc_probe(struct platform_device *pdev)
> 

-- 
DEPRECATED: Please use lee@kernel.org

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

* Re: [RESEND][PATCH v1 1/9] mfd: intel_soc_pmic_crc: Use devm_regmap_add_irq_chip()
  2022-07-18 12:23 [RESEND][PATCH v1 1/9] mfd: intel_soc_pmic_crc: Use devm_regmap_add_irq_chip() Andy Shevchenko
                   ` (7 preceding siblings ...)
  2022-07-18 12:23 ` [RESEND][PATCH v1 9/9] Revert "mfd: intel_soc_pmic_bxtwc: Support IRQ chip hierarchy" Andy Shevchenko
@ 2022-08-08 15:21 ` Lee Jones
  2022-08-08 15:34   ` Andy Shevchenko
  8 siblings, 1 reply; 15+ messages in thread
From: Lee Jones @ 2022-08-08 15:21 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: linux-kernel, Andy Shevchenko, Hans de Goede, Lee Jones

On Mon, 18 Jul 2022, Andy Shevchenko wrote:

> Use devm_regmap_add_irq_chip() to simplify the code.
> 
> While at it, replace -1 magic parameter by PLATFORM_DEVID_NONE when
> calling mfd_add_devices().
> 
> Note, the mfd_add_devices() left in non-devm variant here due to
> potentially increased churn while wrapping pwm_remove_table().
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Tested-by: Hans de Goede <hdegoede@redhat.com>
> Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>
> ---
>  drivers/mfd/intel_soc_pmic_crc.c | 24 +++++-------------------
>  1 file changed, 5 insertions(+), 19 deletions(-)

Doesn't apply, please rebase the set (probably on -next).

-- 
DEPRECATED: Please use lee@kernel.org

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

* Re: [RESEND][PATCH v1 1/9] mfd: intel_soc_pmic_crc: Use devm_regmap_add_irq_chip()
  2022-08-08 15:21 ` [RESEND][PATCH v1 1/9] mfd: intel_soc_pmic_crc: Use devm_regmap_add_irq_chip() Lee Jones
@ 2022-08-08 15:34   ` Andy Shevchenko
  0 siblings, 0 replies; 15+ messages in thread
From: Andy Shevchenko @ 2022-08-08 15:34 UTC (permalink / raw)
  To: Lee Jones
  Cc: Andy Shevchenko, Linux Kernel Mailing List, Andy Shevchenko,
	Hans de Goede

On Mon, Aug 8, 2022 at 5:22 PM Lee Jones <lee.jones@linaro.org> wrote:
> On Mon, 18 Jul 2022, Andy Shevchenko wrote:
>
> > Use devm_regmap_add_irq_chip() to simplify the code.
> >
> > While at it, replace -1 magic parameter by PLATFORM_DEVID_NONE when
> > calling mfd_add_devices().
> >
> > Note, the mfd_add_devices() left in non-devm variant here due to
> > potentially increased churn while wrapping pwm_remove_table().

> Doesn't apply, please rebase the set (probably on -next).

It was a wrong series, and I guess the latest one is this:
https://lore.kernel.org/lkml/20220801114211.36267-1-andriy.shevchenko@linux.intel.com/

-- 
With Best Regards,
Andy Shevchenko

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

* Re: [RESEND][PATCH v1 9/9] Revert "mfd: intel_soc_pmic_bxtwc: Support IRQ chip hierarchy"
  2022-08-08 15:21     ` Lee Jones
@ 2022-08-08 15:35       ` Andy Shevchenko
  0 siblings, 0 replies; 15+ messages in thread
From: Andy Shevchenko @ 2022-08-08 15:35 UTC (permalink / raw)
  To: Lee Jones; +Cc: Andy Shevchenko, Linux Kernel Mailing List, Andy Shevchenko

On Mon, Aug 8, 2022 at 5:21 PM Lee Jones <lee.jones@linaro.org> wrote:
> On Mon, 08 Aug 2022, Lee Jones wrote:
> > On Mon, 18 Jul 2022, Andy Shevchenko wrote:
> >
> > > This reverts commit 4a34dfdfcc185efea44da958b2e4a6005a70e7d4.
> >
> > Sign-off?
> >
> > Commit message?
>
> My guess is that you didn't mean to send 8 and 9, right?

Right!

It was a wrong series, and I guess the latest one is this:
https://lore.kernel.org/lkml/20220801114211.36267-1-andriy.shevchenko@linux.intel.com/


--
With Best Regards,
Andy Shevchenko

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

end of thread, other threads:[~2022-08-08 15:35 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-18 12:23 [RESEND][PATCH v1 1/9] mfd: intel_soc_pmic_crc: Use devm_regmap_add_irq_chip() Andy Shevchenko
2022-07-18 12:23 ` [RESEND][PATCH v1 2/9] mfd: intel_soc_pmic_crc: Convert to use i2c_get/set_clientdata() Andy Shevchenko
2022-07-18 12:23 ` [RESEND][PATCH v1 3/9] mfd: intel_soc_pmic_crc: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc Andy Shevchenko
2022-07-18 12:23 ` [RESEND][PATCH v1 4/9] mfd: intel_soc_pmic_crc: Drop redundant ACPI_PTR() and ifdeffery Andy Shevchenko
2022-07-18 12:23 ` [RESEND][PATCH v1 5/9] mfd: intel_soc_pmic_crc: Convert driver to use ->probe_new() Andy Shevchenko
2022-07-18 12:23 ` [RESEND][PATCH v1 6/9] mfd: intel_soc_pmic_crc: Replace intel_soc_pmic with crystal_cove Andy Shevchenko
2022-07-18 12:23 ` [RESEND][PATCH v1 7/9] mfd: intel_soc_pmic_crc: Update the copyright year Andy Shevchenko
2022-07-18 12:23 ` [RESEND][PATCH v1 8/9] mfd: intel_soc_pmic_bxtwc: Support IRQ chip hierarchy Andy Shevchenko
2022-08-08 15:20   ` Lee Jones
2022-07-18 12:23 ` [RESEND][PATCH v1 9/9] Revert "mfd: intel_soc_pmic_bxtwc: Support IRQ chip hierarchy" Andy Shevchenko
2022-08-08 15:20   ` Lee Jones
2022-08-08 15:21     ` Lee Jones
2022-08-08 15:35       ` Andy Shevchenko
2022-08-08 15:21 ` [RESEND][PATCH v1 1/9] mfd: intel_soc_pmic_crc: Use devm_regmap_add_irq_chip() Lee Jones
2022-08-08 15:34   ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).