mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v3] gpio:amdpt:add new device ID and 24-pin support
@ 2021-12-09  2:26 Yuchang Hsu
  2021-12-09 11:18 ` Andy Shevchenko
  0 siblings, 1 reply; 2+ messages in thread
From: Yuchang Hsu @ 2021-12-09  2:26 UTC (permalink / raw)
  To: linus.walleij, brgl, Richard_Hsu, andriy.shevchenko
  Cc: linux-gpio, linux-kernel, Yd_Tseng, Cindy1_Hsu, Andrew_Su

From: Hsu Yuchang <Richard_Hsu@asmedia.com.tw>

This patch add an ACPI HID(AMDIF031) and pin number in the pt_gpio_acpi_match.
And we retrieve pin number by device_get_match_data().

Signed-off-by: Yuchang Hsu <Richard_Hsu@asmedia.com.tw>
--- Add AMDIF031 support
 drivers/gpio/gpio-amdpt.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/gpio/gpio-amdpt.c b/drivers/gpio/gpio-amdpt.c
index bbf53e289141..13f4e2af3800 100644
--- a/drivers/gpio/gpio-amdpt.c
+++ b/drivers/gpio/gpio-amdpt.c
@@ -14,6 +14,7 @@
 #include <linux/platform_device.h>

 #define PT_TOTAL_GPIO 8
+#define PT_TOTAL_GPIO_EX 24

 /* PCI-E MMIO register offsets */
 #define PT_DIRECTION_REG   0x00
@@ -103,7 +104,7 @@ static int pt_gpio_probe(struct platform_device *pdev)
 	pt_gpio->gc.owner            = THIS_MODULE;
 	pt_gpio->gc.request          = pt_gpio_request;
 	pt_gpio->gc.free             = pt_gpio_free;
-	pt_gpio->gc.ngpio            = PT_TOTAL_GPIO;
+	pt_gpio->gc.ngpio            = (uintptr_t)device_get_match_data(dev);
 #if defined(CONFIG_OF_GPIO)
 	pt_gpio->gc.of_node          = dev->of_node;
 #endif
@@ -133,8 +134,9 @@ static int pt_gpio_remove(struct platform_device *pdev)
 }

 static const struct acpi_device_id pt_gpio_acpi_match[] = {
-	{ "AMDF030", 0 },
-	{ "AMDIF030", 0 },
+	{ "AMDF030", PT_TOTAL_GPIO },
+	{ "AMDIF030", PT_TOTAL_GPIO },
+	{ "AMDIF031", PT_TOTAL_GPIO_EX },
 	{ },
 };
 MODULE_DEVICE_TABLE(acpi, pt_gpio_acpi_match);
--
2.30.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v3] gpio:amdpt:add new device ID and 24-pin support
  2021-12-09  2:26 [PATCH v3] gpio:amdpt:add new device ID and 24-pin support Yuchang Hsu
@ 2021-12-09 11:18 ` Andy Shevchenko
  0 siblings, 0 replies; 2+ messages in thread
From: Andy Shevchenko @ 2021-12-09 11:18 UTC (permalink / raw)
  To: Yuchang Hsu
  Cc: linus.walleij, brgl, Richard_Hsu, linux-gpio, linux-kernel,
	Yd_Tseng, Cindy1_Hsu, Andrew_Su

On Thu, Dec 09, 2021 at 10:26:05AM +0800, Yuchang Hsu wrote:
> From: Hsu Yuchang <Richard_Hsu@asmedia.com.tw>

Thanks for v3, my comments below.

As I pointed out the subject should be

	gpio: amdpt: add new device ID and 24-pin support

(mind the white spaces).

> This patch add an ACPI HID(AMDIF031) and pin number in the pt_gpio_acpi_match.

As Submitting Patches documentation advises the description should be in
imperative form:

	Add an ACPI HID(AMDIF031) and pin number in the pt_gpio_acpi_match.

> And we retrieve pin number by device_get_match_data().
> 
> Signed-off-by: Yuchang Hsu <Richard_Hsu@asmedia.com.tw>

> --- Add AMDIF031 support

After cutter '--- ' line means _after_, and not on the same line.
The changelog contents should explain the changes in the patch versions,
and not the changes which is done in the patch against the code base, for
the latter the commit message suffices.

Look at the plenty of the examples you may find in the mail archive:
https://lore.kernel.org/linux-gpio/.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-12-09 11:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-09  2:26 [PATCH v3] gpio:amdpt:add new device ID and 24-pin support Yuchang Hsu
2021-12-09 11:18 ` Andy Shevchenko

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®