Re: [PATCH 4/5] omap: mailbox: fix detection for previously supported chips

2010-10-27 Thread Felipe Contreras
On Wed, Oct 27, 2010 at 12:00 PM, Grazvydas Ignotas  wrote:
> On Wed, Oct 27, 2010 at 10:28 AM, Felipe Contreras
>  wrote:
>> On Wed, Oct 27, 2010 at 8:06 AM, Varadarajan, Charulatha  
>> wrote:
>>>
>>> Use cpu_is_* check only. No need to have #if CONFIG_ARCH_* checks.
>>
>> Some people conditionally compile only for one architecture, like in
>> consumer devices. There's no point in wasting space for that.
>
> And cpu_is_* calls become constants in such cases, allowing compiler
> to optimize away unneeded 'if' blocks, not to mention cpu_is_* allows
> multi-omap support. cpu_is_* is the way to go.

The problem is not the cpu_is_* calls, the problem is what is inside
them (e.g. omap3_mboxes). If CONFIG_ARCH_OMAP3 is not defined, then
compilation would be broken, unless you always include all the arrays.

Multi-omap support is already there, because it means
CONFIG_ARCH_OMAP3, CONFIG_ARCH_OMAP2, etc.

-- 
Felipe Contreras
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 4/5] omap: mailbox: fix detection for previously supported chips

2010-10-27 Thread Grazvydas Ignotas
On Wed, Oct 27, 2010 at 10:28 AM, Felipe Contreras
 wrote:
> On Wed, Oct 27, 2010 at 8:06 AM, Varadarajan, Charulatha  wrote:
>>
>> Use cpu_is_* check only. No need to have #if CONFIG_ARCH_* checks.
>
> Some people conditionally compile only for one architecture, like in
> consumer devices. There's no point in wasting space for that.

And cpu_is_* calls become constants in such cases, allowing compiler
to optimize away unneeded 'if' blocks, not to mention cpu_is_* allows
multi-omap support. cpu_is_* is the way to go.
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 4/5] omap: mailbox: fix detection for previously supported chips

