All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa@the-dreams.de>
To: "Rafael J. Wysocki" <rafael@kernel.org>,
	Oleksij Rempel <o.rempel@pengutronix.de>
Cc: Chuanhua Han <chuanhua.han@nxp.com>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Len Brown <lenb@kernel.org>, Shawn Guo <shawnguo@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-i2c <linux-i2c@vger.kernel.org>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	Leo Li <leoyang.li@nxp.com>,
	Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com>,
	Udit Kumar <udit.kumar@nxp.com>
Subject: Re: [PATCH] ACPI: support for NXP i2c controller
Date: Mon, 2 Sep 2019 23:02:26 +0200	[thread overview]
Message-ID: <20190902210226.GC7253@kunai> (raw)
In-Reply-To: <CAJZ5v0hY2sL+XfN_4v07_hjvoxgCAt+Q89+wNg5Pky6XKP-mqA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 4426 bytes --]

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 <chuanhua.han@nxp.com> wrote:
> >
> > Enable NXP i2c controller to boot with ACPI
> >
> > Signed-off-by: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com>
> > Signed-off-by: Udit Kumar <udit.kumar@nxp.com>
> > Signed-off-by: Chuanhua Han <chuanhua.han@nxp.com>
> 
> Wolfram, any objections to this from the i2c side?

CCing the new maintainer of this driver...

