* [PATCH v4 00/11] Add Renesas PMIC RAA215300 and built-in RTC support
@ 2023-05-18 11:36 Biju Das
2023-05-18 11:36 ` [PATCH v4 02/11] dt-bindings: rtc: isl1208: Convert to json-schema Biju Das
` (3 more replies)
0 siblings, 4 replies; 18+ messages in thread
From: Biju Das @ 2023-05-18 11:36 UTC (permalink / raw)
To: Wolfram Sang, Alessandro Zummo, Alexandre Belloni, Rob Herring,
Krzysztof Kozlowski
Cc: Biju Das, Liam Girdwood, Mark Brown, Geert Uytterhoeven,
Magnus Damm, devicetree, linux-rtc, linux-kernel,
linux-renesas-soc, Fabrizio Castro
This patch series aims to add support for Renesas PMIC RAA215300 and
built-in RTC found on this PMIC device.
The details of PMIC can be found here[1].
Renesas PMIC RAA215300 exposes two separate i2c devices, one for the main
device and another for rtc device.
Enhance i2c_new_ancillary_device() to instantiate a real device.
(eg: Instantiate rtc device from PMIC driver)
The built-in RTC found on PMIC RAA215300 is the same as ISL1208.
However, the external oscillator bit is inverted on PMIC version
0x11. The PMIC driver detects PMIC version and instantiate appropriate
RTC device.
[1]
https://www.renesas.com/in/en/products/power-power-management/multi-channel-power-management-ics-pmics/ssdsoc-power-management-ics-pmic-and-pmus/raa215300-high-performance-9-channel-pmic-supporting-ddr-memory-built-charger-and-rtc
Ref:
https://patchwork.kernel.org/project/linux-renesas-soc/patch/20230505091720.115675-1-biju.das.jz@bp.renesas.com/
https://patchwork.kernel.org/project/linux-renesas-soc/patch/20230505172530.357455-5-biju.das.jz@bp.renesas.com/
v3->v4:
* Dropped Rb tag from Geert for patch#1 as there are new changes.
* Introduced __i2c_new_dummy_device() to share the code between
i2c_new_dummy_device and i2c_new_ancillary_device().
* Introduced __i2c_new_client_device() to pass parent dev
parameter, so that the ancillary device can assign its parent during
creation.
* Added minItems to interrupt-names in binding patch.
* Added interrupt-names in conditional schema check.
* Documented clock and clock-names properties.
* Dropped unused name variable from struct isl1208_config.
* Make similar I2C and DT-based matching.
* Drop enum isl1208_id and split the array isl1208_configs[].
* Introduced isl1208_set_xtoscb() to set XTOSCB bit.
* Added support for internal oscillator enable/disable.
* Moved PMIC bindings from mfd->regulator.
* Dropped minItems from reg.
* Dropped renesas,rtc-enabled property and instead used clock-names property
to find RTC is enabled or not.
* Added reg-names in required property.
* Updated the example.
* Moved from mfd->regulator as it doesn't use MFD APIs
* Dropped handling "renesas,rtc-enabled" property and instead used
clock-names to determine RTC is enabled or not and then instantiating
RTC device.
* Added clock nodes.
v2->v3:
* Enhanced i2c_new_ancillary_device() to instantiate a real ancillary_device().
* RTC device is instantiated by PMIC driver and dropped isl1208_probe_helper().
* Added "TYPE_RAA215300_RTC_A0" to handle inverted oscillator bit case.
* Added more detailed description for renesas,rtc-enabled property.
* Added support for handling "renesas,rtc-enabled" property.
* Based on PMIC version, it instantiates rtc device by calling i2c_new_
ancillary_device().
* Updated the logs.
RFC->v2:
* Dropped the cross-links from bindings and used a single compatible
with separate i2c addresses for pmic main and rtc device.
* Dropped patch#4 and split patch#3 from this series and send as
separate patch to ML [2].
* Added RTC platform driver and mfd cell entry to the PMIC driver.RTC
platform driver creates rtc device by using i2c_new_ancillary_device()
and register the rtc device by calling the helper function provided
by rtc-isl2108 driver.
* Updated reg property in bindings.
* Added optional reg-names, interrupts and renesas,rtc-enabled
properties.
* Fixed the node name in the binding example
* Dropped the cross link property renesas,raa215300-rtc.
* Updated the binding example
* Dropped MODULE_SOFTDEP from the driver as it is added in RTC platform
driver.
* Dropped compatible "renesas,raa215300-isl1208" and "renesas,raa215300-pmic" property.
* Updated the comment polarity->bit for External Oscillator.
* Added raa215300_rtc_probe_helper() for registering raa215300_rtc device and
added the helper function isl1208_probe_helper() to share the code.
* Updated pmic device node on the SoM dtsi based on the bindings.
Logs:
[ 15.447305] rtc-isl1208 3-006f: registered as rtc0
[ 15.479493] rtc-isl1208 3-006f: setting system clock to 2023-04-27T19:31:02 UTC (1682623862)
root@smarc-rzv2l:~# hwclock -r
2023-04-27 19:33:05.499001+00:00
root@smarc-rzv2l:~# hwclock -r
2023-04-27 19:33:06.936688+00:00
root@smarc-rzv2l:~#
Biju Das (11):
i2c: Enhance i2c_new_ancillary_device API
dt-bindings: rtc: isl1208: Convert to json-schema
dt-bindings: rtc: isil,isl1208: Document clock and clock-names
properties
rtc: isl1208: Drop name variable
rtc: isl1208: Make similar I2C and DT-based matching table
rtc: isl1208: Drop enum isl1208_id and split isl1208_configs[]
rtc: isl1208: Add isl1208_set_xtoscb()
rtc: isl1208: Add support for the built-in RTC on the PMIC RAA215300
regulator: dt-bindings: Add Renesas RAA215300 PMIC bindings
regulator: Add Renesas PMIC RAA215300 driver
arm64: dts: renesas: rzg2l-smarc-som: Enable PMIC and built-in RTC
.../bindings/regulator/renesas,raa215300.yaml | 84 ++++++++++++
.../devicetree/bindings/rtc/isil,isl1208.txt | 38 ------
.../devicetree/bindings/rtc/isil,isl1208.yaml | 102 ++++++++++++++
.../boot/dts/renesas/rzg2l-smarc-som.dtsi | 18 +++
drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 6 +-
drivers/i2c/i2c-core-base.c | 90 ++++++++-----
drivers/media/i2c/adv748x/adv748x-core.c | 2 +-
drivers/media/i2c/adv7604.c | 3 +-
drivers/regulator/Kconfig | 7 +
drivers/regulator/Makefile | 1 +
drivers/regulator/raa215300.c | 118 +++++++++++++++++
drivers/rtc/rtc-isl1208.c | 125 +++++++++++++-----
include/linux/i2c.h | 3 +-
13 files changed, 491 insertions(+), 106 deletions(-)
create mode 100644 Documentation/devicetree/bindings/regulator/renesas,raa215300.yaml
delete mode 100644 Documentation/devicetree/bindings/rtc/isil,isl1208.txt
create mode 100644 Documentation/devicetree/bindings/rtc/isil,isl1208.yaml
create mode 100644 drivers/regulator/raa215300.c
--
2.25.1
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH v4 02/11] dt-bindings: rtc: isl1208: Convert to json-schema
2023-05-18 11:36 [PATCH v4 00/11] Add Renesas PMIC RAA215300 and built-in RTC support Biju Das
@ 2023-05-18 11:36 ` Biju Das
2023-05-18 11:36 ` [PATCH v4 03/11] dt-bindings: rtc: isil,isl1208: Document clock and clock-names properties Biju Das
` (2 subsequent siblings)
3 siblings, 0 replies; 18+ messages in thread
From: Biju Das @ 2023-05-18 11:36 UTC (permalink / raw)
To: Alessandro Zummo, Alexandre Belloni, Rob Herring,
Krzysztof Kozlowski, Conor Dooley
Cc: Biju Das, Trent Piepho, linux-rtc, devicetree, Geert Uytterhoeven,
Fabrizio Castro, linux-renesas-soc, Krzysztof Kozlowski
Convert the isl1208 RTC device tree binding documentation to json-schema.
Update the example to match reality.
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
v4->v4_new:
* Moved this patch to PMIC series
* Added minItems to interrupt-names.
* Added interrupt-names in conditional schema check.
v3->v4:
* Added Rb tag from Krzysztof Kozlowski.
* Dropped | from description
* Replaced the pin name #EVDET->EVDET in description.
* Dropped oneOf from compatible.
v2->v3:
* Updated interrupt-names property by keeping the list of names.
* Removed Interrupts from required property as it may not be wired.
* Removed isil,ev-evienb from required property.
RFC->v2:
* Updated maintainers list
* Updated description from original bindings
* removed default from isil,ev-evienb properties to match with the original
bindings.
* Added conditional check for interrupts.
---
.../devicetree/bindings/rtc/isil,isl1208.txt | 38 --------
.../devicetree/bindings/rtc/isil,isl1208.yaml | 89 +++++++++++++++++++
2 files changed, 89 insertions(+), 38 deletions(-)
delete mode 100644 Documentation/devicetree/bindings/rtc/isil,isl1208.txt
create mode 100644 Documentation/devicetree/bindings/rtc/isil,isl1208.yaml
diff --git a/Documentation/devicetree/bindings/rtc/isil,isl1208.txt b/Documentation/devicetree/bindings/rtc/isil,isl1208.txt
deleted file mode 100644
index 51f003006f04..000000000000
--- a/Documentation/devicetree/bindings/rtc/isil,isl1208.txt
+++ /dev/null
@@ -1,38 +0,0 @@
-Intersil ISL1209/19 I2C RTC/Alarm chip with event in
-
-ISL12X9 have additional pins EVIN and #EVDET for tamper detection, while the
-ISL1208 and ISL1218 do not. They are all use the same driver with the bindings
-described here, with chip specific properties as noted.
-
-Required properties supported by the device:
- - "compatible": Should be one of the following:
- - "isil,isl1208"
- - "isil,isl1209"
- - "isil,isl1218"
- - "isil,isl1219"
- - "reg": I2C bus address of the device
-
-Optional properties:
- - "interrupt-names": list which may contains "irq" and "evdet"
- evdet applies to isl1209 and isl1219 only
- - "interrupts": list of interrupts for "irq" and "evdet"
- evdet applies to isl1209 and isl1219 only
- - "isil,ev-evienb": Enable or disable internal pull on EVIN pin
- Applies to isl1209 and isl1219 only
- Possible values are 0 and 1
- Value 0 enables internal pull-up on evin pin, 1 disables it.
- Default will leave the non-volatile configuration of the pullup
- as is.
-
-Example isl1219 node with #IRQ pin connected to SoC gpio1 pin12 and #EVDET pin
-connected to SoC gpio2 pin 24 and internal pull-up enabled in EVIN pin.
-
- isl1219: rtc@68 {
- compatible = "isil,isl1219";
- reg = <0x68>;
- interrupt-names = "irq", "evdet";
- interrupts-extended = <&gpio1 12 IRQ_TYPE_EDGE_FALLING>,
- <&gpio2 24 IRQ_TYPE_EDGE_FALLING>;
- isil,ev-evienb = <1>;
- };
-
diff --git a/Documentation/devicetree/bindings/rtc/isil,isl1208.yaml b/Documentation/devicetree/bindings/rtc/isil,isl1208.yaml
new file mode 100644
index 000000000000..565965147ce6
--- /dev/null
+++ b/Documentation/devicetree/bindings/rtc/isil,isl1208.yaml
@@ -0,0 +1,89 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/rtc/isil,isl1208.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Intersil ISL1209/19 I2C RTC/Alarm chip with event in
+
+maintainers:
+ - Biju Das <biju.das.jz@bp.renesas.com>
+ - Trent Piepho <tpiepho@gmail.com>
+
+description:
+ ISL12X9 have additional pins EVIN and EVDET for tamper detection, while the
+ ISL1208 and ISL1218 do not.
+
+properties:
+ compatible:
+ enum:
+ - isil,isl1208
+ - isil,isl1209
+ - isil,isl1218
+ - isil,isl1219
+
+ reg:
+ maxItems: 1
+
+ interrupts:
+ minItems: 1
+ maxItems: 2
+
+ interrupt-names:
+ minItems: 1
+ items:
+ - const: irq
+ - const: evdet
+
+ isil,ev-evienb:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ enum: [ 0, 1 ]
+ description: |
+ Enable or disable internal pull on EVIN pin
+ Default will leave the non-volatile configuration of the pullup
+ as is.
+ <0> : Enables internal pull-up on evin pin
+ <1> : Disables internal pull-up on evin pin
+
+required:
+ - compatible
+ - reg
+
+allOf:
+ - $ref: rtc.yaml#
+ - if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - isil,isl1209
+ - isil,isl1219
+ then:
+ properties:
+ interrupts:
+ maxItems: 2
+ interrupt-names:
+ items:
+ - const: irq
+ - const: evdet
+ else:
+ properties:
+ interrupts:
+ maxItems: 1
+ interrupt-names:
+ items:
+ - const: irq
+
+unevaluatedProperties: false
+
+examples:
+ - |
+ i2c {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ rtc_twi: rtc@6f {
+ compatible = "isil,isl1208";
+ reg = <0x6f>;
+ };
+ };
--
2.25.1
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH v4 03/11] dt-bindings: rtc: isil,isl1208: Document clock and clock-names properties
2023-05-18 11:36 [PATCH v4 00/11] Add Renesas PMIC RAA215300 and built-in RTC support Biju Das
2023-05-18 11:36 ` [PATCH v4 02/11] dt-bindings: rtc: isl1208: Convert to json-schema Biju Das
@ 2023-05-18 11:36 ` Biju Das
2023-05-18 19:17 ` Conor Dooley
2023-05-19 12:35 ` Geert Uytterhoeven
2023-05-18 11:36 ` [PATCH v4 09/11] regulator: dt-bindings: Add Renesas RAA215300 PMIC bindings Biju Das
2023-05-18 11:36 ` [PATCH v4 11/11] arm64: dts: renesas: rzg2l-smarc-som: Enable PMIC and built-in RTC Biju Das
3 siblings, 2 replies; 18+ messages in thread
From: Biju Das @ 2023-05-18 11:36 UTC (permalink / raw)
To: Alessandro Zummo, Alexandre Belloni, Rob Herring,
Krzysztof Kozlowski, Conor Dooley
Cc: Biju Das, Trent Piepho, linux-rtc, devicetree, Geert Uytterhoeven,
Fabrizio Castro, linux-renesas-soc
As per the HW manual, XTOSCB bit setting is as follows
If using an external clock signal, set the XTOSCB bit as 1 to
disable the crystal oscillator.
If using an external crystal, the XTOSCB bit needs to be set at 0
to enable the crystal oscillator.
Document clock and clock-names properties.
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
v4:
* New patch
---
.../devicetree/bindings/rtc/isil,isl1208.yaml | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/Documentation/devicetree/bindings/rtc/isil,isl1208.yaml b/Documentation/devicetree/bindings/rtc/isil,isl1208.yaml
index 565965147ce6..6c270dd53605 100644
--- a/Documentation/devicetree/bindings/rtc/isil,isl1208.yaml
+++ b/Documentation/devicetree/bindings/rtc/isil,isl1208.yaml
@@ -25,6 +25,19 @@ properties:
reg:
maxItems: 1
+ clocks:
+ maxItems: 1
+
+ clock-names:
+ description: |
+ Use xin, if connected to an external crystal.
+ Use clkin, if connected to an external clock signal.
+ oneOf:
+ - items:
+ - const: xin
+ - items:
+ - const: clkin
+
interrupts:
minItems: 1
maxItems: 2
--
2.25.1
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH v4 09/11] regulator: dt-bindings: Add Renesas RAA215300 PMIC bindings
2023-05-18 11:36 [PATCH v4 00/11] Add Renesas PMIC RAA215300 and built-in RTC support Biju Das
2023-05-18 11:36 ` [PATCH v4 02/11] dt-bindings: rtc: isl1208: Convert to json-schema Biju Das
2023-05-18 11:36 ` [PATCH v4 03/11] dt-bindings: rtc: isil,isl1208: Document clock and clock-names properties Biju Das
@ 2023-05-18 11:36 ` Biju Das
2023-05-18 19:13 ` Conor Dooley
2023-05-19 12:58 ` Geert Uytterhoeven
2023-05-18 11:36 ` [PATCH v4 11/11] arm64: dts: renesas: rzg2l-smarc-som: Enable PMIC and built-in RTC Biju Das
3 siblings, 2 replies; 18+ messages in thread
From: Biju Das @ 2023-05-18 11:36 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley
Cc: Biju Das, Liam Girdwood, Mark Brown, Geert Uytterhoeven,
Magnus Damm, devicetree, linux-renesas-soc, Fabrizio Castro
Document Renesas RAA215300 PMIC bindings.
The RAA215300 is a high Performance 9-Channel PMIC supporting DDR
Memory, with Built-In Charger and RTC.
It supports DDR3, DDR3L, DDR4, and LPDDR4 memory power requirements.
The internally compensated regulators, built-in Real-Time Clock (RTC),
32kHz crystal oscillator, and coin cell battery charger provide a
highly integrated, small footprint power solution ideal for
System-On-Module (SOM) applications. A spread spectrum feature
provides an ease-of-use solution for noise-sensitive audio or RF
applications.
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
v3->v4:
* Moved bindings from mfd->regulator.
* Dropped minItems from reg.
* Dropped renesas,rtc-enabled property and instead used clock-names property
to find RTC is enabled or not.
* Added reg-names in required property.
* Updated the example.
v2->v3:
* Added more detailed description for renesas,rtc-enabled property.
RFC->v2:
* Updated reg property
* Added optional reg-names, interrupts and renesas,rtc-enabled
properties.
* Fixed the node name in the example
* Dropped the cross link property renesas,raa215300-rtc.
* Updated the example
---
.../bindings/regulator/renesas,raa215300.yaml | 84 +++++++++++++++++++
1 file changed, 84 insertions(+)
create mode 100644 Documentation/devicetree/bindings/regulator/renesas,raa215300.yaml
diff --git a/Documentation/devicetree/bindings/regulator/renesas,raa215300.yaml b/Documentation/devicetree/bindings/regulator/renesas,raa215300.yaml
new file mode 100644
index 000000000000..17b16f66f695
--- /dev/null
+++ b/Documentation/devicetree/bindings/regulator/renesas,raa215300.yaml
@@ -0,0 +1,84 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/regulator/renesas,raa215300.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Renesas RAA215300 Power Management Integrated Circuit (PMIC)
+
+maintainers:
+ - Biju Das <biju.das.jz@bp.renesas.com>
+
+description: |
+ The RAA215300 is a high-performance, low-cost 9-channel PMIC designed for
+ 32-bit and 64-bit MCU and MPU applications. It supports DDR3, DDR3L, DDR4,
+ and LPDDR4 memory power requirements. The internally compensated regulators,
+ built-in Real-Time Clock (RTC), 32kHz crystal oscillator, and coin cell
+ battery charger provide a highly integrated, small footprint power solution
+ ideal for System-On-Module (SOM) applications. A spread spectrum feature
+ provides an ease-of-use solution for noise-sensitive audio or RF applications.
+
+ This device exposes two devices via I2C. One for the integrated RTC IP, and
+ one for everything else.
+
+ Link to datasheet:
+ https://www.renesas.com/in/en/products/power-power-management/multi-channel-power-management-ics-pmics/ssdsoc-power-management-ics-pmic-and-pmus/raa215300-high-performance-9-channel-pmic-supporting-ddr-memory-built-charger-and-rtc
+
+properties:
+ compatible:
+ enum:
+ - renesas,raa215300
+
+ reg:
+ maxItems: 2
+
+ reg-names:
+ items:
+ - const: main
+ - const: rtc
+
+ interrupts:
+ maxItems: 1
+
+ clocks:
+ maxItems: 1
+
+ clock-names:
+ description: |
+ Use xin, if connected to an external crystal.
+ Use clkin, if connected to an external clock signal.
+ oneOf:
+ - items:
+ - const: xin
+ - items:
+ - const: clkin
+
+required:
+ - compatible
+ - reg
+ - reg-names
+
+additionalProperties: false
+
+examples:
+ - |
+ /* 32.768kHz crystal */
+ x2: clock-xtal {
+ compatible = "fixed-clock";
+ #clock-cells = <0>;
+ clock-frequency = <32768>;
+ };
+
+ i2c {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ raa215300: pmic@12 {
+ compatible = "renesas,raa215300";
+ reg = <0x12>, <0x6f>;
+ reg-names = "main", "rtc";
+
+ clocks = <&x2>;
+ clock-names = "xin";
+ };
+ };
--
2.25.1
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH v4 11/11] arm64: dts: renesas: rzg2l-smarc-som: Enable PMIC and built-in RTC
2023-05-18 11:36 [PATCH v4 00/11] Add Renesas PMIC RAA215300 and built-in RTC support Biju Das
` (2 preceding siblings ...)
2023-05-18 11:36 ` [PATCH v4 09/11] regulator: dt-bindings: Add Renesas RAA215300 PMIC bindings Biju Das
@ 2023-05-18 11:36 ` Biju Das
3 siblings, 0 replies; 18+ messages in thread
From: Biju Das @ 2023-05-18 11:36 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley
Cc: Biju Das, Geert Uytterhoeven, Magnus Damm, linux-renesas-soc,
devicetree, Fabrizio Castro
Enable PMIC RAA215300 and the built-in RTC on the RZ/{G2L,V2L} SMARC
EVK.
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
v3->v4:
* Added clock nodes.
v2->v3:
* No change.
RFC->V2:
* Updated pmic device node based on the bindings.
---
.../boot/dts/renesas/rzg2l-smarc-som.dtsi | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/arch/arm64/boot/dts/renesas/rzg2l-smarc-som.dtsi b/arch/arm64/boot/dts/renesas/rzg2l-smarc-som.dtsi
index fbbb4f03440b..801d1c1c5bc2 100644
--- a/arch/arm64/boot/dts/renesas/rzg2l-smarc-som.dtsi
+++ b/arch/arm64/boot/dts/renesas/rzg2l-smarc-som.dtsi
@@ -73,6 +73,13 @@ vccq_sdhi0: regulator-vccq-sdhi0 {
gpios = <&pinctrl RZG2L_GPIO(39, 0) GPIO_ACTIVE_HIGH>;
regulator-always-on;
};
+
+ /* 32.768kHz crystal */
+ x2: clock-xtal {
+ compatible = "fixed-clock";
+ #clock-cells = <0>;
+ clock-frequency = <32768>;
+ };
};
&adc {
@@ -351,3 +358,14 @@ &wdt1 {
status = "okay";
timeout-sec = <60>;
};
+
+&i2c3 {
+ raa215300: pmic@12 {
+ compatible = "renesas,raa215300";
+ reg = <0x12>, <0x6f>;
+ reg-names = "main", "rtc";
+
+ clocks = <&x2>;
+ clock-names = "xin";
+ };
+};
--
2.25.1
^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [PATCH v4 09/11] regulator: dt-bindings: Add Renesas RAA215300 PMIC bindings
2023-05-18 11:36 ` [PATCH v4 09/11] regulator: dt-bindings: Add Renesas RAA215300 PMIC bindings Biju Das
@ 2023-05-18 19:13 ` Conor Dooley
2023-05-19 6:53 ` Biju Das
2023-05-19 12:58 ` Geert Uytterhoeven
1 sibling, 1 reply; 18+ messages in thread
From: Conor Dooley @ 2023-05-18 19:13 UTC (permalink / raw)
To: Biju Das
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Liam Girdwood,
Mark Brown, Geert Uytterhoeven, Magnus Damm, devicetree,
linux-renesas-soc, Fabrizio Castro
[-- Attachment #1: Type: text/plain, Size: 966 bytes --]
On Thu, May 18, 2023 at 12:36:41PM +0100, Biju Das wrote:
> Document Renesas RAA215300 PMIC bindings.
>
> The RAA215300 is a high Performance 9-Channel PMIC supporting DDR
> Memory, with Built-In Charger and RTC.
>
> It supports DDR3, DDR3L, DDR4, and LPDDR4 memory power requirements.
> The internally compensated regulators, built-in Real-Time Clock (RTC),
> 32kHz crystal oscillator, and coin cell battery charger provide a
> highly integrated, small footprint power solution ideal for
> System-On-Module (SOM) applications. A spread spectrum feature
> provides an ease-of-use solution for noise-sensitive audio or RF
> applications.
> + reg:
> + maxItems: 2
> +
> + reg-names:
> + items:
> + - const: main
> + - const: rtc
> +required:
> + - compatible
> + - reg
> + - reg-names
Out of curiosity as much as anything else, why do you need reg-names if
the two registers are always required?
Cheers,
Conor.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v4 03/11] dt-bindings: rtc: isil,isl1208: Document clock and clock-names properties
2023-05-18 11:36 ` [PATCH v4 03/11] dt-bindings: rtc: isil,isl1208: Document clock and clock-names properties Biju Das
@ 2023-05-18 19:17 ` Conor Dooley
2023-05-19 12:35 ` Geert Uytterhoeven
1 sibling, 0 replies; 18+ messages in thread
From: Conor Dooley @ 2023-05-18 19:17 UTC (permalink / raw)
To: Biju Das
Cc: Alessandro Zummo, Alexandre Belloni, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Trent Piepho, linux-rtc,
devicetree, Geert Uytterhoeven, Fabrizio Castro,
linux-renesas-soc
[-- Attachment #1: Type: text/plain, Size: 1584 bytes --]
On Thu, May 18, 2023 at 12:36:35PM +0100, Biju Das wrote:
> As per the HW manual, XTOSCB bit setting is as follows
>
> If using an external clock signal, set the XTOSCB bit as 1 to
> disable the crystal oscillator.
>
> If using an external crystal, the XTOSCB bit needs to be set at 0
> to enable the crystal oscillator.
>
> Document clock and clock-names properties.
>
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
I notice on v3 you appealed to Rob or Krzysztof for approval about this
approach. Clearly I not either of them, but it seems reasonable to me.
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Thanks,
Conor.
> ---
> v4:
> * New patch
> ---
> .../devicetree/bindings/rtc/isil,isl1208.yaml | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/rtc/isil,isl1208.yaml b/Documentation/devicetree/bindings/rtc/isil,isl1208.yaml
> index 565965147ce6..6c270dd53605 100644
> --- a/Documentation/devicetree/bindings/rtc/isil,isl1208.yaml
> +++ b/Documentation/devicetree/bindings/rtc/isil,isl1208.yaml
> @@ -25,6 +25,19 @@ properties:
> reg:
> maxItems: 1
>
> + clocks:
> + maxItems: 1
> +
> + clock-names:
> + description: |
> + Use xin, if connected to an external crystal.
> + Use clkin, if connected to an external clock signal.
> + oneOf:
> + - items:
> + - const: xin
> + - items:
> + - const: clkin
> +
> interrupts:
> minItems: 1
> maxItems: 2
> --
> 2.25.1
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 18+ messages in thread
* RE: [PATCH v4 09/11] regulator: dt-bindings: Add Renesas RAA215300 PMIC bindings
2023-05-18 19:13 ` Conor Dooley
@ 2023-05-19 6:53 ` Biju Das
2023-05-19 14:10 ` Conor Dooley
0 siblings, 1 reply; 18+ messages in thread
From: Biju Das @ 2023-05-19 6:53 UTC (permalink / raw)
To: Conor Dooley
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Liam Girdwood,
Mark Brown, Geert Uytterhoeven, Magnus Damm,
devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
Fabrizio Castro
Hi Conor,
Thanks for the feedback.
> Subject: Re: [PATCH v4 09/11] regulator: dt-bindings: Add Renesas
> RAA215300 PMIC bindings
>
> On Thu, May 18, 2023 at 12:36:41PM +0100, Biju Das wrote:
> > Document Renesas RAA215300 PMIC bindings.
> >
> > The RAA215300 is a high Performance 9-Channel PMIC supporting DDR
> > Memory, with Built-In Charger and RTC.
> >
> > It supports DDR3, DDR3L, DDR4, and LPDDR4 memory power requirements.
> > The internally compensated regulators, built-in Real-Time Clock (RTC),
> > 32kHz crystal oscillator, and coin cell battery charger provide a
> > highly integrated, small footprint power solution ideal for
> > System-On-Module (SOM) applications. A spread spectrum feature
> > provides an ease-of-use solution for noise-sensitive audio or RF
> > applications.
> > + reg:
> > + maxItems: 2
> > +
> > + reg-names:
> > + items:
> > + - const: main
> > + - const: rtc
>
> > +required:
> > + - compatible
> > + - reg
> > + - reg-names
>
> Out of curiosity as much as anything else, why do you need reg-names if
> the two registers are always required?
The device has always 2 address spaces and "reg-names" provides a means
of clear differentiation compared to indices.
By enforcing "reg-names" as required property, dt can do some schema-validation
forcing users to specify "reg-names" in device tree.
Implementation wise, we use "rtc" for getting resource details while
creating the second i2c device which overrides the default address.
Strictly speaking reg-names is not required, but from a validation
perspective and since driver is using the same "resource-name" it is
better to have it??
Please share your thoughts.
Cheers,
Biju
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v4 03/11] dt-bindings: rtc: isil,isl1208: Document clock and clock-names properties
2023-05-18 11:36 ` [PATCH v4 03/11] dt-bindings: rtc: isil,isl1208: Document clock and clock-names properties Biju Das
2023-05-18 19:17 ` Conor Dooley
@ 2023-05-19 12:35 ` Geert Uytterhoeven
2023-05-19 16:02 ` Biju Das
1 sibling, 1 reply; 18+ messages in thread
From: Geert Uytterhoeven @ 2023-05-19 12:35 UTC (permalink / raw)
To: Biju Das
Cc: Alessandro Zummo, Alexandre Belloni, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Trent Piepho, linux-rtc,
devicetree, Geert Uytterhoeven, Fabrizio Castro,
linux-renesas-soc
Hi Biju,
On Thu, May 18, 2023 at 1:37 PM Biju Das <biju.das.jz@bp.renesas.com> wrote:
> As per the HW manual, XTOSCB bit setting is as follows
>
> If using an external clock signal, set the XTOSCB bit as 1 to
> disable the crystal oscillator.
>
> If using an external crystal, the XTOSCB bit needs to be set at 0
> to enable the crystal oscillator.
>
> Document clock and clock-names properties.
>
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> ---
> v4:
> * New patch
Thanks for your patch!
> --- a/Documentation/devicetree/bindings/rtc/isil,isl1208.yaml
> +++ b/Documentation/devicetree/bindings/rtc/isil,isl1208.yaml
> @@ -25,6 +25,19 @@ properties:
> reg:
> maxItems: 1
>
> + clocks:
> + maxItems: 1
> +
> + clock-names:
> + description: |
> + Use xin, if connected to an external crystal.
> + Use clkin, if connected to an external clock signal.
> + oneOf:
> + - items:
> + - const: xin
> + - items:
> + - const: clkin
> +
I guess that oneOf scheme is equivalent to the simpler
enum:
- xin
- clkin
?
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v4 09/11] regulator: dt-bindings: Add Renesas RAA215300 PMIC bindings
2023-05-18 11:36 ` [PATCH v4 09/11] regulator: dt-bindings: Add Renesas RAA215300 PMIC bindings Biju Das
2023-05-18 19:13 ` Conor Dooley
@ 2023-05-19 12:58 ` Geert Uytterhoeven
2023-05-19 16:49 ` Biju Das
1 sibling, 1 reply; 18+ messages in thread
From: Geert Uytterhoeven @ 2023-05-19 12:58 UTC (permalink / raw)
To: Biju Das
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Liam Girdwood,
Mark Brown, Geert Uytterhoeven, Magnus Damm, devicetree,
linux-renesas-soc, Fabrizio Castro
Hi Biju,
On Thu, May 18, 2023 at 1:37 PM Biju Das <biju.das.jz@bp.renesas.com> wrote:
> Document Renesas RAA215300 PMIC bindings.
>
> The RAA215300 is a high Performance 9-Channel PMIC supporting DDR
> Memory, with Built-In Charger and RTC.
>
> It supports DDR3, DDR3L, DDR4, and LPDDR4 memory power requirements.
> The internally compensated regulators, built-in Real-Time Clock (RTC),
> 32kHz crystal oscillator, and coin cell battery charger provide a
> highly integrated, small footprint power solution ideal for
> System-On-Module (SOM) applications. A spread spectrum feature
> provides an ease-of-use solution for noise-sensitive audio or RF
> applications.
>
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> ---
> v3->v4:
> * Moved bindings from mfd->regulator.
> * Dropped minItems from reg.
> * Dropped renesas,rtc-enabled property and instead used clock-names property
> to find RTC is enabled or not.
> * Added reg-names in required property.
> * Updated the example.
Thanks for your patch!
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/regulator/renesas,raa215300.yaml
> @@ -0,0 +1,84 @@
> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/regulator/renesas,raa215300.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Renesas RAA215300 Power Management Integrated Circuit (PMIC)
> +
> +maintainers:
> + - Biju Das <biju.das.jz@bp.renesas.com>
> +
> +description: |
> + The RAA215300 is a high-performance, low-cost 9-channel PMIC designed for
> + 32-bit and 64-bit MCU and MPU applications. It supports DDR3, DDR3L, DDR4,
> + and LPDDR4 memory power requirements. The internally compensated regulators,
> + built-in Real-Time Clock (RTC), 32kHz crystal oscillator, and coin cell
> + battery charger provide a highly integrated, small footprint power solution
> + ideal for System-On-Module (SOM) applications. A spread spectrum feature
> + provides an ease-of-use solution for noise-sensitive audio or RF applications.
> +
> + This device exposes two devices via I2C. One for the integrated RTC IP, and
> + one for everything else.
> +
> + Link to datasheet:
> + https://www.renesas.com/in/en/products/power-power-management/multi-channel-power-management-ics-pmics/ssdsoc-power-management-ics-pmic-and-pmus/raa215300-high-performance-9-channel-pmic-supporting-ddr-memory-built-charger-and-rtc
> +
> +properties:
> + compatible:
> + enum:
> + - renesas,raa215300
> +
> + reg:
> + maxItems: 2
> +
> + reg-names:
> + items:
> + - const: main
> + - const: rtc
> +
> + interrupts:
> + maxItems: 1
> +
> + clocks:
> + maxItems: 1
Perhaps add a description to make it clear that not providing clocks
is supported, and means the RTC is disabled?
> +
> + clock-names:
> + description: |
> + Use xin, if connected to an external crystal.
> + Use clkin, if connected to an external clock signal.
> + oneOf:
> + - items:
> + - const: xin
> + - items:
> + - const: clkin
Please replace oneOf+items by enum.
> +
> +required:
> + - compatible
> + - reg
> + - reg-names
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v4 09/11] regulator: dt-bindings: Add Renesas RAA215300 PMIC bindings
2023-05-19 6:53 ` Biju Das
@ 2023-05-19 14:10 ` Conor Dooley
2023-05-19 14:39 ` Biju Das
2023-05-19 14:58 ` Mark Brown
0 siblings, 2 replies; 18+ messages in thread
From: Conor Dooley @ 2023-05-19 14:10 UTC (permalink / raw)
To: Biju Das
Cc: Conor Dooley, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Liam Girdwood, Mark Brown, Geert Uytterhoeven, Magnus Damm,
devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
Fabrizio Castro
[-- Attachment #1: Type: text/plain, Size: 2154 bytes --]
On Fri, May 19, 2023 at 06:53:03AM +0000, Biju Das wrote:
> > Subject: Re: [PATCH v4 09/11] regulator: dt-bindings: Add Renesas
> > RAA215300 PMIC bindings
> >
> > On Thu, May 18, 2023 at 12:36:41PM +0100, Biju Das wrote:
> > > Document Renesas RAA215300 PMIC bindings.
> > >
> > > The RAA215300 is a high Performance 9-Channel PMIC supporting DDR
> > > Memory, with Built-In Charger and RTC.
> > >
> > > It supports DDR3, DDR3L, DDR4, and LPDDR4 memory power requirements.
> > > The internally compensated regulators, built-in Real-Time Clock (RTC),
> > > 32kHz crystal oscillator, and coin cell battery charger provide a
> > > highly integrated, small footprint power solution ideal for
> > > System-On-Module (SOM) applications. A spread spectrum feature
> > > provides an ease-of-use solution for noise-sensitive audio or RF
> > > applications.
> > > + reg:
> > > + maxItems: 2
> > > +
> > > + reg-names:
> > > + items:
> > > + - const: main
> > > + - const: rtc
> >
> > > +required:
> > > + - compatible
> > > + - reg
> > > + - reg-names
> >
> > Out of curiosity as much as anything else, why do you need reg-names if
> > the two registers are always required?
>
> The device has always 2 address spaces and "reg-names" provides a means
> of clear differentiation compared to indices.
>
> By enforcing "reg-names" as required property, dt can do some schema-validation
> forcing users to specify "reg-names" in device tree.
Is that not what we have the following for:
reg:
items:
- description: main register space...
- description: special sauce rtc stuff...
?
The schema validation doesn't stop them putting in the wrong address
either way!
> Implementation wise, we use "rtc" for getting resource details while
> creating the second i2c device which overrides the default address.
>
> Strictly speaking reg-names is not required, but from a validation
> perspective and since driver is using the same "resource-name" it is
> better to have it??
If the order is set by the descriptions, reg-names seem superfluous
/shrug
Cheers,
Conor.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 18+ messages in thread
* RE: [PATCH v4 09/11] regulator: dt-bindings: Add Renesas RAA215300 PMIC bindings
2023-05-19 14:10 ` Conor Dooley
@ 2023-05-19 14:39 ` Biju Das
2023-05-19 14:49 ` Geert Uytterhoeven
2023-05-19 14:58 ` Mark Brown
1 sibling, 1 reply; 18+ messages in thread
From: Biju Das @ 2023-05-19 14:39 UTC (permalink / raw)
To: Conor Dooley
Cc: Conor Dooley, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Liam Girdwood, Mark Brown, Geert Uytterhoeven, Magnus Damm,
devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
Fabrizio Castro
Hi Conor,
Thanks for the feedback.
> -----Original Message-----
> From: Conor Dooley <conor.dooley@microchip.com>
> Sent: Friday, May 19, 2023 3:10 PM
> To: Biju Das <biju.das.jz@bp.renesas.com>
> Cc: Conor Dooley <conor@kernel.org>; Rob Herring <robh+dt@kernel.org>;
> Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>; Conor Dooley
> <conor+dt@kernel.org>; Liam Girdwood <lgirdwood@gmail.com>; Mark Brown
> <broonie@kernel.org>; Geert Uytterhoeven <geert+renesas@glider.be>;
> Magnus Damm <magnus.damm@gmail.com>; devicetree@vger.kernel.org; linux-
> renesas-soc@vger.kernel.org; Fabrizio Castro
> <fabrizio.castro.jz@renesas.com>
> Subject: Re: [PATCH v4 09/11] regulator: dt-bindings: Add Renesas
> RAA215300 PMIC bindings
>
> On Fri, May 19, 2023 at 06:53:03AM +0000, Biju Das wrote:
> > > Subject: Re: [PATCH v4 09/11] regulator: dt-bindings: Add Renesas
> > > RAA215300 PMIC bindings
> > >
> > > On Thu, May 18, 2023 at 12:36:41PM +0100, Biju Das wrote:
> > > > Document Renesas RAA215300 PMIC bindings.
> > > >
> > > > The RAA215300 is a high Performance 9-Channel PMIC supporting DDR
> > > > Memory, with Built-In Charger and RTC.
> > > >
> > > > It supports DDR3, DDR3L, DDR4, and LPDDR4 memory power
> requirements.
> > > > The internally compensated regulators, built-in Real-Time Clock
> > > > (RTC), 32kHz crystal oscillator, and coin cell battery charger
> > > > provide a highly integrated, small footprint power solution ideal
> > > > for System-On-Module (SOM) applications. A spread spectrum feature
> > > > provides an ease-of-use solution for noise-sensitive audio or RF
> > > > applications.
> > > > + reg:
> > > > + maxItems: 2
> > > > +
> > > > + reg-names:
> > > > + items:
> > > > + - const: main
> > > > + - const: rtc
> > >
> > > > +required:
> > > > + - compatible
> > > > + - reg
> > > > + - reg-names
> > >
> > > Out of curiosity as much as anything else, why do you need reg-names
> > > if the two registers are always required?
> >
> > The device has always 2 address spaces and "reg-names" provides a
> > means of clear differentiation compared to indices.
> >
> > By enforcing "reg-names" as required property, dt can do some
> > schema-validation forcing users to specify "reg-names" in device tree.
>
> Is that not what we have the following for:
> reg:
> items:
> - description: main register space...
> - description: special sauce rtc stuff...
> ?
OK, will add description.
>
> The schema validation doesn't stop them putting in the wrong address
> either way!
OK, will drop reg-names from required property.
>
> > Implementation wise, we use "rtc" for getting resource details while
> > creating the second i2c device which overrides the default address.
> >
> > Strictly speaking reg-names is not required, but from a validation
> > perspective and since driver is using the same "resource-name" it is
> > better to have it??
>
> If the order is set by the descriptions, reg-names seem superfluous
> /shrug
Agreed.
Cheers,
Biju
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v4 09/11] regulator: dt-bindings: Add Renesas RAA215300 PMIC bindings
2023-05-19 14:39 ` Biju Das
@ 2023-05-19 14:49 ` Geert Uytterhoeven
2023-05-19 14:52 ` Geert Uytterhoeven
2023-05-19 15:20 ` Conor Dooley
0 siblings, 2 replies; 18+ messages in thread
From: Geert Uytterhoeven @ 2023-05-19 14:49 UTC (permalink / raw)
To: Biju Das
Cc: Conor Dooley, Conor Dooley, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Liam Girdwood, Mark Brown, Geert Uytterhoeven,
Magnus Damm, devicetree@vger.kernel.org,
linux-renesas-soc@vger.kernel.org, Fabrizio Castro
Hi Biju,
On Fri, May 19, 2023 at 4:39 PM Biju Das <biju.das.jz@bp.renesas.com> wrote:
> > -----Original Message-----
> > From: Conor Dooley <conor.dooley@microchip.com>
> > Sent: Friday, May 19, 2023 3:10 PM
> > To: Biju Das <biju.das.jz@bp.renesas.com>
> > Cc: Conor Dooley <conor@kernel.org>; Rob Herring <robh+dt@kernel.org>;
> > Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>; Conor Dooley
> > <conor+dt@kernel.org>; Liam Girdwood <lgirdwood@gmail.com>; Mark Brown
> > <broonie@kernel.org>; Geert Uytterhoeven <geert+renesas@glider.be>;
> > Magnus Damm <magnus.damm@gmail.com>; devicetree@vger.kernel.org; linux-
> > renesas-soc@vger.kernel.org; Fabrizio Castro
> > <fabrizio.castro.jz@renesas.com>
> > Subject: Re: [PATCH v4 09/11] regulator: dt-bindings: Add Renesas
> > RAA215300 PMIC bindings
> >
> > On Fri, May 19, 2023 at 06:53:03AM +0000, Biju Das wrote:
> > > > Subject: Re: [PATCH v4 09/11] regulator: dt-bindings: Add Renesas
> > > > RAA215300 PMIC bindings
> > > >
> > > > On Thu, May 18, 2023 at 12:36:41PM +0100, Biju Das wrote:
> > > > > Document Renesas RAA215300 PMIC bindings.
> > > > >
> > > > > The RAA215300 is a high Performance 9-Channel PMIC supporting DDR
> > > > > Memory, with Built-In Charger and RTC.
> > > > >
> > > > > It supports DDR3, DDR3L, DDR4, and LPDDR4 memory power
> > requirements.
> > > > > The internally compensated regulators, built-in Real-Time Clock
> > > > > (RTC), 32kHz crystal oscillator, and coin cell battery charger
> > > > > provide a highly integrated, small footprint power solution ideal
> > > > > for System-On-Module (SOM) applications. A spread spectrum feature
> > > > > provides an ease-of-use solution for noise-sensitive audio or RF
> > > > > applications.
> > > > > + reg:
> > > > > + maxItems: 2
> > > > > +
> > > > > + reg-names:
> > > > > + items:
> > > > > + - const: main
> > > > > + - const: rtc
> > > >
> > > > > +required:
> > > > > + - compatible
> > > > > + - reg
> > > > > + - reg-names
> > > >
> > > > Out of curiosity as much as anything else, why do you need reg-names
> > > > if the two registers are always required?
> > >
> > > The device has always 2 address spaces and "reg-names" provides a
> > > means of clear differentiation compared to indices.
> > >
> > > By enforcing "reg-names" as required property, dt can do some
> > > schema-validation forcing users to specify "reg-names" in device tree.
> >
> > Is that not what we have the following for:
> > reg:
> > items:
> > - description: main register space...
> > - description: special sauce rtc stuff...
> > ?
>
> OK, will add description.
>
> >
> > The schema validation doesn't stop them putting in the wrong address
> > either way!
>
> OK, will drop reg-names from required property.
Please don't, as i2c_new_ancillary_device() does rely on the name
to set the address when overriding from the default.
> > > Implementation wise, we use "rtc" for getting resource details while
> > > creating the second i2c device which overrides the default address.
> > >
> > > Strictly speaking reg-names is not required, but from a validation
> > > perspective and since driver is using the same "resource-name" it is
> > > better to have it??
> >
> > If the order is set by the descriptions, reg-names seem superfluous
> > /shrug
We have plenty of these, as it turned out to be much easier for validation
to fix the order in the bindings than to support random order ;-)
Lots of Linux drivers that do use the names don't care about the order.
If all actual DTS used the same order, usually the order was fixed during
the text to json-schema conversion...
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v4 09/11] regulator: dt-bindings: Add Renesas RAA215300 PMIC bindings
2023-05-19 14:49 ` Geert Uytterhoeven
@ 2023-05-19 14:52 ` Geert Uytterhoeven
2023-05-19 15:20 ` Conor Dooley
1 sibling, 0 replies; 18+ messages in thread
From: Geert Uytterhoeven @ 2023-05-19 14:52 UTC (permalink / raw)
To: Biju Das
Cc: Conor Dooley, Conor Dooley, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Liam Girdwood, Mark Brown, Geert Uytterhoeven,
Magnus Damm, devicetree@vger.kernel.org,
linux-renesas-soc@vger.kernel.org, Fabrizio Castro
On Fri, May 19, 2023 at 4:49 PM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> On Fri, May 19, 2023 at 4:39 PM Biju Das <biju.das.jz@bp.renesas.com> wrote:
> > > From: Conor Dooley <conor.dooley@microchip.com>
> > > If the order is set by the descriptions, reg-names seem superfluous
> > > /shrug
>
> We have plenty of these, as it turned out to be much easier for validation
> to fix the order in the bindings than to support random order ;-)
> Lots of Linux drivers that do use the names don't care about the order.
> If all actual DTS used the same order, usually the order was fixed during
I meant "When all actual DTS...".
> the text to json-schema conversion...
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v4 09/11] regulator: dt-bindings: Add Renesas RAA215300 PMIC bindings
2023-05-19 14:10 ` Conor Dooley
2023-05-19 14:39 ` Biju Das
@ 2023-05-19 14:58 ` Mark Brown
1 sibling, 0 replies; 18+ messages in thread
From: Mark Brown @ 2023-05-19 14:58 UTC (permalink / raw)
To: Conor Dooley
Cc: Biju Das, Conor Dooley, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Liam Girdwood, Geert Uytterhoeven, Magnus Damm,
devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
Fabrizio Castro
[-- Attachment #1: Type: text/plain, Size: 650 bytes --]
On Fri, May 19, 2023 at 03:10:25PM +0100, Conor Dooley wrote:
> On Fri, May 19, 2023 at 06:53:03AM +0000, Biju Das wrote:
> > By enforcing "reg-names" as required property, dt can do some schema-validation
> > forcing users to specify "reg-names" in device tree.
> Is that not what we have the following for:
> reg:
> items:
> - description: main register space...
> - description: special sauce rtc stuff...
> ?
> The schema validation doesn't stop them putting in the wrong address
> either way!
Being able to look things up by name does help make the code using the
binding more readable, and it helps with reading the DTs too.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH v4 09/11] regulator: dt-bindings: Add Renesas RAA215300 PMIC bindings
2023-05-19 14:49 ` Geert Uytterhoeven
2023-05-19 14:52 ` Geert Uytterhoeven
@ 2023-05-19 15:20 ` Conor Dooley
1 sibling, 0 replies; 18+ messages in thread
From: Conor Dooley @ 2023-05-19 15:20 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Biju Das, Conor Dooley, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Liam Girdwood, Mark Brown, Geert Uytterhoeven,
Magnus Damm, devicetree@vger.kernel.org,
linux-renesas-soc@vger.kernel.org, Fabrizio Castro
[-- Attachment #1: Type: text/plain, Size: 1024 bytes --]
On Fri, May 19, 2023 at 04:49:44PM +0200, Geert Uytterhoeven wrote:
> On Fri, May 19, 2023 at 4:39 PM Biju Das <biju.das.jz@bp.renesas.com> wrote:
> > > -----Original Message-----
> > > From: Conor Dooley <conor.dooley@microchip.com>
> > > On Fri, May 19, 2023 at 06:53:03AM +0000, Biju Das wrote:
> > > > > Subject: Re: [PATCH v4 09/11] regulator: dt-bindings: Add Renesas
> > > > > > +required:
> > > > > > + - compatible
> > > > > > + - reg
> > > > > > + - reg-names
> > > > >
> > > > > Out of curiosity as much as anything else, why do you need reg-names
> > > > > if the two registers are always required?
> > OK, will drop reg-names from required property.
>
> Please don't, as i2c_new_ancillary_device() does rely on the name
> to set the address when overriding from the default.
That looks like my answer! Thanks Geert & sorry for the noise here.
Modulo Geert's requested change, I think I owe you a
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Biju.
Thanks,
Conor.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 18+ messages in thread
* RE: [PATCH v4 03/11] dt-bindings: rtc: isil,isl1208: Document clock and clock-names properties
2023-05-19 12:35 ` Geert Uytterhoeven
@ 2023-05-19 16:02 ` Biju Das
0 siblings, 0 replies; 18+ messages in thread
From: Biju Das @ 2023-05-19 16:02 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Alessandro Zummo, Alexandre Belloni, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Trent Piepho,
linux-rtc@vger.kernel.org, devicetree@vger.kernel.org,
Geert Uytterhoeven, Fabrizio Castro,
linux-renesas-soc@vger.kernel.org
Hi Geert,
Thanks for the feedback.
> Subject: Re: [PATCH v4 03/11] dt-bindings: rtc: isil,isl1208: Document
> clock and clock-names properties
>
> Hi Biju,
>
> On Thu, May 18, 2023 at 1:37 PM Biju Das <biju.das.jz@bp.renesas.com>
> wrote:
> > As per the HW manual, XTOSCB bit setting is as follows
> >
> > If using an external clock signal, set the XTOSCB bit as 1 to disable
> > the crystal oscillator.
> >
> > If using an external crystal, the XTOSCB bit needs to be set at 0 to
> > enable the crystal oscillator.
> >
> > Document clock and clock-names properties.
> >
> > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> > ---
> > v4:
> > * New patch
>
> Thanks for your patch!
>
> > --- a/Documentation/devicetree/bindings/rtc/isil,isl1208.yaml
> > +++ b/Documentation/devicetree/bindings/rtc/isil,isl1208.yaml
> > @@ -25,6 +25,19 @@ properties:
> > reg:
> > maxItems: 1
> >
> > + clocks:
> > + maxItems: 1
> > +
> > + clock-names:
> > + description: |
> > + Use xin, if connected to an external crystal.
> > + Use clkin, if connected to an external clock signal.
> > + oneOf:
> > + - items:
> > + - const: xin
> > + - items:
> > + - const: clkin
> > +
>
> I guess that oneOf scheme is equivalent to the simpler
>
> enum:
> - xin
> - clkin
Agreed.
Cheers,
Biju
^ permalink raw reply [flat|nested] 18+ messages in thread
* RE: [PATCH v4 09/11] regulator: dt-bindings: Add Renesas RAA215300 PMIC bindings
2023-05-19 12:58 ` Geert Uytterhoeven
@ 2023-05-19 16:49 ` Biju Das
0 siblings, 0 replies; 18+ messages in thread
From: Biju Das @ 2023-05-19 16:49 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Liam Girdwood,
Mark Brown, Geert Uytterhoeven, Magnus Damm,
devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
Fabrizio Castro
Hi Geert,
Thanks for the feedback.
> Subject: Re: [PATCH v4 09/11] regulator: dt-bindings: Add Renesas
> RAA215300 PMIC bindings
>
> Hi Biju,
>
> On Thu, May 18, 2023 at 1:37 PM Biju Das <biju.das.jz@bp.renesas.com>
> wrote:
> > Document Renesas RAA215300 PMIC bindings.
> >
> > The RAA215300 is a high Performance 9-Channel PMIC supporting DDR
> > Memory, with Built-In Charger and RTC.
> >
> > It supports DDR3, DDR3L, DDR4, and LPDDR4 memory power requirements.
> > The internally compensated regulators, built-in Real-Time Clock (RTC),
> > 32kHz crystal oscillator, and coin cell battery charger provide a
> > highly integrated, small footprint power solution ideal for
> > System-On-Module (SOM) applications. A spread spectrum feature
> > provides an ease-of-use solution for noise-sensitive audio or RF
> > applications.
> >
> > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> > ---
> > v3->v4:
> > * Moved bindings from mfd->regulator.
> > * Dropped minItems from reg.
> > * Dropped renesas,rtc-enabled property and instead used clock-names
> property
> > to find RTC is enabled or not.
> > * Added reg-names in required property.
> > * Updated the example.
>
> Thanks for your patch!
>
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/regulator/renesas,raa215300.ya
> > +++ ml
> > @@ -0,0 +1,84 @@
> > +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause %YAML 1.2
> > +---
> > +$id:
> > +title: Renesas RAA215300 Power Management Integrated Circuit (PMIC)
> > +
> > +maintainers:
> > + - Biju Das <biju.das.jz@bp.renesas.com>
> > +
> > +description: |
> > + The RAA215300 is a high-performance, low-cost 9-channel PMIC
> > +designed for
> > + 32-bit and 64-bit MCU and MPU applications. It supports DDR3,
> > +DDR3L, DDR4,
> > + and LPDDR4 memory power requirements. The internally compensated
> > +regulators,
> > + built-in Real-Time Clock (RTC), 32kHz crystal oscillator, and coin
> > +cell
> > + battery charger provide a highly integrated, small footprint power
> > +solution
> > + ideal for System-On-Module (SOM) applications. A spread spectrum
> > +feature
> > + provides an ease-of-use solution for noise-sensitive audio or RF
> applications.
> > +
> > + This device exposes two devices via I2C. One for the integrated RTC
> > + IP, and one for everything else.
> > +
> > + Link to datasheet:
> > +
> > + https://www.renesas.com/in/en/products/power-power-management/multi-
> > + channel-power-management-ics-pmics/ssdsoc-power-management-ics-pmic-
> > + and-pmus/raa215300-high-performance-9-channel-pmic-supporting-ddr-me
> > + mory-built-charger-and-rtc
> > +
> > +properties:
> > + compatible:
> > + enum:
> > + - renesas,raa215300
> > +
> > + reg:
> > + maxItems: 2
> > +
> > + reg-names:
> > + items:
> > + - const: main
> > + - const: rtc
> > +
> > + interrupts:
> > + maxItems: 1
> > +
> > + clocks:
> > + maxItems: 1
>
> Perhaps add a description to make it clear that not providing clocks is
> supported, and means the RTC is disabled?
Agreed.
>
> > +
> > + clock-names:
> > + description: |
> > + Use xin, if connected to an external crystal.
> > + Use clkin, if connected to an external clock signal.
> > + oneOf:
> > + - items:
> > + - const: xin
> > + - items:
> > + - const: clkin
>
> Please replace oneOf+items by enum.
OK.
Cheers,
Biju
>
> > +
> > +required:
> > + - compatible
> > + - reg
> > + - reg-names
^ permalink raw reply [flat|nested] 18+ messages in thread
end of thread, other threads:[~2023-05-19 16:49 UTC | newest]
Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-18 11:36 [PATCH v4 00/11] Add Renesas PMIC RAA215300 and built-in RTC support Biju Das
2023-05-18 11:36 ` [PATCH v4 02/11] dt-bindings: rtc: isl1208: Convert to json-schema Biju Das
2023-05-18 11:36 ` [PATCH v4 03/11] dt-bindings: rtc: isil,isl1208: Document clock and clock-names properties Biju Das
2023-05-18 19:17 ` Conor Dooley
2023-05-19 12:35 ` Geert Uytterhoeven
2023-05-19 16:02 ` Biju Das
2023-05-18 11:36 ` [PATCH v4 09/11] regulator: dt-bindings: Add Renesas RAA215300 PMIC bindings Biju Das
2023-05-18 19:13 ` Conor Dooley
2023-05-19 6:53 ` Biju Das
2023-05-19 14:10 ` Conor Dooley
2023-05-19 14:39 ` Biju Das
2023-05-19 14:49 ` Geert Uytterhoeven
2023-05-19 14:52 ` Geert Uytterhoeven
2023-05-19 15:20 ` Conor Dooley
2023-05-19 14:58 ` Mark Brown
2023-05-19 12:58 ` Geert Uytterhoeven
2023-05-19 16:49 ` Biju Das
2023-05-18 11:36 ` [PATCH v4 11/11] arm64: dts: renesas: rzg2l-smarc-som: Enable PMIC and built-in RTC Biju Das
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).