On Wed, Jun 8, 2011 at 23:38, Scott Jiang wrote:
> 2011/6/3 Mike Frysinger:
>> On Fri, Jun 3, 2011 at 18:17, Scott Jiang wrote:
>>> --- /dev/null
>>> +++ b/drivers/media/video/blackfin/ppi.c
>>> @@ -0,0 +1,266 @@
>>> +#include <asm/io.h>
>>
>> linux/io.h
>>
>>> +#define regr(reg)               readw((reg) + ppi_base)
>>> +#define regw(value, reg)        writew(value, ((reg) + ppi_base))
>>> +
>>> +#define REG_PPI_CONTROL        0x00 /* PPI Control */
>>> +#define REG_PPI_STATUS         0x04 /* PPI Status */
>>> +#define REG_PPI_COUNT          0x08 /* Transfer Count */
>>> +#define REG_PPI_DELAY          0x0C /* Delay Count */
>>> +#define REG_PPI_FRAME          0x10 /* Lines Per Frame */
>>
>> ugh, no.  include asm/bfin_ppi.h, and then use things like
>> bfin_read(&regs->control) and bfin_write(&regs->control, 0x100).
>
> I want to write a universal driver for blackfin and arm, so I used ioremap.

couple of things:
 - 99% sure arm wont have PPI, so portability doesnt matter to this code
 - bfin_{read,write} have different behavior than io.h {read,write}
... the latter contains a lot more unnecessary code as it is geared
towards the async bank, not the mmr space
 - even if you stuck with io.h, the ppi offsets need to be thrown away
in favor of using the bfin_ppi structure

please keep replies on list
-mike
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to