All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 3/4] OMAP2+: use control module mfd driver in omap_type
@ 2012-07-25 11:05 ` Konstantin Baydarov
  0 siblings, 0 replies; 6+ messages in thread
From: Konstantin Baydarov @ 2012-07-25 11:05 UTC (permalink / raw)
  To: b-cousson, kishon, santosh.shilimkar, tony, paul
  Cc: balbi, amit.kucheria, linux-pm, linux-arm-kernel, linux-omap,
	amit.kachhap, Eduardo Valentin

[-- Attachment #1: Type: text/plain, Size: 1403 bytes --]

OMAP system control module can be probed early, then
omap_type is safe to use its APIs.

TODO: add support for other omap versions

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Konstantin Baydarov <kbaidarov@dev.rtsoft.ru>
---
 arch/arm/mach-omap2/id.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index 40373db..8018cad 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -18,6 +18,7 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/io.h>
+#include <linux/mfd/omap_control.h>
 
 #include <asm/cputype.h>
 
@@ -43,15 +44,15 @@ int omap_type(void)
 	u32 val = 0;
 
 	if (cpu_is_omap24xx()) {
-		val = omap_ctrl_readl(OMAP24XX_CONTROL_STATUS);
+		val = omap_control_status_read();
 	} else if (soc_is_am33xx()) {
-		val = omap_ctrl_readl(AM33XX_CONTROL_STATUS);
+		val = omap_control_status_read();
 	} else if (cpu_is_omap34xx()) {
-		val = omap_ctrl_readl(OMAP343X_CONTROL_STATUS);
+		val = omap_control_status_read();
 	} else if (cpu_is_omap44xx()) {
-		val = omap_ctrl_readl(OMAP4_CTRL_MODULE_CORE_STATUS);
+		val = omap_control_status_read();
 	} else if (soc_is_omap54xx()) {
-		val = omap_ctrl_readl(OMAP5XXX_CONTROL_STATUS);
+		val = omap_control_status_read();
 		val &= OMAP5_DEVICETYPE_MASK;
 		val >>= 6;
 		goto out;
-- 
1.7.7.6


[-- Attachment #2: Attached Message Part --]
[-- Type: text/plain, Size: 0 bytes --]



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

* [PATCH v4 3/4] OMAP2+: use control module mfd driver in omap_type
@ 2012-07-25 11:05 ` Konstantin Baydarov
  0 siblings, 0 replies; 6+ messages in thread
From: Konstantin Baydarov @ 2012-07-25 11:05 UTC (permalink / raw)
  To: linux-arm-kernel

OMAP system control module can be probed early, then
omap_type is safe to use its APIs.

TODO: add support for other omap versions

Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
Signed-off-by: Konstantin Baydarov <kbaidarov@dev.rtsoft.ru>
---
 arch/arm/mach-omap2/id.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index 40373db..8018cad 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -18,6 +18,7 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/io.h>
+#include <linux/mfd/omap_control.h>
 
 #include <asm/cputype.h>
 
