mfd: max77686/802: Remove support for board files
authorKrzysztof Kozlowski <k.kozlowski@samsung.com>
Mon, 29 Dec 2014 09:09:16 +0000 (10:09 +0100)
committerLee Jones <lee.jones@linaro.org>
Thu, 22 Jan 2015 16:03:55 +0000 (16:03 +0000)
The driver is used only on Exynos based boards with DTS support.
After removal of board file support from max77686 and max77802 regulator
drivers, the MFD driver can be converted 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 (max77686 and max77802) won't bind.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Reviewed-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Tested-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/mfd/Kconfig
drivers/mfd/max77686.c
include/linux/mfd/max77686-private.h
include/linux/mfd/max77686.h

index c47b2da7986e9ae7617ae1c90002991d90205235..be5b684eefcf8ecc5c95907a70eba03a80c0d3df 100644 (file)
@@ -429,6 +429,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
index 2b2f2ccda523ae6537f069d29e35b2838488d82e..760d08d7923d42304df008dcd1e40aa472521657 100644 (file)
@@ -205,24 +205,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;
@@ -233,14 +219,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)
@@ -259,7 +237,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) {
index 960b92ad450d5a642bc8ff168f165134b590566b..f5043490d67c95956cf57247386d83fe71b76000 100644 (file)
@@ -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];
index 553f7d09258acc9348fef7ad989c3d97db600e1d..bb995ab9a57564be1ae635ac455688e6f2f1173b 100644 (file)
@@ -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 */