* [PATCH v2 00/10] Support ROHM BD96801 Scalable PMIC
@ 2024-05-24 8:15 Matti Vaittinen
2024-05-24 8:16 ` [PATCH v2 01/10] dt-bindings: ROHM BD96801 PMIC regulators Matti Vaittinen
2024-05-24 8:17 ` [PATCH v2 02/10] dt-bindings: mfd: bd96801 PMIC core Matti Vaittinen
0 siblings, 2 replies; 5+ messages in thread
From: Matti Vaittinen @ 2024-05-24 8:15 UTC (permalink / raw)
To: Matti Vaittinen, Matti Vaittinen
Cc: Rob Herring, Matti Vaittinen, Krzysztof Kozlowski,
Wim Van Sebroeck, devicetree, Lee Jones, linux-kernel,
Conor Dooley, Guenter Roeck, Mark Brown, linux-watchdog,
Greg Kroah-Hartman, Liam Girdwood, Rafael J. Wysocki,
Thomas Gleixner
[-- Attachment #1: Type: text/plain, Size: 5219 bytes --]
Support ROHM BD96801 Scalable PMIC
The ROHM BD96801 is automotive grade PMIC, intended to be usable in
multiple solutions. The BD96801 can be used as a stand-alone, or together
with separate 'companion PMICs'. This modular approach aims to make this
PMIC suitable for various use-cases.
This series brings only limited support. The more complete set of
features was sent in the RFC:
https://lore.kernel.org/lkml/cover.1712058690.git.mazziesaccount@gmail.com/
The BD96801 provides two physical IRQ lines called "intb" and "errb" in
the data-sheet. These are handled using own regmap-IRQ controller for
both of the IRQ lines. This causes a debugFS naming conflict for IRQ
domains created by the regmap-IRQ. This series adds support for setting
a name suffix to IRQ domains. Some prior discussion can be seen here:
https://lore.kernel.org/all/Zjzt8mOW6dO_7XNV@finisterre.sirena.org.uk/
As writing of this there is no known system doing configurations which
require the PMIC to be in STBY state using Linux driver. Furthermore,
ensuring the PMIC is and stays in the STBY state when configurations
are done may not be trivial. Especially, not in a generic way in a
regulator driver. This is likely to be system specific.
Hence it felt natural to upstream only partial support for
now, while leaving a note about the RFC series with more complete
support for those who may need it later.
The patches from 1 to 6 are just typical "add support for device X"
stuff. They should provide very much usable driver for BD96801 and I
hope they don't cause too many questions and can be merged when
quality seems high enough :)
Supporting the ERRB IRQ (patches 9 and 10) requires the regmap IRQ change
(patch 8) which further requires the IRQ domain change (patch 7).
Patches 7 and 8 may need more careful thinking. Thus, the ERRB IRQ
support is added as a separate step, which can be merged later or even
dropped if the irqdomain changes prove to be unacceptable.
Revision history still tries to summarize changes from the RFC for the
reviewers.
Revision history:
v1 => v2:
- Add support for setting a name suffix for fwnode backed IRQ domains.
- Add support for setting a domain name suffix for regmap-IRQ.
- Add handling of ERRB IRQs.
- Small fixes based on feedback.
RFCv2 => v1:
- Drop ERRB IRQ from drivers (but not DT bindings).
- Drop configuration which requires STBY - state.
- Fix the register lock race by moving it from the regulator
driver to the MFD driver.
RFCv1 => RFCv2:
- Tidying code based on feedback form Krzysztof Kozlowski and
Lee Jones.
- Documented undocumented watchdog related DT properties.
- Added usage of the watchdog IRQ.
- Use irq_domain_update_bus_token() to work-around debugFS name
collision for IRQ domains.
---
Matti Vaittinen (10):
dt-bindings: ROHM BD96801 PMIC regulators
dt-bindings: mfd: bd96801 PMIC core
mfd: support ROHM BD96801 PMIC core
regulator: bd96801: ROHM BD96801 PMIC regulators
watchdog: ROHM BD96801 PMIC WDG driver
MAINTAINERS: Add ROHM BD96801 'scalable PMIC' entries
irqdomain: Allow giving name suffix for domain
regmap: Allow setting IRQ domain name suffix
mfd: bd96801: Add ERRB IRQ
regulator: bd96801: Add ERRB IRQ
.../bindings/mfd/rohm,bd96801-pmic.yaml | 173 +++
.../regulator/rohm,bd96801-regulator.yaml | 63 ++
MAINTAINERS | 4 +
drivers/base/regmap/regmap-irq.c | 13 +-
drivers/mfd/Kconfig | 13 +
drivers/mfd/Makefile | 1 +
drivers/mfd/rohm-bd96801.c | 488 ++++++++
drivers/regulator/Kconfig | 12 +
drivers/regulator/Makefile | 2 +
drivers/regulator/bd96801-regulator.c | 1008 +++++++++++++++++
drivers/watchdog/Kconfig | 13 +
drivers/watchdog/Makefile | 1 +
drivers/watchdog/bd96801_wdt.c | 416 +++++++
include/linux/irqdomain.h | 28 +-
include/linux/mfd/rohm-bd96801.h | 215 ++++
include/linux/mfd/rohm-generic.h | 1 +
include/linux/regmap.h | 4 +
kernel/irq/irqdomain.c | 53 +-
18 files changed, 2487 insertions(+), 21 deletions(-)
create mode 100644 Documentation/devicetree/bindings/mfd/rohm,bd96801-pmic.yaml
create mode 100644 Documentation/devicetree/bindings/regulator/rohm,bd96801-regulator.yaml
create mode 100644 drivers/mfd/rohm-bd96801.c
create mode 100644 drivers/regulator/bd96801-regulator.c
create mode 100644 drivers/watchdog/bd96801_wdt.c
create mode 100644 include/linux/mfd/rohm-bd96801.h
base-commit: 4cece764965020c22cff7665b18a012006359095
--
2.45.1
--
Matti Vaittinen, Linux device drivers
ROHM Semiconductors, Finland SWDC
Kiviharjunlenkki 1E
90220 OULU
FINLAND
~~~ "I don't think so," said Rene Descartes. Just then he vanished ~~~
Simon says - in Latin please.
~~~ "non cogito me" dixit Rene Descarte, deinde evanescavit ~~~
Thanks to Simon Glass for the translation =]
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2 01/10] dt-bindings: ROHM BD96801 PMIC regulators
2024-05-24 8:15 [PATCH v2 00/10] Support ROHM BD96801 Scalable PMIC Matti Vaittinen
@ 2024-05-24 8:16 ` Matti Vaittinen
2024-05-25 18:39 ` Krzysztof Kozlowski
2024-05-24 8:17 ` [PATCH v2 02/10] dt-bindings: mfd: bd96801 PMIC core Matti Vaittinen
1 sibling, 1 reply; 5+ messages in thread
From: Matti Vaittinen @ 2024-05-24 8:16 UTC (permalink / raw)
To: Matti Vaittinen, Matti Vaittinen
Cc: Lee Jones, Liam Girdwood, Mark Brown, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Matti Vaittinen, linux-kernel,
devicetree
[-- Attachment #1: Type: text/plain, Size: 3254 bytes --]
ROHM BD96801 is a highly configurable automotive grade PMIC. Introduce
DT bindings for the BD96801 regulators.
Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
---
v1 => v2:
- use lowercase node names in example
- drop unnecessary '|' from description
RFCv2 => v1
- Drop regulator-name pattern requirement
- do not require regulator-name
---
.../regulator/rohm,bd96801-regulator.yaml | 63 +++++++++++++++++++
1 file changed, 63 insertions(+)
create mode 100644 Documentation/devicetree/bindings/regulator/rohm,bd96801-regulator.yaml
diff --git a/Documentation/devicetree/bindings/regulator/rohm,bd96801-regulator.yaml b/Documentation/devicetree/bindings/regulator/rohm,bd96801-regulator.yaml
new file mode 100644
index 000000000000..b3d2d7d583ce
--- /dev/null
+++ b/Documentation/devicetree/bindings/regulator/rohm,bd96801-regulator.yaml
@@ -0,0 +1,63 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/regulator/rohm,bd96801-regulator.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: ROHM BD96801 Power Management Integrated Circuit regulators
+
+maintainers:
+ - Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
+
+description:
+ This module is part of the ROHM BD96801 MFD device. For more details
+ see Documentation/devicetree/bindings/mfd/rohm,bd96801-pmic.yaml.
+
+ The regulator controller is represented as a sub-node of the PMIC node
+ on the device tree.
+
+ Regulator nodes should be named to buck_<number> and ldo_<number>.
+ The valid names for BD96801 regulator nodes are
+ buck1, buck2, buck3, buck4, ldo5, ldo6, ldo7
+
+patternProperties:
+ "^ldo[5-7]$":
+ type: object
+ description:
+ Properties for single LDO regulator.
+ $ref: regulator.yaml#
+
+ properties:
+ rohm,initial-voltage-microvolt:
+ description:
+ Initial voltage for regulator. Voltage can be tuned +/-150 mV from
+ this value. NOTE, This can be modified via I2C only when PMIC is in
+ STBY state.
+ minimum: 300000
+ maximum: 3300000
+
+ unevaluatedProperties: false
+
+ "^buck[1-4]$":
+ type: object
+ description:
+ Properties for single BUCK regulator.
+ $ref: regulator.yaml#
+
+ properties:
+ rohm,initial-voltage-microvolt:
+ description:
+ Initial voltage for regulator. Voltage can be tuned +/-150 mV from
+ this value. NOTE, This can be modified via I2C only when PMIC is in
+ STBY state.
+ minimum: 500000
+ maximum: 3300000
+
+ rohm,keep-on-stby:
+ description:
+ Keep the regulator powered when PMIC transitions to STBY state.
+ type: boolean
+
+ unevaluatedProperties: false
+
+additionalProperties: false
--
2.45.1
--
Matti Vaittinen, Linux device drivers
ROHM Semiconductors, Finland SWDC
Kiviharjunlenkki 1E
90220 OULU
FINLAND
~~~ "I don't think so," said Rene Descartes. Just then he vanished ~~~
Simon says - in Latin please.
~~~ "non cogito me" dixit Rene Descarte, deinde evanescavit ~~~
Thanks to Simon Glass for the translation =]
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v2 02/10] dt-bindings: mfd: bd96801 PMIC core
2024-05-24 8:15 [PATCH v2 00/10] Support ROHM BD96801 Scalable PMIC Matti Vaittinen
2024-05-24 8:16 ` [PATCH v2 01/10] dt-bindings: ROHM BD96801 PMIC regulators Matti Vaittinen
@ 2024-05-24 8:17 ` Matti Vaittinen
2024-05-25 18:58 ` Krzysztof Kozlowski
1 sibling, 1 reply; 5+ messages in thread
From: Matti Vaittinen @ 2024-05-24 8:17 UTC (permalink / raw)
To: Matti Vaittinen, Matti Vaittinen
Cc: Lee Jones, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Matti Vaittinen, Mark Brown, devicetree, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 7827 bytes --]
ROHM BD96801 is a highly configurable automotive grade PMIC. Introduce
DT bindings for the BD96801 core.
Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
---
Revision history:
v1 => v2:
- use lowercase node names in example
- minor addition to ERRB use-cases
RFCv2 => v1
- minor cleaning
- add timeout-sec
RFCv1 => RFCv2:
- Document rohm,hw-timeout-ms
- Document rohm,wdg-action
---
.../bindings/mfd/rohm,bd96801-pmic.yaml | 173 ++++++++++++++++++
1 file changed, 173 insertions(+)
create mode 100644 Documentation/devicetree/bindings/mfd/rohm,bd96801-pmic.yaml
diff --git a/Documentation/devicetree/bindings/mfd/rohm,bd96801-pmic.yaml b/Documentation/devicetree/bindings/mfd/rohm,bd96801-pmic.yaml
new file mode 100644
index 000000000000..d381125a0a15
--- /dev/null
+++ b/Documentation/devicetree/bindings/mfd/rohm,bd96801-pmic.yaml
@@ -0,0 +1,173 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mfd/rohm,bd96801-pmic.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: ROHM BD96801 Scalable Power Management Integrated Circuit
+
+maintainers:
+ - Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
+
+description:
+ BD96801 is an automotive grade single-chip power management IC.
+ It integrates 4 buck converters and 3 LDOs with safety features like
+ over-/under voltage and over current detection and a watchdog.
+
+properties:
+ compatible:
+ const: rohm,bd96801
+
+ reg:
+ maxItems: 1
+
+ interrupts:
+ description:
+ The PMIC provides intb and errb IRQ lines. The errb IRQ line is used
+ for fatal IRQs which will cause the PMIC to shut down power outputs.
+ In many systems this will shut down the SoC contolling the PMIC and
+ connecting/handling the errb can be omitted. However, there are cases
+ where the SoC is not powered by the PMIC or has a short time backup
+ energy to handle shutdown of critical hardware. In that case it may be
+ useful to connect the errb and handle errb events.
+ minItems: 1
+ maxItems: 2
+
+ interrupt-names:
+ minItems: 1
+ items:
+ - enum: [intb, errb]
+ - const: errb
+
+ rohm,hw-timeout-ms:
+ description:
+ Watchdog timeout value(s). First walue is timeout limit. Second value is
+ optional value for 'too early' watchdog ping if window timeout mode is
+ to be used.
+ minItems: 1
+ maxItems: 2
+
+ rohm,wdg-action:
+ description:
+ Whether the watchdog failure must turn off the regulator power outputs or
+ just toggle the INTB line.
+ enum:
+ - prstb
+ - intb-only
+
+ timeout-sec:
+ maxItems: 2
+
+ regulators:
+ $ref: /schemas/regulator/rohm,bd96801-regulator.yaml
+ description:
+ List of child nodes that specify the regulators.
+
+required:
+ - compatible
+ - reg
+ - interrupts
+ - interrupt-names
+ - regulators
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/interrupt-controller/irq.h>
+ #include <dt-bindings/leds/common.h>
+ i2c {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ pmic: pmic@60 {
+ reg = <0x60>;
+ compatible = "rohm,bd96801";
+ interrupt-parent = <&gpio1>;
+ interrupts = <29 IRQ_TYPE_LEVEL_LOW>, <6 IRQ_TYPE_LEVEL_LOW>;
+ interrupt-names = "intb", "errb";
+
+ regulators {
+ buck1 {
+ regulator-name = "buck1";
+ regulator-ramp-delay = <1250>;
+ /* 0.5V min INITIAL - 150 mV tune */
+ regulator-min-microvolt = <350000>;
+ /* 3.3V + 150mV tune */
+ regulator-max-microvolt = <3450000>;
+
+ /* These can be set only when PMIC is in STBY */
+ rohm,initial-voltage-microvolt = <500000>;
+ regulator-ov-error-microvolt = <230000>;
+ regulator-uv-error-microvolt = <230000>;
+ regulator-temp-protection-kelvin = <1>;
+ regulator-temp-warn-kelvin = <0>;
+ };
+ buck2 {
+ regulator-name = "buck2";
+ regulator-min-microvolt = <350000>;
+ regulator-max-microvolt = <3450000>;
+
+ rohm,initial-voltage-microvolt = <3000000>;
+ regulator-ov-error-microvolt = <18000>;
+ regulator-uv-error-microvolt = <18000>;
+ regulator-temp-protection-kelvin = <1>;
+ regulator-temp-warn-kelvin = <1>;
+ };
+ buck3 {
+ regulator-name = "buck3";
+ regulator-min-microvolt = <350000>;
+ regulator-max-microvolt = <3450000>;
+
+ rohm,initial-voltage-microvolt = <600000>;
+ regulator-ov-warn-microvolt = <18000>;
+ regulator-uv-warn-microvolt = <18000>;
+ regulator-temp-protection-kelvin = <1>;
+ regulator-temp-error-kelvin = <0>;
+ };
+ buck4 {
+ regulator-name = "buck4";
+ regulator-min-microvolt = <350000>;
+ regulator-max-microvolt = <3450000>;
+
+ rohm,initial-voltage-microvolt = <600000>;
+ regulator-ov-warn-microvolt = <18000>;
+ regulator-uv-warn-microvolt = <18000>;
+ regulator-temp-protection-kelvin = <1>;
+ regulator-temp-error-kelvin = <0>;
+ };
+ ldo5 {
+ regulator-name = "ldo5";
+ regulator-min-microvolt = <300000>;
+ regulator-max-microvolt = <3300000>;
+
+ rohm,initial-voltage-microvolt = <500000>;
+ regulator-ov-error-microvolt = <36000>;
+ regulator-uv-error-microvolt = <34000>;
+ regulator-temp-protection-kelvin = <1>;
+ regulator-temp-warn-kelvin = <0>;
+ };
+ ldo6 {
+ regulator-name = "ldo6";
+ regulator-min-microvolt = <300000>;
+ regulator-max-microvolt = <3300000>;
+
+ rohm,initial-voltage-microvolt = <300000>;
+ regulator-ov-error-microvolt = <36000>;
+ regulator-uv-error-microvolt = <34000>;
+ regulator-temp-protection-kelvin = <1>;
+ regulator-temp-warn-kelvin = <0>;
+ };
+ ldo7 {
+ regulator-name = "ldo7";
+ regulator-min-microvolt = <300000>;
+ regulator-max-microvolt = <3300000>;
+
+ rohm,initial-voltage-microvolt = <500000>;
+ regulator-ov-error-microvolt = <36000>;
+ regulator-uv-error-microvolt = <34000>;
+ regulator-temp-protection-kelvin = <1>;
+ regulator-temp-warn-kelvin = <0>;
+ };
+ };
+ };
+ };
--
2.45.1
--
Matti Vaittinen, Linux device drivers
ROHM Semiconductors, Finland SWDC
Kiviharjunlenkki 1E
90220 OULU
FINLAND
~~~ "I don't think so," said Rene Descartes. Just then he vanished ~~~
Simon says - in Latin please.
~~~ "non cogito me" dixit Rene Descarte, deinde evanescavit ~~~
Thanks to Simon Glass for the translation =]
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 484 bytes --]
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v2 01/10] dt-bindings: ROHM BD96801 PMIC regulators
2024-05-24 8:16 ` [PATCH v2 01/10] dt-bindings: ROHM BD96801 PMIC regulators Matti Vaittinen
@ 2024-05-25 18:39 ` Krzysztof Kozlowski
0 siblings, 0 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2024-05-25 18:39 UTC (permalink / raw)
To: Matti Vaittinen, Matti Vaittinen
Cc: Lee Jones, Liam Girdwood, Mark Brown, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, linux-kernel, devicetree
On 24/05/2024 10:16, Matti Vaittinen wrote:
> ROHM BD96801 is a highly configurable automotive grade PMIC. Introduce
> DT bindings for the BD96801 regulators.
>
> Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
>
> ---
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2 02/10] dt-bindings: mfd: bd96801 PMIC core
2024-05-24 8:17 ` [PATCH v2 02/10] dt-bindings: mfd: bd96801 PMIC core Matti Vaittinen
@ 2024-05-25 18:58 ` Krzysztof Kozlowski
0 siblings, 0 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2024-05-25 18:58 UTC (permalink / raw)
To: Matti Vaittinen, Matti Vaittinen
Cc: Lee Jones, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Mark Brown, devicetree, linux-kernel
On 24/05/2024 10:17, Matti Vaittinen wrote:
> ROHM BD96801 is a highly configurable automotive grade PMIC. Introduce
> DT bindings for the BD96801 core.
>
> Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
>
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-05-25 18:59 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-24 8:15 [PATCH v2 00/10] Support ROHM BD96801 Scalable PMIC Matti Vaittinen
2024-05-24 8:16 ` [PATCH v2 01/10] dt-bindings: ROHM BD96801 PMIC regulators Matti Vaittinen
2024-05-25 18:39 ` Krzysztof Kozlowski
2024-05-24 8:17 ` [PATCH v2 02/10] dt-bindings: mfd: bd96801 PMIC core Matti Vaittinen
2024-05-25 18:58 ` Krzysztof Kozlowski
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).