linux-mips
[Top] [All Lists]

Re: [PATCH] 2/7 AU1100 MMC support

To: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Subject: Re: [PATCH] 2/7 AU1100 MMC support
From: Rodolfo Giometti <giometti@linux.it>
Date: Thu, 10 Aug 2006 15:36:58 +0200
Cc: linux-mips@linux-mips.org
In-reply-to: <44DB34C2.3090302@ru.mvista.com>
Organization: GNU/Linux Device Drivers, Embedded Systems and Courses
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <20060809210843.GC13145@enneenne.com> <44DB34C2.3090302@ru.mvista.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.12-2006-07-14
On Thu, Aug 10, 2006 at 05:29:38PM +0400, Sergei Shtylyov wrote:
> > static void au1xmmc_set_power(struct au1xmmc_host *host, int state)
> > {
> > 
> >-    u32 val = au1xmmc_card_table[host->id].bcsrpwr;
> >+    u32 val;
> > 
> >+    val = au1xmmc_card_table[host->id].power;
> >+
> >+#if defined(CONFIG_MIPS_DB1200)
> >     bcsr->board &= ~val;
> >     if (state) bcsr->board |= val;
> >+#endif
> > 
> >     au_sync_delay(1);
> > }
> 
>    If DBAu1100 doesn't allow to control slot power, then I don't think 
> pretending it does is a good thing. Shouldn't these #ifdef's be in 
> au1xmmc_set_ios() instead (the function is void anyway but that would allow 
> us to save on the code size a bit more)?

Mmm. I proposed that solution but I don't know exaclty how several
DB1x00 boards work. I just protect the variable "bcsr" which is not
defined for my board.

> > static inline int au1xmmc_card_inserted(struct au1xmmc_host *host)
> > {
> >-    return (bcsr->sig_status & au1xmmc_card_table[host->id].bcsrstatus)
> >-            ? 1 : 0;
> >+    u32 val, data = 1;
> >+
> >+    val = au1xmmc_card_table[host->id].status;
> >+
> >+#if defined(CONFIG_MIPS_DB1200)
> >+    data = bcsr->sig_status & val;
> >+#endif
> >+
> >+    return !!data;
> > }
> 
>    Hrm, are you sure there's no way to sense that the card is *really* 
> inserted or not?

Again as above. For my specific board I use:

   #if defined(CONFIG_MIPS_DB1200)
       data = bcsr->sig_status & val;
   #elif defined(CONFIG_MIPS_MYBOARD)
       specific code...
   #endif

Maybe we should modify my solution including other DB1x00 boards
ifdef. However, the important thing is to protect againt variable
"bcsr" if a specific board doesn't support it.

> > static inline int au1xmmc_card_readonly(struct au1xmmc_host *host)
> > {
> >-    return (bcsr->status & au1xmmc_card_table[host->id].wpstatus)
> >-            ? 1 : 0;
> >+    u32 val, data = 0;
> >+
> >+    val = au1xmmc_card_table[host->id].wpstatus;
> >+
> >+#if defined(CONFIG_MIPS_DB1200)
> >+    data = bcsr->status & val;
> >+#endif
> >+
> >+    return !!data;
> > }
> 
>    Ditto.

The same as above. :)

Ciao,

Rodolfo

-- 

GNU/Linux Solutions                  e-mail:    giometti@enneenne.com
Linux Device Driver                             giometti@gnudd.com
Embedded Systems                                giometti@linux.it
UNIX programming                     phone:     +39 349 2432127

Attachment: signature.asc
Description: Digital signature

<Prev in Thread] Current Thread [Next in Thread>