Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1076678ybe; Mon, 2 Sep 2019 14:03:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqwyS2OivQkYTdfdDehmFwROT4sBMfdkXjN4INSohtGk2iI2rded4F5k6M7ecJh2enAUS2eG X-Received: by 2002:a63:e306:: with SMTP id f6mr26448232pgh.39.1567458212719; Mon, 02 Sep 2019 14:03:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567458212; cv=none; d=google.com; s=arc-20160816; b=TBMwkz5JgbterOP4WYqANDI4HGzxfeXhvcUn+6P1+8Hr6k+b7wypNNGh0rgGMw/QRU 64/bjKgHQHS8lkiYgaJ/dtvGOH7/ZZMfGFG3szLCxskdrs1fHPDGCEInqKuP4TgmD/iD alrSwiMIxTaPxcpES1WJuzoHRNYTnQaNH/PHj3ww9R776R53IAipRRJKt1y1lKe9IL8a QYnz8xkeowUvRl2c33OZQE6GFYyL8HgEVTCDWK3GAEjai/GhKCeCM4hKzdq4aOcrksW4 05PlJIe0kTsywkuHmQ/P1gy0ujBnG9drjHTn3ibHYImmeCU/HkaWBBvS7CeCyMDTm6XV VE/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=wDVlhF5ER/nST0Nioxn6t41B3nq6D7isVhZrZ+VommY=; b=eo651O2/FaO/VNehZ19gJlhi/x+F1hajFaYaT3VkSu3FFVvxrwSMn6LREfIewiX/v7 mUy+UkpPVcKo00wVWlZWs20ZwKISis9Gk3QQoFB8E5c7aKRm4vW/wEF3m8DAlOWO74wS IblQhFkz3CPA4gUt8HeMTrZOpgbo35JEb0ZEDk4TkffA2SKEbf9qMh+C5jHvYEMmishr +NsQycW6/GJyPGa+y4emEkAghCbi6fVS/cRpfQyab/Oh30FWh79Z3qIEaATeOLVL8MtY mNKl9FQVDHrXJqFb66VaRR4q72juL1zOaciSIqRLmnXZ694u/JxRcjMCaWg1ZpE+VCQb GjPg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y6si5805979pgy.588.2019.09.02.14.03.15; Mon, 02 Sep 2019 14:03:32 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727459AbfIBVC3 (ORCPT + 99 others); Mon, 2 Sep 2019 17:02:29 -0400 Received: from sauhun.de ([88.99.104.3]:44198 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727370AbfIBVC3 (ORCPT ); Mon, 2 Sep 2019 17:02:29 -0400 Received: from localhost (p54B337C1.dip0.t-ipconnect.de [84.179.55.193]) by pokefinder.org (Postfix) with ESMTPSA id 79B4D2C0165; Mon, 2 Sep 2019 23:02:26 +0200 (CEST) Date: Mon, 2 Sep 2019 23:02:26 +0200 From: Wolfram Sang To: "Rafael J. Wysocki" , Oleksij Rempel Cc: Chuanhua Han , "Rafael J. Wysocki" , Len Brown , Shawn Guo , Sascha Hauer , ACPI Devel Maling List , Linux Kernel Mailing List , linux-i2c , Linux ARM , Leo Li , Meenakshi Aggarwal , Udit Kumar Subject: Re: [PATCH] ACPI: support for NXP i2c controller Message-ID: <20190902210226.GC7253@kunai> References: <20190711102601.20582-1-chuanhua.han@nxp.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="f0KYrhQ4vYSV2aJu" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --f0KYrhQ4vYSV2aJu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Sep 02, 2019 at 10:56:22PM +0200, Rafael J. Wysocki wrote: > On Thu, Jul 11, 2019 at 12:35 PM Chuanhua Han wrot= e: > > > > Enable NXP i2c controller to boot with ACPI > > > > Signed-off-by: Meenakshi Aggarwal > > Signed-off-by: Udit Kumar > > Signed-off-by: Chuanhua Han >=20 > Wolfram, any objections to this from the i2c side? CCing the new maintainer of this driver... >=20 > > --- > > drivers/acpi/acpi_apd.c | 6 ++++++ > > drivers/i2c/busses/i2c-imx.c | 15 +++++++++++++++ > > 2 files changed, 21 insertions(+) > > > > diff --git a/drivers/acpi/acpi_apd.c b/drivers/acpi/acpi_apd.c > > index ff47317..cf8566c 100644 > > --- a/drivers/acpi/acpi_apd.c > > +++ b/drivers/acpi/acpi_apd.c > > @@ -165,6 +165,11 @@ static const struct apd_device_desc thunderx2_i2c_= desc =3D { > > .fixed_clk_rate =3D 125000000, > > }; > > > > +static const struct apd_device_desc nxp_i2c_desc =3D { > > + .setup =3D acpi_apd_setup, > > + .fixed_clk_rate =3D 350000000, > > +}; > > + > > static const struct apd_device_desc hip08_spi_desc =3D { > > .setup =3D acpi_apd_setup, > > .fixed_clk_rate =3D 250000000, > > @@ -238,6 +243,7 @@ static const struct acpi_device_id acpi_apd_device_= ids[] =3D { > > { "HISI02A1", APD_ADDR(hip07_i2c_desc) }, > > { "HISI02A2", APD_ADDR(hip08_i2c_desc) }, > > { "HISI0173", APD_ADDR(hip08_spi_desc) }, > > + { "NXP0001", APD_ADDR(nxp_i2c_desc) }, > > #endif > > { } > > }; > > diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c > > index b1b8b93..99f9b96 100644 > > --- a/drivers/i2c/busses/i2c-imx.c > > +++ b/drivers/i2c/busses/i2c-imx.c > > @@ -44,6 +44,7 @@ > > #include > > #include > > #include > > +#include > > > > /* This will be the driver name the kernel reports */ > > #define DRIVER_NAME "imx-i2c" > > @@ -255,6 +256,12 @@ static const struct of_device_id i2c_imx_dt_ids[] = =3D { > > }; > > MODULE_DEVICE_TABLE(of, i2c_imx_dt_ids); > > > > +static const struct acpi_device_id i2c_imx_acpi_ids[] =3D { > > + {"NXP0001", .driver_data =3D (kernel_ulong_t)&vf610_i2c_hwdata}, > > + { } > > +}; > > +MODULE_DEVICE_TABLE(acpi, i2c_imx_acpi_ids); > > + > > static inline int is_imx1_i2c(struct imx_i2c_struct *i2c_imx) > > { > > return i2c_imx->hwdata->devtype =3D=3D IMX1_I2C; > > @@ -1052,6 +1059,9 @@ static int i2c_imx_probe(struct platform_device *= pdev) > > { > > const struct of_device_id *of_id =3D of_match_device(i2c_imx_dt= _ids, > > &pdev->dev); > > + const struct acpi_device_id *acpi_id =3D > > + acpi_match_device(i2c_imx_acpi_ids, > > + &pdev->dev); > > struct imx_i2c_struct *i2c_imx; > > struct resource *res; > > struct imxi2c_platform_data *pdata =3D dev_get_platdata(&pdev->= dev); > > @@ -1079,6 +1089,9 @@ static int i2c_imx_probe(struct platform_device *= pdev) > > > > if (of_id) > > i2c_imx->hwdata =3D of_id->data; > > + else if (acpi_id) > > + i2c_imx->hwdata =3D (struct imx_i2c_hwdata *) > > + acpi_id->driver_data; > > else > > i2c_imx->hwdata =3D (struct imx_i2c_hwdata *) > > platform_get_device_id(pdev)->driver_da= ta; > > @@ -1091,6 +1104,7 @@ static int i2c_imx_probe(struct platform_device *= pdev) > > i2c_imx->adapter.nr =3D pdev->id; > > i2c_imx->adapter.dev.of_node =3D pdev->dev.of_node; > > i2c_imx->base =3D base; > > + ACPI_COMPANION_SET(&i2c_imx->adapter.dev, ACPI_COMPANION(&pdev-= >dev)); > > > > /* Get I2C clock */ > > i2c_imx->clk =3D devm_clk_get(&pdev->dev, NULL); > > @@ -1253,6 +1267,7 @@ static struct platform_driver i2c_imx_driver =3D { > > .name =3D DRIVER_NAME, > > .pm =3D &i2c_imx_pm_ops, > > .of_match_table =3D i2c_imx_dt_ids, > > + .acpi_match_table =3D ACPI_PTR(i2c_imx_acpi_ids), > > }, > > .id_table =3D imx_i2c_devtype, > > }; > > -- > > 2.9.5 > > --f0KYrhQ4vYSV2aJu Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAl1tg2EACgkQFA3kzBSg KbZjdQ//fUFpSzgjzQ8pjBl6JVroHT8jzq2aP30gEwpsl/FI14JgShodic81qs0q 9s7imcri7trPcIJolZPmqdZ7GOrTxQq1N2I2B0EnS+krBEOMj8WS2B1TOxhpeAdC wXSQIEkEtXV+XKxGGhNNnw20GJp9OEzsbGbqOAv8hL3toI2MOjTJn0lv+tuWJpPB LhL5DfizUp24aocb8Y7pp5XBCGYm+X2wekkTuGQ6G9S/ApfgfTjGncIhmacD07ML H9/z0Gq9WNpQz/5knUquLANiUFA9VjNrxup3jHFMCCnUxvdO5RzY76X0kxWiWXru CexaoxPMsQ18J/jQFdEw0y3buiTjHOgs0ipAMY41gCMM3LcdbBwUbDqg94FtK+f2 rsKzrBA9yAJ5v8nqb9GQSwYrFV40fMpYjEWbac+aptlA4dArLcpQZdmeXgvpzhR8 9g7djI6+V0/M+LqyAFuCLoy4luTszOe1FdOrOHiO+4Yx2La2+JKSuGu1uM80eBWs Ea4l1PtgSsjVNs7Xq5VYO6v4J8SK2XGNAazdQOMAHONtmoUIL4QQhuyCrFOh2MbR BSgZLZc2cDusYZRk6IU87a7o6tAFb8FYlJrlrPFN/Cv29zzat0kilpi4t4Pqqpx5 9Kgsq4dCj8enN/LGbWPC3HkuKV9LATHJcD5FyE8k0EGRJ/3RvIw= =y6Va -----END PGP SIGNATURE----- --f0KYrhQ4vYSV2aJu--