From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 655C0C282DD for ; Mon, 10 Jun 2019 08:44:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3B133207E0 for ; Mon, 10 Jun 2019 08:44:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="DK+uSure" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388120AbfFJIod (ORCPT ); Mon, 10 Jun 2019 04:44:33 -0400 Received: from mail-it1-f193.google.com ([209.85.166.193]:51534 "EHLO mail-it1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388033AbfFJIoc (ORCPT ); Mon, 10 Jun 2019 04:44:32 -0400 Received: by mail-it1-f193.google.com with SMTP id m3so12035826itl.1 for ; Mon, 10 Jun 2019 01:44:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=VS+cgEF/QUrbLF7DuqoiP4P2XAG1E5uMf3M9NoVhDxc=; b=DK+uSuretD7HL2a7vsPPnfX+8oGDG1VU/1GW3bNgb2Ee3mlXI/EOFVpP71A1qCzXmV qdq2OtFbX/XHjAVPfppxUcaVS0NKqNSJGPnYsfBuj0fqOQ1QstV+o4rfTetA4URaJBQy uoooP6cJSJS5sWkHj/DxE98Nntg/SUyT37V1pSRlpNzgzDJW084gU7ULnySZeBZc0GiQ /UqxysPa4zWEXmNTK+aHxuxZEu0Lnx+tNdN7d4AcMHl6cN96/WolqeISR9Yt9qpROthj 6rK86ggqQAlclsN6bGEHYdS7LfAnNh8jifGC0KHGOdoulTaGk6lNYT20ntnXk+DDjHF1 /hEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=VS+cgEF/QUrbLF7DuqoiP4P2XAG1E5uMf3M9NoVhDxc=; b=PJko1eCxPH3uxOhEjAhM/0Gk3OblvRfxYIEHjYAdGXdGfxiNwhFvC2dyJgmu7ytZ7m Xr7EiQM7186EOyR/E4dVfaymLE+WwM4tG5DHqIvtwzhEaVrnm01VoKhLA01/wKOi5nYb du5d+3JGa+aQcIL/qwCjIU+ptNxuiN68GHbP5UCcl3tEtvCKPiMrnnh6VMyePugwLqnd jAxdQOTHEF/EuYJJ/QyqI+yQF8Hi5hgAcod2ZfN1+waD4966n7h3EzODvXXnEEx102rT fIR3wsPMkWn0Nk9M0+c8gcs3DrXnb4x5WFBJz6gaIYi6A+7PENuM14H2MCsLw67EEkwb kREw== X-Gm-Message-State: APjAAAXRFrkcjstnxQ1xI0mSbOvMSv2KLA2Ha6yU0i3k7htc2JiXWT2Y ErVTbmrIziYL2f/Ur5lekNBjjddmbg5+p0UzR7Koug== X-Google-Smtp-Source: APXvYqyFs/Qz/+BC0ZDFUppIgbEfWY14++ciL9hJj1GnRU8+kHd3W+8xr8lU+QumsR1X+b0RC4Ha2EIH/Cvf+6SH3Ws= X-Received: by 2002:a02:ce37:: with SMTP id v23mr44208035jar.2.1560156271880; Mon, 10 Jun 2019 01:44:31 -0700 (PDT) MIME-Version: 1.0 References: <20190610084213.1052-1-lee.jones@linaro.org> In-Reply-To: <20190610084213.1052-1-lee.jones@linaro.org> From: Ard Biesheuvel Date: Mon, 10 Jun 2019 10:44:19 +0200 Message-ID: Subject: Re: [PATCH v3 1/8] i2c: i2c-qcom-geni: Provide support for ACPI To: Lee Jones Cc: alokc@codeaurora.org, Andy Gross , David Brown , wsa+renesas@sang-engineering.com, Bjorn Andersson , Linus Walleij , balbi@kernel.org, Greg Kroah-Hartman , Jeffrey Hugo , linux-i2c , linux-arm-msm , "open list:GPIO SUBSYSTEM" , linux-usb , linux-arm-kernel , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org On Mon, 10 Jun 2019 at 10:42, Lee Jones wrote: > > 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(-) > > 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), > }, > }; > > -- > 2.17.1 >