spi: hisi-sfc-v3xx: factor out IO modes configuration
authorYicong Yang <yangyicong@hisilicon.com>
Thu, 24 Sep 2020 12:24:27 +0000 (20:24 +0800)
committerMark Brown <broonie@kernel.org>
Fri, 25 Sep 2020 20:26:26 +0000 (21:26 +0100)
commit2c8af6a59744b242a193118c799a45621476f8ed
tree30d727d344ce48c776b180ca5cdbe893621ccb90
parentf09a433b1e4057e6379b7e1207548fff30d5dca3
spi: hisi-sfc-v3xx: factor out IO modes configuration

Factor IO modes configuration out of hisi_sfc_v3xx_generic_exec_op()
using an IO modes lookup table. This will make the process a bit clearer
and reduce the cyclomatic complexity. Simplify the IO mode definition
macros a little bit as well.

Also add the .supports_op() method for the controller mem ops, in order
to avoid OOB access.

Acked-by: John Garry <john.garry@huawei.com>
Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>
Link: https://lore.kernel.org/r/1600950270-52536-2-git-send-email-yangyicong@hisilicon.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-hisi-sfc-v3xx.c