Hi Jon,

On Thu, Feb 18, 2010 at 09:37:52, Jon Povey wrote:
> I am starting work on porting our drivers from MV kernel to the git
> kernel, and getting a lot of warnings like:
>
>   warning: passing argument 1 of '__typesafe_io' makes integer from
> pointer without a cast
>
> Which comes from source like:
>
>   u32 tmpreg;
>   tmpreg = inl(GPIO_DIR45);
>
> We have our own header with lots of lines like this (inspired by drivers
> in the beta DM355 SDK):
>
>   #define GPIO_DIR45 IO_ADDRESS( DAVINCI_GPIO_BASE + 0x60 )
>
> Now, I'm pretty sure the we shouldn't be doing this for portability and
> so on, and should be getting these addresses in some
> platform-independent way, but for now It Works so I don't want to fix
> it.

To access GPIOs you should use GPIO driver (please see
include/linux/gpio.h)

>
> I would however like a clue on the right way to fix these warnings and
> do the kind of accesses I'm trying to do. There are many similar-looking
> macros and functions available: inl(), insl(), __raw_readl() and I don't
> know which I should be using, or if I should be passing around u32
> "addresses" or __iomem pointers (maybe the IO_ADDRESS() should go?).
> Had a look around for documentation but not found anything too useful.

You are right, using IO_ADDRESS is deprecated. Kevin is
not accepting any patches which use it. The correct way
is to use ioremap() to get a virtual address and then
use __raw_{readl|writel}() to access the address. You
can find many examples of this in arch/arm/mach-davinci/*

Thanks,
Sekhar
_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to