[RFC linux dev-4.7 1/5] drivers: fsi: Add function to get FSI clock rate

Eddie James eajames at linux.vnet.ibm.com
Sat Mar 11 08:48:22 AEDT 2017


From: "Edward A. James" <eajames at us.ibm.com>

client drivers (I2C, etc) may need to know FSI bus clock rate.

Signed-off-by: Edward A. James <eajames at us.ibm.com>
---
 drivers/fsi/fsi-core.c | 7 +++++++
 include/linux/fsi.h    | 1 +
 2 files changed, 8 insertions(+)

diff --git a/drivers/fsi/fsi-core.c b/drivers/fsi/fsi-core.c
index 3d382e6..492c9e9 100644
--- a/drivers/fsi/fsi-core.c
+++ b/drivers/fsi/fsi-core.c
@@ -139,6 +139,13 @@ int fsi_device_peek(struct fsi_device *dev, void *val)
 	return fsi_slave_read(dev->slave, addr, val, sizeof(uint32_t));
 }
 
+unsigned long fsi_device_get_clk_rate(struct fsi_device *dev)
+{
+	/* TODO: get clk from dts */
+	return 8333333;
+}
+EXPORT_SYMBOL_GPL(fsi_device_get_clk_rate);
+
 static void fsi_device_release(struct device *_device)
 {
 	struct fsi_device *device = to_fsi_dev(_device);
diff --git a/include/linux/fsi.h b/include/linux/fsi.h
index d22d0c5..57c8fdb 100644
--- a/include/linux/fsi.h
+++ b/include/linux/fsi.h
@@ -35,6 +35,7 @@ extern int fsi_device_read(struct fsi_device *dev, uint32_t addr,
 extern int fsi_device_write(struct fsi_device *dev, uint32_t addr,
 		const void *val, size_t size);
 extern int fsi_device_peek(struct fsi_device *dev, void *val);
+extern unsigned long fsi_device_get_clk_rate(struct fsi_device *dev);
 
 struct fsi_device_id {
 	u8	engine_type;
-- 
1.8.3.1



More information about the openbmc mailing list