RE: [PATCH 1/3] musb: save dynfifo in musb struct

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: Felipe Balbi [mailto:felipe.balbi@xxxxxxxxx]
> Sent: Monday, December 14, 2009 9:55 PM
> To: Gupta, Ajay Kumar
> Cc: linux-usb@xxxxxxxxxxxxxxx; linux-omap@xxxxxxxxxxxxxxx; Balbi Felipe
> (Nokia-D/Helsinki); david-b@xxxxxxxxxxx
> Subject: Re: [PATCH 1/3] musb: save dynfifo in musb struct
> 
> Hi,
> 
> On Mon, Dec 14, 2009 at 02:39:40PM +0100, ext Ajay Kumar Gupta wrote:
> >Save dynamic FIFO read only information for later uses such as, during
> >musb_save/restore_context functions.
> >
> >Signed-off-by: Ajay Kumar Gupta <ajay.gupta@xxxxxx>
> 
> NAK
> 
> >---
> > drivers/usb/musb/musb_core.c |    4 +++-
> > drivers/usb/musb/musb_core.h |    1 +
> > 2 files changed, 4 insertions(+), 1 deletions(-)
> >
> >diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
> >index 49f2346..d4adbbf 100644
> >--- a/drivers/usb/musb/musb_core.c
> >+++ b/drivers/usb/musb/musb_core.c
> >@@ -1328,8 +1328,10 @@ static int __init musb_core_init(u16 musb_type,
> struct musb *musb)
> > 	reg = musb_read_configdata(mbase);
> >
> > 	strcpy(aInfo, (reg & MUSB_CONFIGDATA_UTMIDW) ? "UTMI-16" : "UTMI-
> 8");
> >-	if (reg & MUSB_CONFIGDATA_DYNFIFO)
> >+	if (reg & MUSB_CONFIGDATA_DYNFIFO) {
> > 		strcat(aInfo, ", dyn FIFOs");
> >+		musb->dyn_fifo = true;
> 
> we have this inside struct musb_hdrc_config.
> This is duplicating that.

musb->config->dyn_fifo is coming from platform files and is user defined
but we need to check if the mentor core itself supports dynamic fifo.

See the dynamic fifo code snippet:

--------------------------------------------------------
        if (reg & MUSB_CONFIGDATA_DYNFIFO) {
                if (musb->config->dyn_fifo)
                        status = ep_config_from_table(musb);
                else {
                        ERR("reconfigure software for Dynamic FIFOs\n");
                        status = -ENODEV;
                }
        } else {
--------------------------------------------------------

If CONFIGDATA register bit indicates that dynamic FIFO is supported then
musb->config->dyn_fifo has to be set to '1' for suceessful initialization.

Thus CONFIGDATA register bit alone is sufficient condition to save/restore
Tx/Rx FIFOSZ/FIFOADDR registers.

-Ajay

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

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux