io: Provide _inX() and _outX()
authorJohn Garry <john.garry@huawei.com>
Fri, 27 Mar 2020 16:06:12 +0000 (00:06 +0800)
committerWei Xu <xuwei5@hisilicon.com>
Thu, 7 May 2020 06:54:18 +0000 (14:54 +0800)
commitf009c89df79abea5f5244b8135a205f7d4352f86
tree1a90a66d9638933c0d6df3a10bcf56d9413039e8
parent8f3d9f354286745c751374f5f1fcafee6b3f3136
io: Provide _inX() and _outX()

Since commit a7851aa54c0c ("io: change outX() to have their own IO barrier
overrides") and commit 87fe2d543f81 ("io: change inX() to have their own
IO barrier overrides"), the outX and inX functions have memory barriers
which can be overridden.

However, the generic logic_pio lib has continued to use readl/writel et al
for IO port accesses, which has weaker barriers on arm64.

Provide generic _inX() and _outX(), which can be used by logic pio.

For consistency, we check for !defined({in,out}X) && !defined(_{in,out}X),
for defining _{in,out}X, while a check for just !defined({in,out}X) should
suffice.

Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Wei Xu <xuwei5@hisilicon.com>
include/asm-generic/io.h