Problem in using ioread32() and iowrite32() func for devive driver in linux
I have written a device driver for fpga and all the registers are memory mapped . I am using ioremap() functiom to map the physical memeory amd iounmap() to unmap it to access any register i am using ioread32() and iowrite32() functions to read and write to 32 bit location but the function when reading and writing is doing the swaping of the bits as :-
if data is written as 0xddbb dddd
the read as 0xdddd bbdd
can any body suggert why this problen is ...In UDD book by Rubini it is suggested that we should use these wrapper function then why is this problem these functions are similar to readl and writel etc of 2.4 version ....
By dereferencing the pointer i am able to get the correct value insted of ioread32()
Please suggest me if you get any idea
thanks in advance