From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: David Thompson <davthompson@nvidia.com>
Cc: linus.walleij@linaro.org, brgl@bgdev.pl,
linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
limings@nvidia.com
Subject: Re: [PATCH v1 v/1] gpio: mlxbf: enable GPIO interface and ACPI event for host-gpio[7]
Date: Thu, 9 Feb 2023 23:59:53 +0200 [thread overview]
Message-ID: <Y+Vs2WxqXVQmh4+z@smile.fi.intel.com> (raw)
In-Reply-To: <20230203184907.18786-1-davthompson@nvidia.com>
On Fri, Feb 03, 2023 at 01:49:07PM -0500, David Thompson wrote:
> This commit adds ACPI handling for host-gpio[7] to trigger
> the power-button event.
This has something to discuss...
...
> /* Pad Electrical Controls. */
> -#define MLXBF_GPIO_PAD_CONTROL_FIRST_WORD 0x0700
> -#define MLXBF_GPIO_PAD_CONTROL_1_FIRST_WORD 0x0708
> -#define MLXBF_GPIO_PAD_CONTROL_2_FIRST_WORD 0x0710
> -#define MLXBF_GPIO_PAD_CONTROL_3_FIRST_WORD 0x0718
> +#define MLXBF_GPIO_PAD_CONTROL_FIRST_WORD 0x0700
> +#define MLXBF_GPIO_PAD_CONTROL_1_FIRST_WORD 0x0708
> +#define MLXBF_GPIO_PAD_CONTROL_2_FIRST_WORD 0x0710
> +#define MLXBF_GPIO_PAD_CONTROL_3_FIRST_WORD 0x0718
Unrelated change.
> +#define MLXBF_GPIO_PIN_DIR_I 0x1040
> +#define MLXBF_GPIO_PIN_DIR_O 0x1048
> +#define MLXBF_GPIO_PIN_STATE 0x1000
> +#define MLXBF_GPIO_SCRATCHPAD 0x20
Ditto. You already have it defined, why to change?
> -#define MLXBF_GPIO_PIN_DIR_I 0x1040
> -#define MLXBF_GPIO_PIN_DIR_O 0x1048
> -#define MLXBF_GPIO_PIN_STATE 0x1000
> -#define MLXBF_GPIO_SCRATCHPAD 0x20
...
> + gs->hwirq = irq;
> + gc->to_irq = mlxbf_gpio_to_irq;
This sounds incorrect. Seems like for _any_ interrupt you will give the same
result. Moreover, you should not use to_irq(). Try to model proper IRQ chip.
...
> platform_set_drvdata(pdev, gs);
> + acpi_gpiochip_request_interrupts(gc);
This is done by GPIO library, no?
...
> dev_info(&pdev->dev, "registered Mellanox BlueField GPIO");
> +
> return 0;
Stray change.
--
With Best Regards,
Andy Shevchenko
prev parent reply other threads:[~2023-02-09 22:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-03 18:49 David Thompson
2023-02-09 21:59 ` Andy Shevchenko [this message]
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=Y+Vs2WxqXVQmh4+z@smile.fi.intel.com \
--to=andriy.shevchenko@intel.com \
--cc=brgl@bgdev.pl \
--cc=davthompson@nvidia.com \
--cc=limings@nvidia.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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®