aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWeifeng Voon <weifeng.voon@intel.com>2016-08-12 10:02:48 -0400
committerWolfram Sang <wsa@the-dreams.de>2016-08-25 18:42:03 -0400
commita92ec1746f10e339220bf186c4f6cce531b8a7ee (patch)
tree885970678d525d0ed62e3aaa6e196e175539424a
parent19c0a5399fe46218c2b5a5c17a01cf60f91ff5ae (diff)
i2c: designware: get fast plus and high speed *CNT configuration
I2C designware controller can run at fast mode plus and high speed. This patch adds the capability to get the HCNT, LCNT configuration via FPCN (fast plus) and HSCN (high speed) ACPI method. 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>
-rw-r--r--drivers/i2c/busses/i2c-designware-core.h8
-rw-r--r--drivers/i2c/busses/i2c-designware-platdrv.c2
2 files changed, 10 insertions, 0 deletions
diff --git a/drivers/i2c/busses/i2c-designware-core.h b/drivers/i2c/busses/i2c-designware-core.h
index 63f6d4acee39..84866db2d04f 100644
--- a/drivers/i2c/busses/i2c-designware-core.h
+++ b/drivers/i2c/busses/i2c-designware-core.h
@@ -62,6 +62,10 @@
62 * @ss_lcnt: standard speed LCNT value 62 * @ss_lcnt: standard speed LCNT value
63 * @fs_hcnt: fast speed HCNT value 63 * @fs_hcnt: fast speed HCNT value
64 * @fs_lcnt: fast speed LCNT value 64 * @fs_lcnt: fast speed LCNT value
65 * @fp_hcnt: fast plus HCNT value
66 * @fp_lcnt: fast plus LCNT value
67 * @hs_hcnt: high speed HCNT value
68 * @hs_lcnt: high speed LCNT value
65 * @acquire_lock: function to acquire a hardware lock on the bus 69 * @acquire_lock: function to acquire a hardware lock on the bus
66 * @release_lock: function to release a hardware lock on the bus 70 * @release_lock: function to release a hardware lock on the bus
67 * @pm_runtime_disabled: true if pm runtime is disabled 71 * @pm_runtime_disabled: true if pm runtime is disabled
@@ -105,6 +109,10 @@ struct dw_i2c_dev {
105 u16 ss_lcnt; 109 u16 ss_lcnt;
106 u16 fs_hcnt; 110 u16 fs_hcnt;
107 u16 fs_lcnt; 111 u16 fs_lcnt;
112 u16 fp_hcnt;
113 u16 fp_lcnt;
114 u16 hs_hcnt;
115 u16 hs_lcnt;
108 int (*acquire_lock)(struct dw_i2c_dev *dev); 116 int (*acquire_lock)(struct dw_i2c_dev *dev);
109 void (*release_lock)(struct dw_i2c_dev *dev); 117 void (*release_lock)(struct dw_i2c_dev *dev);
110 bool pm_runtime_disabled; 118 bool pm_runtime_disabled;
diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
index 1608cf4d3263..cbe4fb31cb4b 100644
--- a/drivers/i2c/busses/i2c-designware-platdrv.c
+++ b/drivers/i2c/busses/i2c-designware-platdrv.c
@@ -107,6 +107,8 @@ static int dw_i2c_acpi_configure(struct platform_device *pdev)
107 dw_i2c_acpi_params(pdev, "SSCN", &dev->ss_hcnt, &dev->ss_lcnt, NULL); 107 dw_i2c_acpi_params(pdev, "SSCN", &dev->ss_hcnt, &dev->ss_lcnt, NULL);
108 dw_i2c_acpi_params(pdev, "FMCN", &dev->fs_hcnt, &dev->fs_lcnt, 108 dw_i2c_acpi_params(pdev, "FMCN", &dev->fs_hcnt, &dev->fs_lcnt,
109 &dev->sda_hold_time); 109 &dev->sda_hold_time);
110 dw_i2c_acpi_params(pdev, "FPCN", &dev->fp_hcnt, &dev->fp_lcnt, NULL);
111 dw_i2c_acpi_params(pdev, "HSCN", &dev->hs_hcnt, &dev->hs_lcnt, NULL);
110 112
111 id = acpi_match_device(pdev->dev.driver->acpi_match_table, &pdev->dev); 113 id = acpi_match_device(pdev->dev.driver->acpi_match_table, &pdev->dev);
112 if (id && id->driver_data) 114 if (id && id->driver_data)