Re: [PATCH v1 27/27] usb: musb: implement runtime is_inventra_dma/is_cppi_enabled/tusb_dma_omap

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

 



2010/12/21 Sergei Shtylyov <sshtylyov@xxxxxxxxxx>:
> Hello.
>
> On 21-12-2010 19:14, tom.leiming@xxxxxxxxx wrote:
>
>> From: Ming Lei<tom.leiming@xxxxxxxxx>
>
>> Now we can implement the three helpers below in runtime method:
>
>>        is_inventra_dma/is_cppi_enabled/tusb_dma_omap
>
>> so we can build all hw glue drivers, dma drivers and musb_hdrc into
>> one single binary image to support musb on mulitple machines.
>
>> Signed-off-by: Ming Lei<tom.leiming@xxxxxxxxx>
>
> [...]
>
>> diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h
>> index 5b3557c..78725df 100644
>> --- a/drivers/usb/musb/musb_core.h
>> +++ b/drivers/usb/musb/musb_core.h
>> @@ -681,4 +681,23 @@ static inline const char *get_dma_name(struct musb
>> *musb)
>>  #endif
>>  }
>>
>> +#ifdef CONFIG_USB_INVENTRA_DMA
>> +#define        is_inventra_dma(musb)   (musb->ops->flags &
>> MUSB_GLUE_DMA_INVENTRA)
>> +#else
>> +#define        is_inventra_dma(musb)   0
>> +#endif
>> +
>> +#ifdef CONFIG_USB_TI_CPPI_DMA
>> +#define        is_cppi_enabled(musb)   (musb->ops->flags &
>> MUSB_GLUE_DMA_CPPI)
>> +
>> +#else
>> +#define        is_cppi_enabled(musb)   0
>> +#endif
>> +
>> +#ifdef CONFIG_USB_TUSB_OMAP_DMA
>> +#define tusb_dma_omap(musb)                    (musb->ops->flags &
>> MUSB_GLUE_DMA_TUSB)
>> +#else
>> +#define tusb_dma_omap(musb)                    0
>> +#endif
>> +
>>  #endif        /* __MUSB_CORE_H__ */
>> diff --git a/drivers/usb/musb/musb_dma.h b/drivers/usb/musb/musb_dma.h
>> index dbc6d3d..df5a735 100644
>> --- a/drivers/usb/musb/musb_dma.h
>> +++ b/drivers/usb/musb/musb_dma.h
>> @@ -68,24 +68,6 @@ struct musb_hw_ep;
>>  #define       is_dma_capable()        (0)
>>  #endif
>>
>> -#ifdef CONFIG_USB_INVENTRA_DMA
>> -#define        is_inventra_dma(musb)   1
>> -#else
>> -#define        is_inventra_dma(musb)   0
>> -#endif
>> -
>> -#ifdef CONFIG_USB_TI_CPPI_DMA
>> -#define        is_cppi_enabled(musb)   1
>> -#else
>> -#define        is_cppi_enabled(musb)   0
>> -#endif
>> -
>> -#ifdef CONFIG_USB_TUSB_OMAP_DMA
>> -#define tusb_dma_omap(musb)                    1
>> -#else
>> -#define tusb_dma_omap(musb)                    0
>> -#endif
>> -
>
>   Why not keep the macros in musb_dma.h?

Because of musb->ops->flags, which types are defined in musb_core.h.

thank,
-- 
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