]> Git Repo - J-linux.git/commitdiff
Merge tag 'regulator-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie...
authorLinus Torvalds <[email protected]>
Wed, 20 Nov 2024 20:18:50 +0000 (12:18 -0800)
committerLinus Torvalds <[email protected]>
Wed, 20 Nov 2024 20:18:50 +0000 (12:18 -0800)
Pull regulator updates from Mark Brown:
 "This was a quite quiet release for regulators on the drivers front,
  but we do have two small but useful core improvements:

   - Improve handling of cases where DT platforms specify both DT and
     init_data based configuration for a single regulator.

   - A helper of_regulator_get_optional() to simplify writing generic
     bindings for regulator consumers in subsystems.

  There's also some YAML conversions for the DT bindings which are a big
  part of the diffstat"

* tag 'regulator-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator:
  regulator: dt-bindings: qcom,rpmh: Correct PM8550VE supplies
  regulator: Switch back to struct platform_driver::remove()
  regulator: doc: remove documentation comment for regulator_init
  regulator: doc: add missing documentation for init_cb
  regulator: rk808: Restrict DVS GPIOs to the RK808 variant only
  regulator: rk808: Use dev_err_probe() in the probe path
  regulator: rk808: Perform trivial code cleanups
  regulator: dt-bindings: qcom,qca6390-pmu: add more properties for wcn6855
  regulator: dt-bindings: lltc,ltc3676: convert to YAML
  regulator: core: Use fsleep() to get best sleep mechanism
  regulator: core: remove machine init callback from config
  regulator: core: add callback to perform runtime init
  regulator: core: do not silently ignore provided init_data
  regulator: max5970: Drop unused structs
  regulator: dt-bindings: vctrl-regulator: convert to YAML
  regulator: qcom-smd: make smd_vreg_rpm static
  regulator: Call of_node_put() only once in rzg2l_usb_vbus_regulator_probe()
  regulator: isl6271a: Drop explicit initialization of struct i2c_device_id::driver_data to 0
  regulator: Add devres version of of_regulator_get_optional()
  regulator: Add of_regulator_get_optional() for pure DT regulator lookup

1  2 
drivers/regulator/rk808-regulator.c

index 01a8d04879184cda17c02139e1ee87b901c815ab,76f9a426450de368907340844bf34b3a47fdc7c8..7d82bd1b36dfcfba1b3149d0226f044399d51c77
@@@ -1,6 -1,6 +1,6 @@@
  // SPDX-License-Identifier: GPL-2.0-only
  /*
-  * Regulator driver for Rockchip RK805/RK808/RK818
+  * Regulator driver for Rockchip RK80x and RK81x PMIC series
   *
   * Copyright (c) 2014, Fuzhou Rockchip Electronics Co., Ltd
   * Copyright (c) 2021 Rockchip Electronics Co., Ltd.
@@@ -23,7 -23,7 +23,7 @@@
  #include <linux/regulator/of_regulator.h>
  #include <linux/gpio/consumer.h>
  
- /* Field Definitions */
+ /* Field definitions */
  #define RK808_BUCK_VSEL_MASK  0x3f
  #define RK808_BUCK4_VSEL_MASK 0xf
  #define RK808_LDO_VSEL_MASK   0x1f
@@@ -1379,8 -1379,6 +1379,8 @@@ static const struct regulator_desc rk80
                .n_linear_ranges = ARRAY_SIZE(rk817_buck1_voltage_ranges),
                .vsel_reg = RK817_BUCK3_ON_VSEL_REG,
                .vsel_mask = RK817_BUCK_VSEL_MASK,
 +              .apply_reg = RK817_POWER_CONFIG,
 +              .apply_bit = RK817_BUCK3_FB_RES_INTER,
                .enable_reg = RK817_POWER_EN_REG(0),
                .enable_mask = ENABLE_MASK(RK817_ID_DCDC3),
                .enable_val = ENABLE_MASK(RK817_ID_DCDC3),
