Re: [PATCH 10/28] usb: musb: handle tusb fifo style by runtime method

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

 



2010/12/13 Felipe Balbi <balbi@xxxxxx>:
> Hi,
>
> On Mon, Dec 13, 2010 at 01:01:52AM +0800, tom.leiming@xxxxxxxxx wrote:
>>
>> From: Ming Lei <tom.leiming@xxxxxxxxx>
>>
>> This patch introduces MUSB_GLUE_TUSB_STYLE flag, which
>> can be used to handle tusb dependent things by runtime
>> method instead of previous static method.
>>
>> This patch handles tusb fifo style according to the flag
>> of MUSB_GLUE_TUSB_STYLE passed from hw glue drivers.
>
> I'm not sure I like this approach. I didn't want musb to have to know
> _where_ it's running. As long as platform sets up things correctly.

We need to remove CONFIG_USB_MUSB_TUSB6010 first, so I think
the method taken by the patch is doable for the purpose.

Once we have better one, we can convert to it, but I find no better
one than it at least now.

>
>> @@ -253,6 +253,8 @@ enum musb_g_ep0_state {
>>
>> /******************************** TYPES
>> *************************************/
>>
>> +#define     MUSB_GLUE_TUSB_STYLE   0x0001
>> +
>> /**
>>  * struct musb_platform_ops - Operations passed to musb_core by HW glue
>> layer
>>  * @fifo_mode: which fifo_mode is taken by me
>> @@ -297,9 +299,8 @@ struct musb_hw_ep {
>>        void __iomem            *fifo;
>>        void __iomem            *regs;
>>
>> -#ifdef CONFIG_USB_MUSB_TUSB6010
>> +       /*Fixme: the following field is only used by tusb*/
>>        void __iomem            *conf;
>> -#endif
>>
>>        /* index in musb->endpoints[]  */
>>        u8                      epnum;
>> @@ -314,12 +315,13 @@ struct musb_hw_ep {
>>        struct dma_channel      *tx_channel;
>>        struct dma_channel      *rx_channel;
>>
>> -#ifdef CONFIG_USB_MUSB_TUSB6010
>> -       /* TUSB has "asynchronous" and "synchronous" dma modes */
>> +       /*
>> +        * TUSB has "asynchronous" and "synchronous" dma modes
>> +        * Fixme: the following three fields are only valid for TUSB.
>> +        * */
>>        dma_addr_t              fifo_async;
>>        dma_addr_t              fifo_sync;
>>        void __iomem            *fifo_sync_va;
>> -#endif
>>
>> #ifdef CONFIG_USB_MUSB_HDRC_HCD
>>        void __iomem            *target_regs;
>> @@ -429,11 +431,10 @@ struct musb {
>>        void __iomem            *ctrl_base;
>>        void __iomem            *mregs;
>>
>> -#ifdef CONFIG_USB_MUSB_TUSB6010
>> +       /*Fixme: the three fields below are only used by tusb*/
>>        dma_addr_t              async;
>>        dma_addr_t              sync;
>>        void __iomem            *sync_va;
>> -#endif
>
> fields which are used only by tusb should be moved to struct tusb_glue

Yes,  I agree with you, so I update the comment.

> instead. That'll be a bit more work.

Could we do it in another patch set?

thanks,
-- 
Lei Ming
--
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