The S3C RTC requires 32768 Hz clock as input which is provided by PMIC.
However there is no such clock provider but rather a regulator driver
which registers the clock as a regulator.  This is an old driver which
will not be updated so add a workaround - a fixed-clock to fill missing
clock phandle reference in S3C RTC.

This fixes dtbs_check warnings:

  rtc@e2800000: clocks: [[2, 145]] is too short
  rtc@e2800000: clock-names: ['rtc'] is too short

Signed-off-by: Krzysztof Kozlowski <k...@kernel.org>
---
 arch/arm/boot/dts/s5pv210-aquila.dts | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/arch/arm/boot/dts/s5pv210-aquila.dts 
b/arch/arm/boot/dts/s5pv210-aquila.dts
index 14969b6529e8..eaeb0e921aaa 100644
--- a/arch/arm/boot/dts/s5pv210-aquila.dts
+++ b/arch/arm/boot/dts/s5pv210-aquila.dts
@@ -32,6 +32,13 @@
                        0x40000000 0x18000000>;
        };
 
+       pmic_ap_clk: clock-0 {
+               /* Workaround for missing clock on PMIC */
+               compatible = "fixed-clock";
+               #clock-cells = <0>;
+               clock-frequency = <32768>;
+       };
+
        regulators {
                compatible = "simple-bus";
                #address-cells = <1>;
@@ -228,6 +235,11 @@
                                        regulator-always-on;
                                };
 
+                               ap32khz_reg: EN32KHz-AP {
+                                       regulator-name = "32KHz AP";
+                                       regulator-always-on;
+                               };
+
                                vichg_reg: ENVICHG {
                                        regulator-name = "VICHG";
                                };
@@ -326,6 +338,11 @@
        status = "okay";
 };
 
+&rtc {
+       clocks = <&clocks CLK_RTC>, <&pmic_ap_clk>;
+       clock-names = "rtc", "rtc_src";
+};
+
 &sdhci0 {
        bus-width = <4>;
        non-removable;
-- 
2.17.1

Reply via email to