From: Jon Hunter <jonathanh@nvidia.com>
To: Akhil R <akhilrajeev@nvidia.com>
Cc: <andy.shevchenko@gmail.com>, <bgolaszewski@baylibre.com>,
<kyarlagadda@nvidia.com>, <ldewangan@nvidia.com>,
<linus.walleij@linaro.org>, <linux-gpio@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <linux-tegra@vger.kernel.org>,
<mperttunen@nvidia.com>, <smangipudi@nvidia.com>,
<thierry.reding@gmail.com>
Subject: Re: [PATCH v5] gpio: tegra186: Add ACPI support
Date: Thu, 8 Jul 2021 14:08:17 +0100 [thread overview]
Message-ID: <5010ac2c-bfd0-1a79-d470-a1c601207f28@nvidia.com> (raw)
In-Reply-To: <1625130054-22947-1-git-send-email-akhilrajeev@nvidia.com>
On 01/07/2021 10:00, Akhil R wrote:
> Add ACPI module ID to probe the driver from the ACPI based bootloader
> firmware.
>
> Signed-off-by: Akhil R <akhilrajeev@nvidia.com>
> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
> ---
> v5 changes:
> * Updated ioremap_resource check as per Jon's comments.
>
> drivers/gpio/gpio-tegra186.c | 30 ++++++++++++++++++++++++------
> 1 file changed, 24 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpio/gpio-tegra186.c b/drivers/gpio/gpio-tegra186.c
> index 1bd9e44..8a64dcb 100644
> --- a/drivers/gpio/gpio-tegra186.c
> +++ b/drivers/gpio/gpio-tegra186.c
> @@ -620,15 +620,21 @@ static int tegra186_gpio_probe(struct platform_device *pdev)
> if (!gpio)
> return -ENOMEM;
>
> - gpio->soc = of_device_get_match_data(&pdev->dev);
> + gpio->soc = device_get_match_data(&pdev->dev);
>
> gpio->secure = devm_platform_ioremap_resource_byname(pdev, "security");
> - if (IS_ERR(gpio->secure))
> - return PTR_ERR(gpio->secure);
> + if (IS_ERR(gpio->secure)) {
> + gpio->secure = devm_platform_ioremap_resource(pdev, 0);
> + if (IS_ERR(gpio->secure))
> + return PTR_ERR(gpio->secure);
> + }
>
> gpio->base = devm_platform_ioremap_resource_byname(pdev, "gpio");
> - if (IS_ERR(gpio->base))
> - return PTR_ERR(gpio->base);
> + if (IS_ERR(gpio->base)) {
> + gpio->base = devm_platform_ioremap_resource(pdev, 1);
> + if (IS_ERR(gpio->base))
> + return PTR_ERR(gpio->base);
> + }
>
> err = platform_irq_count(pdev);
> if (err < 0)
> @@ -690,11 +696,13 @@ static int tegra186_gpio_probe(struct platform_device *pdev)
>
> gpio->gpio.names = (const char * const *)names;
>
> +#if defined(CONFIG_OF_GPIO)
> gpio->gpio.of_node = pdev->dev.of_node;
> gpio->gpio.of_gpio_n_cells = 2;
> gpio->gpio.of_xlate = tegra186_gpio_of_xlate;
> +#endif /* CONFIG_OF_GPIO */
>
> - gpio->intc.name = pdev->dev.of_node->name;
> + gpio->intc.name = dev_name(&pdev->dev);
> gpio->intc.irq_ack = tegra186_irq_ack;
> gpio->intc.irq_mask = tegra186_irq_mask;
> gpio->intc.irq_unmask = tegra186_irq_unmask;
> @@ -918,10 +926,20 @@ static const struct of_device_id tegra186_gpio_of_match[] = {
> };
> MODULE_DEVICE_TABLE(of, tegra186_gpio_of_match);
>
> +static const struct acpi_device_id tegra186_gpio_acpi_match[] = {
> + { .id = "NVDA0108", .driver_data = (kernel_ulong_t)&tegra186_main_soc },
> + { .id = "NVDA0208", .driver_data = (kernel_ulong_t)&tegra186_aon_soc },
> + { .id = "NVDA0308", .driver_data = (kernel_ulong_t)&tegra194_main_soc },
> + { .id = "NVDA0408", .driver_data = (kernel_ulong_t)&tegra194_aon_soc },
> + {}
> +};
> +MODULE_DEVICE_TABLE(acpi, tegra186_gpio_acpi_match);
> +
> static struct platform_driver tegra186_gpio_driver = {
> .driver = {
> .name = "tegra186-gpio",
> .of_match_table = tegra186_gpio_of_match,
> + .acpi_match_table = tegra186_gpio_acpi_match,
> },
> .probe = tegra186_gpio_probe,
> .remove = tegra186_gpio_remove,
>
Looks good to me.
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
Cheers
Jon
--
nvpublic
next prev parent reply other threads:[~2021-07-08 13:08 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-17 10:05 [PATCH] " Akhil R
2021-06-17 14:54 ` Linus Walleij
2021-06-17 15:21 ` Andy Shevchenko
2021-06-18 13:39 ` [PATCH v2] " Akhil R
2021-06-18 14:31 ` Andy Shevchenko
2021-06-21 15:08 ` Akhil R
2021-06-29 15:17 ` Akhil R
2021-06-30 16:14 ` Andy Shevchenko
2021-06-30 17:47 ` Akhil R
2021-06-30 18:17 ` [PATCH v3] " Akhil R
2021-06-30 18:23 ` Andy Shevchenko
2021-07-01 5:01 ` [PATCH v4] " Akhil R
2021-07-01 5:53 ` Jon Hunter
2021-07-01 9:00 ` [PATCH v5] " Akhil R
2021-07-08 13:08 ` Jon Hunter [this message]
2021-07-16 8:31 ` Bartosz Golaszewski
2021-07-19 4:46 ` [PATCH v6] " Akhil R
2021-08-05 19:30 ` Bartosz Golaszewski
2021-06-18 19:39 ` [PATCH] " kernel test robot
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=5010ac2c-bfd0-1a79-d470-a1c601207f28@nvidia.com \
--to=jonathanh@nvidia.com \
--cc=akhilrajeev@nvidia.com \
--cc=andy.shevchenko@gmail.com \
--cc=bgolaszewski@baylibre.com \
--cc=kyarlagadda@nvidia.com \
--cc=ldewangan@nvidia.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=mperttunen@nvidia.com \
--cc=smangipudi@nvidia.com \
--cc=thierry.reding@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®