2010-10-27 Thread Felipe Contreras
On Wed, Oct 27, 2010 at 8:06 AM, Varadarajan, Charulatha  wrote:
>> Fix the mailbox detection for OMAP3630 and 2430, also minor
>> cleanup on conditional ifdef's that could affect it.
>>
>> Given that 2430 has an iva too include it, as the same steps
>> for omap3 apply.
>>
>> Signed-off-by: Omar Ramirez Luna 
>> ---
>>  arch/arm/mach-omap2/mailbox.c |   16 ++--
>>  1 files changed, 10 insertions(+), 6 deletions(-)
>>
>> diff --git a/arch/arm/mach-omap2/mailbox.c
>> b/arch/arm/mach-omap2/mailbox.c
>> index 61f2149..b8fd120 100644
>> --- a/arch/arm/mach-omap2/mailbox.c
>> +++ b/arch/arm/mach-omap2/mailbox.c
>> @@ -277,7 +277,7 @@ static struct omap_mbox_ops omap2_mbox_ops = {
>>
>>  /* FIXME: the following structs should be filled
>> automatically by the user id */
>>
>> -#if defined(CONFIG_ARCH_OMAP3430) || defined(CONFIG_ARCH_OMAP2420)
>> +#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP2)
>>  /* DSP */
>>  static struct omap_mbox2_priv omap2_mbox_dsp_priv = {
>>       .tx_fifo = {
>> @@ -302,7 +302,7 @@ struct omap_mbox mbox_dsp_info = {
>>  };
>>  #endif
>>
>> -#if defined(CONFIG_ARCH_OMAP3430)
>> +#if defined(CONFIG_ARCH_OMAP3)
>>  struct omap_mbox *omap3_mboxes[] = { &mbox_dsp_info, NULL };
>>  #endif
>>
>> @@ -390,15 +390,19 @@ static int __devinit
>> omap2_mbox_probe(struct platform_device *pdev)
>>
>>       if (false)
>>               ;
>> -#if defined(CONFIG_ARCH_OMAP3430)
>> -     else if (cpu_is_omap3430()) {
>> +#if defined(CONFIG_ARCH_OMAP3)
>> +     else if (cpu_is_omap34xx()) {
>
> Use cpu_is_* check only. No need to have #if CONFIG_ARCH_* checks.

Some people conditionally compile only for one architecture, like in
consumer devices. There's no point in wasting space for that.

-- 
Felipe Contreras
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH 4/5] omap: mailbox: fix detection for previously supported chips

2010-10-26 Thread Varadarajan, Charulatha
 

> -Original Message-
> From: linux-omap-ow...@vger.kernel.org 
> [mailto:linux-omap-ow...@vger.kernel.org] On Behalf Of 
> Ramirez Luna, Omar
> Sent: Wednesday, October 27, 2010 3:23 AM
> To: Tony Lindgren; Hiroshi DOYU
> Cc: Felipe Contreras; Dmitry Kasatkin; Kevin Hilman; Ramirez 
> Luna, Omar; Anna, Suman; Paul Walmsley; Cousson, Benoit; 
> Raja, Govindraj; C.A, Subramaniam; linux-omap@vger.kernel.org
> Subject: [PATCH 4/5] omap: mailbox: fix detection for 
> previously supported chips
> 
> Fix the mailbox detection for OMAP3630 and 2430, also minor
> cleanup on conditional ifdef's that could affect it.
> 
> Given that 2430 has an iva too include it, as the same steps
> for omap3 apply.
> 
> Signed-off-by: Omar Ramirez Luna 
> ---
>  arch/arm/mach-omap2/mailbox.c |   16 ++--
>  1 files changed, 10 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/mailbox.c 
> b/arch/arm/mach-omap2/mailbox.c
> index 61f2149..b8fd120 100644
> --- a/arch/arm/mach-omap2/mailbox.c
> +++ b/arch/arm/mach-omap2/mailbox.c
> @@ -277,7 +277,7 @@ static struct omap_mbox_ops omap2_mbox_ops = {
>  
>  /* FIXME: the following structs should be filled 
> automatically by the user id */
>  
> -#if defined(CONFIG_ARCH_OMAP3430) || defined(CONFIG_ARCH_OMAP2420)
> +#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP2)
>  /* DSP */
>  static struct omap_mbox2_priv omap2_mbox_dsp_priv = {
>   .tx_fifo = {
> @@ -302,7 +302,7 @@ struct omap_mbox mbox_dsp_info = {
>  };
>  #endif
>  
> -#if defined(CONFIG_ARCH_OMAP3430)
> +#if defined(CONFIG_ARCH_OMAP3)
>  struct omap_mbox *omap3_mboxes[] = { &mbox_dsp_info, NULL };
>  #endif
>  
> @@ -390,15 +390,19 @@ static int __devinit 
> omap2_mbox_probe(struct platform_device *pdev)
>  
>   if (false)
>   ;
> -#if defined(CONFIG_ARCH_OMAP3430)
> - else if (cpu_is_omap3430()) {
> +#if defined(CONFIG_ARCH_OMAP3)
> + else if (cpu_is_omap34xx()) {

Use cpu_is_* check only. No need to have #if CONFIG_ARCH_* checks.

>   list = omap3_mboxes;
>  
>   list[0]->irq = platform_get_irq_byname(pdev, "dsp");
>   }
>  #endif
> -#if defined(CONFIG_ARCH_OMAP2420)
> - else if (cpu_is_omap2420()) {
> +#if defined(CONFIG_ARCH_OMAP2)
> + else if (cpu_is_omap2430()) {
> + list = omap2_mboxes;
> +
> + list[0]->irq = platform_get_irq_byname(pdev, "dsp");
> + } else if (cpu_is_omap2420()) {

Ditto

>   list = omap2_mboxes;
>  
>   list[0]->irq = platform_get_irq_byname(pdev, "dsp");
> -- 
> 1.7.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe 
> linux-omap" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> --
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 4/5] omap: mailbox: fix detection for previously supported chips

2010-10-26 Thread Omar Ramirez Luna
Fix the mailbox detection for OMAP3630 and 2430, also minor
cleanup on conditional ifdef's that could affect it.

Given that 2430 has an iva too include it, as the same steps
for omap3 apply.

Signed-off-by: Omar Ramirez Luna 
---
 arch/arm/mach-omap2/mailbox.c |   16 ++--
 1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-omap2/mailbox.c b/arch/arm/mach-omap2/mailbox.c
index 61f2149..b8fd120 100644
--- a/arch/arm/mach-omap2/mailbox.c
+++ b/arch/arm/mach-omap2/mailbox.c
@@ -277,7 +277,7 @@ static struct omap_mbox_ops omap2_mbox_ops = {
 
 /* FIXME: the following structs should be filled automatically by the user id 
*/
 
-#if defined(CONFIG_ARCH_OMAP3430) || defined(CONFIG_ARCH_OMAP2420)
+#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP2)
 /* DSP */
 static struct omap_mbox2_priv omap2_mbox_dsp_priv = {
.tx_fifo = {
@@ -302,7 +302,7 @@ struct omap_mbox mbox_dsp_info = {
 };
 #endif
 
-#if defined(CONFIG_ARCH_OMAP3430)
+#if defined(CONFIG_ARCH_OMAP3)
 struct omap_mbox *omap3_mboxes[] = { &mbox_dsp_info, NULL };
 #endif
 
@@ -390,15 +390,19 @@ static int __devinit omap2_mbox_probe(struct 
platform_device *pdev)
 
if (false)
;
-#if defined(CONFIG_ARCH_OMAP3430)
-   else if (cpu_is_omap3430()) {
+#if defined(CONFIG_ARCH_OMAP3)
+   else if (cpu_is_omap34xx()) {
list = omap3_mboxes;
 
list[0]->irq = platform_get_irq_byname(pdev, "dsp");
}
 #endif
-#if defined(CONFIG_ARCH_OMAP2420)
-   else if (cpu_is_omap2420()) {
+#if defined(CONFIG_ARCH_OMAP2)
+   else if (cpu_is_omap2430()) {
+   list = omap2_mboxes;
+
+   list[0]->irq = platform_get_irq_byname(pdev, "dsp");
+   } else if (cpu_is_omap2420()) {
list = omap2_mboxes;
 
list[0]->irq = platform_get_irq_byname(pdev, "dsp");
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html