diff options
author | Mika Westerberg <mika.westerberg@linux.intel.com> | 2014-06-17 07:33:39 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-06-17 07:46:48 -0400 |
commit | 765bdd4e51674c1ae3a61ceb12a05706bf6b691b (patch) | |
tree | b08cba613fa9c8d823f5301e7ed278ab0cbb4457 /drivers/acpi/acpi_lpss.c | |
parent | 7171511eaec5bf23fb06078f59784a3a0626b38f (diff) |
ACPI / LPSS: Take I2C host controllers out of reset
On Intel Baytrail, some I2C host controllers are held in reset when the OS
gets control. This causes the driver to fail to detect the hardware
properly.
Fix this so that we make sure that the I2C host controller is not in reset
when the driver gets probe'd.
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/acpi_lpss.c')
-rw-r--r-- | drivers/acpi/acpi_lpss.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/acpi/acpi_lpss.c b/drivers/acpi/acpi_lpss.c index 63407d264885..9cb65b0e7597 100644 --- a/drivers/acpi/acpi_lpss.c +++ b/drivers/acpi/acpi_lpss.c | |||
@@ -34,6 +34,9 @@ ACPI_MODULE_NAME("acpi_lpss"); | |||
34 | 34 | ||
35 | /* Offsets relative to LPSS_PRIVATE_OFFSET */ | 35 | /* Offsets relative to LPSS_PRIVATE_OFFSET */ |
36 | #define LPSS_CLK_DIVIDER_DEF_MASK (BIT(1) | BIT(16)) | 36 | #define LPSS_CLK_DIVIDER_DEF_MASK (BIT(1) | BIT(16)) |
37 | #define LPSS_RESETS 0x04 | ||
38 | #define LPSS_RESETS_RESET_FUNC BIT(0) | ||
39 | #define LPSS_RESETS_RESET_APB BIT(1) | ||
37 | #define LPSS_GENERAL 0x08 | 40 | #define LPSS_GENERAL 0x08 |
38 | #define LPSS_GENERAL_LTR_MODE_SW BIT(2) | 41 | #define LPSS_GENERAL_LTR_MODE_SW BIT(2) |
39 | #define LPSS_GENERAL_UART_RTS_OVRD BIT(3) | 42 | #define LPSS_GENERAL_UART_RTS_OVRD BIT(3) |
@@ -99,6 +102,17 @@ static void lpss_uart_setup(struct lpss_private_data *pdata) | |||
99 | writel(reg | LPSS_GENERAL_UART_RTS_OVRD, pdata->mmio_base + offset); | 102 | writel(reg | LPSS_GENERAL_UART_RTS_OVRD, pdata->mmio_base + offset); |
100 | } | 103 | } |
101 | 104 | ||
105 | static void lpss_i2c_setup(struct lpss_private_data *pdata) | ||
106 | { | ||
107 | unsigned int offset; | ||
108 | u32 val; | ||
109 | |||
110 | offset = pdata->dev_desc->prv_offset + LPSS_RESETS; | ||
111 | val = readl(pdata->mmio_base + offset); | ||
112 | val |= LPSS_RESETS_RESET_APB | LPSS_RESETS_RESET_FUNC; | ||
113 | writel(val, pdata->mmio_base + offset); | ||
114 | } | ||
115 | |||
102 | static struct lpss_device_desc lpt_dev_desc = { | 116 | static struct lpss_device_desc lpt_dev_desc = { |
103 | .clk_required = true, | 117 | .clk_required = true, |
104 | .prv_offset = 0x800, | 118 | .prv_offset = 0x800, |
@@ -171,6 +185,7 @@ static struct lpss_device_desc byt_i2c_dev_desc = { | |||
171 | .prv_offset = 0x800, | 185 | .prv_offset = 0x800, |
172 | .save_ctx = true, | 186 | .save_ctx = true, |
173 | .shared_clock = &i2c_clock, | 187 | .shared_clock = &i2c_clock, |
188 | .setup = lpss_i2c_setup, | ||
174 | }; | 189 | }; |
175 | 190 | ||
176 | #else | 191 | #else |