summaryrefslogtreecommitdiff
path: root/drivers/i2c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2020-07-22 22:36:18 +0200
committerArnd Bergmann <arnd@arndb.de>2020-07-22 22:36:18 +0200
commit18517746d732aabe27257d40a0955d0d177ab039 (patch)
tree8de2ecfae1591bdd480f62641012a99bdaa51254 /drivers/i2c
parente2837df66837736fab6253133f7b6f9d0e6e0810 (diff)
parent03c900b3be116003ccd0e798431f6d0c25ff6729 (diff)
Merge tag 'qcom-drivers-for-5.9' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into arm/drivers
Qualcomm driver updates for v5.9 For RPMh this fixes an issue where ktime was used during suspend, allows the driver to be used on ARM targets and some minor cleanups. It adds support for the latest format version in the socinfo driver and adds identifiers for SM8250 and SDM630. SMD-RPM gains compatibles for MSM8994 and MSM8936 and the Qualcomm SCM gains compatibles MSM8994 and IPQ8074. The GENI core code gains interconnect path voting and performance level support, with subsequent patches integrating this with the SPI, I2C, UART and QSPI drivers. Following this the KGDB support for the GENI serial driver is improved, the performance related to chip-select is improved for SPI and QSPI. * tag 'qcom-drivers-for-5.9' of git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: (35 commits) soc: qcom: geni: Fix NULL pointer dereference tty: serial: qcom-geni-serial: Drop the icc bw votes in suspend for console serial: qcom_geni_serial: Always use 4 bytes per TX FIFO word serial: qcom_geni_serial: Make kgdb work even if UART isn't console spi: spi-geni-qcom: Get rid of most overhead in prepare_message() spi: spi-geni-qcom: Set the clock properly at runtime resume spi: spi-geni-qcom: Avoid clock setting if not needed spi: spi-qcom-qspi: Set an autosuspend delay of 250 ms spi: spi-qcom-qspi: Avoid clock setting if not needed spi: spi-qcom-qspi: Use OPP API to set clk/perf state firmware: qcom_scm: Add msm8994 compatible firmware: qcom_scm: Fix legacy convention SCM accessors <linux/of.h>: add stub for of_get_next_parent() to fix qcom build error dt-bindings: firmware: qcom: Add compatible for IPQ8074 SoC spi: spi-geni-qcom: Use OPP API to set clk/perf state tty: serial: qcom_geni_serial: Use OPP API to set clk/perf state spi: spi-qcom-qspi: Add interconnect support spi: spi-geni-qcom: Add interconnect support spi: spi-geni-qcom: Combine the clock setting code tty: serial: qcom_geni_serial: Add interconnect support ... Link: https://lore.kernel.org/r/20200721044812.3429652-1-bjorn.andersson@linaro.org Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/busses/i2c-qcom-geni.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-qcom-geni.c b/drivers/i2c/busses/i2c-qcom-geni.c
index 18d1e4fd4cf3..32b2a9921b14 100644
--- a/drivers/i2c/busses/i2c-qcom-geni.c
+++ b/drivers/i2c/busses/i2c-qcom-geni.c
@@ -557,6 +557,22 @@ static int geni_i2c_probe(struct platform_device *pdev)
gi2c->adap.dev.of_node = dev->of_node;
strlcpy(gi2c->adap.name, "Geni-I2C", sizeof(gi2c->adap.name));
+ ret = geni_icc_get(&gi2c->se, "qup-memory");
+ if (ret)
+ return ret;
+ /*
+ * Set the bus quota for core and cpu to a reasonable value for
+ * register access.
+ * Set quota for DDR based on bus speed.
+ */
+ gi2c->se.icc_paths[GENI_TO_CORE].avg_bw = GENI_DEFAULT_BW;
+ gi2c->se.icc_paths[CPU_TO_GENI].avg_bw = GENI_DEFAULT_BW;
+ gi2c->se.icc_paths[GENI_TO_DDR].avg_bw = Bps_to_icc(gi2c->clk_freq_out);
+
+ ret = geni_icc_set_bw(&gi2c->se);
+ if (ret)
+ return ret;
+
ret = geni_se_resources_on(&gi2c->se);
if (ret) {
dev_err(dev, "Error turning on resources %d\n", ret);
@@ -579,6 +595,10 @@ static int geni_i2c_probe(struct platform_device *pdev)
return ret;
}
+ ret = geni_icc_disable(&gi2c->se);
+ if (ret)
+ return ret;
+
dev_dbg(dev, "i2c fifo/se-dma mode. fifo depth:%d\n", tx_depth);
gi2c->suspended = 1;
@@ -623,7 +643,7 @@ static int __maybe_unused geni_i2c_runtime_suspend(struct device *dev)
gi2c->suspended = 1;
}
- return 0;
+ return geni_icc_disable(&gi2c->se);
}
static int __maybe_unused geni_i2c_runtime_resume(struct device *dev)
@@ -631,6 +651,10 @@ static int __maybe_unused geni_i2c_runtime_resume(struct device *dev)
int ret;
struct geni_i2c_dev *gi2c = dev_get_drvdata(dev);
+ ret = geni_icc_enable(&gi2c->se);
+ if (ret)
+ return ret;
+
ret = geni_se_resources_on(&gi2c->se);
if (ret)
return ret;