summaryrefslogtreecommitdiff
path: root/include/linux/i2c.h
diff options
context:
space:
mode:
authorYicong Yang <yangyicong@hisilicon.com>2021-04-08 19:17:18 +0800
committerWolfram Sang <wsa@kernel.org>2021-04-10 21:53:51 +0200
commit3b4c747cd32078172dd238929e38a43cfed83580 (patch)
tree893a135beeddecfbe093a101014ec31a1faf218c /include/linux/i2c.h
parent07740c92ae57ca21204f1e0c6f59272cdf3190cc (diff)
i2c: core: add api to provide frequency mode strings
Some I2C drivers like Designware and HiSilicon will print the bus frequency mode information, so add a public one that everyone can make use of. Tested-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Reviewed-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Yicong Yang <yangyicong@hisilicon.com> Signed-off-by: Wolfram Sang <wsa@kernel.org>
Diffstat (limited to 'include/linux/i2c.h')
-rw-r--r--include/linux/i2c.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index ce473ddc0378..e5d8b9dad6bf 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -51,6 +51,9 @@ struct module;
struct property_entry;
#if IS_ENABLED(CONFIG_I2C)
+/* Return the Frequency mode string based on the bus frequency */
+const char *i2c_freq_mode_string(u32 bus_freq_hz);
+
/*
* The master routines are the ones normally used to transmit data to devices
* on a bus (or read from them). Apart from two basic transfer functions to