* [PATCH v6 1/4] rtc: ac100: support clock-output-names in device tree binding
[not found] ` <20160819074226.16636-1-wens-jdAy2FN1RRM@public.gmane.org>
@ 2016-08-19 7:42 ` Chen-Yu Tsai
[not found] ` <20160819074226.16636-2-wens-jdAy2FN1RRM@public.gmane.org>
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: Alessandro Zummo, Alexandre Belloni, Maxime Ripard
Cc: Chen-Yu Tsai, rtc-linux-/JYPxA39Uh5TLH3MbocFFw,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
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-jdAy2FN1RRM@public.gmane.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
--
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
---
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH v6 2/4] ARM: dts: sun9i: a80-optimus: Add device node for AC100
[not found] ` <20160819074226.16636-1-wens-jdAy2FN1RRM@public.gmane.org>
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: Alessandro Zummo, Alexandre Belloni, Maxime Ripard
Cc: Chen-Yu Tsai, rtc-linux-/JYPxA39Uh5TLH3MbocFFw,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
Signed-off-by: Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.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@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
--
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
---
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH v6 3/4] ARM: dts: sun9i: cubieboard4: Add device node for AC100
[not found] ` <20160819074226.16636-1-wens-jdAy2FN1RRM@public.gmane.org>
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: Alessandro Zummo, Alexandre Belloni, Maxime Ripard
Cc: Chen-Yu Tsai, rtc-linux-/JYPxA39Uh5TLH3MbocFFw,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
Signed-off-by: Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.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@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
--
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
---
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.
^ 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
[not found] ` <20160819074226.16636-1-wens-jdAy2FN1RRM@public.gmane.org>
` (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: Alessandro Zummo, Alexandre Belloni, Maxime Ripard
Cc: Chen-Yu Tsai, rtc-linux-/JYPxA39Uh5TLH3MbocFFw,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
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-jdAy2FN1RRM@public.gmane.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@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@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
--
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
---
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH v6 0/4] ARM: dts: sun9i: Enable X-Powers AC100 RTC
[not found] ` <20160819074226.16636-1-wens-jdAy2FN1RRM@public.gmane.org>
` (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: Chen-Yu Tsai
Cc: Alessandro Zummo, Alexandre Belloni,
rtc-linux-/JYPxA39Uh5TLH3MbocFFw,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
[-- Attachment #1: Type: text/plain, Size: 895 bytes --]
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
--
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
---
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread