From: Lee Jones <lee.jones@linaro.org>
To: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Cc: Samuel Ortiz <sameo@linux.intel.com>,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>,
linux-kernel@vger.kernel.org, Ben Dooks <ben-linux@fluff.org>,
Kukjin Kim <kgene.kim@samsung.com>,
Russell King <linux@arm.linux.org.uk>,
linux-arm-kernel@lists.infradead.org,
linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org,
Kyungmin Park <kyungmin.park@samsung.com>,
Marek Szyprowski <m.szyprowski@samsung.com>,
Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
Javier Martinez Canillas <javier.martinez@collabora.co.uk>,
Chanwoo Choi <cw00.choi@samsung.com>
Subject: Re: [PATCH v3 08/14] mfd: max77686/802: Remove support for board files
Date: Mon, 3 Nov 2014 17:01:28 +0000 [thread overview]
Message-ID: <20141103170128.GD12011@x1> (raw)
In-Reply-To: <1414668053-31370-9-git-send-email-k.kozlowski@samsung.com>
On Thu, 30 Oct 2014, Krzysztof Kozlowski wrote:
> The driver is used only on Exynos based boards with DTS support.
> Convert the driver to DTS-only version. This simplifies a little the
> code:
> 1. No dead (unused) entries in platform_data structure.
> 2. More code removed.
> 3. Regulator driver does not depend on allocated memory
> from MFD driver.
> 4. It makes also easier extending the regulator driver.
>
> Add to the max77686 MFD driver dependency on CONFIG_OF because without
> DTS the regulator drivers won't bind.
>
> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> Reviewed-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
> ---
> drivers/mfd/Kconfig | 1 +
> drivers/mfd/max77686.c | 23 -----------------------
> include/linux/mfd/max77686-private.h | 1 -
> include/linux/mfd/max77686.h | 28 ----------------------------
> 4 files changed, 1 insertion(+), 52 deletions(-)
Applied, thanks.
> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
> index cbdb10918af1..fd9d19ccf8c0 100644
> --- a/drivers/mfd/Kconfig
> +++ b/drivers/mfd/Kconfig
> @@ -401,6 +401,7 @@ config MFD_MAX14577
> config MFD_MAX77686
> bool "Maxim Semiconductor MAX77686/802 PMIC Support"
> depends on I2C=y
> + depends on OF
> select MFD_CORE
> select REGMAP_I2C
> select REGMAP_IRQ
> diff --git a/drivers/mfd/max77686.c b/drivers/mfd/max77686.c
> index 9e1046bdef90..418b08b6c066 100644
> --- a/drivers/mfd/max77686.c
> +++ b/drivers/mfd/max77686.c
> @@ -211,24 +211,10 @@ static const struct of_device_id max77686_pmic_dt_match[] = {
> { },
> };
>
> -static struct max77686_platform_data *max77686_i2c_parse_dt_pdata(struct device
> - *dev)
> -{
> - struct max77686_platform_data *pd;
> -
> - pd = devm_kzalloc(dev, sizeof(*pd), GFP_KERNEL);
> - if (!pd)
> - return NULL;
> -
> - dev->platform_data = pd;
> - return pd;
> -}
> -
> static int max77686_i2c_probe(struct i2c_client *i2c,
> const struct i2c_device_id *id)
> {
> struct max77686_dev *max77686 = NULL;
> - struct max77686_platform_data *pdata = dev_get_platdata(&i2c->dev);
> const struct of_device_id *match;
> unsigned int data;
> int ret = 0;
> @@ -239,14 +225,6 @@ static int max77686_i2c_probe(struct i2c_client *i2c,
> const struct mfd_cell *cells;
> int n_devs;
>
> - if (IS_ENABLED(CONFIG_OF) && i2c->dev.of_node && !pdata)
> - pdata = max77686_i2c_parse_dt_pdata(&i2c->dev);
> -
> - if (!pdata) {
> - dev_err(&i2c->dev, "No platform data found.\n");
> - return -EINVAL;
> - }
> -
> max77686 = devm_kzalloc(&i2c->dev,
> sizeof(struct max77686_dev), GFP_KERNEL);
> if (!max77686)
> @@ -265,7 +243,6 @@ static int max77686_i2c_probe(struct i2c_client *i2c,
> max77686->dev = &i2c->dev;
> max77686->i2c = i2c;
>
> - max77686->wakeup = pdata->wakeup;
> max77686->irq = i2c->irq;
>
> if (max77686->type == TYPE_MAX77686) {
> diff --git a/include/linux/mfd/max77686-private.h b/include/linux/mfd/max77686-private.h
> index 960b92ad450d..f5043490d67c 100644
> --- a/include/linux/mfd/max77686-private.h
> +++ b/include/linux/mfd/max77686-private.h
> @@ -447,7 +447,6 @@ struct max77686_dev {
> struct regmap_irq_chip_data *rtc_irq_data;
>
> int irq;
> - bool wakeup;
> struct mutex irqlock;
> int irq_masks_cur[MAX77686_IRQ_GROUP_NR];
> int irq_masks_cache[MAX77686_IRQ_GROUP_NR];
> diff --git a/include/linux/mfd/max77686.h b/include/linux/mfd/max77686.h
> index 553f7d09258a..bb995ab9a575 100644
> --- a/include/linux/mfd/max77686.h
> +++ b/include/linux/mfd/max77686.h
> @@ -119,12 +119,6 @@ enum max77802_regulators {
> MAX77802_REG_MAX,
> };
>
> -struct max77686_regulator_data {
> - int id;
> - struct regulator_init_data *initdata;
> - struct device_node *of_node;
> -};
> -
> enum max77686_opmode {
> MAX77686_OPMODE_NORMAL,
> MAX77686_OPMODE_LP,
> @@ -136,26 +130,4 @@ struct max77686_opmode_data {
> int mode;
> };
>
> -struct max77686_platform_data {
> - int ono;
> - int wakeup;
> -
> - /* ---- PMIC ---- */
> - struct max77686_regulator_data *regulators;
> - int num_regulators;
> -
> - struct max77686_opmode_data *opmode_data;
> -
> - /*
> - * GPIO-DVS feature is not enabled with the current version of
> - * MAX77686 driver. Buck2/3/4_voltages[0] is used as the default
> - * voltage at probe. DVS/SELB gpios are set as OUTPUT-LOW.
> - */
> - int buck234_gpio_dvs[3]; /* GPIO of [0]DVS1, [1]DVS2, [2]DVS3 */
> - int buck234_gpio_selb[3]; /* [0]SELB2, [1]SELB3, [2]SELB4 */
> - unsigned int buck2_voltage[8]; /* buckx_voltage in uV */
> - unsigned int buck3_voltage[8];
> - unsigned int buck4_voltage[8];
> -};
> -
> #endif /* __LINUX_MFD_MAX77686_H */
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
WARNING: multiple messages have this Message-ID (diff)
From: lee.jones@linaro.org (Lee Jones)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 08/14] mfd: max77686/802: Remove support for board files
Date: Mon, 3 Nov 2014 17:01:28 +0000 [thread overview]
Message-ID: <20141103170128.GD12011@x1> (raw)
In-Reply-To: <1414668053-31370-9-git-send-email-k.kozlowski@samsung.com>
On Thu, 30 Oct 2014, Krzysztof Kozlowski wrote:
> The driver is used only on Exynos based boards with DTS support.
> Convert the driver to DTS-only version. This simplifies a little the
> code:
> 1. No dead (unused) entries in platform_data structure.
> 2. More code removed.
> 3. Regulator driver does not depend on allocated memory
> from MFD driver.
> 4. It makes also easier extending the regulator driver.
>
> Add to the max77686 MFD driver dependency on CONFIG_OF because without
> DTS the regulator drivers won't bind.
>
> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> Reviewed-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
> ---
> drivers/mfd/Kconfig | 1 +
> drivers/mfd/max77686.c | 23 -----------------------
> include/linux/mfd/max77686-private.h | 1 -
> include/linux/mfd/max77686.h | 28 ----------------------------
> 4 files changed, 1 insertion(+), 52 deletions(-)
Applied, thanks.
> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
> index cbdb10918af1..fd9d19ccf8c0 100644
> --- a/drivers/mfd/Kconfig
> +++ b/drivers/mfd/Kconfig
> @@ -401,6 +401,7 @@ config MFD_MAX14577
> config MFD_MAX77686
> bool "Maxim Semiconductor MAX77686/802 PMIC Support"
> depends on I2C=y
> + depends on OF
> select MFD_CORE
> select REGMAP_I2C
> select REGMAP_IRQ
> diff --git a/drivers/mfd/max77686.c b/drivers/mfd/max77686.c
> index 9e1046bdef90..418b08b6c066 100644
> --- a/drivers/mfd/max77686.c
> +++ b/drivers/mfd/max77686.c
> @@ -211,24 +211,10 @@ static const struct of_device_id max77686_pmic_dt_match[] = {
> { },
> };
>
> -static struct max77686_platform_data *max77686_i2c_parse_dt_pdata(struct device
> - *dev)
> -{
> - struct max77686_platform_data *pd;
> -
> - pd = devm_kzalloc(dev, sizeof(*pd), GFP_KERNEL);
> - if (!pd)
> - return NULL;
> -
> - dev->platform_data = pd;
> - return pd;
> -}
> -
> static int max77686_i2c_probe(struct i2c_client *i2c,
> const struct i2c_device_id *id)
> {
> struct max77686_dev *max77686 = NULL;
> - struct max77686_platform_data *pdata = dev_get_platdata(&i2c->dev);
> const struct of_device_id *match;
> unsigned int data;
> int ret = 0;
> @@ -239,14 +225,6 @@ static int max77686_i2c_probe(struct i2c_client *i2c,
> const struct mfd_cell *cells;
> int n_devs;
>
> - if (IS_ENABLED(CONFIG_OF) && i2c->dev.of_node && !pdata)
> - pdata = max77686_i2c_parse_dt_pdata(&i2c->dev);
> -
> - if (!pdata) {
> - dev_err(&i2c->dev, "No platform data found.\n");
> - return -EINVAL;
> - }
> -
> max77686 = devm_kzalloc(&i2c->dev,
> sizeof(struct max77686_dev), GFP_KERNEL);
> if (!max77686)
> @@ -265,7 +243,6 @@ static int max77686_i2c_probe(struct i2c_client *i2c,
> max77686->dev = &i2c->dev;
> max77686->i2c = i2c;
>
> - max77686->wakeup = pdata->wakeup;
> max77686->irq = i2c->irq;
>
> if (max77686->type == TYPE_MAX77686) {
> diff --git a/include/linux/mfd/max77686-private.h b/include/linux/mfd/max77686-private.h
> index 960b92ad450d..f5043490d67c 100644
> --- a/include/linux/mfd/max77686-private.h
> +++ b/include/linux/mfd/max77686-private.h
> @@ -447,7 +447,6 @@ struct max77686_dev {
> struct regmap_irq_chip_data *rtc_irq_data;
>
> int irq;
> - bool wakeup;
> struct mutex irqlock;
> int irq_masks_cur[MAX77686_IRQ_GROUP_NR];
> int irq_masks_cache[MAX77686_IRQ_GROUP_NR];
> diff --git a/include/linux/mfd/max77686.h b/include/linux/mfd/max77686.h
> index 553f7d09258a..bb995ab9a575 100644
> --- a/include/linux/mfd/max77686.h
> +++ b/include/linux/mfd/max77686.h
> @@ -119,12 +119,6 @@ enum max77802_regulators {
> MAX77802_REG_MAX,
> };
>
> -struct max77686_regulator_data {
> - int id;
> - struct regulator_init_data *initdata;
> - struct device_node *of_node;
> -};
> -
> enum max77686_opmode {
> MAX77686_OPMODE_NORMAL,
> MAX77686_OPMODE_LP,
> @@ -136,26 +130,4 @@ struct max77686_opmode_data {
> int mode;
> };
>
> -struct max77686_platform_data {
> - int ono;
> - int wakeup;
> -
> - /* ---- PMIC ---- */
> - struct max77686_regulator_data *regulators;
> - int num_regulators;
> -
> - struct max77686_opmode_data *opmode_data;
> -
> - /*
> - * GPIO-DVS feature is not enabled with the current version of
> - * MAX77686 driver. Buck2/3/4_voltages[0] is used as the default
> - * voltage at probe. DVS/SELB gpios are set as OUTPUT-LOW.
> - */
> - int buck234_gpio_dvs[3]; /* GPIO of [0]DVS1, [1]DVS2, [2]DVS3 */
> - int buck234_gpio_selb[3]; /* [0]SELB2, [1]SELB3, [2]SELB4 */
> - unsigned int buck2_voltage[8]; /* buckx_voltage in uV */
> - unsigned int buck3_voltage[8];
> - unsigned int buck4_voltage[8];
> -};
> -
> #endif /* __LINUX_MFD_MAX77686_H */
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
next prev parent reply other threads:[~2014-11-03 17:01 UTC|newest]
Thread overview: 69+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-30 11:20 [PATCH v3 00/14] regulator: max77686: Add GPIO control Krzysztof Kozlowski
2014-10-30 11:20 ` Krzysztof Kozlowski
2014-10-30 11:20 ` [PATCH v3 01/14] mfd: max77686/802: Map regulator driver to its own of_node Krzysztof Kozlowski
2014-10-30 11:20 ` Krzysztof Kozlowski
2014-10-30 11:20 ` Krzysztof Kozlowski
2014-10-31 12:23 ` Mark Brown
2014-10-31 12:23 ` Mark Brown
2014-10-31 13:07 ` Krzysztof Kozlowski
2014-10-31 13:07 ` Krzysztof Kozlowski
2014-10-31 18:06 ` Mark Brown
2014-10-31 18:06 ` Mark Brown
2014-10-30 11:20 ` [PATCH v3 02/14] mfd/regulator: dt-bindings: max77686: Document of_compatible for regulator Krzysztof Kozlowski
2014-10-30 11:20 ` Krzysztof Kozlowski
2014-10-30 11:20 ` Krzysztof Kozlowski
2014-11-03 17:00 ` Lee Jones
2014-11-03 17:00 ` Lee Jones
2014-11-04 7:53 ` Krzysztof Kozlowski
2014-11-04 7:53 ` Krzysztof Kozlowski
2014-10-30 11:20 ` [PATCH v3 03/14] regulator: dt-bindings: max77802: " Krzysztof Kozlowski
2014-10-30 11:20 ` Krzysztof Kozlowski
2014-10-30 11:20 ` [PATCH v3 04/14] regulator: max77686: Consistently index opmode array by rdev id Krzysztof Kozlowski
2014-10-30 11:20 ` Krzysztof Kozlowski
2014-10-30 11:20 ` [RFT v3 05/14] regulator: max77802: Don't ignore return value of current opmode Krzysztof Kozlowski
2014-10-30 11:20 ` Krzysztof Kozlowski
2014-10-30 11:20 ` Krzysztof Kozlowski
[not found] ` <1414668053-31370-6-git-send-email-k.kozlowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2014-10-30 11:42 ` Javier Martinez Canillas
2014-10-30 11:42 ` Javier Martinez Canillas
2014-10-30 11:42 ` Javier Martinez Canillas
2014-10-30 11:20 ` [RFT v3 06/14] regulator: max77802: Remove support for board files Krzysztof Kozlowski
2014-10-30 11:20 ` Krzysztof Kozlowski
[not found] ` <1414668053-31370-7-git-send-email-k.kozlowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2014-10-30 11:50 ` Javier Martinez Canillas
2014-10-30 11:50 ` Javier Martinez Canillas
2014-10-30 11:50 ` Javier Martinez Canillas
2014-10-30 12:10 ` Krzysztof Kozlowski
2014-10-30 12:10 ` Krzysztof Kozlowski
2014-10-30 12:21 ` Javier Martinez Canillas
2014-10-30 12:21 ` Javier Martinez Canillas
2014-10-30 12:30 ` Krzysztof Kozlowski
2014-10-30 12:30 ` Krzysztof Kozlowski
2014-10-30 12:42 ` Javier Martinez Canillas
2014-10-30 12:42 ` Javier Martinez Canillas
2014-10-30 12:53 ` Krzysztof Kozlowski
2014-10-30 12:53 ` Krzysztof Kozlowski
2014-10-30 14:02 ` Javier Martinez Canillas
2014-10-30 14:02 ` Javier Martinez Canillas
2014-10-30 11:20 ` [PATCH v3 07/14] regulator: max77686: " Krzysztof Kozlowski
2014-10-30 11:20 ` Krzysztof Kozlowski
2014-10-30 11:20 ` [PATCH v3 08/14] mfd: max77686/802: " Krzysztof Kozlowski
2014-10-30 11:20 ` Krzysztof Kozlowski
2014-11-03 17:01 ` Lee Jones [this message]
2014-11-03 17:01 ` Lee Jones
2014-11-04 7:51 ` Krzysztof Kozlowski
2014-11-04 7:51 ` Krzysztof Kozlowski
2014-11-04 8:07 ` Lee Jones
2014-11-04 8:07 ` Lee Jones
2014-10-30 11:20 ` [PATCH v3 09/14] regulator: max77686: Initialize opmode explicitly to normal mode Krzysztof Kozlowski
2014-10-30 11:20 ` Krzysztof Kozlowski
2014-10-30 11:20 ` Krzysztof Kozlowski
2014-10-30 11:20 ` [PATCH v3 10/14] regulator: max77686: Add GPIO control Krzysztof Kozlowski
2014-10-30 11:20 ` Krzysztof Kozlowski
2014-10-30 11:20 ` [PATCH v3 11/14] mfd/regulator: dt-bindings: max77686: Document gpio properties Krzysztof Kozlowski
2014-10-30 11:20 ` Krzysztof Kozlowski
2014-10-30 11:20 ` [PATCH v3 12/14] ARM: dts: exynos4412-trats: Switch max77686 regulators to GPIO control Krzysztof Kozlowski
2014-10-30 11:20 ` Krzysztof Kozlowski
2014-10-30 11:20 ` [PATCH v3 13/14] ARM: dts: exynos5420-peach: Update to new max77802 regulator compatible Krzysztof Kozlowski
2014-10-30 11:20 ` Krzysztof Kozlowski
[not found] ` <1414668053-31370-1-git-send-email-k.kozlowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2014-10-30 11:20 ` [PATCH v3 14/14] ARM: dts: exynos5800-peach: " Krzysztof Kozlowski
2014-10-30 11:20 ` Krzysztof Kozlowski
2014-10-30 11:20 ` Krzysztof Kozlowski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20141103170128.GD12011@x1 \
--to=lee.jones@linaro.org \
--cc=b.zolnierkie@samsung.com \
--cc=ben-linux@fluff.org \
--cc=broonie@kernel.org \
--cc=cw00.choi@samsung.com \
--cc=devicetree@vger.kernel.org \
--cc=javier.martinez@collabora.co.uk \
--cc=k.kozlowski@samsung.com \
--cc=kgene.kim@samsung.com \
--cc=kyungmin.park@samsung.com \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=m.szyprowski@samsung.com \
--cc=sameo@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.