Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'regulator-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator

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

+490 -309
+167
Documentation/devicetree/bindings/regulator/lltc,ltc3676.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/regulator/lltc,ltc3676.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Linear Technology LTC3676 8-output regulators 8 + 9 + maintainers: 10 + - Tim Harvey <tharvey@gateworks.com> 11 + 12 + description: | 13 + LTC3676 contains eight regulators, 4 switching SW1..SW4 and four LDO1..4 . 14 + 15 + properties: 16 + compatible: 17 + const: lltc,ltc3676 18 + 19 + reg: 20 + maxItems: 1 21 + 22 + interrupts: 23 + maxItems: 1 24 + 25 + regulators: 26 + type: object 27 + additionalProperties: false 28 + description: | 29 + List of regulators provided by this controller, must be named 30 + after their hardware counterparts (SW|LDO)[1-4]. 31 + 32 + patternProperties: 33 + "^(sw[1-4]|ldo[24])$": 34 + type: object 35 + unevaluatedProperties: false 36 + $ref: regulator.yaml# 37 + description: 38 + Properties for single SW or LDO regulator. Regulators SW1..SW4 can 39 + regulate the feedback reference from 412.5mV to 800mV in 12.5 mV 40 + steps. The output voltage thus ranges between 0.4125 * (1 + R1/R2) V 41 + and 0.8 * (1 + R1/R2) V. 42 + Regulators LDO1, LDO2, LDO4 have a fixed 0.725 V reference and thus 43 + output 0.725 * (1 + R1/R2) V. 44 + The LDO1 standby regulator can not be disabled and thus should have 45 + the regulator-always-on property set. 46 + 47 + properties: 48 + lltc,fb-voltage-divider: 49 + description: 50 + An array of two integers containing the resistor values 51 + R1 and R2 of the feedback voltage divider in ohms. 52 + $ref: /schemas/types.yaml#/definitions/uint32-array 53 + minItems: 2 54 + maxItems: 2 55 + 56 + required: 57 + - lltc,fb-voltage-divider 58 + 59 + properties: 60 + ldo1: 61 + type: object 62 + unevaluatedProperties: false 63 + $ref: regulator.yaml# 64 + description: 65 + The LDO1 standby regulator can not be disabled and thus should 66 + have the regulator-always-on property set. See patternProperties 67 + description above for the rest of the details. 68 + 69 + properties: 70 + lltc,fb-voltage-divider: 71 + description: 72 + An array of two integers containing the resistor values 73 + R1 and R2 of the feedback voltage divider in ohms. 74 + $ref: /schemas/types.yaml#/definitions/uint32-array 75 + minItems: 2 76 + maxItems: 2 77 + 78 + required: 79 + - lltc,fb-voltage-divider 80 + - regulator-always-on 81 + 82 + ldo3: 83 + type: object 84 + unevaluatedProperties: false 85 + $ref: regulator.yaml# 86 + description: 87 + The LDO3 regulator is fixed to 1.8 V. See patternProperties 88 + description above for the rest of the details. 89 + 90 + required: 91 + - compatible 92 + - reg 93 + - regulators 94 + 95 + additionalProperties: false 96 + 97 + examples: 98 + - | 99 + i2c { 100 + #address-cells = <1>; 101 + #size-cells = <0>; 102 + 103 + pmic@3c { 104 + compatible = "lltc,ltc3676"; 105 + reg = <0x3c>; 106 + 107 + regulators { 108 + sw1_reg: sw1 { 109 + regulator-min-microvolt = <674400>; 110 + regulator-max-microvolt = <1308000>; 111 + lltc,fb-voltage-divider = <127000 200000>; 112 + regulator-ramp-delay = <7000>; 113 + regulator-boot-on; 114 + regulator-always-on; 115 + }; 116 + 117 + sw2_reg: sw2 { 118 + regulator-min-microvolt = <1033310>; 119 + regulator-max-microvolt = <200400>; 120 + lltc,fb-voltage-divider = <301000 200000>; 121 + regulator-ramp-delay = <7000>; 122 + regulator-boot-on; 123 + regulator-always-on; 124 + }; 125 + 126 + sw3_reg: sw3 { 127 + regulator-min-microvolt = <674400>; 128 + regulator-max-microvolt = <130800>; 129 + lltc,fb-voltage-divider = <127000 200000>; 130 + regulator-ramp-delay = <7000>; 131 + regulator-boot-on; 132 + regulator-always-on; 133 + }; 134 + 135 + sw4_reg: sw4 { 136 + regulator-min-microvolt = <868310>; 137 + regulator-max-microvolt = <168400>; 138 + lltc,fb-voltage-divider = <221000 200000>; 139 + regulator-ramp-delay = <7000>; 140 + regulator-boot-on; 141 + regulator-always-on; 142 + }; 143 + 144 + ldo2_reg: ldo2 { 145 + regulator-min-microvolt = <2490375>; 146 + regulator-max-microvolt = <2490375>; 147 + lltc,fb-voltage-divider = <487000 200000>; 148 + regulator-boot-on; 149 + regulator-always-on; 150 + }; 151 + 152 + ldo3_reg: ldo3 { 153 + regulator-min-microvolt = <1800000>; 154 + regulator-max-microvolt = <1800000>; 155 + regulator-boot-on; 156 + }; 157 + 158 + ldo4_reg: ldo4 { 159 + regulator-min-microvolt = <3023250>; 160 + regulator-max-microvolt = <3023250>; 161 + lltc,fb-voltage-divider = <634000 200000>; 162 + regulator-boot-on; 163 + regulator-always-on; 164 + }; 165 + }; 166 + }; 167 + };
-94
Documentation/devicetree/bindings/regulator/ltc3676.txt
··· 1 - Linear Technology LTC3676 8-output regulators 2 - 3 - Required properties: 4 - - compatible: "lltc,ltc3676" 5 - - reg: I2C slave address 6 - 7 - Required child node: 8 - - regulators: Contains eight regulator child nodes sw1, sw2, sw3, sw4, 9 - ldo1, ldo2, ldo3, and ldo4, specifying the initialization data as 10 - documented in Documentation/devicetree/bindings/regulator/regulator.txt. 11 - 12 - Each regulator is defined using the standard binding for regulators. The 13 - nodes for sw1, sw2, sw3, sw4, ldo1, ldo2 and ldo4 additionally need to specify 14 - the resistor values of their external feedback voltage dividers: 15 - 16 - Required properties (not on ldo3): 17 - - lltc,fb-voltage-divider: An array of two integers containing the resistor 18 - values R1 and R2 of the feedback voltage divider in ohms. 19 - 20 - Regulators sw1, sw2, sw3, sw4 can regulate the feedback reference from: 21 - 412.5mV to 800mV in 12.5 mV steps. The output voltage thus ranges between 22 - 0.4125 * (1 + R1/R2) V and 0.8 * (1 + R1/R2) V. 23 - 24 - Regulators ldo1, ldo2, and ldo4 have a fixed 0.725 V reference and thus output 25 - 0.725 * (1 + R1/R2) V. The ldo3 regulator is fixed to 1.8 V. The ldo1 standby 26 - regulator can not be disabled and thus should have the regulator-always-on 27 - property set. 28 - 29 - Example: 30 - 31 - ltc3676: pmic@3c { 32 - compatible = "lltc,ltc3676"; 33 - reg = <0x3c>; 34 - 35 - regulators { 36 - sw1_reg: sw1 { 37 - regulator-min-microvolt = <674400>; 38 - regulator-max-microvolt = <1308000>; 39 - lltc,fb-voltage-divider = <127000 200000>; 40 - regulator-ramp-delay = <7000>; 41 - regulator-boot-on; 42 - regulator-always-on; 43 - }; 44 - 45 - sw2_reg: sw2 { 46 - regulator-min-microvolt = <1033310>; 47 - regulator-max-microvolt = <200400>; 48 - lltc,fb-voltage-divider = <301000 200000>; 49 - regulator-ramp-delay = <7000>; 50 - regulator-boot-on; 51 - regulator-always-on; 52 - }; 53 - 54 - sw3_reg: sw3 { 55 - regulator-min-microvolt = <674400>; 56 - regulator-max-microvolt = <130800>; 57 - lltc,fb-voltage-divider = <127000 200000>; 58 - regulator-ramp-delay = <7000>; 59 - regulator-boot-on; 60 - regulator-always-on; 61 - }; 62 - 63 - sw4_reg: sw4 { 64 - regulator-min-microvolt = <868310>; 65 - regulator-max-microvolt = <168400>; 66 - lltc,fb-voltage-divider = <221000 200000>; 67 - regulator-ramp-delay = <7000>; 68 - regulator-boot-on; 69 - regulator-always-on; 70 - }; 71 - 72 - ldo2_reg: ldo2 { 73 - regulator-min-microvolt = <2490375>; 74 - regulator-max-microvolt = <2490375>; 75 - lltc,fb-voltage-divider = <487000 200000>; 76 - regulator-boot-on; 77 - regulator-always-on; 78 - }; 79 - 80 - ldo3_reg: ldo3 { 81 - regulator-min-microvolt = <1800000>; 82 - regulator-max-microvolt = <1800000>; 83 - regulator-boot-on; 84 - }; 85 - 86 - ldo4_reg: ldo4 { 87 - regulator-min-microvolt = <3023250>; 88 - regulator-max-microvolt = <3023250>; 89 - lltc,fb-voltage-divider = <634000 200000>; 90 - regulator-boot-on; 91 - regulator-always-on; 92 - }; 93 - }; 94 - };
+12
Documentation/devicetree/bindings/regulator/qcom,qca6390-pmu.yaml
··· 33 33 vddpmu-supply: 34 34 description: VDD_PMU supply regulator handle 35 35 36 + vddpmumx-supply: 37 + description: VDD_PMU_MX supply regulator handle 38 + 39 + vddpmucx-supply: 40 + description: VDD_PMU_CX supply regulator handle 41 + 36 42 vddio1p2-supply: 37 43 description: VDD_IO_1P2 supply regulator handle 38 44 ··· 77 71 swctrl-gpios: 78 72 maxItems: 1 79 73 description: GPIO line indicating the state of the clock supply to the BT module 74 + 75 + xo-clk-gpios: 76 + maxItems: 1 77 + description: GPIO line allowing to select the XO clock configuration for the module 80 78 81 79 clocks: 82 80 maxItems: 1 ··· 129 119 - vddio-supply 130 120 - vddaon-supply 131 121 - vddpmu-supply 122 + - vddpmumx-supply 123 + - vddpmucx-supply 132 124 - vddrfa0p95-supply 133 125 - vddrfa1p3-supply 134 126 - vddrfa1p9-supply
+1 -1
Documentation/devicetree/bindings/regulator/qcom,rpmh-regulator.yaml
··· 349 349 properties: 350 350 compatible: 351 351 enum: 352 - - qcom,pm8550ve-rpmh-regulators 353 352 - qcom,pm8550vs-rpmh-regulators 354 353 then: 355 354 patternProperties: ··· 384 385 compatible: 385 386 enum: 386 387 - qcom,pmc8380-rpmh-regulators 388 + - qcom,pm8550ve-rpmh-regulators 387 389 then: 388 390 patternProperties: 389 391 "^vdd-l[1-3]-supply$": true
+80
Documentation/devicetree/bindings/regulator/vctrl-regulator.yaml
··· 1 + # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/regulator/vctrl-regulator.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Voltage controlled regulators 8 + 9 + maintainers: 10 + - Heiko Stuebner <heiko@sntech.de> 11 + 12 + allOf: 13 + - $ref: regulator.yaml# 14 + 15 + properties: 16 + compatible: 17 + const: vctrl-regulator 18 + 19 + ctrl-supply: 20 + description: Regulator supplying the control voltage 21 + 22 + ctrl-voltage-range: 23 + description: 24 + Array of two integer values describing the range (min/max) of the 25 + control voltage. The values specify the control voltage needed to 26 + generate the corresponding regulator-min/max-microvolt output 27 + voltage. 28 + minItems: 2 29 + maxItems: 2 30 + $ref: /schemas/types.yaml#/definitions/uint32-array 31 + 32 + min-slew-down-rate: 33 + description: 34 + Describes how slowly the regulator voltage will decay down in the 35 + worst case (lightest expected load). Specified in uV / us (like 36 + main regulator ramp rate). This value is required when 37 + ovp-threshold-percent is specified. 38 + $ref: /schemas/types.yaml#/definitions/uint32 39 + 40 + ovp-threshold-percent: 41 + description: 42 + Overvoltage protection (OVP) threshold of the regulator in percent. 43 + Some regulators have an OVP circuitry which shuts down the regulator 44 + when the actual output voltage deviates beyond a certain margin from 45 + the expected value for a given control voltage. On larger voltage 46 + decreases this can occur undesiredly since the output voltage does 47 + not adjust immediately to changes in the control voltage. To avoid 48 + this situation the vctrl driver breaks down larger voltage decreases 49 + into multiple steps, where each step is within the OVP threshold. 50 + minimum: 0 51 + maximum: 100 52 + 53 + unevaluatedProperties: false 54 + 55 + dependencies: 56 + ovp-threshold-percent: [ min-slew-down-rate ] 57 + 58 + required: 59 + - compatible 60 + - ctrl-supply 61 + - ctrl-voltage-range 62 + - regulator-min-microvolt 63 + - regulator-max-microvolt 64 + 65 + examples: 66 + - | 67 + vctrl-reg { 68 + compatible = "vctrl-regulator"; 69 + regulator-name = "vctrl_reg"; 70 + 71 + ctrl-supply = <&ctrl_reg>; 72 + ctrl-voltage-range = <200000 500000>; 73 + 74 + min-slew-down-rate = <225>; 75 + ovp-threshold-percent = <16>; 76 + 77 + regulator-min-microvolt = <800000>; 78 + regulator-max-microvolt = <1500000>; 79 + }; 80 + ...
-49
Documentation/devicetree/bindings/regulator/vctrl.txt
··· 1 - Bindings for Voltage controlled regulators 2 - ========================================== 3 - 4 - Required properties: 5 - -------------------- 6 - - compatible : must be "vctrl-regulator". 7 - - regulator-min-microvolt : smallest voltage consumers may set 8 - - regulator-max-microvolt : largest voltage consumers may set 9 - - ctrl-supply : The regulator supplying the control voltage. 10 - - ctrl-voltage-range : an array of two integer values describing the range 11 - (min/max) of the control voltage. The values specify 12 - the control voltage needed to generate the corresponding 13 - regulator-min/max-microvolt output voltage. 14 - 15 - Optional properties: 16 - -------------------- 17 - - ovp-threshold-percent : overvoltage protection (OVP) threshold of the 18 - regulator in percent. Some regulators have an OVP 19 - circuitry which shuts down the regulator when the 20 - actual output voltage deviates beyond a certain 21 - margin from the expected value for a given control 22 - voltage. On larger voltage decreases this can occur 23 - undesiredly since the output voltage does not adjust 24 - immediately to changes in the control voltage. To 25 - avoid this situation the vctrl driver breaks down 26 - larger voltage decreases into multiple steps, where 27 - each step is within the OVP threshold. 28 - - min-slew-down-rate : Describes how slowly the regulator voltage will decay 29 - down in the worst case (lightest expected load). 30 - Specified in uV / us (like main regulator ramp rate). 31 - This value is required when ovp-threshold-percent is 32 - specified. 33 - 34 - Example: 35 - 36 - vctrl-reg { 37 - compatible = "vctrl-regulator"; 38 - regulator-name = "vctrl_reg"; 39 - 40 - ctrl-supply = <&ctrl_reg>; 41 - 42 - regulator-min-microvolt = <800000>; 43 - regulator-max-microvolt = <1500000>; 44 - 45 - ctrl-voltage-range = <200000 500000>; 46 - 47 - min-slew-down-rate = <225>; 48 - ovp-threshold-percent = <16>; 49 - };
+6 -6
drivers/regulator/arizona-ldo1.c
··· 375 375 376 376 static struct platform_driver arizona_ldo1_driver = { 377 377 .probe = arizona_ldo1_probe, 378 - .remove_new = arizona_ldo1_remove, 379 - .driver = { 380 - .name = "arizona-ldo1", 378 + .remove = arizona_ldo1_remove, 379 + .driver = { 380 + .name = "arizona-ldo1", 381 381 .probe_type = PROBE_FORCE_SYNCHRONOUS, 382 382 }, 383 383 }; 384 384 385 385 static struct platform_driver madera_ldo1_driver = { 386 386 .probe = madera_ldo1_probe, 387 - .remove_new = arizona_ldo1_remove, 388 - .driver = { 389 - .name = "madera-ldo1", 387 + .remove = arizona_ldo1_remove, 388 + .driver = { 389 + .name = "madera-ldo1", 390 390 .probe_type = PROBE_FORCE_SYNCHRONOUS, 391 391 }, 392 392 };
+1 -1
drivers/regulator/bd9571mwv-regulator.c
··· 356 356 .pm = DEV_PM_OPS, 357 357 }, 358 358 .probe = bd9571mwv_regulator_probe, 359 - .remove_new = bd9571mwv_regulator_remove, 359 + .remove = bd9571mwv_regulator_remove, 360 360 .id_table = bd9571mwv_regulator_id_table, 361 361 }; 362 362 module_platform_driver(bd9571mwv_regulator_driver);
+46 -75
drivers/regulator/core.c
··· 1959 1959 regulator_supply_alias(&dev, &supply); 1960 1960 1961 1961 /* first do a dt based lookup */ 1962 - if (dev && dev->of_node) { 1963 - r = of_regulator_dev_lookup(dev, supply); 1962 + if (dev_of_node(dev)) { 1963 + r = of_regulator_dev_lookup(dev, dev_of_node(dev), supply); 1964 1964 if (!IS_ERR(r)) 1965 1965 return r; 1966 1966 if (PTR_ERR(r) == -EPROBE_DEFER) ··· 2643 2643 } 2644 2644 2645 2645 /** 2646 - * _regulator_delay_helper - a delay helper function 2647 - * @delay: time to delay in microseconds 2648 - * 2649 - * Delay for the requested amount of time as per the guidelines in: 2650 - * 2651 - * Documentation/timers/timers-howto.rst 2652 - * 2653 - * The assumption here is that these regulator operations will never used in 2654 - * atomic context and therefore sleeping functions can be used. 2655 - */ 2656 - static void _regulator_delay_helper(unsigned int delay) 2657 - { 2658 - unsigned int ms = delay / 1000; 2659 - unsigned int us = delay % 1000; 2660 - 2661 - if (ms > 0) { 2662 - /* 2663 - * For small enough values, handle super-millisecond 2664 - * delays in the usleep_range() call below. 2665 - */ 2666 - if (ms < 20) 2667 - us += ms * 1000; 2668 - else 2669 - msleep(ms); 2670 - } 2671 - 2672 - /* 2673 - * Give the scheduler some room to coalesce with any other 2674 - * wakeup sources. For delays shorter than 10 us, don't even 2675 - * bother setting up high-resolution timers and just busy- 2676 - * loop. 2677 - */ 2678 - if (us >= 10) 2679 - usleep_range(us, us + 100); 2680 - else 2681 - udelay(us); 2682 - } 2683 - 2684 - /** 2685 2646 * _regulator_check_status_enabled - check if regulator status can be 2686 2647 * interpreted as "regulator is enabled" 2687 2648 * @rdev: the regulator device to check ··· 2694 2733 s64 remaining = ktime_us_delta(end, ktime_get_boottime()); 2695 2734 2696 2735 if (remaining > 0) 2697 - _regulator_delay_helper(remaining); 2736 + fsleep(remaining); 2698 2737 } 2699 2738 2700 2739 if (rdev->ena_pin) { ··· 2728 2767 int time_remaining = delay; 2729 2768 2730 2769 while (time_remaining > 0) { 2731 - _regulator_delay_helper(rdev->desc->poll_enabled_time); 2770 + fsleep(rdev->desc->poll_enabled_time); 2732 2771 2733 2772 if (rdev->desc->ops->get_status) { 2734 2773 ret = _regulator_check_status_enabled(rdev); ··· 2747 2786 return -ETIMEDOUT; 2748 2787 } 2749 2788 } else { 2750 - _regulator_delay_helper(delay); 2789 + fsleep(delay); 2751 2790 } 2752 2791 2753 2792 trace_regulator_enable_complete(rdev_get_name(rdev)); ··· 3691 3730 } 3692 3731 3693 3732 /* Insert any necessary delays */ 3694 - _regulator_delay_helper(delay); 3733 + fsleep(delay); 3695 3734 3696 3735 if (best_val >= 0) { 3697 3736 unsigned long data = best_val; ··· 5642 5681 goto clean; 5643 5682 } 5644 5683 5645 - init_data = regulator_of_get_init_data(dev, regulator_desc, config, 5646 - &rdev->dev.of_node); 5684 + if (config->init_data) { 5685 + /* 5686 + * Providing of_match means the framework is expected to parse 5687 + * DT to get the init_data. This would conflict with provided 5688 + * init_data, if set. Warn if it happens. 5689 + */ 5690 + if (regulator_desc->of_match) 5691 + dev_warn(dev, "Using provided init data - OF match ignored\n"); 5647 5692 5648 - /* 5649 - * Sometimes not all resources are probed already so we need to take 5650 - * that into account. This happens most the time if the ena_gpiod comes 5651 - * from a gpio extender or something else. 5652 - */ 5653 - if (PTR_ERR(init_data) == -EPROBE_DEFER) { 5654 - ret = -EPROBE_DEFER; 5655 - goto clean; 5656 - } 5657 - 5658 - /* 5659 - * We need to keep track of any GPIO descriptor coming from the 5660 - * device tree until we have handled it over to the core. If the 5661 - * config that was passed in to this function DOES NOT contain 5662 - * a descriptor, and the config after this call DOES contain 5663 - * a descriptor, we definitely got one from parsing the device 5664 - * tree. 5665 - */ 5666 - if (!cfg->ena_gpiod && config->ena_gpiod) 5667 - dangling_of_gpiod = true; 5668 - if (!init_data) { 5669 5693 init_data = config->init_data; 5670 5694 rdev->dev.of_node = of_node_get(config->of_node); 5695 + 5696 + } else { 5697 + init_data = regulator_of_get_init_data(dev, regulator_desc, 5698 + config, 5699 + &rdev->dev.of_node); 5700 + 5701 + /* 5702 + * Sometimes not all resources are probed already so we need to 5703 + * take that into account. This happens most the time if the 5704 + * ena_gpiod comes from a gpio extender or something else. 5705 + */ 5706 + if (PTR_ERR(init_data) == -EPROBE_DEFER) { 5707 + ret = -EPROBE_DEFER; 5708 + goto clean; 5709 + } 5710 + 5711 + /* 5712 + * We need to keep track of any GPIO descriptor coming from the 5713 + * device tree until we have handled it over to the core. If the 5714 + * config that was passed in to this function DOES NOT contain a 5715 + * descriptor, and the config after this call DOES contain a 5716 + * descriptor, we definitely got one from parsing the device 5717 + * tree. 5718 + */ 5719 + if (!cfg->ena_gpiod && config->ena_gpiod) 5720 + dangling_of_gpiod = true; 5671 5721 } 5672 5722 5673 5723 ww_mutex_init(&rdev->mutex, &regulator_ww_class); ··· 5719 5747 goto wash; 5720 5748 } 5721 5749 5750 + if (regulator_desc->init_cb) { 5751 + ret = regulator_desc->init_cb(rdev, config); 5752 + if (ret < 0) 5753 + goto wash; 5754 + } 5755 + 5722 5756 if ((rdev->supply_name && !rdev->supply) && 5723 5757 (rdev->constraints->always_on || 5724 5758 rdev->constraints->boot_on)) { ··· 5734 5756 ERR_PTR(ret)); 5735 5757 5736 5758 resolved_early = true; 5737 - } 5738 - 5739 - /* perform any regulator specific init */ 5740 - if (init_data && init_data->regulator_init) { 5741 - ret = init_data->regulator_init(rdev->reg_data); 5742 - if (ret < 0) 5743 - goto wash; 5744 5759 } 5745 5760 5746 5761 if (config->ena_gpiod) {
+1 -1
drivers/regulator/db8500-prcmu.c
··· 480 480 .probe_type = PROBE_PREFER_ASYNCHRONOUS, 481 481 }, 482 482 .probe = db8500_regulator_probe, 483 - .remove_new = db8500_regulator_remove, 483 + .remove = db8500_regulator_remove, 484 484 }; 485 485 486 486 static int __init db8500_regulator_init(void)
+39
drivers/regulator/devres.c
··· 749 749 return ptr; 750 750 } 751 751 EXPORT_SYMBOL_GPL(devm_regulator_irq_helper); 752 + 753 + #if IS_ENABLED(CONFIG_OF) 754 + static struct regulator *_devm_of_regulator_get(struct device *dev, struct device_node *node, 755 + const char *id, int get_type) 756 + { 757 + struct regulator **ptr, *regulator; 758 + 759 + ptr = devres_alloc(devm_regulator_release, sizeof(*ptr), GFP_KERNEL); 760 + if (!ptr) 761 + return ERR_PTR(-ENOMEM); 762 + 763 + regulator = _of_regulator_get(dev, node, id, get_type); 764 + if (!IS_ERR(regulator)) { 765 + *ptr = regulator; 766 + devres_add(dev, ptr); 767 + } else { 768 + devres_free(ptr); 769 + } 770 + 771 + return regulator; 772 + } 773 + 774 + /** 775 + * devm_of_regulator_get_optional - Resource managed of_regulator_get_optional() 776 + * @dev: device used for dev_printk() messages and resource lifetime management 777 + * @node: device node for regulator "consumer" 778 + * @id: supply name or regulator ID. 779 + * 780 + * Managed regulator_get_optional(). Regulators returned from this 781 + * function are automatically regulator_put() on driver detach. See 782 + * of_regulator_get_optional() for more information. 783 + */ 784 + struct regulator *devm_of_regulator_get_optional(struct device *dev, struct device_node *node, 785 + const char *id) 786 + { 787 + return _devm_of_regulator_get(dev, node, id, OPTIONAL_GET); 788 + } 789 + EXPORT_SYMBOL_GPL(devm_of_regulator_get_optional); 790 + #endif
+12 -6
drivers/regulator/internal.h
··· 65 65 return container_of(dev, struct regulator_dev, dev); 66 66 } 67 67 68 + enum regulator_get_type { 69 + NORMAL_GET, 70 + EXCLUSIVE_GET, 71 + OPTIONAL_GET, 72 + MAX_GET_TYPE 73 + }; 74 + 68 75 #ifdef CONFIG_OF 69 76 struct regulator_dev *of_regulator_dev_lookup(struct device *dev, 77 + struct device_node *np, 70 78 const char *supply); 71 79 struct regulator_init_data *regulator_of_get_init_data(struct device *dev, 72 80 const struct regulator_desc *desc, 73 81 struct regulator_config *config, 74 82 struct device_node **node); 83 + 84 + struct regulator *_of_regulator_get(struct device *dev, struct device_node *node, 85 + const char *id, enum regulator_get_type get_type); 75 86 76 87 struct regulator_dev *of_parse_coupled_regulator(struct regulator_dev *rdev, 77 88 int index); ··· 93 82 94 83 #else 95 84 static inline struct regulator_dev *of_regulator_dev_lookup(struct device *dev, 85 + struct device_node *np, 96 86 const char *supply) 97 87 { 98 88 return ERR_PTR(-ENODEV); ··· 126 114 } 127 115 128 116 #endif 129 - enum regulator_get_type { 130 - NORMAL_GET, 131 - EXCLUSIVE_GET, 132 - OPTIONAL_GET, 133 - MAX_GET_TYPE 134 - }; 135 117 136 118 int _regulator_get_common_check(struct device *dev, const char *id, 137 119 enum regulator_get_type get_type);
+2 -2
drivers/regulator/isl6271a-regulator.c
··· 138 138 } 139 139 140 140 static const struct i2c_device_id isl6271a_id[] = { 141 - {.name = "isl6271a", 0 }, 142 - { }, 141 + { .name = "isl6271a", }, 142 + { } 143 143 }; 144 144 145 145 MODULE_DEVICE_TABLE(i2c, isl6271a_id);
+4 -17
drivers/regulator/max5970-regulator.c
··· 485 485 } 486 486 487 487 static int max597x_adc_range(struct regmap *regmap, const int ch, 488 - u32 *irng, u32 *mon_rng) 488 + int *irng, int *mon_rng) 489 489 { 490 490 unsigned int reg; 491 491 int ret; ··· 552 552 553 553 static int max597x_regulator_probe(struct platform_device *pdev) 554 554 { 555 - struct max5970_data *max597x; 556 555 struct regmap *regmap = dev_get_regmap(pdev->dev.parent, NULL); 557 556 struct max5970_regulator *data; 558 557 struct i2c_client *i2c = to_i2c_client(pdev->dev.parent); ··· 565 566 if (!regmap) 566 567 return -EPROBE_DEFER; 567 568 568 - max597x = devm_kzalloc(&i2c->dev, sizeof(struct max5970_data), GFP_KERNEL); 569 - if (!max597x) 570 - return -ENOMEM; 571 - 572 569 rdevs = devm_kcalloc(&i2c->dev, MAX5970_NUM_SWITCHES, sizeof(struct regulator_dev *), 573 570 GFP_KERNEL); 574 571 if (!rdevs) 575 572 return -ENOMEM; 576 573 577 - i2c_set_clientdata(i2c, max597x); 578 - 579 574 if (of_device_is_compatible(i2c->dev.of_node, "maxim,max5978")) 580 - max597x->num_switches = MAX5978_NUM_SWITCHES; 575 + num_switches = MAX5978_NUM_SWITCHES; 581 576 else if (of_device_is_compatible(i2c->dev.of_node, "maxim,max5970")) 582 - max597x->num_switches = MAX5970_NUM_SWITCHES; 577 + num_switches = MAX5970_NUM_SWITCHES; 583 578 else 584 579 return -ENODEV; 585 - 586 - num_switches = max597x->num_switches; 587 580 588 581 for (i = 0; i < num_switches; i++) { 589 582 data = ··· 587 596 data->num_switches = num_switches; 588 597 data->regmap = regmap; 589 598 590 - ret = max597x_adc_range(regmap, i, &max597x->irng[i], &max597x->mon_rng[i]); 599 + ret = max597x_adc_range(regmap, i, &data->irng, &data->mon_rng); 591 600 if (ret < 0) 592 601 return ret; 593 - 594 - data->irng = max597x->irng[i]; 595 - data->mon_rng = max597x->mon_rng[i]; 596 602 597 603 config.dev = &i2c->dev; 598 604 config.driver_data = (void *)data; ··· 602 614 return PTR_ERR(rdev); 603 615 } 604 616 rdevs[i] = rdev; 605 - max597x->shunt_micro_ohms[i] = data->shunt_micro_ohms; 606 617 } 607 618 608 619 if (IS_REACHABLE(CONFIG_HWMON)) {
+45 -6
drivers/regulator/of_regulator.c
··· 588 588 589 589 /** 590 590 * of_get_regulator - get a regulator device node based on supply name 591 - * @dev: Device pointer for the consumer (of regulator) device 591 + * @dev: Device pointer for dev_printk() messages 592 + * @node: Device node pointer for supply property lookup 592 593 * @supply: regulator supply name 593 594 * 594 595 * Extract the regulator device node corresponding to the supply name. ··· 597 596 * Return: Pointer to the &struct device_node corresponding to the regulator 598 597 * if found, or %NULL if not found. 599 598 */ 600 - static struct device_node *of_get_regulator(struct device *dev, const char *supply) 599 + static struct device_node *of_get_regulator(struct device *dev, struct device_node *node, 600 + const char *supply) 601 601 { 602 602 struct device_node *regnode = NULL; 603 603 char prop_name[64]; /* 64 is max size of property name */ 604 604 605 - dev_dbg(dev, "Looking up %s-supply from device tree\n", supply); 605 + dev_dbg(dev, "Looking up %s-supply from device node %pOF\n", supply, node); 606 606 607 607 snprintf(prop_name, 64, "%s-supply", supply); 608 - regnode = of_parse_phandle(dev->of_node, prop_name, 0); 608 + regnode = of_parse_phandle(node, prop_name, 0); 609 609 if (regnode) 610 610 return regnode; 611 611 ··· 630 628 /** 631 629 * of_regulator_dev_lookup - lookup a regulator device with device tree only 632 630 * @dev: Device pointer for regulator supply lookup. 631 + * @np: Device node pointer for regulator supply lookup. 633 632 * @supply: Supply name or regulator ID. 634 633 * 635 634 * Return: Pointer to the &struct regulator_dev on success, or ERR_PTR() ··· 645 642 * * -%ENODEV if lookup fails permanently. 646 643 * * -%EPROBE_DEFER if lookup could succeed in the future. 647 644 */ 648 - struct regulator_dev *of_regulator_dev_lookup(struct device *dev, 645 + struct regulator_dev *of_regulator_dev_lookup(struct device *dev, struct device_node *np, 649 646 const char *supply) 650 647 { 651 648 struct regulator_dev *r; 652 649 struct device_node *node; 653 650 654 - node = of_get_regulator(dev, supply); 651 + node = of_get_regulator(dev, np, supply); 655 652 if (node) { 656 653 r = of_find_regulator_by_node(node); 657 654 of_node_put(node); ··· 667 664 668 665 return ERR_PTR(-ENODEV); 669 666 } 667 + 668 + struct regulator *_of_regulator_get(struct device *dev, struct device_node *node, 669 + const char *id, enum regulator_get_type get_type) 670 + { 671 + struct regulator_dev *r; 672 + int ret; 673 + 674 + ret = _regulator_get_common_check(dev, id, get_type); 675 + if (ret) 676 + return ERR_PTR(ret); 677 + 678 + r = of_regulator_dev_lookup(dev, node, id); 679 + return _regulator_get_common(r, dev, id, get_type); 680 + } 681 + 682 + /** 683 + * of_regulator_get_optional - get optional regulator via device tree lookup 684 + * @dev: device used for dev_printk() messages 685 + * @node: device node for regulator "consumer" 686 + * @id: Supply name 687 + * 688 + * Return: pointer to struct regulator corresponding to the regulator producer, 689 + * or PTR_ERR() encoded error number. 690 + * 691 + * This is intended for use by consumers that want to get a regulator 692 + * supply directly from a device node, and can and want to deal with 693 + * absence of such supplies. This will _not_ consider supply aliases. 694 + * See regulator_dev_lookup(). 695 + */ 696 + struct regulator *of_regulator_get_optional(struct device *dev, 697 + struct device_node *node, 698 + const char *id) 699 + { 700 + return _of_regulator_get(dev, node, id, OPTIONAL_GET); 701 + } 702 + EXPORT_SYMBOL_GPL(of_regulator_get_optional); 670 703 671 704 /* 672 705 * Returns number of regulators coupled with rdev.
+1 -1
drivers/regulator/qcom_smd-regulator.c
··· 11 11 #include <linux/regulator/of_regulator.h> 12 12 #include <linux/soc/qcom/smd-rpm.h> 13 13 14 - struct qcom_smd_rpm *smd_vreg_rpm; 14 + static struct qcom_smd_rpm *smd_vreg_rpm; 15 15 16 16 struct qcom_rpm_reg { 17 17 struct device *dev;
+2 -5
drivers/regulator/renesas-usb-vbus-regulator.c
··· 49 49 return dev_err_probe(dev, -ENODEV, "regulator node not found\n"); 50 50 51 51 rdev = devm_regulator_register(dev, &rzg2l_usb_vbus_rdesc, &config); 52 - if (IS_ERR(rdev)) { 53 - of_node_put(config.of_node); 52 + of_node_put(config.of_node); 53 + if (IS_ERR(rdev)) 54 54 return dev_err_probe(dev, PTR_ERR(rdev), 55 55 "not able to register vbus regulator\n"); 56 - } 57 - 58 - of_node_put(config.of_node); 59 56 60 57 return 0; 61 58 }
+19 -22
drivers/regulator/rk808-regulator.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-only 2 2 /* 3 - * Regulator driver for Rockchip RK805/RK808/RK818 3 + * Regulator driver for Rockchip RK80x and RK81x PMIC series 4 4 * 5 5 * Copyright (c) 2014, Fuzhou Rockchip Electronics Co., Ltd 6 6 * Copyright (c) 2021 Rockchip Electronics Co., Ltd. ··· 23 23 #include <linux/regulator/of_regulator.h> 24 24 #include <linux/gpio/consumer.h> 25 25 26 - /* Field Definitions */ 26 + /* Field definitions */ 27 27 #define RK808_BUCK_VSEL_MASK 0x3f 28 28 #define RK808_BUCK4_VSEL_MASK 0xf 29 29 #define RK808_LDO_VSEL_MASK 0x1f ··· 1831 1831 RK818_DCDC_EN_REG, BIT(7)), 1832 1832 }; 1833 1833 1834 - static int rk808_regulator_dt_parse_pdata(struct device *dev, 1835 - struct regmap *map, 1836 - struct rk808_regulator_data *pdata) 1834 + static int rk808_regulator_dt_parse_pdata(struct device *dev, struct regmap *map, 1835 + struct rk808_regulator_data *pdata) 1837 1836 { 1838 1837 struct device_node *np; 1839 1838 int tmp, ret = 0, i; ··· 1843 1844 1844 1845 for (i = 0; i < ARRAY_SIZE(pdata->dvs_gpio); i++) { 1845 1846 pdata->dvs_gpio[i] = 1846 - devm_gpiod_get_index_optional(dev, "dvs", i, 1847 - GPIOD_OUT_LOW); 1847 + devm_gpiod_get_index_optional(dev, "dvs", i, GPIOD_OUT_LOW); 1848 1848 if (IS_ERR(pdata->dvs_gpio[i])) { 1849 - ret = PTR_ERR(pdata->dvs_gpio[i]); 1850 - dev_err(dev, "failed to get dvs%d gpio (%d)\n", i, ret); 1849 + ret = dev_err_probe(dev, PTR_ERR(pdata->dvs_gpio[i]), 1850 + "failed to get dvs%d gpio\n", i); 1851 1851 goto dt_parse_end; 1852 1852 } 1853 1853 1854 1854 if (!pdata->dvs_gpio[i]) { 1855 - dev_info(dev, "there is no dvs%d gpio\n", i); 1855 + dev_dbg(dev, "there is no dvs%d gpio\n", i); 1856 1856 continue; 1857 1857 } 1858 1858 1859 1859 tmp = i ? RK808_DVS2_POL : RK808_DVS1_POL; 1860 1860 ret = regmap_update_bits(map, RK808_IO_POL_REG, tmp, 1861 - gpiod_is_active_low(pdata->dvs_gpio[i]) ? 1862 - 0 : tmp); 1861 + gpiod_is_active_low(pdata->dvs_gpio[i]) ? 0 : tmp); 1863 1862 } 1864 1863 1865 1864 dt_parse_end: ··· 1886 1889 if (!pdata) 1887 1890 return -ENOMEM; 1888 1891 1889 - ret = rk808_regulator_dt_parse_pdata(&pdev->dev, regmap, pdata); 1890 - if (ret < 0) 1891 - return ret; 1892 - 1893 - platform_set_drvdata(pdev, pdata); 1894 - 1895 1892 switch (rk808->variant) { 1896 1893 case RK805_ID: 1897 1894 regulators = rk805_reg; ··· 1896 1905 nregulators = ARRAY_SIZE(rk806_reg); 1897 1906 break; 1898 1907 case RK808_ID: 1908 + /* DVS0/1 GPIOs are supported on the RK808 only */ 1909 + ret = rk808_regulator_dt_parse_pdata(&pdev->dev, regmap, pdata); 1910 + if (ret < 0) 1911 + return ret; 1912 + 1899 1913 regulators = rk808_reg; 1900 1914 nregulators = RK808_NUM_REGULATORS; 1901 1915 break; ··· 1921 1925 nregulators = RK818_NUM_REGULATORS; 1922 1926 break; 1923 1927 default: 1924 - dev_err(&pdev->dev, "unsupported RK8XX ID %lu\n", 1925 - rk808->variant); 1926 - return -EINVAL; 1928 + return dev_err_probe(&pdev->dev, -EINVAL, 1929 + "unsupported RK8xx ID %lu\n", rk808->variant); 1927 1930 } 1931 + 1932 + platform_set_drvdata(pdev, pdata); 1928 1933 1929 1934 config.dev = &pdev->dev; 1930 1935 config.driver_data = pdata; ··· 1953 1956 1954 1957 module_platform_driver(rk808_regulator_driver); 1955 1958 1956 - MODULE_DESCRIPTION("regulator driver for the RK805/RK808/RK818 series PMICs"); 1959 + MODULE_DESCRIPTION("Rockchip RK80x/RK81x PMIC series regulator driver"); 1957 1960 MODULE_AUTHOR("Tony xie <tony.xie@rock-chips.com>"); 1958 1961 MODULE_AUTHOR("Chris Zhong <zyw@rock-chips.com>"); 1959 1962 MODULE_AUTHOR("Zhang Qing <zhangqing@rock-chips.com>");
+1 -1
drivers/regulator/stm32-vrefbuf.c
··· 280 280 281 281 static struct platform_driver stm32_vrefbuf_driver = { 282 282 .probe = stm32_vrefbuf_probe, 283 - .remove_new = stm32_vrefbuf_remove, 283 + .remove = stm32_vrefbuf_remove, 284 284 .driver = { 285 285 .name = "stm32-vrefbuf", 286 286 .probe_type = PROBE_PREFER_ASYNCHRONOUS,
+1 -1
drivers/regulator/uniphier-regulator.c
··· 207 207 208 208 static struct platform_driver uniphier_regulator_driver = { 209 209 .probe = uniphier_regulator_probe, 210 - .remove_new = uniphier_regulator_remove, 210 + .remove = uniphier_regulator_remove, 211 211 .driver = { 212 212 .name = "uniphier-regulator", 213 213 .probe_type = PROBE_PREFER_ASYNCHRONOUS,
+1 -1
drivers/regulator/userspace-consumer.c
··· 210 210 211 211 static struct platform_driver regulator_userspace_consumer_driver = { 212 212 .probe = regulator_userspace_consumer_probe, 213 - .remove_new = regulator_userspace_consumer_remove, 213 + .remove = regulator_userspace_consumer_remove, 214 214 .driver = { 215 215 .name = "reg-userspace-consumer", 216 216 .probe_type = PROBE_PREFER_ASYNCHRONOUS,
+1 -1
drivers/regulator/virtual.c
··· 357 357 358 358 static struct platform_driver regulator_virtual_consumer_driver = { 359 359 .probe = regulator_virtual_probe, 360 - .remove_new = regulator_virtual_remove, 360 + .remove = regulator_virtual_remove, 361 361 .driver = { 362 362 .name = "reg-virt-consumer", 363 363 .probe_type = PROBE_PREFER_ASYNCHRONOUS,
+3 -3
drivers/regulator/wm8350-regulator.c
··· 1304 1304 1305 1305 static struct platform_driver wm8350_regulator_driver = { 1306 1306 .probe = wm8350_regulator_probe, 1307 - .remove_new = wm8350_regulator_remove, 1308 - .driver = { 1309 - .name = "wm8350-regulator", 1307 + .remove = wm8350_regulator_remove, 1308 + .driver = { 1309 + .name = "wm8350-regulator", 1310 1310 .probe_type = PROBE_PREFER_ASYNCHRONOUS, 1311 1311 }, 1312 1312 };
-12
include/linux/mfd/max5970.h
··· 16 16 #define MAX5978_NUM_SWITCHES 1 17 17 #define MAX5970_NUM_LEDS 4 18 18 19 - struct max5970_data { 20 - int num_switches; 21 - u32 irng[MAX5970_NUM_SWITCHES]; 22 - u32 mon_rng[MAX5970_NUM_SWITCHES]; 23 - u32 shunt_micro_ohms[MAX5970_NUM_SWITCHES]; 24 - }; 25 - 26 - enum max5970_chip_type { 27 - TYPE_MAX5978 = 1, 28 - TYPE_MAX5970, 29 - }; 30 - 31 19 #define MAX5970_REG_CURRENT_L(ch) (0x01 + (ch) * 4) 32 20 #define MAX5970_REG_CURRENT_H(ch) (0x00 + (ch) * 4) 33 21 #define MAX5970_REG_VOLTAGE_L(ch) (0x03 + (ch) * 4)
+37
include/linux/regulator/consumer.h
··· 168 168 void regulator_put(struct regulator *regulator); 169 169 void devm_regulator_put(struct regulator *regulator); 170 170 171 + #if IS_ENABLED(CONFIG_OF) 172 + struct regulator *__must_check of_regulator_get_optional(struct device *dev, 173 + struct device_node *node, 174 + const char *id); 175 + struct regulator *__must_check devm_of_regulator_get_optional(struct device *dev, 176 + struct device_node *node, 177 + const char *id); 178 + #else 179 + static inline struct regulator *__must_check of_regulator_get_optional(struct device *dev, 180 + struct device_node *node, 181 + const char *id) 182 + { 183 + return ERR_PTR(-ENODEV); 184 + } 185 + 186 + static inline struct regulator *__must_check devm_of_regulator_get_optional(struct device *dev, 187 + struct device_node *node, 188 + const char *id) 189 + { 190 + return ERR_PTR(-ENODEV); 191 + } 192 + #endif 193 + 171 194 int regulator_register_supply_alias(struct device *dev, const char *id, 172 195 struct device *alias_dev, 173 196 const char *alias_id); ··· 369 346 370 347 static inline struct regulator *__must_check 371 348 devm_regulator_get_optional(struct device *dev, const char *id) 349 + { 350 + return ERR_PTR(-ENODEV); 351 + } 352 + 353 + static inline struct regulator *__must_check of_regulator_get_optional(struct device *dev, 354 + struct device_node *node, 355 + const char *id) 356 + { 357 + return ERR_PTR(-ENODEV); 358 + } 359 + 360 + static inline struct regulator *__must_check devm_of_regulator_get_optional(struct device *dev, 361 + struct device_node *node, 362 + const char *id) 372 363 { 373 364 return ERR_PTR(-ENODEV); 374 365 }
+7
include/linux/regulator/driver.h
··· 269 269 * config but it cannot store it for later usage. 270 270 * Callback should return 0 on success or negative ERRNO 271 271 * indicating failure. 272 + * @init_cb: Optional callback called after the parsing of init_data. 273 + * Allows the regulator to perform runtime init if necessary, 274 + * such as synching the regulator and the parsed constraints. 275 + * Callback should return 0 on success or negative ERRNO 276 + * indicating failure. 272 277 * @id: Numerical identifier for the regulator. 273 278 * @ops: Regulator operations table. 274 279 * @irq: Interrupt number for the regulator. ··· 370 365 int (*of_parse_cb)(struct device_node *, 371 366 const struct regulator_desc *, 372 367 struct regulator_config *); 368 + int (*init_cb)(struct regulator_dev *, 369 + struct regulator_config *); 373 370 int id; 374 371 unsigned int continuous_voltage_range:1; 375 372 unsigned n_voltages;
+1 -4
include/linux/regulator/machine.h
··· 273 273 * be usable. 274 274 * @num_consumer_supplies: Number of consumer device supplies. 275 275 * @consumer_supplies: Consumer device supply configuration. 276 - * 277 - * @regulator_init: Callback invoked when the regulator has been registered. 278 276 * @driver_data: Data passed to regulator_init. 279 277 */ 280 278 struct regulator_init_data { ··· 283 285 int num_consumer_supplies; 284 286 struct regulator_consumer_supply *consumer_supplies; 285 287 286 - /* optional regulator machine specific init */ 287 - int (*regulator_init)(void *driver_data); 288 + /* optional regulator machine specific data */ 288 289 void *driver_data; /* core does not touch this */ 289 290 }; 290 291