@@@ -1831,9 -1829,8 +1831,8 @@@ static const struct regulator_desc rk81
                RK818_DCDC_EN_REG, BIT(7)),
  };
  
- static int rk808_regulator_dt_parse_pdata(struct device *dev,
-                                  struct regmap *map,
-                                  struct rk808_regulator_data *pdata)
+ static int rk808_regulator_dt_parse_pdata(struct device *dev, struct regmap *map,
+                                         struct rk808_regulator_data *pdata)
  {
        struct device_node *np;
        int tmp, ret = 0, i;
  
        for (i = 0; i < ARRAY_SIZE(pdata->dvs_gpio); i++) {
                pdata->dvs_gpio[i] =
-                       devm_gpiod_get_index_optional(dev, "dvs", i,
-                                                     GPIOD_OUT_LOW);
+                       devm_gpiod_get_index_optional(dev, "dvs", i, GPIOD_OUT_LOW);
                if (IS_ERR(pdata->dvs_gpio[i])) {
-                       ret = PTR_ERR(pdata->dvs_gpio[i]);
-                       dev_err(dev, "failed to get dvs%d gpio (%d)\n", i, ret);
+                       ret = dev_err_probe(dev, PTR_ERR(pdata->dvs_gpio[i]),
+                                           "failed to get dvs%d gpio\n", i);
                        goto dt_parse_end;
                }
  
                if (!pdata->dvs_gpio[i]) {
-                       dev_info(dev, "there is no dvs%d gpio\n", i);
+                       dev_dbg(dev, "there is no dvs%d gpio\n", i);
                        continue;
                }
  
                tmp = i ? RK808_DVS2_POL : RK808_DVS1_POL;
                ret = regmap_update_bits(map, RK808_IO_POL_REG, tmp,
-                               gpiod_is_active_low(pdata->dvs_gpio[i]) ?
-                               0 : tmp);
+                                        gpiod_is_active_low(pdata->dvs_gpio[i]) ? 0 : tmp);
        }
  
  dt_parse_end:
@@@ -1889,12 -1884,6 +1886,6 @@@ static int rk808_regulator_probe(struc
        if (!pdata)
                return -ENOMEM;
  
-       ret = rk808_regulator_dt_parse_pdata(&pdev->dev, regmap, pdata);
-       if (ret < 0)
-               return ret;
-       platform_set_drvdata(pdev, pdata);
        switch (rk808->variant) {
        case RK805_ID:
                regulators = rk805_reg;
                nregulators = ARRAY_SIZE(rk806_reg);
                break;
        case RK808_ID:
+               /* DVS0/1 GPIOs are supported on the RK808 only */
+               ret = rk808_regulator_dt_parse_pdata(&pdev->dev, regmap, pdata);
+               if (ret < 0)
+                       return ret;
                regulators = rk808_reg;
                nregulators = RK808_NUM_REGULATORS;
                break;
                nregulators = RK818_NUM_REGULATORS;
                break;
        default:
-               dev_err(&pdev->dev, "unsupported RK8XX ID %lu\n",
-                       rk808->variant);
-               return -EINVAL;
+               return dev_err_probe(&pdev->dev, -EINVAL,
+                                    "unsupported RK8xx ID %lu\n", rk808->variant);
        }
  
+       platform_set_drvdata(pdev, pdata);
        config.dev = &pdev->dev;
        config.driver_data = pdata;
        config.regmap = regmap;
@@@ -1956,7 -1951,7 +1953,7 @@@ static struct platform_driver rk808_reg
  
  module_platform_driver(rk808_regulator_driver);
  
- MODULE_DESCRIPTION("regulator driver for the RK805/RK808/RK818 series PMICs");
+ MODULE_DESCRIPTION("Rockchip RK80x/RK81x PMIC series regulator driver");
  MODULE_AUTHOR("Tony xie <[email protected]>");
  MODULE_AUTHOR("Chris Zhong <[email protected]>");
  MODULE_AUTHOR("Zhang Qing <[email protected]>");
This page took 0.066736 seconds and 4 git commands to generate.