mfd: intel_soc_pmic: Fix an error handling path in intel_soc_pmic_i2c_probe()
PATCH v3 1/10 mfd: intel_soc_pmic: Fix an error handling path in intel_soc_pmic_i2c_probe()
From: Christophe JAILLET <[email protected]>
The commit in Fixes: has added a pwm_add_table() call in the probe() and a pwm_remove_table() call in the remove(), but forget to update the error handling path of the probe.
Add the missing pwm_remove_table() call.
---
v3: added tag (Hans)
v2: new patch
drivers/mfd/intel_soc_pmic_core.c | 1 + 1 file changed, 1 insertion(+)
drivers/mfd/intel_soc_pmic_core.c +1 -0
@@ -77,6 +77,7 @@ static int intel_soc_pmic_i2c_probe(struct i2c_client *i2c,return 0 ; err_del_irq_chip: +pwm_remove_table (crc_pwm_lookup,ARRAY_SIZE (crc_pwm_lookup));regmap_del_irq_chip (pmic->irq, pmic->irq_chip_data);return ret; }
Signature · 1 line
2.35.1
PATCH v3 2/10 mfd: intel_soc_pmic_crc: Merge Intel PMIC core to crc
The core part is misleading since its only purpose to serve Crystal Cove PMIC, although for couple of different platforms. Merge core part into crc one.
Advantages among others are:
- speed up a compilation and build
- decreasing the code base
- reducing noise in the namespace by making some data static and const
---
v3: removed not used file (Christophe)
v2: added tags and rebased on top of new patch 1
drivers/mfd/Makefile | 3 +- drivers/mfd/intel_soc_pmic_core.c | 161 ----------------------------- drivers/mfd/intel_soc_pmic_core.h | 25 ----- drivers/mfd/intel_soc_pmic_crc.c | 163 ++++++++++++++++++++++++++++-- 4 files changed, 158 insertions(+), 194 deletions(-) delete mode 100644 drivers/mfd/intel_soc_pmic_core.c delete mode 100644 drivers/mfd/intel_soc_pmic_core.h
drivers/mfd/Makefile +1 -2
@@ -236,8 +236,7 @@ obj-$(CONFIG_MFD_RT4831) += rt4831.o obj-$(CONFIG_MFD_RT5033) += rt5033.o obj-$(CONFIG_MFD_SKY81452) += sky81452.o -intel-soc-pmic-objs := intel_soc_pmic_core.o intel_soc_pmic_crc.o -obj-$(CONFIG_INTEL_SOC_PMIC) += intel-soc-pmic.o +obj-$(CONFIG_INTEL_SOC_PMIC) += intel_soc_pmic_crc.o obj-$(CONFIG_INTEL_SOC_PMIC_BXTWC) += intel_soc_pmic_bxtwc.o obj-$(CONFIG_INTEL_SOC_PMIC_CHTWC) += intel_soc_pmic_chtwc.o obj-$(CONFIG_INTEL_SOC_PMIC_CHTDC_TI) += intel_soc_pmic_chtdc_ti.o
drivers/mfd/intel_soc_pmic_core.c deleted +0 -161
161 lines not on this page · raw message
drivers/mfd/intel_soc_pmic_core.h deleted +0 -25
@@ -1,25 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -/* -* Intel SoC PMIC MFD Driver -* -* Copyright (C) 2012-2014 Intel Corporation. All rights reserved. -* -* Author: Yang, Bin <[email protected]> -* Author: Zhu, Lejun <[email protected]> -*/ - -#ifndef __INTEL_SOC_PMIC_CORE_H__ -#define __INTEL_SOC_PMIC_CORE_H__ - -struct intel_soc_pmic_config { -unsigned long irq_flags; -struct mfd_cell *cell_dev; -int n_cell_devs; -const struct regmap_config *regmap_config; -const struct regmap_irq_chip *irq_chip; -}; - -extern struct intel_soc_pmic_config intel_soc_pmic_config_byt_crc; -extern struct intel_soc_pmic_config intel_soc_pmic_config_cht_crc; - -#endif /* __INTEL_SOC_PMIC_CORE_H__ */
drivers/mfd/intel_soc_pmic_crc.c +157 -6
192 lines not on this page · raw message
Signature · 1 line
2.35.1
Lee Jones
AppliedRe: [PATCH v3 02/10] mfd: intel_soc_pmic_crc: Merge Intel PMIC core to crc
Quoted 16 lines · Andy Shevchenko
The core part is misleading since its only purpose to serve Crystal Cove PMIC, although for couple of different platforms. Merge core part into crc one.
Advantages among others are:
- speed up a compilation and build
- decreasing the code base
- reducing noise in the namespace by making some data static and constSigned-off-by Andy Shevchenko <[email protected]>Tested-by Hans de Goede <[email protected]>Reviewed-by Hans de Goede <[email protected]>---
v3: removed not used file (Christophe)
v2: added tags and rebased on top of new patch 1
Quoted 7 lines
drivers/mfd/Makefile | 3 +- drivers/mfd/intel_soc_pmic_core.c | 161 ----------------------------- drivers/mfd/intel_soc_pmic_core.h | 25 ----- drivers/mfd/intel_soc_pmic_crc.c | 163 ++++++++++++++++++++++++++++-- 4 files changed, 158 insertions(+), 194 deletions(-) delete mode 100644 drivers/mfd/intel_soc_pmic_core.c delete mode 100644 drivers/mfd/intel_soc_pmic_core.h
Applied, thanks.
Signature · 1 line
DEPRECATED: Please use [email protected]
PATCH v3 3/10 mfd: intel_soc_pmic: Move non-Intel Makefile entries to their own group
In reply to Andy ShevchenkoIt looks like a random position for couple of Makefile entries that are disrupting Intel PMIC group. Move them to their own group.
---
v3: no changes
v2: added tags and rebased on top of new patch 1
drivers/mfd/Makefile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/mfd/Makefile +4 -3
@@ -172,6 +172,10 @@ obj-$(CONFIG_MFD_MAX8998) += max8998.o max8998-irq.o obj-$(CONFIG_MFD_MP2629) += mp2629.o +obj-$(CONFIG_MFD_MT6360) += mt6360-core.o +mt6397-objs := mt6397-core.o mt6397-irq.o mt6358-irq.o +obj-$(CONFIG_MFD_MT6397) += mt6397.o + pcf50633-objs := pcf50633-core.o pcf50633-irq.o obj-$(CONFIG_MFD_PCF50633) += pcf50633.o obj-$(CONFIG_PCF50633_ADC) += pcf50633-adc.o
@@ -240,9 +244,6 @@ obj-$(CONFIG_INTEL_SOC_PMIC) += intel_soc_pmic_crc.o obj-$(CONFIG_INTEL_SOC_PMIC_BXTWC) += intel_soc_pmic_bxtwc.o obj-$(CONFIG_INTEL_SOC_PMIC_CHTWC) += intel_soc_pmic_chtwc.o obj-$(CONFIG_INTEL_SOC_PMIC_CHTDC_TI) += intel_soc_pmic_chtdc_ti.o -obj-$(CONFIG_MFD_MT6360) += mt6360-core.o -mt6397-objs := mt6397-core.o mt6397-irq.o mt6358-irq.o -obj-$(CONFIG_MFD_MT6397) += mt6397.o obj-$(CONFIG_INTEL_SOC_PMIC_MRFLD) += intel_soc_pmic_mrfld.o obj-$(CONFIG_MFD_ALTERA_A10SR) += altera-a10sr.o
Signature · 1 line
2.35.1
Lee Jones
AppliedRe: [PATCH v3 03/10] mfd: intel_soc_pmic: Move non-Intel Makefile entries to their own group
Quoted 6 lines · Andy Shevchenko
It looks like a random position for couple of
Makefileentries that are disrupting Intel PMIC group. Move them to their own group.Signed-off-by Andy Shevchenko <[email protected]>Tested-by Hans de Goede <[email protected]>Acked-for-MFD-by Lee Jones <[email protected]>
Quoted 7 lines
---
v3: no changes
v2: added tags and rebased on top of new patch 1drivers/mfd/Makefile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
Applied, thanks.
Signature · 1 line
DEPRECATED: Please use [email protected]
PATCH v3 4/10 mfd: intel_soc_pmic_crc: Use devm_regmap_add_irq_chip()
In reply to Andy ShevchenkoUse 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().
---
v3: no changes
v2: added tags and rebased on top of new patch 1
drivers/mfd/intel_soc_pmic_crc.c | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-)
drivers/mfd/intel_soc_pmic_crc.c +5 -15
@@ -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,26 +206,17 @@ 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, + ret =mfd_add_devices (dev,PLATFORM_DEVID_NONE , config->cell_dev, config->n_cell_devs,NULL ,0 ,regmap_irq_get_domain (pmic->irq_chip_data));if (ret) - goto err_del_irq_chip; +pwm_remove_table (crc_pwm_lookup,ARRAY_SIZE (crc_pwm_lookup)); -return 0 ; - -err_del_irq_chip: -pwm_remove_table (crc_pwm_lookup,ARRAY_SIZE (crc_pwm_lookup)); -regmap_del_irq_chip (pmic->irq, pmic->irq_chip_data);return ret; }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));
Signature · 1 line
2.35.1
Lee Jones
AppliedRe: [PATCH v3 04/10] mfd: intel_soc_pmic_crc: Use devm_regmap_add_irq_chip()
Quoted 11 lines · Andy Shevchenko
Use
devm_regmap_add_irq_chip()to simplify the code.While at it, replace -1 magic parameter by
PLATFORM_DEVID_NONEwhen callingmfd_add_devices().Note, the
mfd_add_devices()left in non-devm variant here due to potentially increased churn while wrappingpwm_remove_table().Signed-off-by Andy Shevchenko <[email protected]>Tested-by Hans de Goede <[email protected]>Acked-for-MFD-by Lee Jones <[email protected]>
Quoted 7 lines
---
v3: no changes
v2: added tags and rebased on top of new patch 1drivers/mfd/intel_soc_pmic_crc.c | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-)
Applied, thanks.
Signature · 1 line
DEPRECATED: Please use [email protected]
PATCH v3 5/10 mfd: intel_soc_pmic_crc: Convert to use i2c_get/set_clientdata()
In reply to Andy ShevchenkoWe have the specific helpers for I2C device to set and get its driver data. Convert driver to use them instead of open coded variants.
---
v3: no changes
v2: added tags and rebased on top of new patch 1
drivers/mfd/intel_soc_pmic_crc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mfd/intel_soc_pmic_crc.c +2 -2
@@ -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))
@@ -227,7 +227,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);
Signature · 1 line
2.35.1
Lee Jones
AppliedRe: [PATCH v3 05/10] mfd: intel_soc_pmic_crc: Convert to use i2c_get/set_clientdata()
Quoted 6 lines · Andy Shevchenko
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 <[email protected]>Tested-by Hans de Goede <[email protected]>Acked-for-MFD-by Lee Jones <[email protected]>
Quoted 7 lines
---
v3: no changes
v2: added tags and rebased on top of new patch 1drivers/mfd/intel_soc_pmic_crc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Applied, thanks.
Signature · 1 line
DEPRECATED: Please use [email protected]
PATCH v3 6/10 mfd: intel_soc_pmic_crc: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc
In reply to Andy ShevchenkoLetting 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.
---
v3: no changes
v2: added tags and rebased on top of new patch 1
drivers/mfd/intel_soc_pmic_crc.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/mfd/intel_soc_pmic_crc.c +2 -5
@@ -234,7 +234,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);
@@ -252,10 +251,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[] = { { }
@@ -273,7 +270,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,
Signature · 1 line
2.35.1
Lee Jones
AppliedRe: [PATCH v3 06/10] mfd: intel_soc_pmic_crc: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc
Quoted 7 lines · Andy Shevchenko
Letting the compiler remove these functions when the kernel is built without
CONFIG_PM_SLEEPsupport is simpler and less error prone than the use of #ifdef based kernel configuration guards.Signed-off-by Andy Shevchenko <[email protected]>Tested-by Hans de Goede <[email protected]>Acked-for-MFD-by Lee Jones <[email protected]>
Quoted 7 lines
---
v3: no changes
v2: added tags and rebased on top of new patch 1drivers/mfd/intel_soc_pmic_crc.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
Applied, thanks.
Signature · 1 line
DEPRECATED: Please use [email protected]
PATCH v3 7/10 mfd: intel_soc_pmic_crc: Drop redundant ACPI_PTR() and ifdeffery
In reply to Andy ShevchenkoThe 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.
---
v3: no changes
v2: added tags and rebased on top of new patch 1
drivers/mfd/Kconfig | 4 ++-- drivers/mfd/intel_soc_pmic_crc.c | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-)
drivers/mfd/Kconfig +2 -2
@@ -589,8 +589,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
drivers/mfd/intel_soc_pmic_crc.c +2 -4
@@ -8,9 +8,9 @@* Author: Zhu, Lejun <[email protected]> */ -#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>
@@ -259,19 +259,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,
Signature · 1 line
2.35.1
Lee Jones
AppliedRe: [PATCH v3 07/10] mfd: intel_soc_pmic_crc: Drop redundant ACPI_PTR() and ifdeffery
Quoted 9 lines · Andy Shevchenko
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_PTRor none should be used in a driver.Signed-off-by Andy Shevchenko <[email protected]>Tested-by Hans de Goede <[email protected]>Acked-for-MFD-by Lee Jones <[email protected]>
Quoted 8 lines
---
v3: no changes
v2: added tags and rebased on top of new patch 1drivers/mfd/Kconfig | 4 ++-- drivers/mfd/intel_soc_pmic_crc.c | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-)
Applied, thanks.
Signature · 1 line
DEPRECATED: Please use [email protected]
PATCH v3 8/10 mfd: intel_soc_pmic_crc: Convert driver to use ->probe_new()
In reply to Andy ShevchenkoUse 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.
---
v3: no changes
v2: added tags and rebased on top of new patch 1
drivers/mfd/intel_soc_pmic_crc.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-)
drivers/mfd/intel_soc_pmic_crc.c +2 -9
@@ -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;
@@ -254,11 +253,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" }, { },
@@ -271,9 +265,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, };
Signature · 1 line
2.35.1
Lee Jones
AppliedRe: [PATCH v3 08/10] mfd: intel_soc_pmic_crc: Convert driver to use ->probe_new()
Quoted 8 lines · Andy Shevchenko
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 <[email protected]>Tested-by Hans de Goede <[email protected]>Acked-for-MFD-by Lee Jones <[email protected]>
Quoted 7 lines
---
v3: no changes
v2: added tags and rebased on top of new patch 1drivers/mfd/intel_soc_pmic_crc.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-)
Applied, thanks.
Signature · 1 line
DEPRECATED: Please use [email protected]
PATCH v3 9/10 mfd: intel_soc_pmic_crc: Replace intel_soc_pmic with crystal_cove
In reply to Andy ShevchenkoTo 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.
---
v3: no changes
v2: added tags and rebased on top of new patch 1
drivers/mfd/intel_soc_pmic_crc.c | 42 ++++++++++++++++---------------- 1 file changed, 21 insertions(+), 21 deletions(-)
drivers/mfd/intel_soc_pmic_crc.c +21 -21
@@ -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)
@@ -214,7 +214,7 @@ static int intel_soc_pmic_i2c_probe(struct i2c_client *i2c)return ret; } -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));
@@ -224,7 +224,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);
@@ -233,7 +233,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);
@@ -242,7 +242,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);
@@ -251,26 +251,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" );
Signature · 1 line
2.35.1
Lee Jones
AppliedRe: [PATCH v3 09/10] mfd: intel_soc_pmic_crc: Replace intel_soc_pmic with crystal_cove
Quoted 10 lines · Andy Shevchenko
To reflect the point that this driver is only for one type of the PMICs, replace
intel_soc_pmicwithcrystal_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 <[email protected]>Tested-by Hans de Goede <[email protected]>Acked-for-MFD-by Lee Jones <[email protected]>
Quoted 7 lines
---
v3: no changes
v2: added tags and rebased on top of new patch 1drivers/mfd/intel_soc_pmic_crc.c | 42 ++++++++++++++++---------------- 1 file changed, 21 insertions(+), 21 deletions(-)
Applied, thanks.
Signature · 1 line
DEPRECATED: Please use [email protected]
PATCH v3 10/10 mfd: intel_soc_pmic_crc: Update the copyright year
In reply to Andy ShevchenkoUpdate the copyright year to be 2012-2014, 2022.
---
v3: no changes
v2: added tags and rebased on top of new patch 1
drivers/mfd/intel_soc_pmic_crc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mfd/intel_soc_pmic_crc.c +1 -1
@@ -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 <[email protected]> * Author: Zhu, Lejun <[email protected]>
Signature · 1 line
2.35.1
Lee Jones
AppliedRe: [PATCH v3 10/10] mfd: intel_soc_pmic_crc: Update the copyright year
Quoted 11 lines · Andy Shevchenko
Update the copyright year to be 2012-2014, 2022.
Signed-off-by Andy Shevchenko <[email protected]>Tested-by Hans de Goede <[email protected]>---
v3: no changes
v2: added tags and rebased on top of new patch 1drivers/mfd/intel_soc_pmic_crc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied, thanks.
Signature · 1 line
DEPRECATED: Please use [email protected]
Lee Jones
AppliedQuoted 12 lines · Andy Shevchenko
From: Christophe JAILLET <[email protected]>
The commit in Fixes: has added a
pwm_add_table()call in theprobe()and apwm_remove_table()call in theremove(), but forget to update the error handling path of the probe.Add the missing
pwm_remove_table()call.Fixes a3aa9a93df9f ("mfd: intel_soc_pmic_core: ADD PWM lookup table for CRC PMIC based PWM")Signed-off-by Christophe JAILLET <[email protected]>Signed-off-by Andy Shevchenko <[email protected]>Reviewed-by Hans de Goede <[email protected]>
Quoted 7 lines
---
v3: added tag (Hans)
v2: new patchdrivers/mfd/intel_soc_pmic_core.c | 1 + 1 file changed, 1 insertion(+)
Applied, thanks.
Signature · 1 line
DEPRECATED: Please use [email protected]