[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200623025144.34246-1-john.stultz@linaro.org>
Date: Tue, 23 Jun 2020 02:51:44 +0000
From: John Stultz <john.stultz@...aro.org>
To: lkml <linux-kernel@...r.kernel.org>
Cc: John Stultz <john.stultz@...aro.org>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Jarkko Nikula <jarkko.nikula@...ux.intel.com>,
Wolfram Sang <wsa@...nel.org>, linux-i2c@...r.kernel.org
Subject: [PATCH] i2c: designware: Fix functionality in !CONFIG_ACPI case
On the HiKey board, where CONFIG_ACPI is not set, we started
to see a graphics regression where the adv7511 HDMI bridge driver
wasn't probing. This was due to the i2c bus failing to start up.
I bisected the problem down to commit f9288fcc5c615 ("i2c:
designware: Move ACPI parts into common module") and after
looking at it a bit, I realized that change moved some
initialization into i2c_dw_acpi_adjust_bus_speed(). However,
i2c_dw_acpi_adjust_bus_speed() is only functional if CONFIG_ACPI
is set.
This patch pulls i2c_dw_acpi_adjust_bus_speed() out of the
ifdef CONFIG_ACPI conditional, and gets the board working again.
Cc: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: Jarkko Nikula <jarkko.nikula@...ux.intel.com>
Cc: Wolfram Sang <wsa@...nel.org>
Cc: linux-i2c@...r.kernel.org
Fixes: f9288fcc5c615 ("i2c: designware: Move ACPI parts into common module")
Signed-off-by: John Stultz <john.stultz@...aro.org>
---
drivers/i2c/busses/i2c-designware-common.c | 4 ++--
drivers/i2c/busses/i2c-designware-core.h | 3 +--
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/i2c/busses/i2c-designware-common.c b/drivers/i2c/busses/i2c-designware-common.c
index e3a8640db7da..33de185e15f2 100644
--- a/drivers/i2c/busses/i2c-designware-common.c
+++ b/drivers/i2c/busses/i2c-designware-common.c
@@ -286,6 +286,8 @@ int i2c_dw_acpi_configure(struct device *device)
}
EXPORT_SYMBOL_GPL(i2c_dw_acpi_configure);
+#endif /* CONFIG_ACPI */
+
void i2c_dw_acpi_adjust_bus_speed(struct device *device)
{
struct dw_i2c_dev *dev = dev_get_drvdata(device);
@@ -317,8 +319,6 @@ void i2c_dw_acpi_adjust_bus_speed(struct device *device)
}
EXPORT_SYMBOL_GPL(i2c_dw_acpi_adjust_bus_speed);
-#endif /* CONFIG_ACPI */
-
u32 i2c_dw_scl_hcnt(u32 ic_clk, u32 tSYMBOL, u32 tf, int cond, int offset)
{
/*
diff --git a/drivers/i2c/busses/i2c-designware-core.h b/drivers/i2c/busses/i2c-designware-core.h
index 556673a1f61b..ea2485872cab 100644
--- a/drivers/i2c/busses/i2c-designware-core.h
+++ b/drivers/i2c/busses/i2c-designware-core.h
@@ -364,8 +364,7 @@ int i2c_dw_validate_speed(struct dw_i2c_dev *dev);
#if IS_ENABLED(CONFIG_ACPI)
int i2c_dw_acpi_configure(struct device *device);
-void i2c_dw_acpi_adjust_bus_speed(struct device *device);
#else
static inline int i2c_dw_acpi_configure(struct device *device) { return -ENODEV; }
-static inline void i2c_dw_acpi_adjust_bus_speed(struct device *device) {}
#endif
+void i2c_dw_acpi_adjust_bus_speed(struct device *device);
--
2.17.1
Powered by blists - more mailing lists