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>
This commit is contained in:
Yicong Yang 2020-09-24 20:24:27 +08:00 • committed by Mark Brown
commit 2c8af6a597
No known key found for this signature in database
GPG key ID: 24D68B725D5487D0