diff mbox series

i2c: qup: add probe path for Centriq ACPI devices

Message ID 1520980647-14366-1-git-send-email-austinwc@codeaurora.org
State Changes Requested
Headers show
Series i2c: qup: add probe path for Centriq ACPI devices | expand

Commit Message

Christ, Austin March 13, 2018, 10:37 p.m. UTC
Add support for Qualcomm Centriq devices that are qup-v2 compatible but
do not support DMA, so nodma needs to be set.

Signed-off-by: Austin Christ <austinwc@codeaurora.org>
---

This patch depends on the v2 series titled "Major code reorganization to
make all i2c transfers working" by Abhishek Sahu

 drivers/i2c/busses/i2c-qup.c | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

Comments

Trilok Soni March 13, 2018, 11:43 p.m. UTC | #1
Hi Austin,


> +

Unnecessary empty line addition?

---Trilok Soni
diff mbox series

Patch

diff --git a/drivers/i2c/busses/i2c-qup.c b/drivers/i2c/busses/i2c-qup.c
index 904dfec..9035c78 100644
--- a/drivers/i2c/busses/i2c-qup.c
+++ b/drivers/i2c/busses/i2c-qup.c
@@ -1648,6 +1648,14 @@  static void qup_i2c_disable_clocks(struct qup_i2c_dev *qup)
 	clk_disable_unprepare(qup->pclk);
 }
 
+#if IS_ENABLED(CONFIG_ACPI)
+static const struct acpi_device_id qup_i2c_acpi_match[] = {
+	{ "QCOM8010"},
+	{ },
+};
+MODULE_DEVICE_TABLE(acpi, qup_i2c_acpi_match);
+#endif
+
 static int qup_i2c_probe(struct platform_device *pdev)
 {
 	static const int blk_sizes[] = {4, 16, 32};
@@ -1661,6 +1669,7 @@  static int qup_i2c_probe(struct platform_device *pdev)
 	int blocks;
 	bool is_qup_v1;
 
+
 	qup = devm_kzalloc(&pdev->dev, sizeof(*qup), GFP_KERNEL);
 	if (!qup)
 		return -ENOMEM;
@@ -1675,6 +1684,12 @@  static int qup_i2c_probe(struct platform_device *pdev)
 			DEFAULT_CLK_FREQ);
 	}
 
+	if (acpi_match_device(qup_i2c_acpi_match, qup->dev)) {
+		qup->adap.algo = &qup_i2c_algo_v2;
+		is_qup_v1 = false;
+		goto nodma;
+	}
+
 	if (of_device_is_compatible(pdev->dev.of_node, "qcom,i2c-qup-v1.1.1")) {
 		qup->adap.algo = &qup_i2c_algo;
 		qup->adap.quirks = &qup_i2c_quirks;
@@ -1959,14 +1974,6 @@  static int qup_i2c_resume(struct device *device)
 };
 MODULE_DEVICE_TABLE(of, qup_i2c_dt_match);
 
-#if IS_ENABLED(CONFIG_ACPI)
-static const struct acpi_device_id qup_i2c_acpi_match[] = {
-	{ "QCOM8010"},
-	{ },
-};
-MODULE_DEVICE_TABLE(acpi, qup_i2c_acpi_match);
-#endif
-
 static struct platform_driver qup_i2c_driver = {
 	.probe  = qup_i2c_probe,
 	.remove = qup_i2c_remove,