All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rtc: OMAP: Add external 32k clock feature
@ 2015-03-03  9:42 ` Keerthy
  0 siblings, 0 replies; 19+ messages in thread
From: Keerthy @ 2015-03-03  9:42 UTC (permalink / raw)
  To: a.zummo; +Cc: rtc-linux, linux-kernel, linux-omap, j-keerthy

Add external 32k clock feature. The internal clock will be gated during suspend.
Hence make use of the external 32k clock so that rtc is functional accross
suspend/resume.

Signed-off-by: Keerthy <j-keerthy@ti.com>
---

Tested on DRA7-EVM.

 drivers/rtc/rtc-omap.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/drivers/rtc/rtc-omap.c b/drivers/rtc/rtc-omap.c
index 8e5851a..4f803ca 100644
--- a/drivers/rtc/rtc-omap.c
+++ b/drivers/rtc/rtc-omap.c
@@ -107,6 +107,8 @@
 
 /* OMAP_RTC_OSC_REG bit fields: */
 #define OMAP_RTC_OSC_32KCLK_EN		BIT(6)
+#define OMAP_RTC_OSC_OSC32K_GZ		BIT(4)
+#define OMAP_RTC_OSC_EXT_32K		BIT(3)
 
 /* OMAP_RTC_IRQWAKEEN bit fields: */
 #define OMAP_RTC_IRQWAKEEN_ALARM_WAKEEN	BIT(1)
@@ -120,6 +122,7 @@
 
 struct omap_rtc_device_type {
 	bool has_32kclk_en;
+	bool has_osc_ext_32k;
 	bool has_kicker;
 	bool has_irqwakeen;
 	bool has_pmic_mode;
@@ -446,6 +449,7 @@ static const struct omap_rtc_device_type omap_rtc_default_type = {
 
 static const struct omap_rtc_device_type omap_rtc_am3352_type = {
 	.has_32kclk_en	= true,
+	.has_osc_ext_32k = true,
 	.has_kicker	= true,
 	.has_irqwakeen	= true,
 	.has_pmic_mode	= true,
@@ -543,7 +547,16 @@ static int __init omap_rtc_probe(struct platform_device *pdev)
 	if (rtc->type->has_32kclk_en) {
 		reg = rtc_read(rtc, OMAP_RTC_OSC_REG);
 		rtc_writel(rtc, OMAP_RTC_OSC_REG,
-				reg | OMAP_RTC_OSC_32KCLK_EN);
+			   reg | OMAP_RTC_OSC_32KCLK_EN);
+	}
+
+	/* Enable External clock as the source */
+
+	if (rtc->type->has_osc_ext_32k) {
+		rtc_writel(rtc, OMAP_RTC_OSC_REG,
+			   (OMAP_RTC_OSC_EXT_32K |
+			   rtc_read(rtc, OMAP_RTC_OSC_REG)) &
+			   (~OMAP_RTC_OSC_OSC32K_GZ));
 	}
 
 	/* clear old status */
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH] rtc: OMAP: Add external 32k clock feature
@ 2015-03-03  9:42 ` Keerthy
  0 siblings, 0 replies; 19+ messages in thread
From: Keerthy @ 2015-03-03  9:42 UTC (permalink / raw)
  To: a.zummo; +Cc: rtc-linux, linux-kernel, linux-omap, j-keerthy

Add external 32k clock feature. The internal clock will be gated during suspend.
Hence make use of the external 32k clock so that rtc is functional accross
suspend/resume.

Signed-off-by: Keerthy <j-keerthy@ti.com>
---

Tested on DRA7-EVM.

 drivers/rtc/rtc-omap.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/drivers/rtc/rtc-omap.c b/drivers/rtc/rtc-omap.c
index 8e5851a..4f803ca 100644
--- a/drivers/rtc/rtc-omap.c
+++ b/drivers/rtc/rtc-omap.c
@@ -107,6 +107,8 @@
 
 /* OMAP_RTC_OSC_REG bit fields: */
 #define OMAP_RTC_OSC_32KCLK_EN		BIT(6)
+#define OMAP_RTC_OSC_OSC32K_GZ		BIT(4)
+#define OMAP_RTC_OSC_EXT_32K		BIT(3)
 
 /* OMAP_RTC_IRQWAKEEN bit fields: */
 #define OMAP_RTC_IRQWAKEEN_ALARM_WAKEEN	BIT(1)