> 
> > ---
> >  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 = {
> >         .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 +243,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 b1b8b93..99f9b96 100644
> > --- a/drivers/i2c/busses/i2c-imx.c
> > +++ b/drivers/i2c/busses/i2c-imx.c
> > @@ -44,6 +44,7 @@
> >  #include <linux/pm_runtime.h>
> >  #include <linux/sched.h>
> >  #include <linux/slab.h>
> > +#include <linux/acpi.h>
> >
> >  /* 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[] = {
> >  };
> >  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;
> > @@ -1052,6 +1059,9 @@ 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);
> > +       const struct acpi_device_id *acpi_id =
> > +                       acpi_match_device(i2c_imx_acpi_ids,
> > +                                         &pdev->dev);
> >         struct imx_i2c_struct *i2c_imx;
> >         struct resource *res;
> >         struct imxi2c_platform_data *pdata = dev_get_platdata(&pdev->dev);
> > @@ -1079,6 +1089,9 @@ static int i2c_imx_probe(struct platform_device *pdev)
> >
> >         if (of_id)
> >                 i2c_imx->hwdata = of_id->data;
> > +       else if (acpi_id)
> > +               i2c_imx->hwdata = (struct imx_i2c_hwdata *)
> > +                               acpi_id->driver_data;
> >         else
> >                 i2c_imx->hwdata = (struct imx_i2c_hwdata *)
> >                                 platform_get_device_id(pdev)->driver_data;
> > @@ -1091,6 +1104,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);
> > @@ -1253,6 +1267,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 = ACPI_PTR(i2c_imx_acpi_ids),
> >         },
> >         .id_table = imx_i2c_devtype,
> >  };
> > --
> > 2.9.5
> >

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Wolfram Sang <wsa@the-dreams.de>
To: "Rafael J. Wysocki" <rafael@kernel.org>,
	Oleksij Rempel <o.rempel@pengutronix.de>
Cc: Udit Kumar <udit.kumar@nxp.com>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Leo Li <leoyang.li@nxp.com>,
	ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
	Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com>,
	linux-i2c <linux-i2c@vger.kernel.org>,
	Chuanhua Han <chuanhua.han@nxp.com>,
	Shawn Guo <shawnguo@kernel.org>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	Len Brown <lenb@kernel.org>
Subject: Re: [PATCH] ACPI: support for NXP i2c controller
Date: Mon, 2 Sep 2019 23:02:26 +0200	[thread overview]
Message-ID: <20190902210226.GC7253@kunai> (raw)
In-Reply-To: <CAJZ5v0hY2sL+XfN_4v07_hjvoxgCAt+Q89+wNg5Pky6XKP-mqA@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 4426 bytes --]

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 <chuanhua.han@nxp.com> wrote:
> >
> > Enable NXP i2c controller to boot with ACPI
> >
> > Signed-off-by: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com>
> > Signed-off-by: Udit Kumar <udit.kumar@nxp.com>
> > Signed-off-by: Chuanhua Han <chuanhua.han@nxp.com>
> 
> Wolfram, any objections to this from the i2c side?

CCing the new maintainer of this driver...

> 
> > ---
> >  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 = {
> >         .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 +243,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 b1b8b93..99f9b96 100644
> > --- a/drivers/i2c/busses/i2c-imx.c
> > +++ b/drivers/i2c/busses/i2c-imx.c
> > @@ -44,6 +44,7 @@
> >  #include <linux/pm_runtime.h>
> >  #include <linux/sched.h>
> >  #include <linux/slab.h>
> > +#include <linux/acpi.h>
> >
> >  /* 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[] = {
> >  };
> >  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;
> > @@ -1052,6 +1059,9 @@ 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);
> > +       const struct acpi_device_id *acpi_id =
> > +                       acpi_match_device(i2c_imx_acpi_ids,
> > +                                         &pdev->dev);
> >         struct imx_i2c_struct *i2c_imx;
> >         struct resource *res;
> >         struct imxi2c_platform_data *pdata = dev_get_platdata(&pdev->dev);
> > @@ -1079,6 +1089,9 @@ static int i2c_imx_probe(struct platform_device *pdev)
> >
> >         if (of_id)
> >                 i2c_imx->hwdata = of_id->data;
> > +       else if (acpi_id)
> > +               i2c_imx->hwdata = (struct imx_i2c_hwdata *)
> > +                               acpi_id->driver_data;
> >         else
> >                 i2c_imx->hwdata = (struct imx_i2c_hwdata *)
> >                                 platform_get_device_id(pdev)->driver_data;
> > @@ -1091,6 +1104,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);
> > @@ -1253,6 +1267,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 = ACPI_PTR(i2c_imx_acpi_ids),
> >         },
> >         .id_table = imx_i2c_devtype,
> >  };
> > --
> > 2.9.5
> >

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2019-09-02 21:02 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-11 10:26 [PATCH] ACPI: support for NXP i2c controller Chuanhua Han
2019-07-11 10:26 ` Chuanhua Han
2019-07-18  8:45 ` Rafael J. Wysocki
2019-07-18  8:45   ` Rafael J. Wysocki
2019-07-18  8:48   ` [EXT] " Chuanhua Han
2019-07-18  8:48     ` Chuanhua Han
2019-09-02 20:56 ` Rafael J. Wysocki
2019-09-02 20:56   ` Rafael J. Wysocki
2019-09-02 20:56   ` Rafael J. Wysocki
2019-09-02 21:02   ` Wolfram Sang [this message]
2019-09-02 21:02     ` Wolfram Sang
2019-09-02 21:16   ` Andy Shevchenko
2019-09-02 21:16     ` Andy Shevchenko
2019-09-03  5:41     ` Oleksij Rempel
2019-09-03  5:41       ` Oleksij Rempel
     [not found]       ` <AM7PR04MB6885DB03C6B96C7932DDA74B8EB90@AM7PR04MB6885.eurprd04.prod.outlook.com>
2019-09-05  4:33         ` Biwen Li
2019-09-05  4:33           ` Biwen Li
2019-09-05 15:04           ` Biwen Li
2019-09-05 15:04             ` Biwen Li
2019-09-03 10:50   ` Oleksij Rempel
2019-09-03 10:50     ` Oleksij Rempel
2019-09-03 11:08     ` Meenakshi Aggarwal
2019-09-03 11:08       ` Meenakshi Aggarwal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190902210226.GC7253@kunai \
    --to=wsa@the-dreams.de \
    --cc=chuanhua.han@nxp.com \
    --cc=lenb@kernel.org \
    --cc=leoyang.li@nxp.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=meenakshi.aggarwal@nxp.com \
    --cc=o.rempel@pengutronix.de \
    --cc=rafael@kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=udit.kumar@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.