
Dear Fabio,
In message CAOMZO5BEfS10XVztnigMejMVJYLvv+jqDLZYom9K8-G+Zi1TXA@mail.gmail.com you wrote:
I'm sorry, but I fail to understand how writew() can be better than another I/O accessor. Neither of these has the capability to detect the endianess of this specific register interface ?
It's not that writew() is better. The problem is that we cannot use clrsetbits_le16() for a big endian controller.
On ARM (a LE architecture), clrsetbits_le16() maps down into:
clrsetbits_le16 -> out_le16 / in_le16 -> out_arch, w,le16 / in_arch, w,le16 -> __raw_writew(cpu_to_le16()) / le16__to_cpu(__raw_readw()) -> __raw_writew() / __raw_readw()
while
writew() -> __raw_writew(cpu_to_le16(v),__mem_pci(c)) __raw_writew()
Both map into __raw_writew() [which then boild down into __arch_putw() which is just a volatile unsigned short write access.
So both clrsetbits_le16() and writew() are little endian accessors. In which way would one write other data to the device than the other?
Best regards,
Wolfgang Denk