diff mbox series

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

Message ID 20211208103621.9253-1-Richard_Hsu@asmedia.com.tw
State New
Headers show
Series [v2] gpio:amdpt:add new device ID and 24-pin support | expand

Commit Message

Yuchang Hsu Dec. 8, 2021, 10:36 a.m. UTC
Hi Andy Shevchenko,
How and what to put the Changelog after '---'?i just remove '---'.

This patch adds a ACPI HID(AMDIF031) and pin number in the pt_gpio_acpi_match.
And We retrieve pin number supporting by device_get_match_data().

Signed-off-by: Yuchang Hsu <Richard_Hsu@asmedia.com.tw>

 drivers/gpio/gpio-amdpt.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

--
2.30.2

BR
 Richard

Comments

Andy Shevchenko Dec. 8, 2021, 12:19 p.m. UTC | #1
On Wed, Dec 08, 2021 at 06:36:21PM +0800, Yuchang Hsu wrote:

Thanks for update, my comments below.

> Hi Andy Shevchenko,

> How and what to put the Changelog after '---'?i just remove '---'.

No, you shouldn't remove it, instead you should add the text after it in a free
form of what you have done in the submitted version in comparison to the
previous one.

To achieve this use `git format-patch ...` and then edit it and then send it
with a help of `git send-email ...`.

> This patch adds a ACPI HID(AMDIF031) and pin number in the pt_gpio_acpi_match.

"This patch adds a ..." --> "Add an ..."

> And We retrieve pin number supporting by device_get_match_data().

"And " --> ""
"supporting " --> ""

So, waiting for v3.
diff mbox series

Patch

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);