@@ -43,15 +44,15 @@ int omap_type(void)
 	u32 val = 0;
 
 	if (cpu_is_omap24xx()) {
-		val = omap_ctrl_readl(OMAP24XX_CONTROL_STATUS);
+		val = omap_control_status_read();
 	} else if (soc_is_am33xx()) {
-		val = omap_ctrl_readl(AM33XX_CONTROL_STATUS);
+		val = omap_control_status_read();
 	} else if (cpu_is_omap34xx()) {
-		val = omap_ctrl_readl(OMAP343X_CONTROL_STATUS);
+		val = omap_control_status_read();
 	} else if (cpu_is_omap44xx()) {
-		val = omap_ctrl_readl(OMAP4_CTRL_MODULE_CORE_STATUS);
+		val = omap_control_status_read();
 	} else if (soc_is_omap54xx()) {
-		val = omap_ctrl_readl(OMAP5XXX_CONTROL_STATUS);
+		val = omap_control_status_read();
 		val &= OMAP5_DEVICETYPE_MASK;
 		val >>= 6;
 		goto out;
-- 
1.7.7.6

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

* Re: [PATCH v4 3/4] OMAP2+: use control module mfd driver in omap_type
  2012-07-25 11:05 ` Konstantin Baydarov
@ 2012-07-25 12:39   ` Sergei Shtylyov
  -1 siblings, 0 replies; 6+ messages in thread
From: Sergei Shtylyov @ 2012-07-25 12:39 UTC (permalink / raw)
  To: Konstantin Baydarov
  Cc: b-cousson, kishon, santosh.shilimkar, tony, paul, amit.kucheria,
	Eduardo Valentin, balbi, linux-pm, linux-omap, linux-arm-kernel,
	amit.kachhap

Hello.

On 25-07-2012 15:05, Konstantin Baydarov wrote:

> OMAP system control module can be probed early, then
> omap_type is safe to use its APIs.

> TODO: add support for other omap versions

> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
> Signed-off-by: Konstantin Baydarov <kbaidarov@dev.rtsoft.ru>
> ---
>   arch/arm/mach-omap2/id.c |   11 ++++++-----
>   1 files changed, 6 insertions(+), 5 deletions(-)

> diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
> index 40373db..8018cad 100644
> --- a/arch/arm/mach-omap2/id.c
> +++ b/arch/arm/mach-omap2/id.c
[...]
> @@ -43,15 +44,15 @@ int omap_type(void)
>   	u32 val = 0;
>
>   	if (cpu_is_omap24xx()) {
> -		val = omap_ctrl_readl(OMAP24XX_CONTROL_STATUS);
> +		val = omap_control_status_read();
>   	} else if (soc_is_am33xx()) {
> -		val = omap_ctrl_readl(AM33XX_CONTROL_STATUS);
> +		val = omap_control_status_read();
>   	} else if (cpu_is_omap34xx()) {
> -		val = omap_ctrl_readl(OMAP343X_CONTROL_STATUS);
> +		val = omap_control_status_read();
>   	} else if (cpu_is_omap44xx()) {
> -		val = omap_ctrl_readl(OMAP4_CTRL_MODULE_CORE_STATUS);
> +		val = omap_control_status_read();

    Isn't it better to merge now identical code into one *if*?

WBR, Sergei


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

* [PATCH v4 3/4] OMAP2+: use control module mfd driver in omap_type
@ 2012-07-25 12:39   ` Sergei Shtylyov
  0 siblings, 0 replies; 6+ messages in thread
From: Sergei Shtylyov @ 2012-07-25 12:39 UTC (permalink / raw)
  To: linux-arm-kernel

Hello.

On 25-07-2012 15:05, Konstantin Baydarov wrote:

> OMAP system control module can be probed early, then
> omap_type is safe to use its APIs.

> TODO: add support for other omap versions

> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
> Signed-off-by: Konstantin Baydarov <kbaidarov@dev.rtsoft.ru>
> ---
>   arch/arm/mach-omap2/id.c |   11 ++++++-----
>   1 files changed, 6 insertions(+), 5 deletions(-)

> diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
> index 40373db..8018cad 100644
> --- a/arch/arm/mach-omap2/id.c
> +++ b/arch/arm/mach-omap2/id.c
[...]
> @@ -43,15 +44,15 @@ int omap_type(void)
>   	u32 val = 0;
>
>   	if (cpu_is_omap24xx()) {
> -		val = omap_ctrl_readl(OMAP24XX_CONTROL_STATUS);
> +		val = omap_control_status_read();
>   	} else if (soc_is_am33xx()) {
> -		val = omap_ctrl_readl(AM33XX_CONTROL_STATUS);
> +		val = omap_control_status_read();
>   	} else if (cpu_is_omap34xx()) {
> -		val = omap_ctrl_readl(OMAP343X_CONTROL_STATUS);
> +		val = omap_control_status_read();
>   	} else if (cpu_is_omap44xx()) {
> -		val = omap_ctrl_readl(OMAP4_CTRL_MODULE_CORE_STATUS);
> +		val = omap_control_status_read();

    Isn't it better to merge now identical code into one *if*?

WBR, Sergei

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

* Re: [PATCH v4 3/4] OMAP2+: use control module mfd driver in omap_type
  2012-07-25 12:39   ` Sergei Shtylyov
@ 2012-07-25 12:45     ` Konstantin Baydarov
  -1 siblings, 0 replies; 6+ messages in thread
From: Konstantin Baydarov @ 2012-07-25 12:45 UTC (permalink / raw)
  To: Sergei Shtylyov
  Cc: b-cousson, kishon, santosh.shilimkar, tony, paul, amit.kucheria,
	Eduardo Valentin, balbi, linux-pm, linux-omap, linux-arm-kernel,
	amit.kachhap

  HI, Sergei.

On 07/25/2012 04:39 PM, Sergei Shtylyov wrote:
> Hello.
>
> On 25-07-2012 15:05, Konstantin Baydarov wrote:
>
>> OMAP system control module can be probed early, then
>> omap_type is safe to use its APIs.
>
>> TODO: add support for other omap versions
>
>> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
>> Signed-off-by: Konstantin Baydarov <kbaidarov@dev.rtsoft.ru>
>> ---
>>   arch/arm/mach-omap2/id.c |   11 ++++++-----
>>   1 files changed, 6 insertions(+), 5 deletions(-)
>
>> diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
>> index 40373db..8018cad 100644
>> --- a/arch/arm/mach-omap2/id.c
>> +++ b/arch/arm/mach-omap2/id.c
> [...]
>> @@ -43,15 +44,15 @@ int omap_type(void)
>>       u32 val = 0;
>>
>>       if (cpu_is_omap24xx()) {
>> -        val = omap_ctrl_readl(OMAP24XX_CONTROL_STATUS);
>> +        val = omap_control_status_read();
>>       } else if (soc_is_am33xx()) {
>> -        val = omap_ctrl_readl(AM33XX_CONTROL_STATUS);
>> +        val = omap_control_status_read();
>>       } else if (cpu_is_omap34xx()) {
>> -        val = omap_ctrl_readl(OMAP343X_CONTROL_STATUS);
>> +        val = omap_control_status_read();
>>       } else if (cpu_is_omap44xx()) {
>> -        val = omap_ctrl_readl(OMAP4_CTRL_MODULE_CORE_STATUS);
>> +        val = omap_control_status_read();
>
>    Isn't it better to merge now identical code into one *if*?
Good point.
>
> WBR, Sergei
>
> -- 
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

* [PATCH v4 3/4] OMAP2+: use control module mfd driver in omap_type
@ 2012-07-25 12:45     ` Konstantin Baydarov
  0 siblings, 0 replies; 6+ messages in thread
From: Konstantin Baydarov @ 2012-07-25 12:45 UTC (permalink / raw)
  To: linux-arm-kernel

  HI, Sergei.

On 07/25/2012 04:39 PM, Sergei Shtylyov wrote:
> Hello.
>
> On 25-07-2012 15:05, Konstantin Baydarov wrote:
>
>> OMAP system control module can be probed early, then
>> omap_type is safe to use its APIs.
>
>> TODO: add support for other omap versions
>
>> Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
>> Signed-off-by: Konstantin Baydarov <kbaidarov@dev.rtsoft.ru>
>> ---
>>   arch/arm/mach-omap2/id.c |   11 ++++++-----
>>   1 files changed, 6 insertions(+), 5 deletions(-)
>
>> diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
>> index 40373db..8018cad 100644
>> --- a/arch/arm/mach-omap2/id.c
>> +++ b/arch/arm/mach-omap2/id.c
> [...]
>> @@ -43,15 +44,15 @@ int omap_type(void)
>>       u32 val = 0;
>>
>>       if (cpu_is_omap24xx()) {
>> -        val = omap_ctrl_readl(OMAP24XX_CONTROL_STATUS);
>> +        val = omap_control_status_read();
>>       } else if (soc_is_am33xx()) {
>> -        val = omap_ctrl_readl(AM33XX_CONTROL_STATUS);
>> +        val = omap_control_status_read();
>>       } else if (cpu_is_omap34xx()) {
>> -        val = omap_ctrl_readl(OMAP343X_CONTROL_STATUS);
>> +        val = omap_control_status_read();
>>       } else if (cpu_is_omap44xx()) {
>> -        val = omap_ctrl_readl(OMAP4_CTRL_MODULE_CORE_STATUS);
>> +        val = omap_control_status_read();
>
>    Isn't it better to merge now identical code into one *if*?
Good point.
>
> WBR, Sergei
>
> -- 
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2012-07-25 12:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-25 11:05 [PATCH v4 3/4] OMAP2+: use control module mfd driver in omap_type Konstantin Baydarov
2012-07-25 11:05 ` Konstantin Baydarov
2012-07-25 12:39 ` Sergei Shtylyov
2012-07-25 12:39   ` Sergei Shtylyov
2012-07-25 12:45   ` Konstantin Baydarov
2012-07-25 12:45     ` Konstantin Baydarov

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.