From patchwork Wed Jun 12 14:26:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 166574 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp3752813ilk; Wed, 12 Jun 2019 07:27:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqyKQdo1Ou97JGbRegpxIr5MrceUGkQsAzzCfnljrGe8cSCuHtaMPgbEYzkWgVeoyVuHRVKU X-Received: by 2002:a62:1750:: with SMTP id 77mr18818224pfx.172.1560349671897; Wed, 12 Jun 2019 07:27:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560349671; cv=none; d=google.com; s=arc-20160816; b=T8k2JTOSwcoq6DYeLRFTJAcyMc+MO+dwSa0p5xmtuvWMaf/r3yrIHrN/z6t+vD1mxF CfBo1SC3pkqwIY4/xPkJVZY7M49XX3AZ3lxnb2WcNp3mqf0tiXsh1cehim+FXe6J58n0 en9+7f6OkjXzKRzXYaKpAjKmBa/7P5zIx/mRfF/NUNxPsxO0+WSSC31i0ofIv5CGvwlf D38ZDqOtXEJ55PCWGgYfknT0u8oyBmjPSysdSntdBqOBm+fqysxeClDLx6Vtaln1Xyzk AeOwb1aNail2NB8KA+LLW/pim9SmPIxSR8qthfxVHmMjz6nv/iT0W2RbWTnlSjnX+JyY j9aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=/Aaq1IVmTDwb5aMIJ54pXjvtw4nnZoMXSsSE3y/KzPo=; b=pFziQBiQ1jlXtadEawTPf3B3++o9DMixG5b0yvkdTu/bMJO5CxfxAHUg/WPjLYGogc oKDIXZe2VGt81flpeNgZLcYNA7SXxPhN3iRMwTe24Sl/bapCixvBZm3zj+e8G2u6/GRD aY/PikBdI3lZWwjBR6yXxUAfa8sA6n4F156Kyjiu0aeavkOAKHrxOG3xl+wEg+xn2oYW owiRQo2EBJZTTHec97sSBnFQQuVu2dnAeIaW5rkxYc0xii/uiPdlbxXqAHEcMQk23Zno BB6990Oy+hygdh+ocDqq4pkMo3bA4j4yq5Te9Lv9KePM0I/wtBUrywZX4UVMoMogdqKE zZiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=spIr1HI0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f1si16068077pld.78.2019.06.12.07.27.51; Wed, 12 Jun 2019 07:27:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=spIr1HI0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2439664AbfFLO1E (ORCPT + 30 others); Wed, 12 Jun 2019 10:27:04 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:38321 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2409267AbfFLO1B (ORCPT ); Wed, 12 Jun 2019 10:27:01 -0400 Received: by mail-wm1-f66.google.com with SMTP id s15so6774934wmj.3 for ; Wed, 12 Jun 2019 07:27:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=/Aaq1IVmTDwb5aMIJ54pXjvtw4nnZoMXSsSE3y/KzPo=; b=spIr1HI0F3AbtAb8DiEu9/whqpOq+KBs10UFyXRd2fSUB1k5RBU6LCcCvVt+QuW/vS oYdIGMzDfdkTfT6jYYjOpkFonvS+vzQwx9/Fxl6TXi+O2dNyxmmXE9Df9WzDen3//b5y ljMssjx4qZ3ak18yl9aXl4FmlH/NWEAUxLlxVICaMzyU0EUL30iFeE0e9VXlrGA7UcOX AXrZQIlUpuFk5xKlo2l/vShTgeyK3RUyY5UNypj3AV4gPjqd0e5jHOoEU+O6mIKCWA9i 0nAvG33btRAYHe81prn37js+mnL5VvdULXuL0SeXnGYxD2GuopufTTmtY1oh7HJIUUgY DNGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=/Aaq1IVmTDwb5aMIJ54pXjvtw4nnZoMXSsSE3y/KzPo=; b=Go7cNWqILGRu2CRo/L/dc3DwZ11SxgQgCQHdBCTk4kMh8ES7kVpxJMaDxO6+5M8cU9 R0kiic47DUGXQ3sC1UEw8qWZBxeVooa430GpvYyOQTPtvA+qtuQYjhqs6MsWgvHw0DFB ElBrAZn8Rg8s/8zWxVOTAATRxcwlv6u3oAH11S/Jj2WsjeIVcyKP50XCH2CgOeWiikfu Ow9Y3PyuHdY1HwRZIt5MiGoIeVYfqzGyggXJ6xBNS4XoXWf6UXIHbjN2/7QukGlkGQ/q qfXhkJdT/HRcyc0DfKsVFrWF59as+tK8K79QvwFbFQJmJydnou5jaR4ygmyhw/eImopa IlHA== X-Gm-Message-State: APjAAAUwmoEkJgeinD6jvs5Hmy3qj2TZJvd1KOLOcqVsP0Owl9T9Yrbk M2Zhf/JrzwqbEedAiR/9Z7McGA== X-Received: by 2002:a1c:6c14:: with SMTP id h20mr6555123wmc.168.1560349619579; Wed, 12 Jun 2019 07:26:59 -0700 (PDT) Received: from dell.watershed.co.uk ([185.80.132.160]) by smtp.gmail.com with ESMTPSA id y18sm203959wmd.29.2019.06.12.07.26.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Jun 2019 07:26:58 -0700 (PDT) From: Lee Jones To: alokc@codeaurora.org, agross@kernel.org, david.brown@linaro.org, wsa+renesas@sang-engineering.com, bjorn.andersson@linaro.org, balbi@kernel.org, gregkh@linuxfoundation.org, ard.biesheuvel@linaro.org, jlhugo@gmail.com Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-gpio@vger.kernel.org, linux-usb@vger.kernel.or, Lee Jones Subject: [PATCH v4 1/6] i2c: i2c-qcom-geni: Provide support for ACPI Date: Wed, 12 Jun 2019 15:26:49 +0100 Message-Id: <20190612142654.9639-2-lee.jones@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190612142654.9639-1-lee.jones@linaro.org> References: <20190612142654.9639-1-lee.jones@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add a match table to allow automatic probing of ACPI device QCOM0220. Ignore clock attainment errors. Set default clock frequency value. Signed-off-by: Lee Jones Acked-by: Ard Biesheuvel --- drivers/i2c/busses/i2c-qcom-geni.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/drivers/i2c/busses/i2c-qcom-geni.c b/drivers/i2c/busses/i2c-qcom-geni.c index db075bc0d952..9e3b8a98688d 100644 --- a/drivers/i2c/busses/i2c-qcom-geni.c +++ b/drivers/i2c/busses/i2c-qcom-geni.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 // Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. +#include #include #include #include @@ -483,6 +484,14 @@ static const struct i2c_algorithm geni_i2c_algo = { .functionality = geni_i2c_func, }; +#ifdef CONFIG_ACPI +static const struct acpi_device_id geni_i2c_acpi_match[] = { + { "QCOM0220"}, + { }, +}; +MODULE_DEVICE_TABLE(acpi, geni_i2c_acpi_match); +#endif + static int geni_i2c_probe(struct platform_device *pdev) { struct geni_i2c_dev *gi2c; @@ -502,7 +511,7 @@ static int geni_i2c_probe(struct platform_device *pdev) return PTR_ERR(gi2c->se.base); gi2c->se.clk = devm_clk_get(&pdev->dev, "se"); - if (IS_ERR(gi2c->se.clk)) { + if (IS_ERR(gi2c->se.clk) && !has_acpi_companion(&pdev->dev)) { ret = PTR_ERR(gi2c->se.clk); dev_err(&pdev->dev, "Err getting SE Core clk %d\n", ret); return ret; @@ -516,6 +525,9 @@ static int geni_i2c_probe(struct platform_device *pdev) gi2c->clk_freq_out = KHZ(100); } + if (has_acpi_companion(&pdev->dev)) + ACPI_COMPANION_SET(&gi2c->adap.dev, ACPI_COMPANION(&pdev->dev)); + gi2c->irq = platform_get_irq(pdev, 0); if (gi2c->irq < 0) { dev_err(&pdev->dev, "IRQ error for i2c-geni\n"); @@ -660,6 +672,7 @@ static struct platform_driver geni_i2c_driver = { .name = "geni_i2c", .pm = &geni_i2c_pm_ops, .of_match_table = geni_i2c_dt_match, + .acpi_match_table = ACPI_PTR(geni_i2c_acpi_match), }, };