@@ -120,6 +122,7 @@
 
 struct omap_rtc_device_type {
 	bool has_32kclk_en;
+	bool has_osc_ext_32k;
 	bool has_kicker;
 	bool has_irqwakeen;
 	bool has_pmic_mode;
@@ -446,6 +449,7 @@ static const struct omap_rtc_device_type omap_rtc_default_type = {
 
 static const struct omap_rtc_device_type omap_rtc_am3352_type = {
 	.has_32kclk_en	= true,
+	.has_osc_ext_32k = true,
 	.has_kicker	= true,
 	.has_irqwakeen	= true,
 	.has_pmic_mode	= true,
@@ -543,7 +547,16 @@ static int __init omap_rtc_probe(struct platform_device *pdev)
 	if (rtc->type->has_32kclk_en) {
 		reg = rtc_read(rtc, OMAP_RTC_OSC_REG);
 		rtc_writel(rtc, OMAP_RTC_OSC_REG,
-				reg | OMAP_RTC_OSC_32KCLK_EN);
+			   reg | OMAP_RTC_OSC_32KCLK_EN);
+	}
+
+	/* Enable External clock as the source */
+
+	if (rtc->type->has_osc_ext_32k) {
+		rtc_writel(rtc, OMAP_RTC_OSC_REG,
+			   (OMAP_RTC_OSC_EXT_32K |
+			   rtc_read(rtc, OMAP_RTC_OSC_REG)) &
+			   (~OMAP_RTC_OSC_OSC32K_GZ));
 	}
 
 	/* clear old status */
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [PATCH] rtc: OMAP: Add external 32k clock feature
  2015-03-03  9:42 ` Keerthy
@ 2015-03-17  4:15   ` Keerthy
  -1 siblings, 0 replies; 19+ messages in thread
From: Keerthy @ 2015-03-17  4:15 UTC (permalink / raw)
  To: a.zummo; +Cc: Keerthy, rtc-linux, linux-kernel, linux-omap



On Tuesday 03 March 2015 03:12 PM, Keerthy wrote:
> Add external 32k clock feature. The internal clock will be gated during suspend.
> Hence make use of the external 32k clock so that rtc is functional accross
> suspend/resume.

A gentle ping on this.

>
> Signed-off-by: Keerthy <j-keerthy@ti.com>
> ---
>
> Tested on DRA7-EVM.
>
>   drivers/rtc/rtc-omap.c | 15 ++++++++++++++-
>   1 file changed, 14 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/rtc/rtc-omap.c b/drivers/rtc/rtc-omap.c
> index 8e5851a..4f803ca 100644
> --- a/drivers/rtc/rtc-omap.c
> +++ b/drivers/rtc/rtc-omap.c
> @@ -107,6 +107,8 @@
>
>   /* OMAP_RTC_OSC_REG bit fields: */
>   #define OMAP_RTC_OSC_32KCLK_EN		BIT(6)
> +#define OMAP_RTC_OSC_OSC32K_GZ		BIT(4)
> +#define OMAP_RTC_OSC_EXT_32K		BIT(3)
>
>   /* OMAP_RTC_IRQWAKEEN bit fields: */
>   #define OMAP_RTC_IRQWAKEEN_ALARM_WAKEEN	BIT(1)
> @@ -120,6 +122,7 @@
>
>   struct omap_rtc_device_type {
>   	bool has_32kclk_en;
> +	bool has_osc_ext_32k;
>   	bool has_kicker;
>   	bool has_irqwakeen;
>   	bool has_pmic_mode;
> @@ -446,6 +449,7 @@ static const struct omap_rtc_device_type omap_rtc_default_type = {
>
>   static const struct omap_rtc_device_type omap_rtc_am3352_type = {
>   	.has_32kclk_en	= true,
> +	.has_osc_ext_32k = true,
>   	.has_kicker	= true,
>   	.has_irqwakeen	= true,
>   	.has_pmic_mode	= true,
> @@ -543,7 +547,16 @@ static int __init omap_rtc_probe(struct platform_device *pdev)
>   	if (rtc->type->has_32kclk_en) {
>   		reg = rtc_read(rtc, OMAP_RTC_OSC_REG);
>   		rtc_writel(rtc, OMAP_RTC_OSC_REG,
> -				reg | OMAP_RTC_OSC_32KCLK_EN);
> +			   reg | OMAP_RTC_OSC_32KCLK_EN);
> +	}
> +
> +	/* Enable External clock as the source */
> +
> +	if (rtc->type->has_osc_ext_32k) {
> +		rtc_writel(rtc, OMAP_RTC_OSC_REG,
> +			   (OMAP_RTC_OSC_EXT_32K |
> +			   rtc_read(rtc, OMAP_RTC_OSC_REG)) &
> +			   (~OMAP_RTC_OSC_OSC32K_GZ));
>   	}
>
>   	/* clear old status */
>

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH] rtc: OMAP: Add external 32k clock feature
@ 2015-03-17  4:15   ` Keerthy
  0 siblings, 0 replies; 19+ messages in thread
From: Keerthy @ 2015-03-17  4:15 UTC (permalink / raw)
  To: a.zummo; +Cc: Keerthy, rtc-linux, linux-kernel, linux-omap



On Tuesday 03 March 2015 03:12 PM, Keerthy wrote:
> Add external 32k clock feature. The internal clock will be gated during suspend.
> Hence make use of the external 32k clock so that rtc is functional accross
> suspend/resume.

A gentle ping on this.

>
> Signed-off-by: Keerthy <j-keerthy@ti.com>
> ---
>
> Tested on DRA7-EVM.
>
>   drivers/rtc/rtc-omap.c | 15 ++++++++++++++-
>   1 file changed, 14 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/rtc/rtc-omap.c b/drivers/rtc/rtc-omap.c
> index 8e5851a..4f803ca 100644
> --- a/drivers/rtc/rtc-omap.c
> +++ b/drivers/rtc/rtc-omap.c
> @@ -107,6 +107,8 @@
>
>   /* OMAP_RTC_OSC_REG bit fields: */
>   #define OMAP_RTC_OSC_32KCLK_EN		BIT(6)
> +#define OMAP_RTC_OSC_OSC32K_GZ		BIT(4)
> +#define OMAP_RTC_OSC_EXT_32K		BIT(3)
>
>   /* OMAP_RTC_IRQWAKEEN bit fields: */
>   #define OMAP_RTC_IRQWAKEEN_ALARM_WAKEEN	BIT(1)
> @@ -120,6 +122,7 @@
>
>   struct omap_rtc_device_type {
>   	bool has_32kclk_en;
> +	bool has_osc_ext_32k;
>   	bool has_kicker;
>   	bool has_irqwakeen;
>   	bool has_pmic_mode;
> @@ -446,6 +449,7 @@ static const struct omap_rtc_device_type omap_rtc_default_type = {
>
>   static const struct omap_rtc_device_type omap_rtc_am3352_type = {
>   	.has_32kclk_en	= true,
> +	.has_osc_ext_32k = true,
>   	.has_kicker	= true,
>   	.has_irqwakeen	= true,
>   	.has_pmic_mode	= true,
> @@ -543,7 +547,16 @@ static int __init omap_rtc_probe(struct platform_device *pdev)
>   	if (rtc->type->has_32kclk_en) {
>   		reg = rtc_read(rtc, OMAP_RTC_OSC_REG);
>   		rtc_writel(rtc, OMAP_RTC_OSC_REG,
> -				reg | OMAP_RTC_OSC_32KCLK_EN);
> +			   reg | OMAP_RTC_OSC_32KCLK_EN);
> +	}
> +
> +	/* Enable External clock as the source */
> +
> +	if (rtc->type->has_osc_ext_32k) {
> +		rtc_writel(rtc, OMAP_RTC_OSC_REG,
> +			   (OMAP_RTC_OSC_EXT_32K |
> +			   rtc_read(rtc, OMAP_RTC_OSC_REG)) &
> +			   (~OMAP_RTC_OSC_OSC32K_GZ));
>   	}
>
>   	/* clear old status */
>

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [rtc-linux] [PATCH] rtc: OMAP: Add external 32k clock feature
  2015-03-03  9:42 ` Keerthy
@ 2015-03-24 22:59   ` Andrew Morton
  -1 siblings, 0 replies; 19+ messages in thread
From: Andrew Morton @ 2015-03-24 22:59 UTC (permalink / raw)
  To: rtc-linux; +Cc: Keerthy, a.zummo, linux-kernel, linux-omap

On Tue, 3 Mar 2015 15:12:02 +0530 Keerthy <j-keerthy@ti.com> wrote:

> Add external 32k clock feature. The internal clock will be gated during suspend.
> Hence make use of the external 32k clock so that rtc is functional accross
> suspend/resume.
> 
> ...
>
> @@ -446,6 +449,7 @@ static const struct omap_rtc_device_type omap_rtc_default_type = {
>  
>  static const struct omap_rtc_device_type omap_rtc_am3352_type = {
>  	.has_32kclk_en	= true,
> +	.has_osc_ext_32k = true,
>  	.has_kicker	= true,
>  	.has_irqwakeen	= true,
>  	.has_pmic_mode	= true,
> @@ -543,7 +547,16 @@ static int __init omap_rtc_probe(struct platform_device *pdev)
>  	if (rtc->type->has_32kclk_en) {
>  		reg = rtc_read(rtc, OMAP_RTC_OSC_REG);
>  		rtc_writel(rtc, OMAP_RTC_OSC_REG,
> -				reg | OMAP_RTC_OSC_32KCLK_EN);
> +			   reg | OMAP_RTC_OSC_32KCLK_EN);
> +	}
> +
> +	/* Enable External clock as the source */
> +
> +	if (rtc->type->has_osc_ext_32k) {
> +		rtc_writel(rtc, OMAP_RTC_OSC_REG,
> +			   (OMAP_RTC_OSC_EXT_32K |
> +			   rtc_read(rtc, OMAP_RTC_OSC_REG)) &
> +			   (~OMAP_RTC_OSC_OSC32K_GZ));
>  	}

How do we know that all systems have this external clock and that it
works OK?

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [rtc-linux] [PATCH] rtc: OMAP: Add external 32k clock feature
@ 2015-03-24 22:59   ` Andrew Morton
  0 siblings, 0 replies; 19+ messages in thread
From: Andrew Morton @ 2015-03-24 22:59 UTC (permalink / raw)
  To: rtc-linux; +Cc: Keerthy, a.zummo, linux-kernel, linux-omap

On Tue, 3 Mar 2015 15:12:02 +0530 Keerthy <j-keerthy@ti.com> wrote:

> Add external 32k clock feature. The internal clock will be gated during suspend.
> Hence make use of the external 32k clock so that rtc is functional accross
> suspend/resume.
> 
> ...
>
> @@ -446,6 +449,7 @@ static const struct omap_rtc_device_type omap_rtc_default_type = {
>  
>  static const struct omap_rtc_device_type omap_rtc_am3352_type = {
>  	.has_32kclk_en	= true,
> +	.has_osc_ext_32k = true,
>  	.has_kicker	= true,
>  	.has_irqwakeen	= true,
>  	.has_pmic_mode	= true,
> @@ -543,7 +547,16 @@ static int __init omap_rtc_probe(struct platform_device *pdev)
>  	if (rtc->type->has_32kclk_en) {
>  		reg = rtc_read(rtc, OMAP_RTC_OSC_REG);
>  		rtc_writel(rtc, OMAP_RTC_OSC_REG,
> -				reg | OMAP_RTC_OSC_32KCLK_EN);
> +			   reg | OMAP_RTC_OSC_32KCLK_EN);
> +	}
> +
> +	/* Enable External clock as the source */
> +
> +	if (rtc->type->has_osc_ext_32k) {
> +		rtc_writel(rtc, OMAP_RTC_OSC_REG,
> +			   (OMAP_RTC_OSC_EXT_32K |
> +			   rtc_read(rtc, OMAP_RTC_OSC_REG)) &
> +			   (~OMAP_RTC_OSC_OSC32K_GZ));
>  	}

How do we know that all systems have this external clock and that it
works OK?

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [rtc-linux] [PATCH] rtc: OMAP: Add external 32k clock feature
  2015-03-24 22:59   ` Andrew Morton
  (?)
@ 2015-04-07  3:29     ` Keerthy
  -1 siblings, 0 replies; 19+ messages in thread
From: Keerthy @ 2015-04-07  3:29 UTC (permalink / raw)
  To: Andrew Morton, rtc-linux; +Cc: Keerthy, a.zummo, linux-kernel, linux-omap

Hi Andrew,

Apologies for replying late.

On Wednesday 25 March 2015 04:29 AM, Andrew Morton wrote:
> On Tue, 3 Mar 2015 15:12:02 +0530 Keerthy <j-keerthy@ti.com> wrote:
>
>> Add external 32k clock feature. The internal clock will be gated during suspend.
>> Hence make use of the external 32k clock so that rtc is functional accross
>> suspend/resume.
>>
>> ...
>>
>> @@ -446,6 +449,7 @@ static const struct omap_rtc_device_type omap_rtc_default_type = {
>>
>>   static const struct omap_rtc_device_type omap_rtc_am3352_type = {
>>   	.has_32kclk_en	= true,
>> +	.has_osc_ext_32k = true,
>>   	.has_kicker	= true,
>>   	.has_irqwakeen	= true,
>>   	.has_pmic_mode	= true,
>> @@ -543,7 +547,16 @@ static int __init omap_rtc_probe(struct platform_device *pdev)
>>   	if (rtc->type->has_32kclk_en) {
>>   		reg = rtc_read(rtc, OMAP_RTC_OSC_REG);
>>   		rtc_writel(rtc, OMAP_RTC_OSC_REG,
>> -				reg | OMAP_RTC_OSC_32KCLK_EN);
>> +			   reg | OMAP_RTC_OSC_32KCLK_EN);
>> +	}
>> +
>> +	/* Enable External clock as the source */
>> +
>> +	if (rtc->type->has_osc_ext_32k) {
>> +		rtc_writel(rtc, OMAP_RTC_OSC_REG,
>> +			   (OMAP_RTC_OSC_EXT_32K |
>> +			   rtc_read(rtc, OMAP_RTC_OSC_REG)) &
>> +			   (~OMAP_RTC_OSC_OSC32K_GZ));
>>   	}
>
> How do we know that all systems have this external clock and that it
> works OK?
>

AM335 and AM43X have the external clock feature which we choose using 
RTC_OSC_REG. I verified it works OK by seeing the RTC seconds ticking 
even after switching the source to the external 32k Clock.

Regards,
Keerthy

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [rtc-linux] [PATCH] rtc: OMAP: Add external 32k clock feature
@ 2015-04-07  3:29     ` Keerthy
  0 siblings, 0 replies; 19+ messages in thread
From: Keerthy @ 2015-04-07  3:29 UTC (permalink / raw)
  To: Andrew Morton, rtc-linux; +Cc: Keerthy, a.zummo, linux-kernel, linux-omap

Hi Andrew,

Apologies for replying late.

On Wednesday 25 March 2015 04:29 AM, Andrew Morton wrote:
> On Tue, 3 Mar 2015 15:12:02 +0530 Keerthy <j-keerthy@ti.com> wrote:
>
>> Add external 32k clock feature. The internal clock will be gated during suspend.
>> Hence make use of the external 32k clock so that rtc is functional accross
>> suspend/resume.
>>
>> ...
>>
>> @@ -446,6 +449,7 @@ static const struct omap_rtc_device_type omap_rtc_default_type = {
>>
>>   static const struct omap_rtc_device_type omap_rtc_am3352_type = {
>>   	.has_32kclk_en	= true,
>> +	.has_osc_ext_32k = true,
>>   	.has_kicker	= true,
>>   	.has_irqwakeen	= true,
>>   	.has_pmic_mode	= true,
>> @@ -543,7 +547,16 @@ static int __init omap_rtc_probe(struct platform_device *pdev)
>>   	if (rtc->type->has_32kclk_en) {
>>   		reg = rtc_read(rtc, OMAP_RTC_OSC_REG);
>>   		rtc_writel(rtc, OMAP_RTC_OSC_REG,
>> -				reg | OMAP_RTC_OSC_32KCLK_EN);
>> +			   reg | OMAP_RTC_OSC_32KCLK_EN);
>> +	}
>> +
>> +	/* Enable External clock as the source */
>> +
>> +	if (rtc->type->has_osc_ext_32k) {
>> +		rtc_writel(rtc, OMAP_RTC_OSC_REG,
>> +			   (OMAP_RTC_OSC_EXT_32K |
>> +			   rtc_read(rtc, OMAP_RTC_OSC_REG)) &
>> +			   (~OMAP_RTC_OSC_OSC32K_GZ));
>>   	}
>
> How do we know that all systems have this external clock and that it
> works OK?
>

AM335 and AM43X have the external clock feature which we choose using 
RTC_OSC_REG. I verified it works OK by seeing the RTC seconds ticking 
even after switching the source to the external 32k Clock.

Regards,
Keerthy

-- 
-- 
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@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [rtc-linux] [PATCH] rtc: OMAP: Add external 32k clock feature
@ 2015-04-07  3:29     ` Keerthy
  0 siblings, 0 replies; 19+ messages in thread
From: Keerthy @ 2015-04-07  3:29 UTC (permalink / raw)
  To: Andrew Morton, rtc-linux; +Cc: Keerthy, a.zummo, linux-kernel, linux-omap

Hi Andrew,

Apologies for replying late.

On Wednesday 25 March 2015 04:29 AM, Andrew Morton wrote:
> On Tue, 3 Mar 2015 15:12:02 +0530 Keerthy <j-keerthy@ti.com> wrote:
>
>> Add external 32k clock feature. The internal clock will be gated during suspend.
>> Hence make use of the external 32k clock so that rtc is functional accross
>> suspend/resume.
>>
>> ...
>>
>> @@ -446,6 +449,7 @@ static const struct omap_rtc_device_type omap_rtc_default_type = {
>>
>>   static const struct omap_rtc_device_type omap_rtc_am3352_type = {
>>   	.has_32kclk_en	= true,
>> +	.has_osc_ext_32k = true,
>>   	.has_kicker	= true,
>>   	.has_irqwakeen	= true,
>>   	.has_pmic_mode	= true,
>> @@ -543,7 +547,16 @@ static int __init omap_rtc_probe(struct platform_device *pdev)
>>   	if (rtc->type->has_32kclk_en) {
>>   		reg = rtc_read(rtc, OMAP_RTC_OSC_REG);
>>   		rtc_writel(rtc, OMAP_RTC_OSC_REG,
>> -				reg | OMAP_RTC_OSC_32KCLK_EN);
>> +			   reg | OMAP_RTC_OSC_32KCLK_EN);
>> +	}
>> +
>> +	/* Enable External clock as the source */
>> +
>> +	if (rtc->type->has_osc_ext_32k) {
>> +		rtc_writel(rtc, OMAP_RTC_OSC_REG,
>> +			   (OMAP_RTC_OSC_EXT_32K |
>> +			   rtc_read(rtc, OMAP_RTC_OSC_REG)) &
>> +			   (~OMAP_RTC_OSC_OSC32K_GZ));
>>   	}
>
> How do we know that all systems have this external clock and that it
> works OK?
>

AM335 and AM43X have the external clock feature which we choose using 
RTC_OSC_REG. I verified it works OK by seeing the RTC seconds ticking 
even after switching the source to the external 32k Clock.

Regards,
Keerthy

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [rtc-linux] [PATCH] rtc: OMAP: Add external 32k clock feature
  2015-04-07  3:29     ` Keerthy
@ 2015-04-07  7:06       ` Igor Grinberg
  -1 siblings, 0 replies; 19+ messages in thread
From: Igor Grinberg @ 2015-04-07  7:06 UTC (permalink / raw)
  To: Keerthy, Andrew Morton, rtc-linux
  Cc: Keerthy, a.zummo, linux-kernel, linux-omap

Hi,

On 04/07/15 06:29, Keerthy wrote:
> Hi Andrew,
> 
> Apologies for replying late.
> 
> On Wednesday 25 March 2015 04:29 AM, Andrew Morton wrote:
>> On Tue, 3 Mar 2015 15:12:02 +0530 Keerthy <j-keerthy@ti.com> wrote:
>>
>>> Add external 32k clock feature. The internal clock will be gated during suspend.
>>> Hence make use of the external 32k clock so that rtc is functional accross
>>> suspend/resume.
>>>
>>> ...
>>>
>>> @@ -446,6 +449,7 @@ static const struct omap_rtc_device_type omap_rtc_default_type = {
>>>
>>>   static const struct omap_rtc_device_type omap_rtc_am3352_type = {
>>>       .has_32kclk_en    = true,
>>> +    .has_osc_ext_32k = true,
>>>       .has_kicker    = true,
>>>       .has_irqwakeen    = true,
>>>       .has_pmic_mode    = true,
>>> @@ -543,7 +547,16 @@ static int __init omap_rtc_probe(struct platform_device *pdev)
>>>       if (rtc->type->has_32kclk_en) {
>>>           reg = rtc_read(rtc, OMAP_RTC_OSC_REG);
>>>           rtc_writel(rtc, OMAP_RTC_OSC_REG,
>>> -                reg | OMAP_RTC_OSC_32KCLK_EN);
>>> +               reg | OMAP_RTC_OSC_32KCLK_EN);
>>> +    }
>>> +
>>> +    /* Enable External clock as the source */
>>> +
>>> +    if (rtc->type->has_osc_ext_32k) {
>>> +        rtc_writel(rtc, OMAP_RTC_OSC_REG,
>>> +               (OMAP_RTC_OSC_EXT_32K |
>>> +               rtc_read(rtc, OMAP_RTC_OSC_REG)) &
>>> +               (~OMAP_RTC_OSC_OSC32K_GZ));
>>>       }
>>
>> How do we know that all systems have this external clock and that it
>> works OK?
>>
> 
> AM335 and AM43X have the external clock feature which we choose using
> RTC_OSC_REG. I verified it works OK by seeing the RTC seconds ticking
> even after switching the source to the external 32k Clock.

AFAIU, this is related to the external (outside of SoC) oscillator, right?
If so, there is a possibility to not assemble it on the board (at least
on AM335) and use the internal clock source instead.
There are dozens of boards out there that do not have the external
oscillator assembled.

Am I missing something?

-- 
Regards,
Igor.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [rtc-linux] [PATCH] rtc: OMAP: Add external 32k clock feature
@ 2015-04-07  7:06       ` Igor Grinberg
  0 siblings, 0 replies; 19+ messages in thread
From: Igor Grinberg @ 2015-04-07  7:06 UTC (permalink / raw)
  To: Keerthy, Andrew Morton, rtc-linux
  Cc: Keerthy, a.zummo, linux-kernel, linux-omap

Hi,

On 04/07/15 06:29, Keerthy wrote:
> Hi Andrew,
> 
> Apologies for replying late.
> 
> On Wednesday 25 March 2015 04:29 AM, Andrew Morton wrote:
>> On Tue, 3 Mar 2015 15:12:02 +0530 Keerthy <j-keerthy@ti.com> wrote:
>>
>>> Add external 32k clock feature. The internal clock will be gated during suspend.
>>> Hence make use of the external 32k clock so that rtc is functional accross
>>> suspend/resume.
>>>
>>> ...
>>>
>>> @@ -446,6 +449,7 @@ static const struct omap_rtc_device_type omap_rtc_default_type = {
>>>
>>>   static const struct omap_rtc_device_type omap_rtc_am3352_type = {
>>>       .has_32kclk_en    = true,
>>> +    .has_osc_ext_32k = true,
>>>       .has_kicker    = true,
>>>       .has_irqwakeen    = true,
>>>       .has_pmic_mode    = true,
>>> @@ -543,7 +547,16 @@ static int __init omap_rtc_probe(struct platform_device *pdev)
>>>       if (rtc->type->has_32kclk_en) {
>>>           reg = rtc_read(rtc, OMAP_RTC_OSC_REG);
>>>           rtc_writel(rtc, OMAP_RTC_OSC_REG,
>>> -                reg | OMAP_RTC_OSC_32KCLK_EN);
>>> +               reg | OMAP_RTC_OSC_32KCLK_EN);
>>> +    }
>>> +
>>> +    /* Enable External clock as the source */
>>> +
>>> +    if (rtc->type->has_osc_ext_32k) {
>>> +        rtc_writel(rtc, OMAP_RTC_OSC_REG,
>>> +               (OMAP_RTC_OSC_EXT_32K |
>>> +               rtc_read(rtc, OMAP_RTC_OSC_REG)) &
>>> +               (~OMAP_RTC_OSC_OSC32K_GZ));
>>>       }
>>
>> How do we know that all systems have this external clock and that it
>> works OK?
>>
> 
> AM335 and AM43X have the external clock feature which we choose using
> RTC_OSC_REG. I verified it works OK by seeing the RTC seconds ticking
> even after switching the source to the external 32k Clock.

AFAIU, this is related to the external (outside of SoC) oscillator, right?
If so, there is a possibility to not assemble it on the board (at least
on AM335) and use the internal clock source instead.
There are dozens of boards out there that do not have the external
oscillator assembled.

Am I missing something?

-- 
Regards,
Igor.

-- 
-- 
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@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [rtc-linux] [PATCH] rtc: OMAP: Add external 32k clock feature
  2015-04-07  7:06       ` Igor Grinberg
  (?)
@ 2015-04-10  8:26         ` Keerthy
  -1 siblings, 0 replies; 19+ messages in thread
From: Keerthy @ 2015-04-10  8:26 UTC (permalink / raw)
  To: Igor Grinberg, Andrew Morton, rtc-linux
  Cc: Keerthy, a.zummo, linux-kernel, linux-omap

Hi

On Tuesday 07 April 2015 12:36 PM, Igor Grinberg wrote:
> Hi,
>
> On 04/07/15 06:29, Keerthy wrote:
>> Hi Andrew,
>>
>> Apologies for replying late.
>>
>> On Wednesday 25 March 2015 04:29 AM, Andrew Morton wrote:
>>> On Tue, 3 Mar 2015 15:12:02 +0530 Keerthy <j-keerthy@ti.com> wrote:
>>>
>>>> Add external 32k clock feature. The internal clock will be gated during suspend.
>>>> Hence make use of the external 32k clock so that rtc is functional accross
>>>> suspend/resume.
>>>>
>>>> ...
>>>>
>>>> @@ -446,6 +449,7 @@ static const struct omap_rtc_device_type omap_rtc_default_type = {
>>>>
>>>>    static const struct omap_rtc_device_type omap_rtc_am3352_type = {
>>>>        .has_32kclk_en    = true,
>>>> +    .has_osc_ext_32k = true,
>>>>        .has_kicker    = true,
>>>>        .has_irqwakeen    = true,
>>>>        .has_pmic_mode    = true,
>>>> @@ -543,7 +547,16 @@ static int __init omap_rtc_probe(struct platform_device *pdev)
>>>>        if (rtc->type->has_32kclk_en) {
>>>>            reg = rtc_read(rtc, OMAP_RTC_OSC_REG);
>>>>            rtc_writel(rtc, OMAP_RTC_OSC_REG,
>>>> -                reg | OMAP_RTC_OSC_32KCLK_EN);
>>>> +               reg | OMAP_RTC_OSC_32KCLK_EN);
>>>> +    }
>>>> +
>>>> +    /* Enable External clock as the source */
>>>> +
>>>> +    if (rtc->type->has_osc_ext_32k) {
>>>> +        rtc_writel(rtc, OMAP_RTC_OSC_REG,
>>>> +               (OMAP_RTC_OSC_EXT_32K |
>>>> +               rtc_read(rtc, OMAP_RTC_OSC_REG)) &
>>>> +               (~OMAP_RTC_OSC_OSC32K_GZ));
>>>>        }
>>>
>>> How do we know that all systems have this external clock and that it
>>> works OK?
>>>
>>
>> AM335 and AM43X have the external clock feature which we choose using
>> RTC_OSC_REG. I verified it works OK by seeing the RTC seconds ticking
>> even after switching the source to the external 32k Clock.
>
> AFAIU, this is related to the external (outside of SoC) oscillator, right?
> If so, there is a possibility to not assemble it on the board (at least
> on AM335) and use the internal clock source instead.

Yes. The register 'OMAP_RTC_OSC_REG' is part of the RTC IP register set
so i assumed that it would be with the RTCs of those particular SoCs.

> There are dozens of boards out there that do not have the external
> oscillator assembled.
>
> Am I missing something?
>

Regards,
Keerthy

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [rtc-linux] [PATCH] rtc: OMAP: Add external 32k clock feature
@ 2015-04-10  8:26         ` Keerthy
  0 siblings, 0 replies; 19+ messages in thread
From: Keerthy @ 2015-04-10  8:26 UTC (permalink / raw)
  To: Igor Grinberg, Andrew Morton, rtc-linux
  Cc: Keerthy, a.zummo, linux-kernel, linux-omap

Hi

On Tuesday 07 April 2015 12:36 PM, Igor Grinberg wrote:
> Hi,
>
> On 04/07/15 06:29, Keerthy wrote:
>> Hi Andrew,
>>
>> Apologies for replying late.
>>
>> On Wednesday 25 March 2015 04:29 AM, Andrew Morton wrote:
>>> On Tue, 3 Mar 2015 15:12:02 +0530 Keerthy <j-keerthy@ti.com> wrote:
>>>
>>>> Add external 32k clock feature. The internal clock will be gated during suspend.
>>>> Hence make use of the external 32k clock so that rtc is functional accross
>>>> suspend/resume.
>>>>
>>>> ...
>>>>
>>>> @@ -446,6 +449,7 @@ static const struct omap_rtc_device_type omap_rtc_default_type = {
>>>>
>>>>    static const struct omap_rtc_device_type omap_rtc_am3352_type = {
>>>>        .has_32kclk_en    = true,
>>>> +    .has_osc_ext_32k = true,
>>>>        .has_kicker    = true,
>>>>        .has_irqwakeen    = true,
>>>>        .has_pmic_mode    = true,
>>>> @@ -543,7 +547,16 @@ static int __init omap_rtc_probe(struct platform_device *pdev)
>>>>        if (rtc->type->has_32kclk_en) {
>>>>            reg = rtc_read(rtc, OMAP_RTC_OSC_REG);
>>>>            rtc_writel(rtc, OMAP_RTC_OSC_REG,
>>>> -                reg | OMAP_RTC_OSC_32KCLK_EN);
>>>> +               reg | OMAP_RTC_OSC_32KCLK_EN);
>>>> +    }
>>>> +
>>>> +    /* Enable External clock as the source */
>>>> +
>>>> +    if (rtc->type->has_osc_ext_32k) {
>>>> +        rtc_writel(rtc, OMAP_RTC_OSC_REG,
>>>> +               (OMAP_RTC_OSC_EXT_32K |
>>>> +               rtc_read(rtc, OMAP_RTC_OSC_REG)) &
>>>> +               (~OMAP_RTC_OSC_OSC32K_GZ));
>>>>        }
>>>
>>> How do we know that all systems have this external clock and that it
>>> works OK?
>>>
>>
>> AM335 and AM43X have the external clock feature which we choose using
>> RTC_OSC_REG. I verified it works OK by seeing the RTC seconds ticking
>> even after switching the source to the external 32k Clock.
>
> AFAIU, this is related to the external (outside of SoC) oscillator, right?
> If so, there is a possibility to not assemble it on the board (at least
> on AM335) and use the internal clock source instead.

Yes. The register 'OMAP_RTC_OSC_REG' is part of the RTC IP register set
so i assumed that it would be with the RTCs of those particular SoCs.

> There are dozens of boards out there that do not have the external
> oscillator assembled.
>
> Am I missing something?
>

Regards,
Keerthy

-- 
-- 
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@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [rtc-linux] [PATCH] rtc: OMAP: Add external 32k clock feature
@ 2015-04-10  8:26         ` Keerthy
  0 siblings, 0 replies; 19+ messages in thread
From: Keerthy @ 2015-04-10  8:26 UTC (permalink / raw)
  To: Igor Grinberg, Andrew Morton, rtc-linux
  Cc: Keerthy, a.zummo, linux-kernel, linux-omap

Hi

On Tuesday 07 April 2015 12:36 PM, Igor Grinberg wrote:
> Hi,
>
> On 04/07/15 06:29, Keerthy wrote:
>> Hi Andrew,
>>
>> Apologies for replying late.
>>
>> On Wednesday 25 March 2015 04:29 AM, Andrew Morton wrote:
>>> On Tue, 3 Mar 2015 15:12:02 +0530 Keerthy <j-keerthy@ti.com> wrote:
>>>
>>>> Add external 32k clock feature. The internal clock will be gated during suspend.
>>>> Hence make use of the external 32k clock so that rtc is functional accross
>>>> suspend/resume.
>>>>
>>>> ...
>>>>
>>>> @@ -446,6 +449,7 @@ static const struct omap_rtc_device_type omap_rtc_default_type = {
>>>>
>>>>    static const struct omap_rtc_device_type omap_rtc_am3352_type = {
>>>>        .has_32kclk_en    = true,
>>>> +    .has_osc_ext_32k = true,
>>>>        .has_kicker    = true,
>>>>        .has_irqwakeen    = true,
>>>>        .has_pmic_mode    = true,
>>>> @@ -543,7 +547,16 @@ static int __init omap_rtc_probe(struct platform_device *pdev)
>>>>        if (rtc->type->has_32kclk_en) {
>>>>            reg = rtc_read(rtc, OMAP_RTC_OSC_REG);
>>>>            rtc_writel(rtc, OMAP_RTC_OSC_REG,
>>>> -                reg | OMAP_RTC_OSC_32KCLK_EN);
>>>> +               reg | OMAP_RTC_OSC_32KCLK_EN);
>>>> +    }
>>>> +
>>>> +    /* Enable External clock as the source */
>>>> +
>>>> +    if (rtc->type->has_osc_ext_32k) {
>>>> +        rtc_writel(rtc, OMAP_RTC_OSC_REG,
>>>> +               (OMAP_RTC_OSC_EXT_32K |
>>>> +               rtc_read(rtc, OMAP_RTC_OSC_REG)) &
>>>> +               (~OMAP_RTC_OSC_OSC32K_GZ));
>>>>        }
>>>
>>> How do we know that all systems have this external clock and that it
>>> works OK?
>>>
>>
>> AM335 and AM43X have the external clock feature which we choose using
>> RTC_OSC_REG. I verified it works OK by seeing the RTC seconds ticking
>> even after switching the source to the external 32k Clock.
>
> AFAIU, this is related to the external (outside of SoC) oscillator, right?
> If so, there is a possibility to not assemble it on the board (at least
> on AM335) and use the internal clock source instead.

Yes. The register 'OMAP_RTC_OSC_REG' is part of the RTC IP register set
so i assumed that it would be with the RTCs of those particular SoCs.

> There are dozens of boards out there that do not have the external
> oscillator assembled.
>
> Am I missing something?
>

Regards,
Keerthy

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [rtc-linux] [PATCH] rtc: OMAP: Add external 32k clock feature
  2015-04-10  8:26         ` Keerthy
  (?)
@ 2015-04-10 20:37           ` Andrew Morton
  -1 siblings, 0 replies; 19+ messages in thread
From: Andrew Morton @ 2015-04-10 20:37 UTC (permalink / raw)
  To: Keerthy
  Cc: Igor Grinberg, rtc-linux, Keerthy, a.zummo, linux-kernel, linux-omap

On Fri, 10 Apr 2015 13:56:54 +0530 Keerthy <a0393675@ti.com> wrote:

> >>> How do we know that all systems have this external clock and that it
> >>> works OK?
> >>>
> >>
> >> AM335 and AM43X have the external clock feature which we choose using
> >> RTC_OSC_REG. I verified it works OK by seeing the RTC seconds ticking
> >> even after switching the source to the external 32k Clock.
> >
> > AFAIU, this is related to the external (outside of SoC) oscillator, right?
> > If so, there is a possibility to not assemble it on the board (at least
> > on AM335) and use the internal clock source instead.
> 
> Yes. The register 'OMAP_RTC_OSC_REG' is part of the RTC IP register set
> so i assumed that it would be with the RTCs of those particular SoCs.

I'm a bit lost here.  AFAICT there's a risk that some manufacturers
have not wired up the external oscillator, so this patch will break
those systems.  Do we know for sure that this cannot be the case?

Is there any way in which we can get all systems working properly?  If
there's no way of auto-detecting an external oscillator then perhaps a
module parameter is needed.  If so, it would be better if the driver
were to default to internal oscillator (ie: current behaviour), and the
module parameter selects the external oscillator.  This way, existing
systems are unaffected by the kernel upgrade.


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [rtc-linux] [PATCH] rtc: OMAP: Add external 32k clock feature
@ 2015-04-10 20:37           ` Andrew Morton
  0 siblings, 0 replies; 19+ messages in thread
From: Andrew Morton @ 2015-04-10 20:37 UTC (permalink / raw)
  To: Keerthy
  Cc: Igor Grinberg, rtc-linux, Keerthy, a.zummo, linux-kernel, linux-omap

On Fri, 10 Apr 2015 13:56:54 +0530 Keerthy <a0393675@ti.com> wrote:

> >>> How do we know that all systems have this external clock and that it
> >>> works OK?
> >>>
> >>
> >> AM335 and AM43X have the external clock feature which we choose using
> >> RTC_OSC_REG. I verified it works OK by seeing the RTC seconds ticking
> >> even after switching the source to the external 32k Clock.
> >
> > AFAIU, this is related to the external (outside of SoC) oscillator, right?
> > If so, there is a possibility to not assemble it on the board (at least
> > on AM335) and use the internal clock source instead.
> 
> Yes. The register 'OMAP_RTC_OSC_REG' is part of the RTC IP register set
> so i assumed that it would be with the RTCs of those particular SoCs.

I'm a bit lost here.  AFAICT there's a risk that some manufacturers
have not wired up the external oscillator, so this patch will break
those systems.  Do we know for sure that this cannot be the case?

Is there any way in which we can get all systems working properly?  If
there's no way of auto-detecting an external oscillator then perhaps a
module parameter is needed.  If so, it would be better if the driver
were to default to internal oscillator (ie: current behaviour), and the
module parameter selects the external oscillator.  This way, existing
systems are unaffected by the kernel upgrade.

-- 
-- 
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@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [rtc-linux] [PATCH] rtc: OMAP: Add external 32k clock feature
@ 2015-04-10 20:37           ` Andrew Morton
  0 siblings, 0 replies; 19+ messages in thread
From: Andrew Morton @ 2015-04-10 20:37 UTC (permalink / raw)
  To: Keerthy
  Cc: Igor Grinberg, rtc-linux, Keerthy, a.zummo, linux-kernel, linux-omap

On Fri, 10 Apr 2015 13:56:54 +0530 Keerthy <a0393675@ti.com> wrote:

> >>> How do we know that all systems have this external clock and that it
> >>> works OK?
> >>>
> >>
> >> AM335 and AM43X have the external clock feature which we choose using
> >> RTC_OSC_REG. I verified it works OK by seeing the RTC seconds ticking
> >> even after switching the source to the external 32k Clock.
> >
> > AFAIU, this is related to the external (outside of SoC) oscillator, right?
> > If so, there is a possibility to not assemble it on the board (at least
> > on AM335) and use the internal clock source instead.
> 
> Yes. The register 'OMAP_RTC_OSC_REG' is part of the RTC IP register set
> so i assumed that it would be with the RTCs of those particular SoCs.

I'm a bit lost here.  AFAICT there's a risk that some manufacturers
have not wired up the external oscillator, so this patch will break
those systems.  Do we know for sure that this cannot be the case?

Is there any way in which we can get all systems working properly?  If
there's no way of auto-detecting an external oscillator then perhaps a
module parameter is needed.  If so, it would be better if the driver
were to default to internal oscillator (ie: current behaviour), and the
module parameter selects the external oscillator.  This way, existing
systems are unaffected by the kernel upgrade.


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [rtc-linux] [PATCH] rtc: OMAP: Add external 32k clock feature
  2015-04-10 20:37           ` Andrew Morton
@ 2015-04-10 22:23             ` Alexandre Belloni
  -1 siblings, 0 replies; 19+ messages in thread
From: Alexandre Belloni @ 2015-04-10 22:23 UTC (permalink / raw)
  To: rtc-linux
  Cc: Keerthy, Igor Grinberg, Keerthy, a.zummo, linux-kernel, linux-omap

On 10/04/2015 at 13:37:30 -0700, Andrew Morton wrote :
> Is there any way in which we can get all systems working properly?  If
> there's no way of auto-detecting an external oscillator then perhaps a
> module parameter is needed.  If so, it would be better if the driver
> were to default to internal oscillator (ie: current behaviour), and the
> module parameter selects the external oscillator.  This way, existing
> systems are unaffected by the kernel upgrade.
> 

Actually, I would use the common clock framework, allowing to chose
between the internal and an external clock source by using the "clocks"
property. This would also allow to have the correct reference count on
that 32k internal clock. It may not matter now but for example, not
doing so became a problem on at91.

As a fallback, if no clocks property is available, I would use the
internal 32k to keep DT ABI backward compatibility.

-- 
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [rtc-linux] [PATCH] rtc: OMAP: Add external 32k clock feature
@ 2015-04-10 22:23             ` Alexandre Belloni
  0 siblings, 0 replies; 19+ messages in thread
From: Alexandre Belloni @ 2015-04-10 22:23 UTC (permalink / raw)
  To: rtc-linux
  Cc: Keerthy, Igor Grinberg, Keerthy, a.zummo, linux-kernel, linux-omap

On 10/04/2015 at 13:37:30 -0700, Andrew Morton wrote :
> Is there any way in which we can get all systems working properly?  If
> there's no way of auto-detecting an external oscillator then perhaps a
> module parameter is needed.  If so, it would be better if the driver
> were to default to internal oscillator (ie: current behaviour), and the
> module parameter selects the external oscillator.  This way, existing
> systems are unaffected by the kernel upgrade.
> 

Actually, I would use the common clock framework, allowing to chose
between the internal and an external clock source by using the "clocks"
property. This would also allow to have the correct reference count on
that 32k internal clock. It may not matter now but for example, not
doing so became a problem on at91.

As a fallback, if no clocks property is available, I would use the
internal 32k to keep DT ABI backward compatibility.

-- 
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android 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@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2015-04-10 22:24 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-03  9:42 [PATCH] rtc: OMAP: Add external 32k clock feature Keerthy
2015-03-03  9:42 ` Keerthy
2015-03-17  4:15 ` Keerthy
2015-03-17  4:15   ` Keerthy
2015-03-24 22:59 ` [rtc-linux] " Andrew Morton
2015-03-24 22:59   ` Andrew Morton
2015-04-07  3:29   ` Keerthy
2015-04-07  3:29     ` Keerthy
2015-04-07  3:29     ` Keerthy
2015-04-07  7:06     ` Igor Grinberg
2015-04-07  7:06       ` Igor Grinberg
2015-04-10  8:26       ` Keerthy
2015-04-10  8:26         ` Keerthy
2015-04-10  8:26         ` Keerthy
2015-04-10 20:37         ` Andrew Morton
2015-04-10 20:37           ` Andrew Morton
2015-04-10 20:37           ` Andrew Morton
2015-04-10 22:23           ` Alexandre Belloni
2015-04-10 22:23             ` Alexandre Belloni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.