Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp588250ybe; Fri, 6 Sep 2019 04:20:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqw8Ec+u5C+n8CukF4EcwJdcJkLRU2SUUMMY32zxm313NS0f78nEVSHJyU2+OFcqxei3S14m X-Received: by 2002:a17:90b:318:: with SMTP id ay24mr9430563pjb.28.1567768840952; Fri, 06 Sep 2019 04:20:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567768840; cv=none; d=google.com; s=arc-20160816; b=JJqBoloyzPpc9QXKFvpskU43Dfjwz87aPUHUYFoN2TJPvPzGqLlFY4G+GVRj/AsdrE 0fnbbqf7EUhyxPNAqhppTcmxhxlTeoy1fuExG0f+7fKWmeOxqzbKHtKsqLW5czbXlj55 lLiADTgcIX3bCSHAyCfTPRRdh96M31oH7UIjBgoOCGY2CAwEs5nZ6SuonaH6N5X01pPU CUWV6A+07aPkQjFdBxX3Tu2jToKyFkxn7wDuqzIT4u9hwAfbFYnvPjXVIv9Zf6eHC+9E 407UzXY82OiGy6i74JQzboLEWRwB/vYJxnt+YnzVUPebRF1kSxgdGrTHOSP6yF1sAoxm bKaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=5rKq84QHOcAdoXtjiTtFTy93eGC6R/AyPPtgsMCU2W8=; b=H3hvzI6Nlt+WumnFl637hwVI41SXulBc4hz9oa9FCA6J2U2O2KZ/9LR+2DhqSZFcXT dY+qdjo4xZIwZd821q8biYaghaWik7ip9++FV0J6IKl6Ndv+Z6o33bi+hI47lA7OvULk mEQtw9humldsS/C/B6OXwSF5TbF48RCpXivNgB040I2kCwVLGkixk+p0wsB1ZkcWk7fB Pm+NAjLNBSwm3RxsLANyppoBrUByB/oF+RdrT0zvBNQiXd2NZJjuSiPnfbfahGonvVB4 6wnO49NcQXXA9mX25h7gQA2rtUdiIJLRkK5D/3WVLFMkL1BjJNdlM+w/nOB796dHcn6+ 42UA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=oFy2Rsd4; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 37si4584485pjo.39.2019.09.06.04.20.24; Fri, 06 Sep 2019 04:20:40 -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=@gmail.com header.s=20161025 header.b=oFy2Rsd4; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391919AbfIFKcJ (ORCPT + 99 others); Fri, 6 Sep 2019 06:32:09 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:36554 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729053AbfIFKcJ (ORCPT ); Fri, 6 Sep 2019 06:32:09 -0400 Received: by mail-pg1-f196.google.com with SMTP id l21so3263677pgm.3; Fri, 06 Sep 2019 03:32:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=5rKq84QHOcAdoXtjiTtFTy93eGC6R/AyPPtgsMCU2W8=; b=oFy2Rsd4PPunJebqhYLKX+0hn+GiXdKIR3YsUvL0TG7apYKiHrbFSuXztFNnf64OE6 SImRJTpwz9xAXIxE4dijI+7q77g025fCPPz2xNDIeemvXI9B7ZLMPm61JRlqpl08NEkQ DhCp4tp683IfgnaG+/0Vq7YvVaJVI6QtJKmP5fbuz+USY8RoVzijWb/ihrF5g0UWU6L5 HdFs/dBGpT5Tt0G+JK9phbo3/w+elLztFPNzuUzgvzhCKNQK+IPM6MYDawAcH3lM8x1Z nYAaH+EuCw+coTkHZRV9y1SsSWqSyZYI6LaPqy0b2zs1lZU0WMsqUZf3TIUq2OEG4dEt VzSQ== 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=5rKq84QHOcAdoXtjiTtFTy93eGC6R/AyPPtgsMCU2W8=; b=eNT1+Ea/l6DCGuD18Eh1XpOPmjxtuoX5kpnf1pLAllLkIa7f/RUtWJqJrNMoDWxacs 1oPzQdibPLLpvJeJi6WrleEMtV2VzX2mXc8FvHPeCOWzzPe+9lfGKTNS97a29HWnaDXH ua4Fj9OWbic6J7WJezZF9R76nJD7jUBoD99+gFa12LsVE2Txdr71IVfseeTSQXrOsfM0 YpE44e8gMUB9lOTZsu+uiLFkqN4jOetPFGz3ZS8wpnKOQ85rA0eJkgec7RZSR2oZZNlQ dUGMtlLda0otL0of3rNsMl4cHbWIc9CEKeDt9VfwZ6HxCwgtJSi1DMBwePLsVlTH/n+O Knhg== X-Gm-Message-State: APjAAAWiWITqfES19P4KNxy/PF3GsuEvuj8VyD92UE0kozR15okKwLmT cK9c+WOwmtGzaPQpaKEew5f7SyrHkk/n216KM6k= X-Received: by 2002:a17:90a:7f96:: with SMTP id m22mr1422911pjl.30.1567765927768; Fri, 06 Sep 2019 03:32:07 -0700 (PDT) MIME-Version: 1.0 References: <20190906075319.21244-1-biwen.li@nxp.com> In-Reply-To: <20190906075319.21244-1-biwen.li@nxp.com> From: Andy Shevchenko Date: Fri, 6 Sep 2019 13:31:56 +0300 Message-ID: Subject: Re: [v2] ACPI: support for NXP i2c controller To: Biwen Li Cc: "Rafael J. Wysocki" , Leo Li , Meenakshi Aggarwal , Udit Kumar , Wolfram Sang , "Rafael J. Wysocki" , Chuanhua Han , Shawn Guo , Sascha Hauer , ACPI Devel Maling List , Linux Kernel Mailing List , linux-i2c , linux-arm Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 6, 2019 at 11:03 AM Biwen Li wrote: > > From: Chuanhua Han > > Enable NXP i2c controller to boot with ACPI > Thanks, the code looks good to me, Reviewed-by: Andy Shevchenko though... > Signed-off-by: Meenakshi Aggarwal > Signed-off-by: Udit Kumar > Signed-off-by: Chuanhua Han This SoB chain is a bit odd. Who is the author of this? The first SoB in the chain usually points to the first (main) author. There is also possible to change that, though in that case for the rest we now use Co-developed-by tag rather than SoB. In any case, if Rafael and Wolfram are okay with this, I have no objections. > Signed-off-by: Biwen Li > --- > Change in v2: > - Simplify code > - Adjust header file order > - Not use ACPI_PTR() > > drivers/acpi/acpi_apd.c | 7 +++++++ > drivers/i2c/busses/i2c-imx.c | 17 +++++++++++++---- > 2 files changed, 20 insertions(+), 4 deletions(-) > > diff --git a/drivers/acpi/acpi_apd.c b/drivers/acpi/acpi_apd.c > index 7cd0c9ac71ea..71511ae2dfcd 100644 > --- a/drivers/acpi/acpi_apd.c > +++ b/drivers/acpi/acpi_apd.c > @@ -160,11 +160,17 @@ static const struct apd_device_desc hip08_i2c_desc = { > .setup = acpi_apd_setup, > .fixed_clk_rate = 250000000, > }; > + > static const struct apd_device_desc thunderx2_i2c_desc = { > .setup = acpi_apd_setup, > .fixed_clk_rate = 125000000, > }; > > +static const struct apd_device_desc nxp_i2c_desc = { > + .setup = acpi_apd_setup, > + .fixed_clk_rate = 350000000, > +}; > + > static const struct apd_device_desc hip08_spi_desc = { > .setup = acpi_apd_setup, > .fixed_clk_rate = 250000000, > @@ -238,6 +244,7 @@ static const struct acpi_device_id acpi_apd_device_ids[] = { > { "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 15f6cde6452f..a3b61336fe55 100644 > --- a/drivers/i2c/busses/i2c-imx.c > +++ b/drivers/i2c/busses/i2c-imx.c > @@ -20,6 +20,7 @@ > * > */ > > +#include > #include > #include > #include > @@ -255,6 +256,12 @@ static const struct of_device_id i2c_imx_dt_ids[] = { > }; > MODULE_DEVICE_TABLE(of, i2c_imx_dt_ids); > > +static const struct acpi_device_id i2c_imx_acpi_ids[] = { > + {"NXP0001", .driver_data = (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 == IMX1_I2C; > @@ -1048,14 +1055,13 @@ static const struct i2c_algorithm i2c_imx_algo = { > > static int i2c_imx_probe(struct platform_device *pdev) > { > - const struct of_device_id *of_id = of_match_device(i2c_imx_dt_ids, > - &pdev->dev); > struct imx_i2c_struct *i2c_imx; > struct resource *res; > struct imxi2c_platform_data *pdata = dev_get_platdata(&pdev->dev); > void __iomem *base; > int irq, ret; > dma_addr_t phy_addr; > + const struct imx_i2c_hwdata *match; > > dev_dbg(&pdev->dev, "<%s>\n", __func__); > > @@ -1075,8 +1081,9 @@ static int i2c_imx_probe(struct platform_device *pdev) > if (!i2c_imx) > return -ENOMEM; > > - if (of_id) > - i2c_imx->hwdata = of_id->data; > + match = device_get_match_data(&pdev->dev); > + if (match) > + i2c_imx->hwdata = match; > else > i2c_imx->hwdata = (struct imx_i2c_hwdata *) > platform_get_device_id(pdev)->driver_data; > @@ -1089,6 +1096,7 @@ static int i2c_imx_probe(struct platform_device *pdev) > i2c_imx->adapter.nr = pdev->id; > i2c_imx->adapter.dev.of_node = pdev->dev.of_node; > i2c_imx->base = base; > + ACPI_COMPANION_SET(&i2c_imx->adapter.dev, ACPI_COMPANION(&pdev->dev)); > > /* Get I2C clock */ > i2c_imx->clk = devm_clk_get(&pdev->dev, NULL); > @@ -1247,6 +1255,7 @@ static struct platform_driver i2c_imx_driver = { > .name = DRIVER_NAME, > .pm = &i2c_imx_pm_ops, > .of_match_table = i2c_imx_dt_ids, > + .acpi_match_table = i2c_imx_acpi_ids, > }, > .id_table = imx_i2c_devtype, > }; > -- > 2.17.1 > -- With Best Regards, Andy Shevchenko