summaryrefslogtreecommitdiffstats
path: root/drivers/fsi
diff options
context:
space:
mode:
authorJoel Stanley <joel@jms.id.au>2020-07-28 12:25:26 +0930
committerJoel Stanley <joel@jms.id.au>2020-09-10 12:23:19 +0930
commitadd6895188e49aa6b730d647ca896559370aa2be (patch)
treee5f19aabdb693fe9860fc7fe979e1f1fa0775eec /drivers/fsi
parent4a80c2017bd9136a139773ba980341ea7e71dafd (diff)
downloadlinux-add6895188e49aa6b730d647ca896559370aa2be.tar.bz2
fsi: aspeed: Add module param for bus divisor
For testing and hardware debugging a user may wish to override the divisor at runtime. By setting fsi_master_aspeed.bus_div=N, the divisor will be set to N, if 0 < N <= 0x3ff. This is a module parameter and not a device tree option as it will only need to be set when testing or debugging. Reviewed-by: Eddie James <eajames@linux.ibm.com> Link: https://lore.kernel.org/r/20200728025527.174503-5-joel@jms.id.au Signed-off-by: Joel Stanley <joel@jms.id.au>
Diffstat (limited to 'drivers/fsi')
-rw-r--r--drivers/fsi/fsi-master-aspeed.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/fsi/fsi-master-aspeed.c b/drivers/fsi/fsi-master-aspeed.c
index f503f64ab32b..2531e826ba8b 100644
--- a/drivers/fsi/fsi-master-aspeed.c
+++ b/drivers/fsi/fsi-master-aspeed.c
@@ -87,6 +87,7 @@ static const u32 fsi_base = 0xa0000000;
#define FSI_DIVISOR_DEFAULT 1
#define FSI_DIVISOR_CABLED 2
static u16 aspeed_fsi_divisor = FSI_DIVISOR_DEFAULT;
+module_param_named(bus_div,aspeed_fsi_divisor, ushort, 0);
#define OPB_POLL_TIMEOUT 10000
@@ -454,9 +455,12 @@ static int tacoma_cabled_fsi_fixup(struct device *dev)
if (gpio) {
/*
* Cable signal integrity means we should run the bus
- * slightly slower
+ * slightly slower. Do not override if a kernel param
+ * has already overridden.
*/
- aspeed_fsi_divisor = FSI_DIVISOR_CABLED;
+ if (aspeed_fsi_divisor == FSI_DIVISOR_DEFAULT)
+ aspeed_fsi_divisor = FSI_DIVISOR_CABLED;
+
gpiod_direction_output(mux_gpio, 0);
dev_info(dev, "FSI configured for external cable\n");
} else {