From patchwork Tue Mar 13 22:37:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Austin Christ X-Patchwork-Id: 10281091 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 726D7601A0 for ; Tue, 13 Mar 2018 22:37:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5ABA32811E for ; Tue, 13 Mar 2018 22:37:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4D9E928401; Tue, 13 Mar 2018 22:37:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B350D2811E for ; Tue, 13 Mar 2018 22:37:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752054AbeCMWhj (ORCPT ); Tue, 13 Mar 2018 18:37:39 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:34270 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751300AbeCMWhj (ORCPT ); Tue, 13 Mar 2018 18:37:39 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 7B03C607A2; Tue, 13 Mar 2018 22:37:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1520980658; bh=9H16LFjp05ROPZVBjVqcvhFrWus29o9lGqXkAO16suQ=; h=From:To:Cc:Subject:Date:From; b=QxFY/G65Ue/zGWF+jTEqV03w9FQmaqF4Uiw+J4/liLRZ2q8/3Z2LQaEPaHfMjf1EK AQTc2u8U9uA89ZQDE/SpzwA58KlJQPHvWlFFnJsF4JYalY0UoGR/zP1n0Rb+lxUTLB pHg1OoQUSgE9OTlR6FnPWZSnf30Y7K47/Qupxe4E= Received: from austinwc-lnx.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: austinwc@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id B608E60590; Tue, 13 Mar 2018 22:37:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1520980658; bh=9H16LFjp05ROPZVBjVqcvhFrWus29o9lGqXkAO16suQ=; h=From:To:Cc:Subject:Date:From; b=QxFY/G65Ue/zGWF+jTEqV03w9FQmaqF4Uiw+J4/liLRZ2q8/3Z2LQaEPaHfMjf1EK AQTc2u8U9uA89ZQDE/SpzwA58KlJQPHvWlFFnJsF4JYalY0UoGR/zP1n0Rb+lxUTLB pHg1OoQUSgE9OTlR6FnPWZSnf30Y7K47/Qupxe4E= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org B608E60590 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=austinwc@codeaurora.org From: Austin Christ To: wsa@the-dreams.de, linux-i2c@vger.kernel.org Cc: linux-arm-msm@vger.kernel.org, timur@codeaurora.org, Austin Christ Subject: [PATCH] i2c: qup: add probe path for Centriq ACPI devices Date: Tue, 13 Mar 2018 16:37:27 -0600 Message-Id: <1520980647-14366-1-git-send-email-austinwc@codeaurora.org> X-Mailer: git-send-email 1.9.1 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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(-) 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,