Re: [PATCH 12/28] usb: musb: same musb_readb/musb_writeb in single image to support multiple machines

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Felipe Balbi
Date: Monday, December 13, 2010 - 1:27 am

Hi,

On Mon, Dec 13, 2010 at 01:01:57AM +0800, tom.leiming@gmail.com wrote:

my idea for this was to have struct musb_io_ops. something like:

struct musb_io_ops {
	u8	(*readb)(const void __iomem *addr, unsigned offset);
	void	(*writeb)(const void __iomem *addr, unsigned offset, u8 data);

	u16	(*readw)(....);
	void	(*writew)(;...);

	u32	(*readl)();
	void	(writel)();
}

then you have a pointer for that inside the struct musb_platform_ops, or
maybe somewhere else. And you initialize the same way platform_ops, and
if you don't have a field, you fallback to default implementation.

-- 
balbi
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/28] usb: musb: musb cleanup, tom.leiming, (Sun Dec 12, 10:01 am)
[PATCH 11/28] usb: musb: remove musb_in_tusb, tom.leiming, (Sun Dec 12, 10:01 am)
[PATCH 12/27] usb: musb: remove musb_in_tusb, tom.leiming, (Sun Dec 12, 10:01 am)
[PATCH 21/28] usb: musb: print dma type in runtime way, tom.leiming, (Sun Dec 12, 10:02 am)
[PATCH 22/27] usb: musb: print dma type in runtime way, tom.leiming, (Sun Dec 12, 10:02 am)
RE: [PATCH 0/28] usb: musb: musb cleanup, Gupta, Ajay Kumar, (Mon Dec 13, 12:55 am)
Re: [PATCH 12/28] usb: musb: same musb_readb/musb_writeb i ..., Felipe Balbi, (Mon Dec 13, 1:27 am)
Re: [PATCH 0/28] usb: musb: musb cleanup, Ming Lei, (Mon Dec 13, 3:17 am)
Re: [PATCH 0/28] usb: musb: musb cleanup, Ming Lei, (Mon Dec 13, 3:18 am)