summaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses/i2c-designware-core.c
diff options
context:
space:
mode:
authorWeifeng Voon <weifeng.voon@intel.com>2016-08-12 17:02:49 +0300
committerWolfram Sang <wsa@the-dreams.de>2016-08-26 00:42:05 +0200
commitd608c3d9ac818fc0addc884144c7550e03b0fc6f (patch)
treeb560469cebb07a4749afbed85c071a00c7203e7b /drivers/i2c/busses/i2c-designware-core.c
parenta92ec1746f10e339220bf186c4f6cce531b8a7ee (diff)
downloadblackbird-op-linux-d608c3d9ac818fc0addc884144c7550e03b0fc6f.tar.gz
blackbird-op-linux-d608c3d9ac818fc0addc884144c7550e03b0fc6f.zip
i2c: designware: Enable fast mode plus
This patch enabled fast mode plus. The fast mode plus and fast speed share the same HCNT and LCNT register. So, the fast mode plus will only run when the HCNT and LCNT value is provided. Else, it will run at fast speed as default. Signed-off-by: Weifeng Voon <weifeng.voon@intel.com> Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c/busses/i2c-designware-core.c')
-rw-r--r--drivers/i2c/busses/i2c-designware-core.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/i2c/busses/i2c-designware-core.c b/drivers/i2c/busses/i2c-designware-core.c
index c6922b806fb7..07edff7a62e3 100644
--- a/drivers/i2c/busses/i2c-designware-core.c
+++ b/drivers/i2c/busses/i2c-designware-core.c
@@ -347,8 +347,11 @@ int i2c_dw_init(struct dw_i2c_dev *dev)
dw_writel(dev, lcnt, DW_IC_SS_SCL_LCNT);
dev_dbg(dev->dev, "Standard-mode HCNT:LCNT = %d:%d\n", hcnt, lcnt);
- /* Set SCL timing parameters for fast-mode */
- if (dev->fs_hcnt && dev->fs_lcnt) {
+ /* Set SCL timing parameters for fast-mode or fast-mode plus */
+ if ((dev->clk_freq == 1000000) && dev->fp_hcnt && dev->fp_lcnt) {
+ hcnt = dev->fp_hcnt;
+ lcnt = dev->fp_lcnt;
+ } else if (dev->fs_hcnt && dev->fs_lcnt) {
hcnt = dev->fs_hcnt;
lcnt = dev->fs_lcnt;
} else {
OpenPOWER on IntegriCloud