* [PATCH 0/3] regulator: Add FP9931/JD9930
@ 2025-11-07 20:06 Andreas Kemnade
2025-11-07 20:06 ` [PATCH 1/3] dt-bindings: vendor-prefixes: Add Fitipower Andreas Kemnade
` (2 more replies)
0 siblings, 3 replies; 17+ messages in thread
From: Andreas Kemnade @ 2025-11-07 20:06 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Liam Girdwood,
Mark Brown, Guenter Roeck
Cc: devicetree, linux-kernel, linux-hwmon, Andreas Kemnade
Add a driver for the FP9931/JD9930 regulator which provides the
comparatively high voltages needed for electronic paper displays.
Datasheet for the FP9931 is at
https://www.fitipower.com/dl/file/flXa6hIchVeu0W3K
Although it is in English, it seems to be only downloadable
from the Chinese part of that website.
For the JD9930 there can be a datasheet found at
https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/196/JD9930_2D00_0.7_2D00_JUN_2D00_2019.pdf
To simplify things, include the hwmon part directly which is only
one register read and there are not other functions besides
regulators in this chip.
Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
---
Andreas Kemnade (3):
dt-bindings: vendor-prefixes: Add Fitipower
dt-bindings: regulator: Add Fitipower FP9931/JD9930
regulator: Add FP9931/JD9930 driver
.../devicetree/bindings/regulator/fiti,fp9931.yaml | 133 +++++
.../devicetree/bindings/vendor-prefixes.yaml | 2 +
drivers/regulator/Kconfig | 10 +
drivers/regulator/Makefile | 1 +
drivers/regulator/fp9931.c | 567 +++++++++++++++++++++
5 files changed, 713 insertions(+)
---
base-commit: dcb6fa37fd7bc9c3d2b066329b0d27dedf8becaa
change-id: 20251107-fp9931-submit-0ac249b5d6b0
Best regards,
--
Andreas Kemnade <andreas@kemnade.info>
^ permalink raw reply [flat|nested] 17+ messages in thread* [PATCH 1/3] dt-bindings: vendor-prefixes: Add Fitipower 2025-11-07 20:06 [PATCH 0/3] regulator: Add FP9931/JD9930 Andreas Kemnade @ 2025-11-07 20:06 ` Andreas Kemnade 2025-11-08 12:10 ` Krzysztof Kozlowski 2025-11-07 20:06 ` [PATCH 2/3] dt-bindings: regulator: Add Fitipower FP9931/JD9930 Andreas Kemnade 2025-11-07 20:06 ` [PATCH 3/3] regulator: Add FP9931/JD9930 driver Andreas Kemnade 2 siblings, 1 reply; 17+ messages in thread From: Andreas Kemnade @ 2025-11-07 20:06 UTC (permalink / raw) To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Liam Girdwood, Mark Brown, Guenter Roeck Cc: devicetree, linux-kernel, linux-hwmon, Andreas Kemnade Add Fitipower Integrated Technology Inc. to the vendor prefixes. Signed-off-by: Andreas Kemnade <andreas@kemnade.info> --- Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml index f1d1882009ba..506b146e9bd0 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.yaml +++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml @@ -570,6 +570,8 @@ patternProperties: description: Foxconn Industrial Internet "^firefly,.*": description: Firefly + "^fiti,.*": + description: Fitipower Integrated Technology Inc. "^flipkart,.*": description: Flipkart Inc. "^focaltech,.*": -- 2.47.3 ^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PATCH 1/3] dt-bindings: vendor-prefixes: Add Fitipower 2025-11-07 20:06 ` [PATCH 1/3] dt-bindings: vendor-prefixes: Add Fitipower Andreas Kemnade @ 2025-11-08 12:10 ` Krzysztof Kozlowski 0 siblings, 0 replies; 17+ messages in thread From: Krzysztof Kozlowski @ 2025-11-08 12:10 UTC (permalink / raw) To: Andreas Kemnade Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Liam Girdwood, Mark Brown, Guenter Roeck, devicetree, linux-kernel, linux-hwmon On Fri, Nov 07, 2025 at 09:06:44PM +0100, Andreas Kemnade wrote: > Add Fitipower Integrated Technology Inc. to the vendor prefixes. > > Signed-off-by: Andreas Kemnade <andreas@kemnade.info> > --- > Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml > index f1d1882009ba..506b146e9bd0 100644 > --- a/Documentation/devicetree/bindings/vendor-prefixes.yaml > +++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml > @@ -570,6 +570,8 @@ patternProperties: > description: Foxconn Industrial Internet > "^firefly,.*": > description: Firefly > + "^fiti,.*": fitipower, just like domain name. Best regards, Krzysztof ^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 2/3] dt-bindings: regulator: Add Fitipower FP9931/JD9930 2025-11-07 20:06 [PATCH 0/3] regulator: Add FP9931/JD9930 Andreas Kemnade 2025-11-07 20:06 ` [PATCH 1/3] dt-bindings: vendor-prefixes: Add Fitipower Andreas Kemnade @ 2025-11-07 20:06 ` Andreas Kemnade 2025-11-08 12:17 ` Krzysztof Kozlowski 2025-11-07 20:06 ` [PATCH 3/3] regulator: Add FP9931/JD9930 driver Andreas Kemnade 2 siblings, 1 reply; 17+ messages in thread From: Andreas Kemnade @ 2025-11-07 20:06 UTC (permalink / raw) To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Liam Girdwood, Mark Brown, Guenter Roeck Cc: devicetree, linux-kernel, linux-hwmon, Andreas Kemnade Document the FP9931/JD9930. As the FP9931 is a clear subset of the JD9930, define it as a fallback compatible. GPIO names are same as in the datasheet except for the EN pad which is described as "enable". Signed-off-by: Andreas Kemnade <andreas@kemnade.info> --- .../devicetree/bindings/regulator/fiti,fp9931.yaml | 133 +++++++++++++++++++++ 1 file changed, 133 insertions(+) diff --git a/Documentation/devicetree/bindings/regulator/fiti,fp9931.yaml b/Documentation/devicetree/bindings/regulator/fiti,fp9931.yaml new file mode 100644 index 000000000000..ce44040a3c02 --- /dev/null +++ b/Documentation/devicetree/bindings/regulator/fiti,fp9931.yaml @@ -0,0 +1,133 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/regulator/fiti,fp9931.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: FitiPower FP9931/JD9930 Power Management Integrated Circuit + +maintainers: + - Andreas Kemnade <andreas@kemnade.info> + +description: + FP9931 is a Power Management IC to provide Power for EPDs with one 3.3V + switch, 2 symmetric LDOs behind 2 DC/DC converters, and one unsymmetric + regulator for a compensation voltage. + JD9930 has in addition some kind of night mode. + +properties: + compatible: + oneOf: + - const: fiti,fp9931 + + - items: + - const: fiti,jd9930 + - const: fiti,fp9931 + + reg: + maxItems: 1 + + '#thermal-sensor-cells': + const: 0 + + enable-gpios: + maxItems: 1 + + pg-gpios: + maxItems: 1 + + ts-en-gpios: + maxItems: 1 + + xon-gpios: + maxItems: 1 + + vin-supply: + description: + Supply for the whole chip. Some vendor kernels and devicetrees + declare this as a non-existing GPIO named "pwrall". + + fiti,tdly: + $ref: /schemas/types.yaml#/definitions/uint32-array + description: + Power up soft start delay settings tDLY1-4 bitfields in the + POWERON_DELAY register + + minItems: 4 + maxItems: 4 + + VCOM: + type: object + $ref: /schemas/regulator/regulator.yaml# + unevaluatedProperties: false + description: + The regulator for the compenstation voltage. + properties: + regulator-name: + const: VCOM + + VPOSNEG: + type: object + $ref: /schemas/regulator/regulator.yaml# + unevaluatedProperties: false + description: + The pair of symmetric LDOs + properties: + regulator-name: + const: VPOSNEG + + V3P3: + type: object + $ref: /schemas/regulator/regulator.yaml# + unevaluatedProperties: false + description: + The pair of symmetric LDOs + properties: + regulator-name: + const: V3P3 + +required: + - compatible + - reg + - '#thermal-sensor-cells' + - pg-gpios + - enable-gpios + +additionalProperties: false + +examples: + - | + #include <dt-bindings/gpio/gpio.h> + i2c { + #address-cells = <1>; + #size-cells = <0>; + + fp9931: pmic@18 { + compatible = "fiti,fp9931"; + reg = <0x18>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_fp9931_gpio>; + #thermal-sensor-cells = <0>; + vin-supply = <&epd_pmic_supply>; + pg-gpios = <&gpio2 7 GPIO_ACTIVE_HIGH>; + ts-en-gpios = <&gpio2 9 GPIO_ACTIVE_HIGH>; + enable-gpios = <&gpio2 8 GPIO_ACTIVE_HIGH>; + fiti,tdly = <2 2 3 3>; + + vcom_reg: VCOM { + regulator-name = "VCOM"; + regulator-min-microvolt = <2352840>; + regulator-max-microvolt = <2352840>; + }; + + vposneg_reg: VPOSNEG { + regulator-name = "VPOSNEG"; + regulator-min-microvolt = <15060000>; + regulator-max-microvolt = <15060000>; + }; + + v3p3_reg: V3P3 { + regulator-name = "V3P3"; + }; + }; + }; -- 2.47.3 ^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PATCH 2/3] dt-bindings: regulator: Add Fitipower FP9931/JD9930 2025-11-07 20:06 ` [PATCH 2/3] dt-bindings: regulator: Add Fitipower FP9931/JD9930 Andreas Kemnade @ 2025-11-08 12:17 ` Krzysztof Kozlowski 2025-11-08 14:21 ` Andreas Kemnade 0 siblings, 1 reply; 17+ messages in thread From: Krzysztof Kozlowski @ 2025-11-08 12:17 UTC (permalink / raw) To: Andreas Kemnade Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Liam Girdwood, Mark Brown, Guenter Roeck, devicetree, linux-kernel, linux-hwmon On Fri, Nov 07, 2025 at 09:06:45PM +0100, Andreas Kemnade wrote: > +properties: > + compatible: > + oneOf: > + - const: fiti,fp9931 > + > + - items: > + - const: fiti,jd9930 > + - const: fiti,fp9931 > + > + reg: > + maxItems: 1 > + > + '#thermal-sensor-cells': Why is this a thermal zone sensor? Aren't you mixing temperature reading with soc? For temperature reading you can use hwmon, for example. > + const: 0 > + > + enable-gpios: > + maxItems: 1 > + > + pg-gpios: > + maxItems: 1 > + > + ts-en-gpios: It's called EN_TS, so en-ts-gpios. > + maxItems: 1 > + > + xon-gpios: That's powerdown-gpios, see gpio-consumer-common. > + maxItems: 1 > + > + vin-supply: > + description: > + Supply for the whole chip. Some vendor kernels and devicetrees > + declare this as a non-existing GPIO named "pwrall". > + > + fiti,tdly: No, look at datasheet. What values are there? ms. > + $ref: /schemas/types.yaml#/definitions/uint32-array > + description: > + Power up soft start delay settings tDLY1-4 bitfields in the > + POWERON_DELAY register > + Drop blank line > + minItems: 4 > + maxItems: 4 > + > + VCOM: Lowercase, just group them under regulators node and use patterns. > + type: object > + $ref: /schemas/regulator/regulator.yaml# > + unevaluatedProperties: false > + description: > + The regulator for the compenstation voltage. > + properties: > + regulator-name: > + const: VCOM No, why? Board designers could call it differently. Drop. > + > + VPOSNEG: > + type: object > + $ref: /schemas/regulator/regulator.yaml# > + unevaluatedProperties: false > + description: > + The pair of symmetric LDOs > + properties: > + regulator-name: > + const: VPOSNEG Drop > + > + V3P3: > + type: object > + $ref: /schemas/regulator/regulator.yaml# > + unevaluatedProperties: false > + description: > + The pair of symmetric LDOs > + properties: > + regulator-name: > + const: V3P3 Drop > + > +required: > + - compatible > + - reg > + - '#thermal-sensor-cells' > + - pg-gpios > + - enable-gpios > + > +additionalProperties: false > + > +examples: > + - | > + #include <dt-bindings/gpio/gpio.h> > + i2c { > + #address-cells = <1>; > + #size-cells = <0>; > + > + fp9931: pmic@18 { Drop unused label. > + compatible = "fiti,fp9931"; > + reg = <0x18>; > + pinctrl-names = "default"; > + pinctrl-0 = <&pinctrl_fp9931_gpio>; > + #thermal-sensor-cells = <0>; > + vin-supply = <&epd_pmic_supply>; > + pg-gpios = <&gpio2 7 GPIO_ACTIVE_HIGH>; > + ts-en-gpios = <&gpio2 9 GPIO_ACTIVE_HIGH>; > + enable-gpios = <&gpio2 8 GPIO_ACTIVE_HIGH>; > + fiti,tdly = <2 2 3 3>; > + > + vcom_reg: VCOM { > + regulator-name = "VCOM"; Names are always lowercase. Best regards, Krzysztof ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 2/3] dt-bindings: regulator: Add Fitipower FP9931/JD9930 2025-11-08 12:17 ` Krzysztof Kozlowski @ 2025-11-08 14:21 ` Andreas Kemnade 2025-11-08 14:46 ` Krzysztof Kozlowski 0 siblings, 1 reply; 17+ messages in thread From: Andreas Kemnade @ 2025-11-08 14:21 UTC (permalink / raw) To: Krzysztof Kozlowski Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Liam Girdwood, Mark Brown, Guenter Roeck, devicetree, linux-kernel, linux-hwmon On Sat, 8 Nov 2025 13:17:31 +0100 Krzysztof Kozlowski <krzk@kernel.org> wrote: > On Fri, Nov 07, 2025 at 09:06:45PM +0100, Andreas Kemnade wrote: > > +properties: > > + compatible: > > + oneOf: > > + - const: fiti,fp9931 > > + > > + - items: > > + - const: fiti,jd9930 > > + - const: fiti,fp9931 > > + > > + reg: > > + maxItems: 1 > > + > > + '#thermal-sensor-cells': > > Why is this a thermal zone sensor? Aren't you mixing temperature > reading with soc? For temperature reading you can use hwmon, for > example. > well, I just took the SY7636A as reference. Is there any document describing the terme "thermal zone sensor". I would define a thermal zone as an area with things influencing each other thermically. These things are sensors, heat sources and sinks. Well, the panel typically does not produce much heat. But I do not insist on having that property here. As far as I understand, the hwmon uses this property as an indication to also create a thermal zone sensor. > > + const: 0 > > + > > + enable-gpios: > > + maxItems: 1 > > + > > + pg-gpios: > > + maxItems: 1 > > + > > + ts-en-gpios: > > It's called EN_TS, so en-ts-gpios. > ok > > > + maxItems: 1 > > + > > + xon-gpios: > > That's powerdown-gpios, see gpio-consumer-common. > looking a bit around: powerdown-gpios e.g. in the MCP4801 describe an *input*, which should be connected to an output of the SoC. Looking at the datasheet, I see "XON Open Drain N-MOS On-Resistance" so it is an *output* (same as for PG). So it is something different then the powerdown-gpios in e.g. the MCP4801. So it is a signal coming from the JD9930 after EN goes low in the power down sequence. > > + maxItems: 1 > > + > > + vin-supply: > > + description: > > + Supply for the whole chip. Some vendor kernels and devicetrees > > + declare this as a non-existing GPIO named "pwrall". > > + > > + fiti,tdly: > > No, look at datasheet. What values are there? ms. > Hmm, no to what? I do not understand your comment. So I guess a bit what might be options to discuss here: - put raw value for the bitfield here (what is currently done). - put the ms values here (then I would expect a suffix in the property name) We have the mapping 0ms - 0, 1ms - 1, 2ms - 2, 4ms - 3, so it is not identical. Regards, Andreas ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 2/3] dt-bindings: regulator: Add Fitipower FP9931/JD9930 2025-11-08 14:21 ` Andreas Kemnade @ 2025-11-08 14:46 ` Krzysztof Kozlowski 2025-11-08 16:52 ` Andreas Kemnade 0 siblings, 1 reply; 17+ messages in thread From: Krzysztof Kozlowski @ 2025-11-08 14:46 UTC (permalink / raw) To: Andreas Kemnade Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Liam Girdwood, Mark Brown, Guenter Roeck, devicetree, linux-kernel, linux-hwmon On 08/11/2025 15:21, Andreas Kemnade wrote: > On Sat, 8 Nov 2025 13:17:31 +0100 > Krzysztof Kozlowski <krzk@kernel.org> wrote: > >> On Fri, Nov 07, 2025 at 09:06:45PM +0100, Andreas Kemnade wrote: >>> +properties: >>> + compatible: >>> + oneOf: >>> + - const: fiti,fp9931 >>> + >>> + - items: >>> + - const: fiti,jd9930 >>> + - const: fiti,fp9931 >>> + >>> + reg: >>> + maxItems: 1 >>> + >>> + '#thermal-sensor-cells': >> >> Why is this a thermal zone sensor? Aren't you mixing temperature >> reading with soc? For temperature reading you can use hwmon, for >> example. >> > well, I just took the SY7636A as reference. Is there any document describing > the terme "thermal zone sensor". I would define a thermal zone as an area > with things influencing each other thermically. These things are > sensors, heat sources and sinks. Well, the panel typically does not produce > much heat. > But I do not insist on having that property here. As far as I understand, > the hwmon uses this property as an indication to also create a thermal zone > sensor. That's Linux detail, but anyway you don't need it. This device does not look like a part of thermal zones. > >>> + const: 0 >>> + >>> + enable-gpios: >>> + maxItems: 1 >>> + >>> + pg-gpios: >>> + maxItems: 1 >>> + >>> + ts-en-gpios: >> >> It's called EN_TS, so en-ts-gpios. >> > ok >> >>> + maxItems: 1 >>> + >>> + xon-gpios: >> >> That's powerdown-gpios, see gpio-consumer-common. >> > looking a bit around: powerdown-gpios e.g. in the MCP4801 > describe an *input*, which should be connected to an output of the SoC. > Looking at the datasheet, I see "XON Open Drain N-MOS On-Resistance" so it is > an *output* (same as for PG). So it is something different then the > powerdown-gpios in e.g. the MCP4801. > So it is a signal coming from the JD9930 after EN goes low in the power down > sequence. OK, I just briefly skimmed through datasheet. > >>> + maxItems: 1 >>> + >>> + vin-supply: >>> + description: >>> + Supply for the whole chip. Some vendor kernels and devicetrees >>> + declare this as a non-existing GPIO named "pwrall". >>> + >>> + fiti,tdly: >> >> No, look at datasheet. What values are there? ms. >> > Hmm, no to what? I do not understand your comment. Please use proper units for the field expressed in the property name suffix and possible values (enum). https://github.com/devicetree-org/dt-schema/blob/main/dtschema/schemas/property-units.yaml You also need default. > So I guess a bit what might be options to discuss here: > - put raw value for the bitfield here (what is currently done). > - put the ms values here (then I would expect a suffix in the property name) > We have the mapping 0ms - 0, 1ms - 1, 2ms - 2, 4ms - 3, so it is > not identical. I don't know what has to be identical. You want here 0, 1, 2 or 4 ms. BTW, if you speak about driver complexity, getting register value out of above is absolutely trivial, so not a suitable argument. Best regards, Krzysztof ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 2/3] dt-bindings: regulator: Add Fitipower FP9931/JD9930 2025-11-08 14:46 ` Krzysztof Kozlowski @ 2025-11-08 16:52 ` Andreas Kemnade 2025-11-09 17:13 ` Krzysztof Kozlowski 0 siblings, 1 reply; 17+ messages in thread From: Andreas Kemnade @ 2025-11-08 16:52 UTC (permalink / raw) To: Krzysztof Kozlowski Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Liam Girdwood, Mark Brown, Guenter Roeck, devicetree, linux-kernel, linux-hwmon On Sat, 8 Nov 2025 15:46:01 +0100 Krzysztof Kozlowski <krzk@kernel.org> wrote: > >>> + fiti,tdly: > >> > >> No, look at datasheet. What values are there? ms. > >> > > Hmm, no to what? I do not understand your comment. > > Please use proper units for the field expressed in the property name > suffix and possible values (enum). > https://github.com/devicetree-org/dt-schema/blob/main/dtschema/schemas/property-units.yaml > > You also need default. > > > So I guess a bit what might be options to discuss here: > > - put raw value for the bitfield here (what is currently done). > > - put the ms values here (then I would expect a suffix in the property name) > > We have the mapping 0ms - 0, 1ms - 1, 2ms - 2, 4ms - 3, so it is > > not identical. > I don't know what has to be identical. You want here 0, 1, 2 or 4 ms. > BTW, if you speak about driver complexity, getting register value out of > above is absolutely trivial, so not a suitable argument. Ok, no problem with doing that trivial conversion in the driver. Playing around with dt-binding-check and add enums (and the -ms in a second step): fitipower,tdlys: $ref: /schemas/types.yaml#/definitions/uint32-array description: Power up soft start delay settings tDLY1-4 bitfields in the POWERON_DELAY register default: <0 0 0 0> items: - enum: - 0 - 1 - 2 - 4 - enum: - 0 - 1 - 2 - 4 - enum: - 0 - 1 - 2 - 4 - enum: - 0 - 1 - 2 - 4 dt-binding-check accepts this, including the example. But if I change it to -ms as you requested, I get /home/andi/old-home/andi/kobo/kernel/Documentation/devicetree/bindings/regulator/fitipower,fp9931.yaml: properties:fitipower,tdly-ms: 'anyOf' conditional failed, one must be fixed: 'maxItems' is a required property hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values. '$ref' is not one of ['maxItems', 'description', 'deprecated'] hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values. 'default' is not one of ['maxItems', 'description', 'deprecated'] hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values. 'items' is not one of ['maxItems', 'description', 'deprecated'] hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values. Additional properties are not allowed ('$ref', 'default' were unexpected) hint: Arrays must be described with a combination of minItems/maxItems/items 'items' is not one of ['description', 'deprecated', 'const', 'enum', 'minimum', 'maximum', 'multipleOf', 'default', '$ref', 'oneOf'] '<0 0 0 0>' is not of type 'integer' hint: cell array properties must define how many entries and what the entries are when there is more than one entry. from schema $id: http://devicetree.org/meta-schemas/core.yaml# /home/andi/old-home/andi/kobo/kernel/Documentation/devicetree/bindings/regulator/fitipower,fp9931.yaml: properties:fitipower,tdly-ms: '$ref' should not be valid under {'const': '$ref'} hint: Standard unit suffix properties don't need a type $ref from schema $id: http://devicetree.org/meta-schemas/core.yaml# /home/andi/old-home/andi/kobo/kernel/Documentation/devicetree/bindings/regulator/fitipower,fp9931.yaml: properties:fitipower,tdly-ms: 'anyOf' conditional failed, one must be fixed: 'maxItems' is a required property hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values. '$ref' is not one of ['maxItems', 'description', 'deprecated'] hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values. 'default' is not one of ['maxItems', 'description', 'deprecated'] hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values. 'items' is not one of ['maxItems', 'description', 'deprecated'] hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values. Additional properties are not allowed ('$ref', 'default' were unexpected) hint: Arrays must be described with a combination of minItems/maxItems/items 'items' is not one of ['description', 'deprecated', 'const', 'enum', 'minimum', 'maximum', 'multipleOf', 'default', '$ref', 'oneOf'] '<0 0 0 0>' is not of type 'integer' hint: cell array properties must define how many entries and what the entries are when there is more than one entry. from schema $id: http://devicetree.org/meta-schemas/core.yaml# /home/andi/old-home/andi/kobo/kernel/Documentation/devicetree/bindings/regulator/fitipower,fp9931.yaml: properties:fitipower,tdly-ms: '$ref' should not be valid under {'const': '$ref'} hint: Standard unit suffix properties don't need a type $ref from schema $id: http://devicetree.org/meta-schemas/core.yaml# Leaving out the type $ref does not improve things much. What is going on here? Regards, Andreas ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 2/3] dt-bindings: regulator: Add Fitipower FP9931/JD9930 2025-11-08 16:52 ` Andreas Kemnade @ 2025-11-09 17:13 ` Krzysztof Kozlowski 2025-11-09 21:12 ` Andreas Kemnade 0 siblings, 1 reply; 17+ messages in thread From: Krzysztof Kozlowski @ 2025-11-09 17:13 UTC (permalink / raw) To: Andreas Kemnade Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Liam Girdwood, Mark Brown, Guenter Roeck, devicetree, linux-kernel, linux-hwmon On 08/11/2025 17:52, Andreas Kemnade wrote: > On Sat, 8 Nov 2025 15:46:01 +0100 > Krzysztof Kozlowski <krzk@kernel.org> wrote: > >>>>> + fiti,tdly: >>>> >>>> No, look at datasheet. What values are there? ms. >>>> >>> Hmm, no to what? I do not understand your comment. >> >> Please use proper units for the field expressed in the property name >> suffix and possible values (enum). >> https://github.com/devicetree-org/dt-schema/blob/main/dtschema/schemas/property-units.yaml >> >> You also need default. >> >>> So I guess a bit what might be options to discuss here: >>> - put raw value for the bitfield here (what is currently done). >>> - put the ms values here (then I would expect a suffix in the property name) >>> We have the mapping 0ms - 0, 1ms - 1, 2ms - 2, 4ms - 3, so it is >>> not identical. >> I don't know what has to be identical. You want here 0, 1, 2 or 4 ms. >> BTW, if you speak about driver complexity, getting register value out of >> above is absolutely trivial, so not a suitable argument. > > Ok, no problem with doing that trivial conversion in the driver. > > Playing around with dt-binding-check and add enums (and the -ms in a > second step): > fitipower,tdlys: > $ref: /schemas/types.yaml#/definitions/uint32-array > description: > Power up soft start delay settings tDLY1-4 bitfields in the > POWERON_DELAY register > default: <0 0 0 0> > items: > - enum: > - 0 > - 1 > - 2 > - 4 > - enum: > - 0 > - 1 > - 2 > - 4 > - enum: > - 0 > - 1 > - 2 > - 4 > - enum: > - 0 > - 1 > - 2 > - 4 > > > dt-binding-check accepts this, including the example. But if I change it to -ms > as you requested, I get > > /home/andi/old-home/andi/kobo/kernel/Documentation/devicetree/bindings/regulator/fitipower,fp9931.yaml: properties:fitipower,tdly-ms: 'anyOf' conditional failed, one must be fixed: > 'maxItems' is a required property > hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values. > '$ref' is not one of ['maxItems', 'description', 'deprecated'] > hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values. > 'default' is not one of ['maxItems', 'description', 'deprecated'] > hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values. > 'items' is not one of ['maxItems', 'description', 'deprecated'] > hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values. > Additional properties are not allowed ('$ref', 'default' were unexpected) > hint: Arrays must be described with a combination of minItems/maxItems/items > 'items' is not one of ['description', 'deprecated', 'const', 'enum', 'minimum', 'maximum', 'multipleOf', 'default', '$ref', 'oneOf'] > '<0 0 0 0>' is not of type 'integer' > hint: cell array properties must define how many entries and what the entries are when there is more than one entry. > from schema $id: http://devicetree.org/meta-schemas/core.yaml# > /home/andi/old-home/andi/kobo/kernel/Documentation/devicetree/bindings/regulator/fitipower,fp9931.yaml: properties:fitipower,tdly-ms: '$ref' should not be valid under {'const': '$ref'} > hint: Standard unit suffix properties don't need a type $ref > from schema $id: http://devicetree.org/meta-schemas/core.yaml# > /home/andi/old-home/andi/kobo/kernel/Documentation/devicetree/bindings/regulator/fitipower,fp9931.yaml: properties:fitipower,tdly-ms: 'anyOf' conditional failed, one must be fixed: > 'maxItems' is a required property > hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values. > '$ref' is not one of ['maxItems', 'description', 'deprecated'] > hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values. > 'default' is not one of ['maxItems', 'description', 'deprecated'] > hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values. > 'items' is not one of ['maxItems', 'description', 'deprecated'] > hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values. > Additional properties are not allowed ('$ref', 'default' were unexpected) > hint: Arrays must be described with a combination of minItems/maxItems/items > 'items' is not one of ['description', 'deprecated', 'const', 'enum', 'minimum', 'maximum', 'multipleOf', 'default', '$ref', 'oneOf'] > '<0 0 0 0>' is not of type 'integer' > hint: cell array properties must define how many entries and what the entries are when there is more than one entry. > from schema $id: http://devicetree.org/meta-schemas/core.yaml# > /home/andi/old-home/andi/kobo/kernel/Documentation/devicetree/bindings/regulator/fitipower,fp9931.yaml: properties:fitipower,tdly-ms: '$ref' should not be valid under {'const': '$ref'} > hint: Standard unit suffix properties don't need a type $ref > from schema $id: http://devicetree.org/meta-schemas/core.yaml# You must drop ref. That's the entire point of common unit suffix. > > Leaving out the type $ref does not improve things much. > What is going on here? Please paste the error from correct code, not above. Best regards, Krzysztof ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 2/3] dt-bindings: regulator: Add Fitipower FP9931/JD9930 2025-11-09 17:13 ` Krzysztof Kozlowski @ 2025-11-09 21:12 ` Andreas Kemnade 2025-11-10 7:30 ` Krzysztof Kozlowski 0 siblings, 1 reply; 17+ messages in thread From: Andreas Kemnade @ 2025-11-09 21:12 UTC (permalink / raw) To: Krzysztof Kozlowski Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Liam Girdwood, Mark Brown, Guenter Roeck, devicetree, linux-kernel, linux-hwmon On Sun, 9 Nov 2025 18:13:11 +0100 Krzysztof Kozlowski <krzk@kernel.org> wrote: > On 08/11/2025 17:52, Andreas Kemnade wrote: > > On Sat, 8 Nov 2025 15:46:01 +0100 > > Krzysztof Kozlowski <krzk@kernel.org> wrote: > > > >>>>> + fiti,tdly: > >>>> > >>>> No, look at datasheet. What values are there? ms. > >>>> > >>> Hmm, no to what? I do not understand your comment. > >> > >> Please use proper units for the field expressed in the property name > >> suffix and possible values (enum). > >> https://github.com/devicetree-org/dt-schema/blob/main/dtschema/schemas/property-units.yaml > >> > >> You also need default. > >> > >>> So I guess a bit what might be options to discuss here: > >>> - put raw value for the bitfield here (what is currently done). > >>> - put the ms values here (then I would expect a suffix in the property name) > >>> We have the mapping 0ms - 0, 1ms - 1, 2ms - 2, 4ms - 3, so it is > >>> not identical. > >> I don't know what has to be identical. You want here 0, 1, 2 or 4 ms. > >> BTW, if you speak about driver complexity, getting register value out of > >> above is absolutely trivial, so not a suitable argument. > > > > Ok, no problem with doing that trivial conversion in the driver. > > > > Playing around with dt-binding-check and add enums (and the -ms in a > > second step): > > fitipower,tdlys: > > $ref: /schemas/types.yaml#/definitions/uint32-array > > description: > > Power up soft start delay settings tDLY1-4 bitfields in the > > POWERON_DELAY register > > default: <0 0 0 0> > > items: > > - enum: > > - 0 > > - 1 > > - 2 > > - 4 > > - enum: > > - 0 > > - 1 > > - 2 > > - 4 > > - enum: > > - 0 > > - 1 > > - 2 > > - 4 > > - enum: > > - 0 > > - 1 > > - 2 > > - 4 > > > > > > dt-binding-check accepts this, including the example. But if I change it to -ms > > as you requested, I get > > > > /home/andi/old-home/andi/kobo/kernel/Documentation/devicetree/bindings/regulator/fitipower,fp9931.yaml: properties:fitipower,tdly-ms: 'anyOf' conditional failed, one must be fixed: > > 'maxItems' is a required property > > hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values. > > '$ref' is not one of ['maxItems', 'description', 'deprecated'] > > hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values. > > 'default' is not one of ['maxItems', 'description', 'deprecated'] > > hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values. > > 'items' is not one of ['maxItems', 'description', 'deprecated'] > > hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values. > > Additional properties are not allowed ('$ref', 'default' were unexpected) > > hint: Arrays must be described with a combination of minItems/maxItems/items > > 'items' is not one of ['description', 'deprecated', 'const', 'enum', 'minimum', 'maximum', 'multipleOf', 'default', '$ref', 'oneOf'] > > '<0 0 0 0>' is not of type 'integer' > > hint: cell array properties must define how many entries and what the entries are when there is more than one entry. > > from schema $id: http://devicetree.org/meta-schemas/core.yaml# > > /home/andi/old-home/andi/kobo/kernel/Documentation/devicetree/bindings/regulator/fitipower,fp9931.yaml: properties:fitipower,tdly-ms: '$ref' should not be valid under {'const': '$ref'} > > hint: Standard unit suffix properties don't need a type $ref > > from schema $id: http://devicetree.org/meta-schemas/core.yaml# > > /home/andi/old-home/andi/kobo/kernel/Documentation/devicetree/bindings/regulator/fitipower,fp9931.yaml: properties:fitipower,tdly-ms: 'anyOf' conditional failed, one must be fixed: > > 'maxItems' is a required property > > hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values. > > '$ref' is not one of ['maxItems', 'description', 'deprecated'] > > hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values. > > 'default' is not one of ['maxItems', 'description', 'deprecated'] > > hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values. > > 'items' is not one of ['maxItems', 'description', 'deprecated'] > > hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values. > > Additional properties are not allowed ('$ref', 'default' were unexpected) > > hint: Arrays must be described with a combination of minItems/maxItems/items > > 'items' is not one of ['description', 'deprecated', 'const', 'enum', 'minimum', 'maximum', 'multipleOf', 'default', '$ref', 'oneOf'] > > '<0 0 0 0>' is not of type 'integer' > > hint: cell array properties must define how many entries and what the entries are when there is more than one entry. > > from schema $id: http://devicetree.org/meta-schemas/core.yaml# > > /home/andi/old-home/andi/kobo/kernel/Documentation/devicetree/bindings/regulator/fitipower,fp9931.yaml: properties:fitipower,tdly-ms: '$ref' should not be valid under {'const': '$ref'} > > hint: Standard unit suffix properties don't need a type $ref > > from schema $id: http://devicetree.org/meta-schemas/core.yaml# > > You must drop ref. That's the entire point of common unit suffix. > I tried without it: fitipower,tdly-ms: description: Power up soft start delay settings tDLY1-4 bitfields in the POWERON_DELAY register default: <0 0 0 0> items: - enum: - 0 - 1 - 2 - 4 - enum: - 0 - 1 - 2 - 4 - enum: - 0 - 1 - 2 - 4 - enum: - 0 - 1 - 2 - 4 Errors: CHKDT ./Documentation/devicetree/bindings /home/andi/old-home/andi/kobo/kernel/Documentation/devicetree/bindings/regulator/fitipower,fp9931.yaml: properties:fitipower,tdly-ms: 'anyOf' conditional failed, one must be fixed: 'maxItems' is a required property hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values. 'default' is not one of ['maxItems', 'description', 'deprecated'] hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values. 'items' is not one of ['maxItems', 'description', 'deprecated'] hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values. Additional properties are not allowed ('default' was unexpected) hint: Arrays must be described with a combination of minItems/maxItems/items 'items' is not one of ['description', 'deprecated', 'const', 'enum', 'minimum', 'maximum', 'multipleOf', 'default', '$ref', 'oneOf'] '<0 0 0 0>' is not of type 'integer' hint: cell array properties must define how many entries and what the entries are when there is more than one entry. from schema $id: http://devicetree.org/meta-schemas/core.yaml# /home/andi/old-home/andi/kobo/kernel/Documentation/devicetree/bindings/regulator/fitipower,fp9931.yaml: properties:fitipower,tdly-ms: 'anyOf' conditional failed, one must be fixed: 'maxItems' is a required property hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values. 'default' is not one of ['maxItems', 'description', 'deprecated'] hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values. 'items' is not one of ['maxItems', 'description', 'deprecated'] hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values. Additional properties are not allowed ('default' was unexpected) hint: Arrays must be described with a combination of minItems/maxItems/items 'items' is not one of ['description', 'deprecated', 'const', 'enum', 'minimum', 'maximum', 'multipleOf', 'default', '$ref', 'oneOf'] '<0 0 0 0>' is not of type 'integer' hint: cell array properties must define how many entries and what the entries are when there is more than one entry. from schema $id: http://devicetree.org/meta-schemas/core.yaml# maxItems is required according to error message, so trying with... SCHEMA Documentation/devicetree/bindings/processed-schema.json CHKDT ./Documentation/devicetree/bindings /home/andi/old-home/andi/kobo/kernel/Documentation/devicetree/bindings/regulator/fitipower,fp9931.yaml: properties:fitipower,tdly-ms: {'description': 'Power up soft start delay settings tDLY1-4 bitfields in the POWERON_DELAY register', 'default': '<0 0 0 0>', 'maxItems': 4, 'items': [{'enum': [0, 1, 2, 4]}, {'enum': [0, 1, 2, 4]}, {'enum': [0, 1, 2, 4]}, {'enum': [0, 1, 2, 4]}]} should not be valid under {'required': ['maxItems']} hint: "maxItems" is not needed with an "items" list from schema $id: http://devicetree.org/meta-schemas/items.yaml# /home/andi/old-home/andi/kobo/kernel/Documentation/devicetree/bindings/regulator/fitipower,fp9931.yaml: properties:fitipower,tdly-ms: 'anyOf' conditional failed, one must be fixed: 'default' is not one of ['maxItems', 'description', 'deprecated'] hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values. 'items' is not one of ['maxItems', 'description', 'deprecated'] hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values. Additional properties are not allowed ('default' was unexpected) hint: Arrays must be described with a combination of minItems/maxItems/items 'maxItems' is not one of ['description', 'deprecated', 'const', 'enum', 'minimum', 'maximum', 'multipleOf', 'default', '$ref', 'oneOf'] 'items' is not one of ['description', 'deprecated', 'const', 'enum', 'minimum', 'maximum', 'multipleOf', 'default', '$ref', 'oneOf'] '<0 0 0 0>' is not of type 'integer' 1 was expected hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values. hint: cell array properties must define how many entries and what the entries are when there is more than one entry. from schema $id: http://devicetree.org/meta-schemas/core.yaml# /home/andi/old-home/andi/kobo/kernel/Documentation/devicetree/bindings/regulator/fitipower,fp9931.yaml: properties:fitipower,tdly-ms: 'anyOf' conditional failed, one must be fixed: 'default' is not one of ['maxItems', 'description', 'deprecated'] hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values. 'items' is not one of ['maxItems', 'description', 'deprecated'] hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values. Additional properties are not allowed ('default' was unexpected) hint: Arrays must be described with a combination of minItems/maxItems/items 'maxItems' is not one of ['description', 'deprecated', 'const', 'enum', 'minimum', 'maximum', 'multipleOf', 'default', '$ref', 'oneOf'] 'items' is not one of ['description', 'deprecated', 'const', 'enum', 'minimum', 'maximum', 'multipleOf', 'default', '$ref', 'oneOf'] '<0 0 0 0>' is not of type 'integer' 1 was expected hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values. hint: cell array properties must define how many entries and what the entries are when there is more than one entry. from schema $id: http://devicetree.org/meta-schemas/core.yaml# BTW: before you ask: dt-schema is version 2025.8 removing items and default removes all problems. So working: - fitipower,tdly without -ms suffix - fitipower,tdly-ms without default and items but maxItems. Regards, Andreas ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 2/3] dt-bindings: regulator: Add Fitipower FP9931/JD9930 2025-11-09 21:12 ` Andreas Kemnade @ 2025-11-10 7:30 ` Krzysztof Kozlowski 2025-11-10 12:28 ` Andreas Kemnade 0 siblings, 1 reply; 17+ messages in thread From: Krzysztof Kozlowski @ 2025-11-10 7:30 UTC (permalink / raw) To: Andreas Kemnade Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Liam Girdwood, Mark Brown, Guenter Roeck, devicetree, linux-kernel, linux-hwmon On 09/11/2025 22:12, Andreas Kemnade wrote: >> >> You must drop ref. That's the entire point of common unit suffix. >> > I tried without it: > > fitipower,tdly-ms: > description: > Power up soft start delay settings tDLY1-4 bitfields in the > POWERON_DELAY register > default: <0 0 0 0> Arrays are in [] (see also some examples of arrays in the example-schema). [0, 0, 0, 0] And then it should work, but does not which I think is bug in dtschema. I think it works fine when you drop the "default:" completely, so please do so. I'll take a look at the issue. enum should be in one line, btw. Your patchset has also blank line warnings. Best regards, Krzysztof ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 2/3] dt-bindings: regulator: Add Fitipower FP9931/JD9930 2025-11-10 7:30 ` Krzysztof Kozlowski @ 2025-11-10 12:28 ` Andreas Kemnade 0 siblings, 0 replies; 17+ messages in thread From: Andreas Kemnade @ 2025-11-10 12:28 UTC (permalink / raw) To: Krzysztof Kozlowski Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Liam Girdwood, Mark Brown, Guenter Roeck, devicetree, linux-kernel, linux-hwmon On Mon, 10 Nov 2025 08:30:41 +0100 Krzysztof Kozlowski <krzk@kernel.org> wrote: > On 09/11/2025 22:12, Andreas Kemnade wrote: > >> > >> You must drop ref. That's the entire point of common unit suffix. > >> > > I tried without it: > > > > fitipower,tdly-ms: > > description: > > Power up soft start delay settings tDLY1-4 bitfields in the > > POWERON_DELAY register > > default: <0 0 0 0> > > Arrays are in [] (see also some examples of arrays in the example-schema). > [0, 0, 0, 0] > > And then it should work, but does not which I think is bug in dtschema. > I think it works fine when you drop the "default:" completely, so please > do so. I'll take a look at the issue. > ok, dropping default makes dtschema happy. > enum should be in one line, btw. > > Your patchset has also blank line warnings. I fixed the ones shown by checkpatch.pl --strict are there any more I am missing? Regards, Andreas ^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 3/3] regulator: Add FP9931/JD9930 driver 2025-11-07 20:06 [PATCH 0/3] regulator: Add FP9931/JD9930 Andreas Kemnade 2025-11-07 20:06 ` [PATCH 1/3] dt-bindings: vendor-prefixes: Add Fitipower Andreas Kemnade 2025-11-07 20:06 ` [PATCH 2/3] dt-bindings: regulator: Add Fitipower FP9931/JD9930 Andreas Kemnade @ 2025-11-07 20:06 ` Andreas Kemnade 2025-11-08 12:21 ` Krzysztof Kozlowski ` (2 more replies) 2 siblings, 3 replies; 17+ messages in thread From: Andreas Kemnade @ 2025-11-07 20:06 UTC (permalink / raw) To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Liam Girdwood, Mark Brown, Guenter Roeck Cc: devicetree, linux-kernel, linux-hwmon, Andreas Kemnade Add a driver for the FP9931/JD9930 regulator. Implement handling of the PG (power good), TS_EN (temperature sensor enable), and EN (enable regulators) pins. Implement the pair of symmetric LDOs as a single regulator because they share a single voltage set register. For simplicity, just add the temperature sensor (depending on external NTC) directly. Limitations: - As these regulators are controlled together with the VCOM regulator via the EN pin, some kind of management must be in place. As the enable op is not called when the regulator is already enabled, simple refcounting seems not to work to avoid clearing EN when one regulator is still enabled. As these regulators are typically used together, this limitation should not hurt hard, just provide the is_enabled op. - As the VCOM step is quite odd (5V/255 steps), rounding is needed. Due to some limitations in the regulator core, the max/min voltages in the devicetree must match the idea of the driver how to round things exactly. - Night mode is not implemented, so only the FP9931 compatible is needed in the driver, there is no REGULATOR_MODE_NIGHT and no clear definition in the datasheet what it does, also the XON pin which seems to be an input related to that night mode is not used. Signed-off-by: Andreas Kemnade <andreas@kemnade.info> --- drivers/regulator/Kconfig | 10 + drivers/regulator/Makefile | 1 + drivers/regulator/fp9931.c | 567 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 578 insertions(+) diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig index d84f3d054c59..c817a4cc00c8 100644 --- a/drivers/regulator/Kconfig +++ b/drivers/regulator/Kconfig @@ -500,6 +500,16 @@ config REGULATOR_ISL6271A help This driver supports ISL6271A voltage regulator chip. +config REGULATOR_FP9931 + tristate "FitiPower FP9931/JD9930 EPD regulator" + depends on I2C + select REGMAP_I2C + help + This driver supports the FP9931/JD9930 voltage regulator chip + which is used to provide power to Electronic Paper Displays + so it is found in E-Book readers. + If HWWON is enabled, it also provides temperature measurement. + config REGULATOR_LM363X tristate "TI LM363X voltage regulators" depends on MFD_TI_LMU diff --git a/drivers/regulator/Makefile b/drivers/regulator/Makefile index b3101376029d..98a02c854044 100644 --- a/drivers/regulator/Makefile +++ b/drivers/regulator/Makefile @@ -59,6 +59,7 @@ obj-$(CONFIG_REGULATOR_HI6421V600) += hi6421v600-regulator.o obj-$(CONFIG_REGULATOR_HI655X) += hi655x-regulator.o obj-$(CONFIG_REGULATOR_ISL6271A) += isl6271a-regulator.o obj-$(CONFIG_REGULATOR_ISL9305) += isl9305.o +obj-$(CONFIG_REGULATOR_FP9931) += fp9931.o obj-$(CONFIG_REGULATOR_LM363X) += lm363x-regulator.o obj-$(CONFIG_REGULATOR_LOCHNAGAR) += lochnagar-regulator.o obj-$(CONFIG_REGULATOR_LP3971) += lp3971.o diff --git a/drivers/regulator/fp9931.c b/drivers/regulator/fp9931.c new file mode 100644 index 000000000000..3b6341d4944a --- /dev/null +++ b/drivers/regulator/fp9931.c @@ -0,0 +1,567 @@ +// SPDX-License-Identifier: GPL-2.0-only +// Copyright (C) 2025 Andreas Kemnade + +/* Datasheet: https://www.fitipower.com/dl/file/flXa6hIchVeu0W3K */ + +#include <linux/cleanup.h> +#include <linux/completion.h> +#include <linux/gpio/consumer.h> +#include <linux/i2c.h> +#include <linux/module.h> +#include <linux/mutex.h> +#include <linux/hwmon.h> +#include <linux/pm_runtime.h> +#include <linux/property.h> +#include <linux/regulator/consumer.h> +#include <linux/regulator/driver.h> +#include <linux/regulator/machine.h> +#include <linux/regmap.h> + +#define FP9931_REG_TMST_VALUE 0 +#define FP9931_REG_VCOM_SETTING 1 +#define FP9931_REG_VPOSNEG_SETTING 2 +#define FP9931_REG_PWRON_DELAY 3 +#define FP9931_REG_CONTROL_REG1 11 + +#define PGOOD_TIMEOUT_MSECS 200 + +struct fp9931_data { + struct device *dev; + struct regmap *regmap; + struct regulator *vin_reg; + struct gpio_desc *pgood_gpio; + struct gpio_desc *en_gpio; + struct gpio_desc *ts_en_gpio; + struct completion pgood_completion; + int pgood_irq; +}; + +static const unsigned int VPOSNEG_table[] = { + 7040000, + 7040000, + 7040000, + 7040000, + 7040000, + 7040000, + 7260000, + 7490000, + 7710000, + 7930000, + 8150000, + 8380000, + 8600000, + 8820000, + 9040000, + 9270000, + 9490000, + 9710000, + 9940000, + 10160000, + 10380000, + 10600000, + 10830000, + 11050000, + 11270000, + 11490000, + 11720000, + 11940000, + 12160000, + 12380000, + 12610000, + 12830000, + 13050000, + 13280000, + 13500000, + 13720000, + 13940000, + 14170000, + 14390000, + 14610000, + 14830000, + 15060000, +}; + +static const struct hwmon_channel_info *fp9931_info[] = { + HWMON_CHANNEL_INFO(chip, HWMON_C_REGISTER_TZ), + HWMON_CHANNEL_INFO(temp, HWMON_T_INPUT), + NULL +}; + +static int setup_timings(struct fp9931_data *data) +{ + u32 tdly[4]; + u8 tdlys = 0; + int i; + int ret; + + ret = device_property_count_u32(data->dev, "fiti,tdly"); + if (ret == -EINVAL) /* property is optional */ + return 0; + + if (ret < 0) + return ret; + + if (ret != ARRAY_SIZE(tdly)) { + dev_err(data->dev, "invalid delay specification"); + return -EINVAL; + } + + ret = device_property_read_u32_array(data->dev, "fiti,tdly", tdly, ARRAY_SIZE(tdly)); + if (ret) + return ret; + + for (i = ARRAY_SIZE(tdly) - 1; i >= 0; i--) { + if (tdly[i] > 3) + return -EINVAL; + + tdlys <<= 2; + tdlys |= tdly[i]; + } + + ret = pm_runtime_resume_and_get(data->dev); + if (ret < 0) + return ret; + + ret = regmap_write(data->regmap, FP9931_REG_PWRON_DELAY, tdlys); + pm_runtime_put_autosuspend(data->dev); + + return ret; +} + +static int fp9931_hwmon_read(struct device *dev, enum hwmon_sensor_types type, + u32 attr, int channel, long *temp) +{ + struct fp9931_data *data = dev_get_drvdata(dev); + unsigned int val; + s8 signed_val; + int ret; + + if (attr != hwmon_temp_input) + return -EOPNOTSUPP; + + ret = pm_runtime_resume_and_get(data->dev); + if (ret < 0) + return ret; + + ret = regmap_read(data->regmap, FP9931_REG_TMST_VALUE, &val); + if (ret) + return ret; + + pm_runtime_put_autosuspend(data->dev); + signed_val = (s8)val; + + *temp = signed_val; + *temp = *temp * 1000; + + return 0; +} + +static umode_t fp9931_hwmon_is_visible(const void *data, + enum hwmon_sensor_types type, + u32 attr, int channel) +{ + if (type != hwmon_temp) + return 0; + + if (attr != hwmon_temp_input) + return 0; + + return 0444; +} + +static const struct hwmon_ops fp9931_hwmon_ops = { + .is_visible = fp9931_hwmon_is_visible, + .read = fp9931_hwmon_read, +}; + +static const struct hwmon_chip_info fp9931_chip_info = { + .ops = &fp9931_hwmon_ops, + .info = fp9931_info, +}; + +static int fp9931_runtime_suspend(struct device *dev) +{ + int ret = 0; + struct fp9931_data *data = dev_get_drvdata(dev); + + if (data->ts_en_gpio) + gpiod_set_value_cansleep(data->ts_en_gpio, 0); + + if (data->vin_reg) { + ret = regulator_disable(data->vin_reg); + regcache_mark_dirty(data->regmap); + } + + return ret; +} + +static int fp9931_runtime_resume(struct device *dev) +{ + int ret = 0; + struct fp9931_data *data = dev_get_drvdata(dev); + + if (data->vin_reg) + ret = regulator_enable(data->vin_reg); + + if (ret) + return ret; + + if (data->ts_en_gpio) { + gpiod_set_value_cansleep(data->ts_en_gpio, 1); + /* wait for one ADC conversion to have sane temperature */ + usleep_range(10000, 15000); + } + + ret = regcache_sync(data->regmap); + + return ret; +} + +static bool fp9931_volatile_reg(struct device *dev, unsigned int reg) +{ + return reg == FP9931_REG_TMST_VALUE; +} + +static const struct reg_default fp9931_reg_default = { + .reg = FP9931_REG_VCOM_SETTING, + .def = 0x80, +}; + +static const struct regmap_config regmap_config = { + .reg_bits = 8, + .val_bits = 8, + .max_register = 12, + .cache_type = REGCACHE_FLAT, + .volatile_reg = fp9931_volatile_reg, + .reg_defaults = &fp9931_reg_default, + .num_reg_defaults = 1, +}; + +static void disable_nopm(void *d) +{ + struct fp9931_data *data = d; + + fp9931_runtime_suspend(data->dev); +} + +static int fp9931_v3p3_enable(struct regulator_dev *rdev) +{ + struct fp9931_data *data = rdev_get_drvdata(rdev); + int ret; + + ret = pm_runtime_resume_and_get(data->dev); + if (ret < 0) + return ret; + + ret = regulator_enable_regmap(rdev); + if (ret < 0) + pm_runtime_put_autosuspend(data->dev); + + return ret; +} + +static int fp9931_v3p3_disable(struct regulator_dev *rdev) +{ + struct fp9931_data *data = rdev_get_drvdata(rdev); + int ret; + + ret = regulator_disable_regmap(rdev); + pm_runtime_put_autosuspend(data->dev); + + return ret; +} + +static int fp9931_v3p3_is_enabled(struct regulator_dev *rdev) +{ + struct fp9931_data *data = rdev_get_drvdata(rdev); + int ret; + + if (pm_runtime_status_suspended(data->dev)) + return 0; + + ret = pm_runtime_resume_and_get(data->dev); + if (ret < 0) + return 0; + + ret = regulator_is_enabled_regmap(rdev); + + pm_runtime_put_autosuspend(data->dev); + return ret; +} + +static const struct regulator_ops fp9931_v3p3ops = { + .list_voltage = regulator_list_voltage_linear, + .enable = fp9931_v3p3_enable, + .disable = fp9931_v3p3_disable, + .is_enabled = fp9931_v3p3_is_enabled, +}; + +static int fp9931_check_powergood(struct regulator_dev *rdev) +{ + struct fp9931_data *data = rdev_get_drvdata(rdev); + + if (pm_runtime_status_suspended(data->dev)) + return 0; + + return gpiod_get_value_cansleep(data->pgood_gpio); +} + +static int fp9931_get_voltage_sel(struct regulator_dev *rdev) +{ + struct fp9931_data *data = rdev_get_drvdata(rdev); + int ret; + + ret = pm_runtime_resume_and_get(data->dev); + if (ret < 0) + return ret; + + ret = regulator_get_voltage_sel_regmap(rdev); + pm_runtime_put_autosuspend(data->dev); + + return ret; +} + +static int fp9931_set_voltage_sel(struct regulator_dev *rdev, unsigned int selector) +{ + struct fp9931_data *data = rdev_get_drvdata(rdev); + int ret; + + ret = pm_runtime_resume_and_get(data->dev); + if (ret < 0) + return ret; + + ret = regulator_set_voltage_sel_regmap(rdev, selector); + pm_runtime_put_autosuspend(data->dev); + + return ret; +} + +static irqreturn_t pgood_handler(int irq, void *dev_id) +{ + struct fp9931_data *data = dev_id; + + complete(&data->pgood_completion); + + return IRQ_HANDLED; +} + +static int fp9931_set_enable(struct regulator_dev *rdev) +{ + struct fp9931_data *data = rdev_get_drvdata(rdev); + int ret; + + ret = pm_runtime_resume_and_get(data->dev); + if (ret < 0) + return ret; + + reinit_completion(&data->pgood_completion); + gpiod_set_value_cansleep(data->en_gpio, 1); + dev_dbg(data->dev, "turning on..."); + wait_for_completion_timeout(&data->pgood_completion, + msecs_to_jiffies(PGOOD_TIMEOUT_MSECS)); + dev_dbg(data->dev, "turned on"); + if (gpiod_get_value_cansleep(data->pgood_gpio) != 1) { + pm_runtime_put_autosuspend(data->dev); + return -ETIMEDOUT; + } + + return 0; +} + +static int fp9931_clear_enable(struct regulator_dev *rdev) +{ + struct fp9931_data *data = rdev_get_drvdata(rdev); + + gpiod_set_value_cansleep(data->en_gpio, 0); + pm_runtime_put_autosuspend(data->dev); + return 0; +} + +static const struct regulator_ops fp9931_vcom_ops = { + .list_voltage = regulator_list_voltage_linear, + .map_voltage = regulator_map_voltage_linear, + .enable = fp9931_set_enable, + .disable = fp9931_clear_enable, + .is_enabled = fp9931_check_powergood, + .set_voltage_sel = fp9931_set_voltage_sel, + .get_voltage_sel = fp9931_get_voltage_sel, +}; + +static const struct regulator_ops fp9931_vposneg_ops = { + .list_voltage = regulator_list_voltage_table, + .map_voltage = regulator_map_voltage_ascend, + /* gets enabled by enabling vcom, too */ + .is_enabled = fp9931_check_powergood, + .set_voltage_sel = fp9931_set_voltage_sel, + .get_voltage_sel = fp9931_get_voltage_sel, +}; + +static const struct regulator_desc regulators[] = { + { + .name = "V3P3", + .of_match = of_match_ptr("V3P3"), + .id = 0, + .ops = &fp9931_v3p3ops, + .type = REGULATOR_VOLTAGE, + .owner = THIS_MODULE, + .enable_reg = FP9931_REG_CONTROL_REG1, + .enable_mask = BIT(1), + .of_match = of_match_ptr("v3p3"), + .n_voltages = 1, + .min_uV = 3300000 + }, + { + .name = "VPOSNEG", + .of_match = of_match_ptr("VPOSNEG"), + .id = 1, + .ops = &fp9931_vposneg_ops, + .type = REGULATOR_VOLTAGE, + .owner = THIS_MODULE, + .n_voltages = ARRAY_SIZE(VPOSNEG_table), + .vsel_reg = FP9931_REG_VPOSNEG_SETTING, + .vsel_mask = 0x3F, + .volt_table = VPOSNEG_table, + }, + { + .name = "VCOM", + .of_match = of_match_ptr("VCOM"), + .id = 2, + .ops = &fp9931_vcom_ops, + .type = REGULATOR_VOLTAGE, + .owner = THIS_MODULE, + .n_voltages = 255, + .min_uV = 0, + .uV_step = 5000000 / 255, + .vsel_reg = FP9931_REG_VCOM_SETTING, + .vsel_mask = 0xFF + }, +}; + +static int fp9931_probe(struct i2c_client *client) +{ + struct fp9931_data *data; + struct regulator_config config = { }; + struct regulator_dev *rdev; + int ret = 0; + int i; + + data = devm_kzalloc(&client->dev, sizeof(struct fp9931_data), GFP_KERNEL); + data->regmap = devm_regmap_init_i2c(client, ®map_config); + if (IS_ERR(data->regmap)) + return dev_err_probe(&client->dev, PTR_ERR(data->regmap), + "failed to allocate regmap!\n"); + + data->vin_reg = devm_regulator_get_optional(&client->dev, "vin"); + if (IS_ERR(data->vin_reg)) + return dev_err_probe(&client->dev, PTR_ERR(data->vin_reg), + "failid to get vin regulator\n"); + + data->pgood_gpio = devm_gpiod_get(&client->dev, "pg", + GPIOD_IN); + if (IS_ERR(data->pgood_gpio)) + return dev_err_probe(&client->dev, + PTR_ERR(data->pgood_gpio), + "failed to get power good gpio\n"); + + data->pgood_irq = gpiod_to_irq(data->pgood_gpio); + if (data->pgood_irq < 0) + return data->pgood_irq; + + data->en_gpio = devm_gpiod_get(&client->dev, "enable", GPIOD_OUT_LOW); + if (IS_ERR(data->en_gpio)) + return dev_err_probe(&client->dev, + PTR_ERR(data->en_gpio), + "failed to get en gpio\n"); + + data->ts_en_gpio = devm_gpiod_get_optional(&client->dev, "ts-en", GPIOD_OUT_LOW); + if (IS_ERR(data->ts_en_gpio)) + return dev_err_probe(&client->dev, + PTR_ERR(data->ts_en_gpio), + "failed to get en gpio\n"); + + data->dev = &client->dev; + i2c_set_clientdata(client, data); + + init_completion(&data->pgood_completion); + + ret = devm_request_threaded_irq(&client->dev, data->pgood_irq, NULL, + pgood_handler, + IRQF_TRIGGER_RISING | IRQF_ONESHOT, + "PGOOD", data); + if (ret) + return dev_err_probe(&client->dev, ret, + "failed to request irq\n"); + + if (IS_ENABLED(CONFIG_PM)) { + devm_pm_runtime_enable(&client->dev); + pm_runtime_set_autosuspend_delay(&client->dev, 4000); + pm_runtime_use_autosuspend(&client->dev); + } else { + ret = fp9931_runtime_resume(&client->dev); + if (ret < 0) + return ret; + + devm_add_action_or_reset(&client->dev, disable_nopm, data); + } + + ret = setup_timings(data); + if (ret) + return dev_err_probe(&client->dev, ret, "failed to setup timings\n"); + + config.driver_data = data; + config.dev = &client->dev; + config.regmap = data->regmap; + + for (i = 0; i < ARRAY_SIZE(regulators); i++) { + rdev = devm_regulator_register(&client->dev, + ®ulators[i], + &config); + if (IS_ERR(rdev)) + return dev_err_probe(&client->dev, PTR_ERR(rdev), + "failed to register %s regulator\n", + regulators[i].name); + } + + if (IS_REACHABLE(CONFIG_HWMON)) { + struct device *hwmon_dev; + + hwmon_dev = devm_hwmon_device_register_with_info(&client->dev, "fp9931", data, + &fp9931_chip_info, NULL); + if (IS_ERR(hwmon_dev)) + dev_err(&client->dev, "failed to register hwmon\n"); + } + + return 0; +} + +static const struct dev_pm_ops fp9931_pm_ops = { + SET_RUNTIME_PM_OPS(fp9931_runtime_suspend, fp9931_runtime_resume, NULL) +}; + +static const struct of_device_id fp9931_dt_ids[] = { + { + .compatible = "fiti,fp9931", + }, { + .compatible = "fiti,fp9931", /* no night mode */ + }, { + /* sentinel */ + } +}; +MODULE_DEVICE_TABLE(of, fp9931_dt_ids); + +static struct i2c_driver fp9931_i2c_driver = { + .driver = { + .name = "fp9931", + .owner = THIS_MODULE, + .of_match_table = fp9931_dt_ids, + .pm = (&fp9931_pm_ops), + }, + .probe = fp9931_probe, +}; + +module_i2c_driver(fp9931_i2c_driver); + +/* Module information */ +MODULE_DESCRIPTION("FP9931 regulator driver"); +MODULE_LICENSE("GPL"); + -- 2.47.3 ^ permalink raw reply related [flat|nested] 17+ messages in thread
* Re: [PATCH 3/3] regulator: Add FP9931/JD9930 driver 2025-11-07 20:06 ` [PATCH 3/3] regulator: Add FP9931/JD9930 driver Andreas Kemnade @ 2025-11-08 12:21 ` Krzysztof Kozlowski 2025-11-08 23:03 ` Andreas Kemnade 2025-11-10 3:31 ` kernel test robot 2025-11-10 11:29 ` kernel test robot 2 siblings, 1 reply; 17+ messages in thread From: Krzysztof Kozlowski @ 2025-11-08 12:21 UTC (permalink / raw) To: Andreas Kemnade Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Liam Girdwood, Mark Brown, Guenter Roeck, devicetree, linux-kernel, linux-hwmon On Fri, Nov 07, 2025 at 09:06:46PM +0100, Andreas Kemnade wrote: > + > +static int fp9931_probe(struct i2c_client *client) > +{ > + struct fp9931_data *data; > + struct regulator_config config = { }; > + struct regulator_dev *rdev; > + int ret = 0; > + int i; > + > + data = devm_kzalloc(&client->dev, sizeof(struct fp9931_data), GFP_KERNEL); sizeof(*) > + data->regmap = devm_regmap_init_i2c(client, ®map_config); > + if (IS_ERR(data->regmap)) > + return dev_err_probe(&client->dev, PTR_ERR(data->regmap), > + "failed to allocate regmap!\n"); > + > + data->vin_reg = devm_regulator_get_optional(&client->dev, "vin"); > + if (IS_ERR(data->vin_reg)) > + return dev_err_probe(&client->dev, PTR_ERR(data->vin_reg), > + "failid to get vin regulator\n"); > + > + data->pgood_gpio = devm_gpiod_get(&client->dev, "pg", > + GPIOD_IN); Please wrap at 80, not 60. See Linux coding style. > + if (IS_ERR(data->pgood_gpio)) > + return dev_err_probe(&client->dev, > + PTR_ERR(data->pgood_gpio), > + "failed to get power good gpio\n"); > + > + data->pgood_irq = gpiod_to_irq(data->pgood_gpio); > + if (data->pgood_irq < 0) > + return data->pgood_irq; > + > + data->en_gpio = devm_gpiod_get(&client->dev, "enable", GPIOD_OUT_LOW); > + if (IS_ERR(data->en_gpio)) > + return dev_err_probe(&client->dev, > + PTR_ERR(data->en_gpio), No need to break line. > + "failed to get en gpio\n"); > + > + data->ts_en_gpio = devm_gpiod_get_optional(&client->dev, "ts-en", GPIOD_OUT_LOW); > + if (IS_ERR(data->ts_en_gpio)) > + return dev_err_probe(&client->dev, > + PTR_ERR(data->ts_en_gpio), > + "failed to get en gpio\n"); > + > + data->dev = &client->dev; > + i2c_set_clientdata(client, data); > + > + init_completion(&data->pgood_completion); > + > + ret = devm_request_threaded_irq(&client->dev, data->pgood_irq, NULL, > + pgood_handler, > + IRQF_TRIGGER_RISING | IRQF_ONESHOT, > + "PGOOD", data); > + if (ret) > + return dev_err_probe(&client->dev, ret, > + "failed to request irq\n"); > + > + if (IS_ENABLED(CONFIG_PM)) { > + devm_pm_runtime_enable(&client->dev); > + pm_runtime_set_autosuspend_delay(&client->dev, 4000); > + pm_runtime_use_autosuspend(&client->dev); > + } else { > + ret = fp9931_runtime_resume(&client->dev); > + if (ret < 0) > + return ret; > + > + devm_add_action_or_reset(&client->dev, disable_nopm, data); > + } > + > + ret = setup_timings(data); > + if (ret) > + return dev_err_probe(&client->dev, ret, "failed to setup timings\n"); > + > + config.driver_data = data; > + config.dev = &client->dev; > + config.regmap = data->regmap; > + > + for (i = 0; i < ARRAY_SIZE(regulators); i++) { > + rdev = devm_regulator_register(&client->dev, > + ®ulators[i], > + &config); Please wrap according to Linux coding style. > + if (IS_ERR(rdev)) > + return dev_err_probe(&client->dev, PTR_ERR(rdev), > + "failed to register %s regulator\n", > + regulators[i].name); > + } > + > + if (IS_REACHABLE(CONFIG_HWMON)) { > + struct device *hwmon_dev; > + > + hwmon_dev = devm_hwmon_device_register_with_info(&client->dev, "fp9931", data, > + &fp9931_chip_info, NULL); So you use hwmon, then why binding said this is a thermal zone sensor? > + if (IS_ERR(hwmon_dev)) > + dev_err(&client->dev, "failed to register hwmon\n"); > + } > + > + return 0; > +} > + > +static const struct dev_pm_ops fp9931_pm_ops = { > + SET_RUNTIME_PM_OPS(fp9931_runtime_suspend, fp9931_runtime_resume, NULL) > +}; > + > +static const struct of_device_id fp9931_dt_ids[] = { > + { > + .compatible = "fiti,fp9931", > + }, { > + .compatible = "fiti,fp9931", /* no night mode */ Drop, it's the same compatible. > + }, { > + /* sentinel */ > + } > +}; > +MODULE_DEVICE_TABLE(of, fp9931_dt_ids); > + > +static struct i2c_driver fp9931_i2c_driver = { > + .driver = { > + .name = "fp9931", > + .owner = THIS_MODULE, Please do not send us 12 year old code... Drop and runstandard tools (smatch, sparse, cocci) at minimum. > + .of_match_table = fp9931_dt_ids, > + .pm = (&fp9931_pm_ops), No need for () Best regards, Krzysztof ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 3/3] regulator: Add FP9931/JD9930 driver 2025-11-08 12:21 ` Krzysztof Kozlowski @ 2025-11-08 23:03 ` Andreas Kemnade 0 siblings, 0 replies; 17+ messages in thread From: Andreas Kemnade @ 2025-11-08 23:03 UTC (permalink / raw) To: Krzysztof Kozlowski Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Liam Girdwood, Mark Brown, Guenter Roeck, devicetree, linux-kernel, linux-hwmon On Sat, 8 Nov 2025 13:21:57 +0100 Krzysztof Kozlowski <krzk@kernel.org> wrote: > > +static struct i2c_driver fp9931_i2c_driver = { > > + .driver = { > > + .name = "fp9931", > > + .owner = THIS_MODULE, > > Please do not send us 12 year old code... Drop and runstandard tools > (smatch, sparse, cocci) at minimum. Yes, .owner gets handled automatically. And it should be detected by cocci. To me it sounds like you are saying I would dig out 12 year old code somewhere and send it totally unmodernized and unchecked. As a device tree maintainer, you must have seen that I am using the newer unified device property API and also other newer stuff and e.g. no pm_runtime_mark_last_busy(). So just to make it clear to other maintainers what they are dealing with, most of the stuff is new. Most.. So the only exception might be the i2c_driver struct which was copied/modified from an out-of-tree jd9930 driver including that strange night mode. But nothing more, the rest is a rewrite. Regards, Andreas ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 3/3] regulator: Add FP9931/JD9930 driver 2025-11-07 20:06 ` [PATCH 3/3] regulator: Add FP9931/JD9930 driver Andreas Kemnade 2025-11-08 12:21 ` Krzysztof Kozlowski @ 2025-11-10 3:31 ` kernel test robot 2025-11-10 11:29 ` kernel test robot 2 siblings, 0 replies; 17+ messages in thread From: kernel test robot @ 2025-11-10 3:31 UTC (permalink / raw) To: Andreas Kemnade, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Liam Girdwood, Mark Brown, Guenter Roeck Cc: oe-kbuild-all, devicetree, linux-kernel, linux-hwmon, Andreas Kemnade Hi Andreas, kernel test robot noticed the following build warnings: [auto build test WARNING on dcb6fa37fd7bc9c3d2b066329b0d27dedf8becaa] url: https://github.com/intel-lab-lkp/linux/commits/Andreas-Kemnade/dt-bindings-vendor-prefixes-Add-Fitipower/20251108-040835 base: dcb6fa37fd7bc9c3d2b066329b0d27dedf8becaa patch link: https://lore.kernel.org/r/20251107-fp9931-submit-v1-3-aa7b79d9abb6%40kemnade.info patch subject: [PATCH 3/3] regulator: Add FP9931/JD9930 driver config: mips-randconfig-r134-20251110 (https://download.01.org/0day-ci/archive/20251110/202511101159.tlofg0Nn-lkp@intel.com/config) compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project 93d445cba39f4dd3dcda4fa1433eca825cf8fc09) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251110/202511101159.tlofg0Nn-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202511101159.tlofg0Nn-lkp@intel.com/ sparse warnings: (new ones prefixed by >>) >> drivers/regulator/fp9931.c:402:18: sparse: sparse: Initializer entry defined twice drivers/regulator/fp9931.c:409:18: sparse: also defined here vim +402 drivers/regulator/fp9931.c 398 399 static const struct regulator_desc regulators[] = { 400 { 401 .name = "V3P3", > 402 .of_match = of_match_ptr("V3P3"), 403 .id = 0, 404 .ops = &fp9931_v3p3ops, 405 .type = REGULATOR_VOLTAGE, 406 .owner = THIS_MODULE, 407 .enable_reg = FP9931_REG_CONTROL_REG1, 408 .enable_mask = BIT(1), 409 .of_match = of_match_ptr("v3p3"), 410 .n_voltages = 1, 411 .min_uV = 3300000 412 }, 413 { 414 .name = "VPOSNEG", 415 .of_match = of_match_ptr("VPOSNEG"), 416 .id = 1, 417 .ops = &fp9931_vposneg_ops, 418 .type = REGULATOR_VOLTAGE, 419 .owner = THIS_MODULE, 420 .n_voltages = ARRAY_SIZE(VPOSNEG_table), 421 .vsel_reg = FP9931_REG_VPOSNEG_SETTING, 422 .vsel_mask = 0x3F, 423 .volt_table = VPOSNEG_table, 424 }, 425 { 426 .name = "VCOM", 427 .of_match = of_match_ptr("VCOM"), 428 .id = 2, 429 .ops = &fp9931_vcom_ops, 430 .type = REGULATOR_VOLTAGE, 431 .owner = THIS_MODULE, 432 .n_voltages = 255, 433 .min_uV = 0, 434 .uV_step = 5000000 / 255, 435 .vsel_reg = FP9931_REG_VCOM_SETTING, 436 .vsel_mask = 0xFF 437 }, 438 }; 439 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki ^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH 3/3] regulator: Add FP9931/JD9930 driver 2025-11-07 20:06 ` [PATCH 3/3] regulator: Add FP9931/JD9930 driver Andreas Kemnade 2025-11-08 12:21 ` Krzysztof Kozlowski 2025-11-10 3:31 ` kernel test robot @ 2025-11-10 11:29 ` kernel test robot 2 siblings, 0 replies; 17+ messages in thread From: kernel test robot @ 2025-11-10 11:29 UTC (permalink / raw) To: Andreas Kemnade, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Liam Girdwood, Mark Brown, Guenter Roeck Cc: oe-kbuild-all, devicetree, linux-kernel, linux-hwmon, Andreas Kemnade Hi Andreas, kernel test robot noticed the following build warnings: [auto build test WARNING on dcb6fa37fd7bc9c3d2b066329b0d27dedf8becaa] url: https://github.com/intel-lab-lkp/linux/commits/Andreas-Kemnade/dt-bindings-vendor-prefixes-Add-Fitipower/20251108-040835 base: dcb6fa37fd7bc9c3d2b066329b0d27dedf8becaa patch link: https://lore.kernel.org/r/20251107-fp9931-submit-v1-3-aa7b79d9abb6%40kemnade.info patch subject: [PATCH 3/3] regulator: Add FP9931/JD9930 driver config: mips-randconfig-r134-20251110 (https://download.01.org/0day-ci/archive/20251110/202511101911.sdETGGNC-lkp@intel.com/config) compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project 93d445cba39f4dd3dcda4fa1433eca825cf8fc09) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251110/202511101911.sdETGGNC-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202511101911.sdETGGNC-lkp@intel.com/ sparse warnings: (new ones prefixed by >>) >> drivers/regulator/fp9931.c:402:18: sparse: sparse: Initializer entry defined twice drivers/regulator/fp9931.c:409:18: sparse: also defined here vim +402 drivers/regulator/fp9931.c 398 399 static const struct regulator_desc regulators[] = { 400 { 401 .name = "V3P3", > 402 .of_match = of_match_ptr("V3P3"), 403 .id = 0, 404 .ops = &fp9931_v3p3ops, 405 .type = REGULATOR_VOLTAGE, 406 .owner = THIS_MODULE, 407 .enable_reg = FP9931_REG_CONTROL_REG1, 408 .enable_mask = BIT(1), 409 .of_match = of_match_ptr("v3p3"), 410 .n_voltages = 1, 411 .min_uV = 3300000 412 }, 413 { 414 .name = "VPOSNEG", 415 .of_match = of_match_ptr("VPOSNEG"), 416 .id = 1, 417 .ops = &fp9931_vposneg_ops, 418 .type = REGULATOR_VOLTAGE, 419 .owner = THIS_MODULE, 420 .n_voltages = ARRAY_SIZE(VPOSNEG_table), 421 .vsel_reg = FP9931_REG_VPOSNEG_SETTING, 422 .vsel_mask = 0x3F, 423 .volt_table = VPOSNEG_table, 424 }, 425 { 426 .name = "VCOM", 427 .of_match = of_match_ptr("VCOM"), 428 .id = 2, 429 .ops = &fp9931_vcom_ops, 430 .type = REGULATOR_VOLTAGE, 431 .owner = THIS_MODULE, 432 .n_voltages = 255, 433 .min_uV = 0, 434 .uV_step = 5000000 / 255, 435 .vsel_reg = FP9931_REG_VCOM_SETTING, 436 .vsel_mask = 0xFF 437 }, 438 }; 439 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki ^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2025-11-10 12:28 UTC | newest] Thread overview: 17+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2025-11-07 20:06 [PATCH 0/3] regulator: Add FP9931/JD9930 Andreas Kemnade 2025-11-07 20:06 ` [PATCH 1/3] dt-bindings: vendor-prefixes: Add Fitipower Andreas Kemnade 2025-11-08 12:10 ` Krzysztof Kozlowski 2025-11-07 20:06 ` [PATCH 2/3] dt-bindings: regulator: Add Fitipower FP9931/JD9930 Andreas Kemnade 2025-11-08 12:17 ` Krzysztof Kozlowski 2025-11-08 14:21 ` Andreas Kemnade 2025-11-08 14:46 ` Krzysztof Kozlowski 2025-11-08 16:52 ` Andreas Kemnade 2025-11-09 17:13 ` Krzysztof Kozlowski 2025-11-09 21:12 ` Andreas Kemnade 2025-11-10 7:30 ` Krzysztof Kozlowski 2025-11-10 12:28 ` Andreas Kemnade 2025-11-07 20:06 ` [PATCH 3/3] regulator: Add FP9931/JD9930 driver Andreas Kemnade 2025-11-08 12:21 ` Krzysztof Kozlowski 2025-11-08 23:03 ` Andreas Kemnade 2025-11-10 3:31 ` kernel test robot 2025-11-10 11:29 ` kernel test robot
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).