[PATCH 4/4] ASoC: fsl: make fsl_ssi driver compilable on ARM/IMX

Timur Tabi timur at freescale.com
Fri Feb 24 16:29:04 EST 2012


Russell King - ARM Linux wrote:
>> > I'll have to ask around, because I'm sure I'm missing something.
> If what you say is true, it means we have different semantics for the
> same accessors on different architectures.  No wonder it's needing
> drivers to gain ifdefs to select appropriate accessors.
> 
> This needs sorting out properly.  It needs the semantics of readl() etc
> to be fully defined, and all architectures to implement those semantics
> rather than what they think would be appropriate for them.

So I asked around, and sure enough, my macro-fu was weak.  On PowerPC,
readl() maps to in_le32().  Even though PowerPC is big-endian, some
devices are little endian (e.g. PCI and some PICs).

in_le32() is the byte-swapping version of in_be32().  Both functions have
instruction order synchronization instructions in them.

So replacing in_be32() with readl() will break on PowerPC.

-- 
Timur Tabi
Linux kernel developer at Freescale




More information about the linux-arm-kernel mailing list