[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZYxbBkimS1VIuU0a@smile.fi.intel.com>
Date: Wed, 27 Dec 2023 19:12:38 +0200
From: Andy Shevchenko <andriy.shevchenko@...el.com>
To: Mark Hasemeyer <markhas@...omium.org>
Cc: LKML <linux-kernel@...r.kernel.org>,
AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>,
Rob Herring <robh@...nel.org>,
Konrad Dybcio <konrad.dybcio@...aro.org>,
Sudeep Holla <sudeep.holla@....com>,
Raul Rangel <rrangel@...omium.org>,
Tzung-Bi Shih <tzungbi@...nel.org>,
Bartosz Golaszewski <brgl@...ev.pl>, Len Brown <lenb@...nel.org>,
Linus Walleij <linus.walleij@...aro.org>,
Mika Westerberg <mika.westerberg@...ux.intel.com>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Wolfram Sang <wsa@...nel.org>, linux-acpi@...r.kernel.org,
linux-gpio@...r.kernel.org, linux-i2c@...r.kernel.org
Subject: Re: [PATCH v3 02/24] gpiolib: acpi: Modify
acpi_dev_irq_wake_get_by() to use resource
On Tue, Dec 26, 2023 at 12:21:06PM -0700, Mark Hasemeyer wrote:
> Other information besides wake capability can be provided about GPIO
> IRQs such as triggering, polarity, and sharability. Use resource flags
> to provide this information to the caller if they want it.
>
> This should keep the API more robust over time as flags are added,
> modified, or removed. It also more closely matches acpi_irq_get() which
> take a resource as an argument.
>
> Rename the function to acpi_dev_get_gpio_irq_resource() to better
> describe the function's new behavior.
...
> + res_flags = acpi_dev_irq_flags(info.triggering, info.polarity,
> + info.shareable, info.wake_capable);
Broken indentation of the second line.
...
> + *r = DEFINE_RES_NAMED(irq, 1, NULL, res_flags);
So? The whole exercise with the first patch is to have here:
*r = DEFINE_RES_IRQ_NAMED_FLAGS(irq, NULL, res_flags);
...
> + struct resource r;
I prefer to see
struct resource r = {};
even if it makes no difference. This allows to have robust code.
> + ret = acpi_dev_get_gpio_irq_resource(adev, name, index, &r);
> + return ret ?: r.start;
Btw, this function requires header to include ioport.h. I'm not sure
if it's good for ACPI. I would prefer safest approach, i.e. exporting
this from a C code, i.e. gpiolib-acpi.c.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists