* [PATCH v6 1/4] rtc: ac100: support clock-output-names in device tree binding
2016-08-19 7:42 [PATCH v6 0/4] ARM: dts: sun9i: Enable X-Powers AC100 RTC Chen-Yu Tsai
@ 2016-08-19 7:42 ` Chen-Yu Tsai
2016-08-31 16:24 ` Alexandre Belloni
2016-08-19 7:42 ` [PATCH v6 2/4] ARM: dts: sun9i: a80-optimus: Add device node for AC100 Chen-Yu Tsai
` (3 subsequent siblings)
4 siblings, 1 reply; 7+ messages in thread
From: Chen-Yu Tsai @ 2016-08-19 7:42 UTC (permalink / raw)
To: linux-arm-kernel
The ac100 device tree binding specifies the usage of clock-output-names
to specify the names of its 3 clock outputs. This is needed for orphan
clock resolution, when the ac100 is probed much later than any clocks
that consume any of its outputs. This wasn't supported by the driver.
Add support for this.
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
Changes since v5:
- New patch, based on mfd-rtc immutable branch given in
http://www.spinics.net/lists/devicetree/msg137991.html
---
drivers/rtc/rtc-ac100.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/rtc/rtc-ac100.c b/drivers/rtc/rtc-ac100.c
index 70b4fd0f6122..2d0bb02a25d9 100644
--- a/drivers/rtc/rtc-ac100.c
+++ b/drivers/rtc/rtc-ac100.c
@@ -327,6 +327,8 @@ static int ac100_rtc_register_clks(struct ac100_rtc_dev *chip)
.flags = 0,
};
+ of_property_read_string_index(np, "clock-output-names",
+ i, &init.name);
clk->regmap = chip->regmap;
clk->offset = AC100_CLKOUT_CTRL1 + i;
clk->hw.init = &init;
--
2.9.3
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH v6 2/4] ARM: dts: sun9i: a80-optimus: Add device node for AC100
2016-08-19 7:42 [PATCH v6 0/4] ARM: dts: sun9i: Enable X-Powers AC100 RTC Chen-Yu Tsai
2016-08-19 7:42 ` [PATCH v6 1/4] rtc: ac100: support clock-output-names in device tree binding Chen-Yu Tsai
@ 2016-08-19 7:42 ` Chen-Yu Tsai
2016-08-19 7:42 ` [PATCH v6 3/4] ARM: dts: sun9i: cubieboard4: " Chen-Yu Tsai
` (2 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Chen-Yu Tsai @ 2016-08-19 7:42 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
Changes since v5: none
Changes since v4: none
Changes since v3:
- Moved 4M ADDA clk to codec side
Changes since v2: none
Changes since v1: none
---
arch/arm/boot/dts/sun9i-a80-optimus.dts | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/arch/arm/boot/dts/sun9i-a80-optimus.dts b/arch/arm/boot/dts/sun9i-a80-optimus.dts
index 7fd22e888602..e35c06c162a7 100644
--- a/arch/arm/boot/dts/sun9i-a80-optimus.dts
+++ b/arch/arm/boot/dts/sun9i-a80-optimus.dts
@@ -322,6 +322,30 @@
};
};
};
+
+ ac100: codec at e89 {
+ compatible = "x-powers,ac100";
+ reg = <0xe89>;
+
+ ac100_codec: codec {
+ compatible = "x-powers,ac100-codec";
+ interrupt-parent = <&r_pio>;
+ interrupts = <0 9 IRQ_TYPE_LEVEL_LOW>; /* PL9 */
+ #clock-cells = <0>;
+ clock-output-names = "4M_adda";
+ };
+
+ ac100_rtc: rtc {
+ compatible = "x-powers,ac100-rtc";
+ interrupt-parent = <&nmi_intc>;
+ interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
+ clocks = <&ac100_codec>;
+ #clock-cells = <1>;
+ clock-output-names = "cko1_rtc",
+ "cko2_rtc",
+ "cko3_rtc";
+ };
+ };
};
#include "axp809.dtsi"
--
2.9.3
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH v6 3/4] ARM: dts: sun9i: cubieboard4: Add device node for AC100
2016-08-19 7:42 [PATCH v6 0/4] ARM: dts: sun9i: Enable X-Powers AC100 RTC Chen-Yu Tsai
2016-08-19 7:42 ` [PATCH v6 1/4] rtc: ac100: support clock-output-names in device tree binding Chen-Yu Tsai
2016-08-19 7:42 ` [PATCH v6 2/4] ARM: dts: sun9i: a80-optimus: Add device node for AC100 Chen-Yu Tsai
@ 2016-08-19 7:42 ` Chen-Yu Tsai
2016-08-19 7:42 ` [PATCH v6 4/4] ARM: dts: sun9i: Switch to the AC100 RTC clock outputs for osc32k Chen-Yu Tsai
2016-08-22 18:40 ` [PATCH v6 0/4] ARM: dts: sun9i: Enable X-Powers AC100 RTC Maxime Ripard
4 siblings, 0 replies; 7+ messages in thread
From: Chen-Yu Tsai @ 2016-08-19 7:42 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
Changes since v5: none
Changes since v4: none
Changes since v3:
- Moved 4M ADDA clk to codec side
Changes since v2: none
Changes since v1: none
---
arch/arm/boot/dts/sun9i-a80-cubieboard4.dts | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/arch/arm/boot/dts/sun9i-a80-cubieboard4.dts b/arch/arm/boot/dts/sun9i-a80-cubieboard4.dts
index 1526b41c70f1..cf2f4b72a841 100644
--- a/arch/arm/boot/dts/sun9i-a80-cubieboard4.dts
+++ b/arch/arm/boot/dts/sun9i-a80-cubieboard4.dts
@@ -250,6 +250,30 @@
};
};
};
+
+ ac100: codec at e89 {
+ compatible = "x-powers,ac100";
+ reg = <0xe89>;
+
+ ac100_codec: codec {
+ compatible = "x-powers,ac100-codec";
+ interrupt-parent = <&r_pio>;
+ interrupts = <0 9 IRQ_TYPE_LEVEL_LOW>; /* PL9 */
+ #clock-cells = <0>;
+ clock-output-names = "4M_adda";
+ };
+
+ ac100_rtc: rtc {
+ compatible = "x-powers,ac100-rtc";
+ interrupt-parent = <&nmi_intc>;
+ interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
+ clocks = <&ac100_codec>;
+ #clock-cells = <1>;
+ clock-output-names = "cko1_rtc",
+ "cko2_rtc",
+ "cko3_rtc";
+ };
+ };
};
#include "axp809.dtsi"
--
2.9.3
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH v6 4/4] ARM: dts: sun9i: Switch to the AC100 RTC clock outputs for osc32k
2016-08-19 7:42 [PATCH v6 0/4] ARM: dts: sun9i: Enable X-Powers AC100 RTC Chen-Yu Tsai
` (2 preceding siblings ...)
2016-08-19 7:42 ` [PATCH v6 3/4] ARM: dts: sun9i: cubieboard4: " Chen-Yu Tsai
@ 2016-08-19 7:42 ` Chen-Yu Tsai
2016-08-22 18:40 ` [PATCH v6 0/4] ARM: dts: sun9i: Enable X-Powers AC100 RTC Maxime Ripard
4 siblings, 0 replies; 7+ messages in thread
From: Chen-Yu Tsai @ 2016-08-19 7:42 UTC (permalink / raw)
To: linux-arm-kernel
The 32.768 kHz clock inside the A80 SoC is fed from an external source,
typically the AC100 RTC module.
Make the osc32k placeholder a fixed-factor clock so board dts files can
specify its source.
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
Changes since v5:
- Added "clk-div" and "clk-mult" fixed-factor-clock properties to osc32k
placeholder.
Changes since v4: none
Changes since v3: none
Changes since v2: none
Changes since v1: none
---
arch/arm/boot/dts/sun9i-a80-cubieboard4.dts | 5 +++++
arch/arm/boot/dts/sun9i-a80-optimus.dts | 5 +++++
arch/arm/boot/dts/sun9i-a80.dtsi | 11 +++++------
3 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/arch/arm/boot/dts/sun9i-a80-cubieboard4.dts b/arch/arm/boot/dts/sun9i-a80-cubieboard4.dts
index cf2f4b72a841..04b014603659 100644
--- a/arch/arm/boot/dts/sun9i-a80-cubieboard4.dts
+++ b/arch/arm/boot/dts/sun9i-a80-cubieboard4.dts
@@ -103,6 +103,11 @@
allwinner,drive = <SUN4I_PINCTRL_40_MA>;
};
+&osc32k {
+ /* osc32k input is from AC100 */
+ clocks = <&ac100_rtc 0>;
+};
+
&pio {
led_pins_cubieboard4: led-pins at 0 {
allwinner,pins = "PH6", "PH17";
diff --git a/arch/arm/boot/dts/sun9i-a80-optimus.dts b/arch/arm/boot/dts/sun9i-a80-optimus.dts
index e35c06c162a7..fd874ded890e 100644
--- a/arch/arm/boot/dts/sun9i-a80-optimus.dts
+++ b/arch/arm/boot/dts/sun9i-a80-optimus.dts
@@ -152,6 +152,11 @@
status = "okay";
};
+&osc32k {
+ /* osc32k input is from AC100 */
+ clocks = <&ac100_rtc 0>;
+};
+
&pio {
led_pins_optimus: led-pins at 0 {
allwinner,pins = "PH0", "PH1";
diff --git a/arch/arm/boot/dts/sun9i-a80.dtsi b/arch/arm/boot/dts/sun9i-a80.dtsi
index f68b3242b33a..24e3cac4f571 100644
--- a/arch/arm/boot/dts/sun9i-a80.dtsi
+++ b/arch/arm/boot/dts/sun9i-a80.dtsi
@@ -148,15 +148,14 @@
/*
* The 32k clock is from an external source, normally the
- * AC100 codec/RTC chip. This clock is by default enabled
- * and clocked at 32768 Hz, from the oscillator connected
- * to the AC100. It is configurable, but no such driver or
- * bindings exist yet.
+ * AC100 codec/RTC chip. This serves as a placeholder for
+ * board dts files to specify the source.
*/
osc32k: osc32k_clk {
#clock-cells = <0>;
- compatible = "fixed-clock";
- clock-frequency = <32768>;
+ compatible = "fixed-factor-clock";
+ clock-div = <1>;
+ clock-mult = <1>;
clock-output-names = "osc32k";
};
--
2.9.3
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH v6 0/4] ARM: dts: sun9i: Enable X-Powers AC100 RTC
2016-08-19 7:42 [PATCH v6 0/4] ARM: dts: sun9i: Enable X-Powers AC100 RTC Chen-Yu Tsai
` (3 preceding siblings ...)
2016-08-19 7:42 ` [PATCH v6 4/4] ARM: dts: sun9i: Switch to the AC100 RTC clock outputs for osc32k Chen-Yu Tsai
@ 2016-08-22 18:40 ` Maxime Ripard
4 siblings, 0 replies; 7+ messages in thread
From: Maxime Ripard @ 2016-08-22 18:40 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
On Fri, Aug 19, 2016 at 03:42:22PM +0800, Chen-Yu Tsai wrote:
> Hi everyone,
>
> This was "mfd: ac100: Add support for X-Powers AC100 audio codec / RTC
> combo IC". The driver bits have all been merged.
Applied the DT patches. Thanks!
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160822/c4cad27b/attachment.sig>
^ permalink raw reply [flat|nested] 7+ messages in thread