Merge remote-tracking branches 'regulator/topic/cpcap', 'regulator/topic/da9063'...
authorMark Brown <broonie@kernel.org>
Mon, 4 Sep 2017 16:45:42 +0000 (17:45 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 4 Sep 2017 16:45:42 +0000 (17:45 +0100)
drivers/regulator/core.c
drivers/regulator/cpcap-regulator.c
drivers/regulator/da9063-regulator.c
drivers/regulator/fan53555.c
drivers/regulator/ltc3589.c
drivers/regulator/max1586.c
drivers/regulator/s5m8767.c
drivers/reset/reset-socfpga.c

index 9f4d484..b64b791 100644 (file)
@@ -204,8 +204,8 @@ static struct device_node *of_get_regulator(struct device *dev, const char *supp
        regnode = of_parse_phandle(dev->of_node, prop_name, 0);
 
        if (!regnode) {
-               dev_dbg(dev, "Looking up %s property in node %s failed\n",
-                               prop_name, dev->of_node->full_name);
+               dev_dbg(dev, "Looking up %s property in node %pOF failed\n",
+                               prop_name, dev->of_node);
                return NULL;
        }
        return regnode;
index ce1cab3..f541b80 100644 (file)
@@ -123,6 +123,7 @@ struct cpcap_regulator {
                .enable_val = (mode_val),                               \
                .disable_val = (off_val),                               \
                .ramp_delay = (volt_trans_time),                        \
+               .of_map_mode = cpcap_map_mode,                          \
        },                                                              \
        .assign_reg = (assignment_reg),                                 \
        .assign_mask = (assignment_mask),                               \
@@ -213,6 +214,18 @@ static int cpcap_regulator_disable(struct regulator_dev *rdev)
        return error;
 }
 
+static unsigned int cpcap_map_mode(unsigned int mode)
+{
+       switch (mode) {
+       case CPCAP_BIT_AUDIO_NORMAL_MODE:
+               return REGULATOR_MODE_NORMAL;
+       case CPCAP_BIT_AUDIO_LOW_PWR:
+               return REGULATOR_MODE_STANDBY;
+       default:
+               return -EINVAL;
+       }
+}
+
 static unsigned int cpcap_regulator_get_mode(struct regulator_dev *rdev)
 {
        int value;
index c6af343..6a8f9cd 100644 (file)
@@ -736,7 +736,7 @@ static int da9063_regulator_probe(struct platform_device *pdev)
        if (IS_ERR(regl_pdata) || regl_pdata->n_regulators == 0) {
                dev_err(&pdev->dev,
                        "No regulators defined for the platform\n");
-               return PTR_ERR(regl_pdata);
+               return -ENODEV;
        }
 
        /* Find regulators set for particular device model */
index 60f4318..a3bc803 100644 (file)
@@ -407,14 +407,8 @@ static int fan53555_regulator_probe(struct i2c_client *client,
 
        di->regulator = pdata->regulator;
        if (client->dev.of_node) {
-               const struct of_device_id *match;
-
-               match = of_match_device(of_match_ptr(fan53555_dt_ids),
-                                       &client->dev);
-               if (!match)
-                       return -ENODEV;
-
-               di->vendor = (unsigned long) match->data;
+               di->vendor =
+                       (unsigned long)of_device_get_match_data(&client->dev);
        } else {
                /* if no ramp constraint set, get the pdata ramp_delay */
                if (!di->regulator->constraints.ramp_delay) {
@@ -476,7 +470,10 @@ static const struct i2c_device_id fan53555_id[] = {
                .name = "fan53555",
                .driver_data = FAN53555_VENDOR_FAIRCHILD
        }, {
-               .name = "syr82x",
+               .name = "syr827",
+               .driver_data = FAN53555_VENDOR_SILERGY
+       }, {
+               .name = "syr828",
                .driver_data = FAN53555_VENDOR_SILERGY
        },
        { },
index 853a06a..18d5b01 100644 (file)
@@ -539,7 +539,7 @@ static int ltc3589_probe(struct i2c_client *client,
        return 0;
 }
 
-static struct i2c_device_id ltc3589_i2c_id[] = {
+static const struct i2c_device_id ltc3589_i2c_id[] = {
        { "ltc3589",   LTC3589   },
        { "ltc3589-1", LTC3589_1 },
        { "ltc3589-2", LTC3589_2 },
index 6779c2b..66bbaa9 100644 (file)
@@ -169,7 +169,7 @@ static int of_get_max1586_platform_data(struct device *dev,
 
        if (of_property_read_u32(np, "v3-gain",
                                 &pdata->v3_gain) < 0) {
-               dev_err(dev, "%s has no 'v3-gain' property\n", np->full_name);
+               dev_err(dev, "%pOF has no 'v3-gain' property\n", np);
                return -EINVAL;
        }
 
index 383cd75..4836947 100644 (file)
@@ -590,8 +590,8 @@ static int s5m8767_pmic_dt_parse_pdata(struct platform_device *pdev,
                if (of_property_read_u32(reg_np, "op_mode",
                                &rmode->mode)) {
                        dev_warn(iodev->dev,
-                               "no op_mode property property at %s\n",
-                               reg_np->full_name);
+                               "no op_mode property property at %pOF\n",
+                               reg_np);
 
                        rmode->mode = S5M8767_OPMODE_NORMAL_MODE;
                }
index 07224c0..c60904f 100644 (file)
@@ -109,8 +109,8 @@ static int socfpga_reset_probe(struct platform_device *pdev)
         * Do not continue, when we encounter an old DT.
         */
        if (!of_find_property(pdev->dev.of_node, "#reset-cells", NULL)) {
-               dev_err(&pdev->dev, "%s missing #reset-cells property\n",
-                       pdev->dev.of_node->full_name);
+               dev_err(&pdev->dev, "%pOF missing #reset-cells property\n",
+                       pdev->dev.of_node);
                return -EINVAL;
        }