Skip to contentSkip to conversation

gpio-xilinx: Update on xilinx gpio driver

PATCH Superseded Srinivas Neeli 10 participants 18 messages Jul 23, 2020 – Nov 9, 2020 1 message not in the archive

Subsystems (3)

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

v2 cover gpio-xilinx: Update on xilinx gpio driver

This patch series does the following:
-Add clock adaption support
-Add interupt support
-Add MAINTAINERS fragment

Changes in V2:
-Added check for return value of platform_get_irq() API. -Updated code to support rising edge and falling edge. -Added xgpio_xlate() API to support switch. -Added MAINTAINERS fragment.
---
Tested Below scenarios:
-Tested Loop Back.(channel 1.0 connected to channel 2.0) -Tested External switch(Used DIP switch) -Tested Cascade scenario(Here gpio controller acting as
an interrupt controller).
---

Srinivas Neeli (3):
gpio: xilinx: Add clock adaptation support
gpio: xilinx: Add interrupt support
MAINTAINERS: add fragment for xilinx GPIO drivers

 MAINTAINERS                |  10 ++
 drivers/gpio/Kconfig       |   1 +
 drivers/gpio/gpio-xilinx.c | 404 ++++++++++++++++++++++++++++++++++++++++++---
 3 files changed, 395 insertions(+), 20 deletions(-)
Signature · 1 line
2.7.4
#1 lore raw

PATCH v2 1/3 gpio: xilinx: Add clock adaptation support

Add support of clock adaptation for AXI GPIO driver.

---
Changes in V2:
Add check for return value of platform_get_irq() API.

---
 drivers/gpio/gpio-xilinx.c | 111 ++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 109 insertions(+), 2 deletions(-)
drivers/gpio/gpio-xilinx.c +109 -2
index 67f9f82e0db0..d103613e787a 100644
@@ -14,6 +14,8 @@
 #include <linux/io.h>
 #include <linux/gpio/driver.h>
 #include <linux/slab.h>
+#include <linux/pm_runtime.h>
+#include <linux/clk.h>
 
 /* Register Offset Definitions */
 #define XGPIO_DATA_OFFSET   (0x0)	/* Data register  */
@@ -38,6 +40,7 @@
  * @gpio_state: GPIO state shadow register
  * @gpio_dir: GPIO direction shadow register
  * @gpio_lock: Lock used for synchronization
+ * @clk: clock resource for this driver
  */
 struct xgpio_instance {
 	struct gpio_chip gc;
@@ -45,7 +48,8 @@ struct xgpio_instance {
 	unsigned int gpio_width[2];
 	u32 gpio_state[2];
 	u32 gpio_dir[2];
-	spinlock_t gpio_lock[2];
+	spinlock_t gpio_lock[2];	/* For serializing operations */
+	struct clk *clk;
 };
 
 static inline int xgpio_index(struct xgpio_instance *chip, int gpio)
@@ -256,6 +260,83 @@ static void xgpio_save_regs(struct xgpio_instance *chip)
 		       chip->gpio_dir[1]);
 }
 
+static int xgpio_request(struct gpio_chip *chip, unsigned int offset)
+{
+	int ret = pm_runtime_get_sync(chip->parent);
+
+	/*
+	 * If the device is already active pm_runtime_get() will return 1 on
+	 * success, but gpio_request still needs to return 0.
+	 */
+	return ret < 0 ? ret : 0;
+}
+
+static void xgpio_free(struct gpio_chip *chip, unsigned int offset)
+{
+	pm_runtime_put(chip->parent);
+}
+
+static int __maybe_unused xgpio_suspend(struct device *dev)
+{
+	struct platform_device *pdev = to_platform_device(dev);
+	struct irq_data *data;
+	int irq = platform_get_irq(pdev, 0);
+
+	if (irq < 0) {
+		dev_info(&pdev->dev, "platform_get_irq returned %d\n", irq);
+		return irq;
+	}
+
+	data = irq_get_irq_data(irq);
+	if (!irqd_is_wakeup_set(data))
+		return pm_runtime_force_suspend(dev);
+
+	return 0;
+}
+
+static int __maybe_unused xgpio_resume(struct device *dev)
+{
+	struct platform_device *pdev = to_platform_device(dev);
+	struct irq_data *data;
+	int irq = platform_get_irq(pdev, 0);
+
+	if (irq < 0) {
+		dev_info(&pdev->dev, "platform_get_irq returned %d\n", irq);
+		return irq;
+	}
+
+	data = irq_get_irq_data(irq);
+
+	if (!irqd_is_wakeup_set(data))
+		return pm_runtime_force_resume(dev);
+
+	return 0;
+}
+
+static int __maybe_unused xgpio_runtime_suspend(struct device *dev)
+{
+	struct platform_device *pdev = to_platform_device(dev);
+	struct xgpio_instance *gpio = platform_get_drvdata(pdev);
+
+	clk_disable(gpio->clk);
+
+	return 0;
+}
+
+static int __maybe_unused xgpio_runtime_resume(struct device *dev)
+{
+	struct platform_device *pdev = to_platform_device(dev);
+	struct xgpio_instance *gpio = platform_get_drvdata(pdev);
+
+	return clk_enable(gpio->clk);
+}
+
+static const struct dev_pm_ops xgpio_dev_pm_ops = {
+	SET_SYSTEM_SLEEP_PM_OPS(xgpio_suspend, xgpio_resume)
+	SET_RUNTIME_PM_OPS(xgpio_runtime_suspend,
+			   xgpio_runtime_resume, NULL)
+};
+
 /**
  * xgpio_of_probe - Probe method for the GPIO device.
  * @pdev: pointer to the platform device
@@ -324,6 +405,8 @@ static int xgpio_probe(struct platform_device *pdev)
 	chip->gc.direction_output = xgpio_dir_out;
 	chip->gc.get = xgpio_get;
 	chip->gc.set = xgpio_set;
+	chip->gc.request = xgpio_request;
+	chip->gc.free = xgpio_free;
 	chip->gc.set_multiple = xgpio_set_multiple;
 
 	chip->gc.label = dev_name(&pdev->dev);
@@ -334,15 +417,38 @@ static int xgpio_probe(struct platform_device *pdev)
 		return PTR_ERR(chip->regs);
 	}
 
+	chip->clk = devm_clk_get_optional(&pdev->dev, "s_axi_aclk");
+	if (IS_ERR(chip->clk)) {
+		if (PTR_ERR(chip->clk) != -EPROBE_DEFER)
+			dev_err(&pdev->dev, "Input clock not found\n");
+		return PTR_ERR(chip->clk);
+	}
+	status = clk_prepare_enable(chip->clk);
+	if (status < 0) {
+		dev_err(&pdev->dev, "Failed to prepare clk\n");
+		return status;
+	}
+	pm_runtime_enable(&pdev->dev);
+	status = pm_runtime_get_sync(&pdev->dev);
+	if (status < 0)
+		goto err_unprepare_clk;
+
 	xgpio_save_regs(chip);
 
 	status = devm_gpiochip_add_data(&pdev->dev, &chip->gc, chip);
 	if (status) {
 		dev_err(&pdev->dev, "failed to add GPIO chip\n");
-		return status;
+		goto err_pm_put;
 	}
 
+	pm_runtime_put(&pdev->dev);
 	return 0;
+err_pm_put:
+	pm_runtime_put(&pdev->dev);
+err_unprepare_clk:
+	pm_runtime_disable(&pdev->dev);
+	clk_unprepare(chip->clk);
+	return status;
 }
 
 static const struct of_device_id xgpio_of_match[] = {
@@ -357,6 +463,7 @@ static struct platform_driver xgpio_plat_driver = {
 	.driver		= {
 			.name = "gpio-xilinx",
 			.of_match_table	= xgpio_of_match,
+			.pm = &xgpio_dev_pm_ops,
 	},
 };
 
Signature · 1 line
2.7.4
#2 lore raw

Re: [PATCH V2 1/3] gpio: xilinx: Add clock adaptation support

Quoted 3 lines · Srinivas Neeli

Add support of clock adaptation for AXI GPIO driver.

Please make the commit message more specific. I can tell from the patch that it's about power management but I've never heard anyone referring to it as clock adaptation. There's also a lot of runtime pm code in here. Be more descriptive.

Quoted 13 lines

---
Changes in V2:
Add check for return value of platform_get_irq() API.

---
 drivers/gpio/gpio-xilinx.c | 111 ++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 109 insertions(+), 2 deletions(-)
drivers/gpio/gpio-xilinx.c +0 -0
index 67f9f82e0db0..d103613e787a 100644

drivers/gpio/gpio-xilinx.c line 18

Quoted 5 lines
drivers/gpio/gpio-xilinx.c +2 -0
@@ -14,6 +14,8 @@
 #include <linux/io.h>
 #include <linux/gpio/driver.h>
 #include <linux/slab.h>
+#include <linux/pm_runtime.h>
+#include <linux/clk.h>

Alphabetical order of includes?

Quoted 12 lines
drivers/gpio/gpio-xilinx.c +1 -0
 /* Register Offset Definitions */
 #define XGPIO_DATA_OFFSET   (0x0)      /* Data register  */
@@ -38,6 +40,7 @@
  * @gpio_state: GPIO state shadow register
  * @gpio_dir: GPIO direction shadow register
  * @gpio_lock: Lock used for synchronization
+ * @clk: clock resource for this driver
  */
 struct xgpio_instance {
        struct gpio_chip gc;

drivers/gpio/gpio-xilinx.c struct xgpio_instance { · line 51

Quoted 5 lines
drivers/gpio/gpio-xilinx.c +1 -1
@@ -45,7 +48,8 @@ struct xgpio_instance {
        unsigned int gpio_width[2];
        u32 gpio_state[2];
        u32 gpio_dir[2];
-       spinlock_t gpio_lock[2];
+       spinlock_t gpio_lock[2];        /* For serializing operations */

This looks like it was sneaked into an unrelated patch.

Quoted 42 lines
drivers/gpio/gpio-xilinx.c +35 -0
+       struct clk *clk;
 };
 
 static inline int xgpio_index(struct xgpio_instance *chip, int gpio)
@@ -256,6 +260,83 @@ static void xgpio_save_regs(struct xgpio_instance *chip)
                       chip->gpio_dir[1]);
 }
 
+static int xgpio_request(struct gpio_chip *chip, unsigned int offset)
+{
+       int ret = pm_runtime_get_sync(chip->parent);
+
+       /*
+        * If the device is already active pm_runtime_get() will return 1 on
+        * success, but gpio_request still needs to return 0.
+        */
+       return ret < 0 ? ret : 0;
+}
+
+static void xgpio_free(struct gpio_chip *chip, unsigned int offset)
+{
+       pm_runtime_put(chip->parent);
+}
+
+static int __maybe_unused xgpio_suspend(struct device *dev)
+{
+       struct platform_device *pdev = to_platform_device(dev);
+       struct irq_data *data;
+       int irq = platform_get_irq(pdev, 0);
+
+       if (irq < 0) {
+               dev_info(&pdev->dev, "platform_get_irq returned %d\n", irq);
+               return irq;
+       }
+
+       data = irq_get_irq_data(irq);
+       if (!irqd_is_wakeup_set(data))
+               return pm_runtime_force_suspend(dev);
+
+       return 0;
+}
+

drivers/gpio/gpio-xilinx.c static void xgpio_save_regs(struct xgpio_instance *chip) · line 306

Quoted 10 lines
drivers/gpio/gpio-xilinx.c +10 -0
+static int __maybe_unused xgpio_resume(struct device *dev)
+{
+       struct platform_device *pdev = to_platform_device(dev);
+       struct irq_data *data;
+       int irq = platform_get_irq(pdev, 0);
+
+       if (irq < 0) {
+               dev_info(&pdev->dev, "platform_get_irq returned %d\n", irq);
+               return irq;
+       }

No, don't do this on every suspend/resume - just call platform_get_irq() in probe() and store the irq number for later use. This way you only check it once. Also why would you log the return value?

Quoted 46 lines
drivers/gpio/gpio-xilinx.c +35 -0
+
+       data = irq_get_irq_data(irq);
+
+       if (!irqd_is_wakeup_set(data))
+               return pm_runtime_force_resume(dev);
+
+       return 0;
+}
+
+static int __maybe_unused xgpio_runtime_suspend(struct device *dev)
+{
+       struct platform_device *pdev = to_platform_device(dev);
+       struct xgpio_instance *gpio = platform_get_drvdata(pdev);
+
+       clk_disable(gpio->clk);
+
+       return 0;
+}
+
+static int __maybe_unused xgpio_runtime_resume(struct device *dev)
+{
+       struct platform_device *pdev = to_platform_device(dev);
+       struct xgpio_instance *gpio = platform_get_drvdata(pdev);
+
+       return clk_enable(gpio->clk);
+}
+
+static const struct dev_pm_ops xgpio_dev_pm_ops = {
+       SET_SYSTEM_SLEEP_PM_OPS(xgpio_suspend, xgpio_resume)
+       SET_RUNTIME_PM_OPS(xgpio_runtime_suspend,
+                          xgpio_runtime_resume, NULL)
+};
+
 /**
  * xgpio_of_probe - Probe method for the GPIO device.
  * @pdev: pointer to the platform device
@@ -324,6 +405,8 @@ static int xgpio_probe(struct platform_device *pdev)
        chip->gc.direction_output = xgpio_dir_out;
        chip->gc.get = xgpio_get;
        chip->gc.set = xgpio_set;
+       chip->gc.request = xgpio_request;
+       chip->gc.free = xgpio_free;
        chip->gc.set_multiple = xgpio_set_multiple;
 
        chip->gc.label = dev_name(&pdev->dev);

drivers/gpio/gpio-xilinx.c static int xgpio_probe(struct platform_device *pdev) · line 423

Quoted 7 lines
drivers/gpio/gpio-xilinx.c +4 -0
@@ -334,15 +417,38 @@ static int xgpio_probe(struct platform_device *pdev)
                return PTR_ERR(chip->regs);
        }
 
+       chip->clk = devm_clk_get_optional(&pdev->dev, "s_axi_aclk");
+       if (IS_ERR(chip->clk)) {
+               if (PTR_ERR(chip->clk) != -EPROBE_DEFER)
+                       dev_err(&pdev->dev, "Input clock not found\n");

How is this an error if the clock is optional?

Quoted 41 lines
drivers/gpio/gpio-xilinx.c +21 -2
+               return PTR_ERR(chip->clk);
+       }
+       status = clk_prepare_enable(chip->clk);
+       if (status < 0) {
+               dev_err(&pdev->dev, "Failed to prepare clk\n");
+               return status;
+       }
+       pm_runtime_enable(&pdev->dev);
+       status = pm_runtime_get_sync(&pdev->dev);
+       if (status < 0)
+               goto err_unprepare_clk;
+
        xgpio_save_regs(chip);
 
        status = devm_gpiochip_add_data(&pdev->dev, &chip->gc, chip);
        if (status) {
                dev_err(&pdev->dev, "failed to add GPIO chip\n");
-               return status;
+               goto err_pm_put;
        }
 
+       pm_runtime_put(&pdev->dev);
        return 0;
+err_pm_put:
+       pm_runtime_put(&pdev->dev);
+err_unprepare_clk:
+       pm_runtime_disable(&pdev->dev);
+       clk_unprepare(chip->clk);
+       return status;
 }
 
 static const struct of_device_id xgpio_of_match[] = {
@@ -357,6 +463,7 @@ static struct platform_driver xgpio_plat_driver = {
        .driver         = {
                        .name = "gpio-xilinx",
                        .of_match_table = xgpio_of_match,
+                       .pm = &xgpio_dev_pm_ops,
        },
 };
 
--
Quoted 2 lines

2.7.4

Bart

#3 lore raw

PATCH v2 2/3 gpio: xilinx: Add interrupt support

In reply to Srinivas Neeli

Adds interrupt support to the Xilinx GPIO driver so that rising and falling edge line events can be supported. Since interrupt support is an optional feature in the Xilinx IP, the driver continues to support devices which have no interrupt provided.

---
Changes in V2:
Updated code to support rising edge and falling edge. Added xgpio_xlate() API to support gpio-keys. Updated code to check return value of of_property_read_u32.

---
 drivers/gpio/Kconfig       |   1 +
 drivers/gpio/gpio-xilinx.c | 295 ++++++++++++++++++++++++++++++++++++++++++---
 2 files changed, 277 insertions(+), 19 deletions(-)
drivers/gpio/Kconfig +1 -0
index 05e0801c6a78..239f8eb7a8eb 100644
@@ -652,6 +652,7 @@ config GPIO_XGENE_SB
 
 config GPIO_XILINX
 	tristate "Xilinx GPIO support"
+	select GPIOLIB_IRQCHIP
 	help
 	  Say yes here to support the Xilinx FPGA GPIO device
 
drivers/gpio/gpio-xilinx.c +276 -19

436 lines not on this page · raw message

Signature · 1 line
2.7.4
#4 lore raw

Re: [PATCH V2 2/3] gpio: xilinx: Add interrupt support

Quoted 5 lines · Srinivas Neeli

Adds interrupt support to the Xilinx GPIO driver so that rising and falling edge line events can be supported. Since interrupt support is an optional feature in the Xilinx IP, the driver continues to support devices which have no interrupt provided.

...

Quoted 1 line

+#include <linux/irqchip/chained_irq.h>

Not sure I see a user of it.

...

Quoted 18 lines
drivers/gpio/gpio-xilinx.c +18 -0
+/**
+ * xgpio_xlate - Translate gpio_spec to the GPIO number and flags
+ * @gc: Pointer to gpio_chip device structure.
+ * @gpiospec:  gpio specifier as found in the device tree
+ * @flags: A flags pointer based on binding
+ *
+ * Return:
+ * irq number otherwise -EINVAL
+ */
+static int xgpio_xlate(struct gpio_chip *gc,
+                      const struct of_phandle_args *gpiospec, u32 *flags)
+{
+       if (gc->of_gpio_n_cells < 2) {
+               WARN_ON(1);
+               return -EINVAL;
+       }
+
+       if (WARN_ON(gpiospec->args_count < gc->of_gpio_n_cells))

drivers/gpio/gpio-xilinx.c static int __maybe_unused xgpio_suspend(struct device *dev) · line 340

Quoted 10 lines
drivers/gpio/gpio-xilinx.c +10 -0
+               return -EINVAL;
+
+       if (gpiospec->args[0] >= gc->ngpio)
+               return -EINVAL;
+
+       if (flags)
+               *flags = gpiospec->args[1];
+
+       return gpiospec->args[0];
+}

This looks like a very standart xlate function for GPIO. Why do you need to open-code it?

...

Quoted 5 lines

+/**
+ * xgpio_irq_ack - Acknowledge a child GPIO interrupt.

+ * This currently does nothing, but irq_ack is unconditionally called by
+ * handle_edge_irq and therefore must be defined.

This should go after parameter description(s).

Quoted 2 lines

+ * @irq_data: per irq and chip data passed down to chip functions
+ */

...

Quoted 3 lines

/**
+ * xgpio_irq_mask - Write the specified signal of the GPIO device.
+ * @irq_data: per irq and chip data passed down to chip functions

In all comments irq -> IRQ.

drivers/gpio/gpio-xilinx.c static const struct dev_pm_ops xgpio_dev_pm_ops = { · line 409

Quoted 13 lines

+ */

drivers/gpio/gpio-xilinx.c +11 -0
+static void xgpio_irq_mask(struct irq_data *irq_data)
+{
+       unsigned long flags;
+       struct xgpio_instance *chip = irq_data_get_irq_chip_data(irq_data);
+       int irq_offset = irqd_to_hwirq(irq_data);
+       int index = xgpio_index(chip, irq_offset);
+       int offset = xgpio_offset(chip, irq_offset);
+
+       spin_lock_irqsave(&chip->gpio_lock, flags);
+
 
+       chip->irq_enable[index] &= ~BIT(offset);

If you convert your data structure to use bitmaps (and respective API) like

#define XILINX_NGPIOS 64
...
DECLARE_BITMAP(irq_enable, XILINX_NGPIOS);
...

it will make code better to read and understand. For example, here it will be just
__clear_bit(offset, chip->irq_enable);

Review

Quoted 2 lines
(quoted diff) +2 -0
+       dev_dbg(chip->gc.parent, "Disable %d irq, irq_enable_mask 0x%x\n",
+               irq_offset, chip->irq_enable[index]);

Under spin lock?! Hmm...

Quoted 9 lines
drivers/gpio/gpio-xilinx.c +9 -0
+       if (!chip->irq_enable[index]) {
+               /* Disable per channel interrupt */
+               u32 temp = xgpio_readreg(chip->regs + XGPIO_IPIER_OFFSET);
+
+               temp &= ~BIT(index);
+               xgpio_writereg(chip->regs + XGPIO_IPIER_OFFSET, temp);
+       }
+       spin_unlock_irqrestore(&chip->gpio_lock, flags);
+}

...

drivers/gpio/gpio-xilinx.c static const struct dev_pm_ops xgpio_dev_pm_ops = { · line 531

Quoted 2 lines
drivers/gpio/gpio-xilinx.c +2 -0
+       for (index = 0; index < num_channels; index++) {
+               if ((status & BIT(index))) {

If gpio_width is the same among banks, you can use for_each_set_bit() here as well.

...

drivers/gpio/gpio-xilinx.c static const struct dev_pm_ops xgpio_dev_pm_ops = { · line 556

Quoted 3 lines
drivers/gpio/gpio-xilinx.c +3 -0
+                       for_each_set_bit(bit, &all_events, 32) {
+                               generic_handle_irq(irq_find_mapping
+                                       (chip->gc.irq.domain, offset + bit));

Strange indentation. Maybe a temporary variable helps?

...

drivers/gpio/gpio-xilinx.c static int xgpio_probe(struct platform_device *pdev) · line 674

Quoted 3 lines
drivers/gpio/gpio-xilinx.c +3 -0
+       chip->irq = platform_get_irq_optional(pdev, 0);
+       if (chip->irq <= 0) {
+               dev_info(&pdev->dev, "GPIO IRQ not set\n");

Why do you need an optional variant if you print an error anyway?

Quoted 1 line

+ } else {

...

drivers/gpio/gpio-xilinx.c static int xgpio_probe(struct platform_device *pdev) · line 692

Quoted 2 lines
drivers/gpio/gpio-xilinx.c +2 -0
+               chip->gc.irq.parents = (unsigned int *)&chip->irq;
+               chip->gc.irq.num_parents = 1;

Current pattern is to use devm_kcalloc() for it (Linus has plans to simplify this in the future and this will help him to find what patterns are being used)

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#5 lore raw

RE: [PATCH V2 2/3] gpio: xilinx: Add interrupt support

Hi Andy Shevchenko,

Thanks for the review.

Accepted comments will address in V3 and Added few comments in inline.

Quoted 21 lines

-----Original Message-----
From: Andy Shevchenko <[email protected]>
Sent: Thursday, July 23, 2020 11:33 PM
To: Srinivas Neeli <[email protected]>
Cc: Linus Walleij <[email protected]>; Bartosz Golaszewski <[email protected]>; Michal Simek <[email protected]>; Shubhrajyoti Datta <[email protected]>; Srinivas Goud <[email protected]>; open list:GPIO SUBSYSTEM <linux- [email protected]>; linux-arm Mailing List <linux-arm- [email protected]>; Linux Kernel Mailing List <linux- [email protected]>; git <[email protected]>
Subject: Re: [PATCH V2 2/3] gpio: xilinx: Add interrupt support

Quoted 5 lines · Srinivas Neeli

Adds interrupt support to the Xilinx GPIO driver so that rising and falling edge line events can be supported. Since interrupt support is an optional feature in the Xilinx IP, the driver continues to support devices which have no interrupt provided.

Quoted 7 lines

...

Quoted 1 line

+#include <linux/irqchip/chained_irq.h>

Not sure I see a user of it.

...

we are using chained_irq_enter() and chained_irq_exit() APIs , so need "chained_irq.h"

Quoted 96 lines
Quoted 19 lines
drivers/gpio/gpio-xilinx.c +18 -0
+/**
+ * xgpio_xlate - Translate gpio_spec to the GPIO number and flags
+ * @gc: Pointer to gpio_chip device structure.
+ * @gpiospec:  gpio specifier as found in the device tree
+ * @flags: A flags pointer based on binding
+ *
+ * Return:
+ * irq number otherwise -EINVAL
+ */
+static int xgpio_xlate(struct gpio_chip *gc,
+                      const struct of_phandle_args *gpiospec, u32
+*flags) {
+       if (gc->of_gpio_n_cells < 2) {
+               WARN_ON(1);
+               return -EINVAL;
+       }
+
+       if (WARN_ON(gpiospec->args_count < gc->of_gpio_n_cells))

drivers/gpio/gpio-xilinx.c static int __maybe_unused xgpio_suspend(struct device *dev) · line 340

Quoted 10 lines
drivers/gpio/gpio-xilinx.c +10 -0
+               return -EINVAL;
+
+       if (gpiospec->args[0] >= gc->ngpio)
+               return -EINVAL;
+
+       if (flags)
+               *flags = gpiospec->args[1];
+
+       return gpiospec->args[0];
+}

This looks like a very standart xlate function for GPIO. Why do you need to open-code it?

...

Quoted 6 lines

+/**
+ * xgpio_irq_ack - Acknowledge a child GPIO interrupt.

+ * This currently does nothing, but irq_ack is unconditionally called
+ by
+ * handle_edge_irq and therefore must be defined.

This should go after parameter description(s).

Quoted 1 line

+ * @irq_data: per irq and chip data passed down to chip functions */

...

Quoted 3 lines

/**
+ * xgpio_irq_mask - Write the specified signal of the GPIO device.
+ * @irq_data: per irq and chip data passed down to chip functions

In all comments irq -> IRQ.

drivers/gpio/gpio-xilinx.c static const struct dev_pm_ops xgpio_dev_pm_ops = { · line 409

Quoted 13 lines

+ */

drivers/gpio/gpio-xilinx.c +11 -0
+static void xgpio_irq_mask(struct irq_data *irq_data)
+{
+       unsigned long flags;
+       struct xgpio_instance *chip = irq_data_get_irq_chip_data(irq_data);
+       int irq_offset = irqd_to_hwirq(irq_data);
+       int index = xgpio_index(chip, irq_offset);
+       int offset = xgpio_offset(chip, irq_offset);
+
+       spin_lock_irqsave(&chip->gpio_lock, flags);
+
 
+       chip->irq_enable[index] &= ~BIT(offset);

If you convert your data structure to use bitmaps (and respective API) like

#define XILINX_NGPIOS 64
...
DECLARE_BITMAP(irq_enable, XILINX_NGPIOS);
...

it will make code better to read and understand. For example, here it will be just
__clear_bit(offset, chip->irq_enable);

Review

Quoted 2 lines
(quoted diff) +2 -0
+       dev_dbg(chip->gc.parent, "Disable %d irq, irq_enable_mask 0x%x\n",
+               irq_offset, chip->irq_enable[index]);

Under spin lock?! Hmm...

Quoted 9 lines
drivers/gpio/gpio-xilinx.c +9 -0
+       if (!chip->irq_enable[index]) {
+               /* Disable per channel interrupt */
+               u32 temp = xgpio_readreg(chip->regs + XGPIO_IPIER_OFFSET);
+
+               temp &= ~BIT(index);
+               xgpio_writereg(chip->regs + XGPIO_IPIER_OFFSET, temp);
+       }
+       spin_unlock_irqrestore(&chip->gpio_lock, flags);
+}

...

Quoted 7 lines

drivers/gpio/gpio-xilinx.c static const struct dev_pm_ops xgpio_dev_pm_ops = { · line 531

Quoted 2 lines
drivers/gpio/gpio-xilinx.c +2 -0
+       for (index = 0; index < num_channels; index++) {
+               if ((status & BIT(index))) {

If gpio_width is the same among banks, you can use for_each_set_bit() here as well.

...

gpio_wdith vary depends on design. We can configure gpio pins for each bank.

Quoted 7 lines

drivers/gpio/gpio-xilinx.c static const struct dev_pm_ops xgpio_dev_pm_ops = { · line 556

Quoted 4 lines
drivers/gpio/gpio-xilinx.c +3 -0
+                       for_each_set_bit(bit, &all_events, 32) {
+                               generic_handle_irq(irq_find_mapping
+                                       (chip->gc.irq.domain, offset + bit));

Strange indentation. Maybe a temporary variable helps?

Quoted 7 lines

...

drivers/gpio/gpio-xilinx.c static int xgpio_probe(struct platform_device *pdev) · line 674

Quoted 3 lines
drivers/gpio/gpio-xilinx.c +3 -0
+       chip->irq = platform_get_irq_optional(pdev, 0);
+       if (chip->irq <= 0) {
+               dev_info(&pdev->dev, "GPIO IRQ not set\n");

Why do you need an optional variant if you print an error anyway?

Here intention is just printing a debug message to user.

Quoted 4 lines
Quoted 2 lines

+ } else {

Quoted 8 lines

...

drivers/gpio/gpio-xilinx.c static int xgpio_probe(struct platform_device *pdev) · line 692

Quoted 2 lines
drivers/gpio/gpio-xilinx.c +2 -0
+               chip->gc.irq.parents = (unsigned int *)&chip->irq;
+               chip->gc.irq.num_parents = 1;

Current pattern is to use devm_kcalloc() for it (Linus has plans to simplify this in the future and this will help him to find what patterns are being used)

I didn't get this , Could you please explain more.

Quoted 4 lines

--
With Best Regards,
Andy Shevchenko

Adding Robert Hancock to mail chain ( by mistake suppressed cc list) .

Hi Robert,
Could you please provide your comments.

Thanks
Srinivas Neeli

#6 lore raw

Re: [PATCH V2 2/3] gpio: xilinx: Add interrupt support

On Fri, Jul 24, 2020 at 8:15 PM Srinivas Neeli <[email protected]> wrote:

...

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

+#include <linux/irqchip/chained_irq.h>

Not sure I see a user of it.

...

we are using chained_irq_enter() and chained_irq_exit() APIs , so need "chained_irq.h"

I see. But gpio/driver.h does it for you.

...

Quoted 8 lines
Quoted 7 lines

drivers/gpio/gpio-xilinx.c static const struct dev_pm_ops xgpio_dev_pm_ops = { · line 531

Quoted 2 lines
drivers/gpio/gpio-xilinx.c +2 -0
+       for (index = 0; index < num_channels; index++) {
+               if ((status & BIT(index))) {

If gpio_width is the same among banks, you can use for_each_set_bit() here as well.

...

gpio_wdith vary depends on design. We can configure gpio pins for each bank.

I see.

...

Quoted 7 lines
Quoted 5 lines

drivers/gpio/gpio-xilinx.c static int xgpio_probe(struct platform_device *pdev) · line 674

Quoted 3 lines
drivers/gpio/gpio-xilinx.c +3 -0
+       chip->irq = platform_get_irq_optional(pdev, 0);
+       if (chip->irq <= 0) {
+               dev_info(&pdev->dev, "GPIO IRQ not set\n");

Why do you need an optional variant if you print an error anyway?

Here intention is just printing a debug message to user.

Debug message should be debug, and not info. But in any case, I would rather drop it, or use platform_get_irq() b/c now you have a code controversy.

...

Quoted 8 lines
Quoted 6 lines

drivers/gpio/gpio-xilinx.c static int xgpio_probe(struct platform_device *pdev) · line 692

Quoted 2 lines
drivers/gpio/gpio-xilinx.c +2 -0
+               chip->gc.irq.parents = (unsigned int *)&chip->irq;
+               chip->gc.irq.num_parents = 1;

Current pattern is to use devm_kcalloc() for it (Linus has plans to simplify this in the future and this will help him to find what patterns are being used)

I didn't get this , Could you please explain more.

              girq->num_parents = 1;
              girq->parents = devm_kcalloc(dev, girq->num_parents, ...);
   if (!girq->parents)
     return -ENOMEM;

girq->parents[0] = chip->irq;

Also, use temporary variable for IRQ chip structure:
girq = &chip->gc.irq;

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#7 lore raw

Re: [PATCH V2 2/3] gpio: xilinx: Add interrupt support

In reply to Andy Shevchenko
Quoted 23 lines · Andy Shevchenko
Quoted 23 lines
drivers/gpio/gpio-xilinx.c +23 -0
+/**
+ * xgpio_xlate - Translate gpio_spec to the GPIO number and flags
+ * @gc: Pointer to gpio_chip device structure.
+ * @gpiospec:  gpio specifier as found in the device tree
+ * @flags: A flags pointer based on binding
+ *
+ * Return:
+ * irq number otherwise -EINVAL
+ */
+static int xgpio_xlate(struct gpio_chip *gc,
+                      const struct of_phandle_args *gpiospec, u32 *flags)
+{
+       if (gc->of_gpio_n_cells < 2) {
+               WARN_ON(1);
+               return -EINVAL;
+       }
+
+       if (WARN_ON(gpiospec->args_count < gc->of_gpio_n_cells))
+               return -EINVAL;
+
+       if (gpiospec->args[0] >= gc->ngpio)
+               return -EINVAL;
+
Quoted 8 lines

drivers/gpio/gpio-xilinx.c static int __maybe_unused xgpio_suspend(struct device *dev) · line 340

Quoted 5 lines
drivers/gpio/gpio-xilinx.c +5 -0
+       if (flags)
+               *flags = gpiospec->args[1];
+
+       return gpiospec->args[0];
+}

This looks like a very standart xlate function for GPIO. Why do you need to open-code it?

Indeed, this seems the same as the of_gpio_simple_xlate callback which is used if no xlate callback is specified, so I'm not sure why this is necessary?

Quoted 98 lines

...

Quoted 5 lines

+/**
+ * xgpio_irq_ack - Acknowledge a child GPIO interrupt.

+ * This currently does nothing, but irq_ack is unconditionally called by
+ * handle_edge_irq and therefore must be defined.

This should go after parameter description(s).

Quoted 2 lines

+ * @irq_data: per irq and chip data passed down to chip functions
+ */

...

Quoted 3 lines

/**
+ * xgpio_irq_mask - Write the specified signal of the GPIO device.
+ * @irq_data: per irq and chip data passed down to chip functions

In all comments irq -> IRQ.

drivers/gpio/gpio-xilinx.c static const struct dev_pm_ops xgpio_dev_pm_ops = { · line 409

Quoted 13 lines

+ */

drivers/gpio/gpio-xilinx.c +11 -0
+static void xgpio_irq_mask(struct irq_data *irq_data)
+{
+       unsigned long flags;
+       struct xgpio_instance *chip = irq_data_get_irq_chip_data(irq_data);
+       int irq_offset = irqd_to_hwirq(irq_data);
+       int index = xgpio_index(chip, irq_offset);
+       int offset = xgpio_offset(chip, irq_offset);
+
+       spin_lock_irqsave(&chip->gpio_lock, flags);
+
 
+       chip->irq_enable[index] &= ~BIT(offset);

If you convert your data structure to use bitmaps (and respective API) like

#define XILINX_NGPIOS 64
...
DECLARE_BITMAP(irq_enable, XILINX_NGPIOS);
...

it will make code better to read and understand. For example, here it will be just
__clear_bit(offset, chip->irq_enable);

Review

Quoted 2 lines
(quoted diff) +2 -0
+       dev_dbg(chip->gc.parent, "Disable %d irq, irq_enable_mask 0x%x\n",
+               irq_offset, chip->irq_enable[index]);

Under spin lock?! Hmm...

Quoted 9 lines
drivers/gpio/gpio-xilinx.c +9 -0
+       if (!chip->irq_enable[index]) {
+               /* Disable per channel interrupt */
+               u32 temp = xgpio_readreg(chip->regs + XGPIO_IPIER_OFFSET);
+
+               temp &= ~BIT(index);
+               xgpio_writereg(chip->regs + XGPIO_IPIER_OFFSET, temp);
+       }
+       spin_unlock_irqrestore(&chip->gpio_lock, flags);
+}

...

drivers/gpio/gpio-xilinx.c static const struct dev_pm_ops xgpio_dev_pm_ops = { · line 531

Quoted 2 lines
drivers/gpio/gpio-xilinx.c +2 -0
+       for (index = 0; index < num_channels; index++) {
+               if ((status & BIT(index))) {

If gpio_width is the same among banks, you can use for_each_set_bit() here as well.

...

drivers/gpio/gpio-xilinx.c static const struct dev_pm_ops xgpio_dev_pm_ops = { · line 556

Quoted 3 lines
drivers/gpio/gpio-xilinx.c +3 -0
+                       for_each_set_bit(bit, &all_events, 32) {
+                               generic_handle_irq(irq_find_mapping
+                                       (chip->gc.irq.domain, offset + bit));

Strange indentation. Maybe a temporary variable helps?

...

drivers/gpio/gpio-xilinx.c static int xgpio_probe(struct platform_device *pdev) · line 674

Quoted 3 lines
drivers/gpio/gpio-xilinx.c +3 -0
+       chip->irq = platform_get_irq_optional(pdev, 0);
+       if (chip->irq <= 0) {
+               dev_info(&pdev->dev, "GPIO IRQ not set\n");

Why do you need an optional variant if you print an error anyway?

Quoted 1 line

+ } else {

...

drivers/gpio/gpio-xilinx.c static int xgpio_probe(struct platform_device *pdev) · line 692

Quoted 2 lines
drivers/gpio/gpio-xilinx.c +2 -0
+               chip->gc.irq.parents = (unsigned int *)&chip->irq;
+               chip->gc.irq.num_parents = 1;

Current pattern is to use devm_kcalloc() for it (Linus has plans to simplify this in the future and this will help him to find what patterns are being used)

Signature · 4 lines
Robert Hancock
Senior Hardware Designer
SED Systems, a division of Calian Ltd.
Email: [email protected]
#8 lore raw

Re: [PATCH V2 2/3] gpio: xilinx: Add interrupt support

In reply to Srinivas Neeli
Thank you for the patch! Yet something to improve:

Hi Srinivas,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on gpio/for-next]
[also build test ERROR on linus/master v5.8-rc6 next-20200723] [cannot apply to xlnx/master]
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Srinivas-Neeli/gpio-xilinx-Update-on-xilinx-gpio-driver/20200723-220826
base:   https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git for-next
config: x86_64-randconfig-a003-20200723 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-14) 9.3.0
reproduce (this is a W=1 build):
        # save the attached .config to linux build tree
        make W=1 ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate

All errors (new ones prefixed by >>):

drivers/gpio/gpio-xilinx.c: In function 'xgpio_xlate':

>> drivers/gpio/gpio-xilinx.c:325:8: error: 'struct gpio_chip' has no member named 'of_gpio_n_cells'
     325 |  if (gc->of_gpio_n_cells < 2) {
         |        ^~
   In file included from arch/x86/include/asm/bug.h:92,
                    from include/linux/bug.h:5,
                    from include/linux/thread_info.h:12,
                    from arch/x86/include/asm/preempt.h:7,
                    from include/linux/preempt.h:78,
                    from include/linux/spinlock.h:51,
                    from include/linux/seqlock.h:36,
                    from include/linux/time.h:6,
                    from include/linux/stat.h:19,
                    from include/linux/module.h:13,
                    from drivers/gpio/gpio-xilinx.c:11:
   drivers/gpio/gpio-xilinx.c:330:39: error: 'struct gpio_chip' has no member named 'of_gpio_n_cells'
     330 |  if (WARN_ON(gpiospec->args_count < gc->of_gpio_n_cells))
         |                                       ^~
   include/asm-generic/bug.h:118:25: note: in definition of macro 'WARN_ON'
     118 |  int __ret_warn_on = !!(condition);    \
         |                         ^~~~~~~~~
   drivers/gpio/gpio-xilinx.c: In function 'xgpio_probe':
   drivers/gpio/gpio-xilinx.c:638:10: error: 'struct gpio_chip' has no member named 'of_gpio_n_cells'
     638 |  chip->gc.of_gpio_n_cells = cells;
         |          ^
>> drivers/gpio/gpio-xilinx.c:639:10: error: 'struct gpio_chip' has no member named 'of_xlate'
     639 |  chip->gc.of_xlate = xgpio_xlate;
         |          ^

vim +325 drivers/gpio/gpio-xilinx.c

312
313 /**
314 * xgpio_xlate - Translate gpio_spec to the GPIO number and flags
315 * @gc: Pointer to gpio_chip device structure.
316 * @gpiospec: gpio specifier as found in the device tree
317 * @flags: A flags pointer based on binding
318 *
319 * Return:
320 * irq number otherwise -EINVAL
321 */
322 static int xgpio_xlate(struct gpio_chip *gc,
323 const struct of_phandle_args *gpiospec, u32 *flags)
324 {

 > 325		if (gc->of_gpio_n_cells < 2) {

326 WARN_ON(1);
327 return -EINVAL;
328 }
329
330 if (WARN_ON(gpiospec->args_count < gc->of_gpio_n_cells))
331 return -EINVAL;
332
333 if (gpiospec->args[0] >= gc->ngpio)
334 return -EINVAL;
335
336 if (flags)
337 *flags = gpiospec->args[1];
338
339 return gpiospec->args[0];
340 }
341

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

#9 lore raw

Re: [PATCH V2 2/3] gpio: xilinx: Add interrupt support

Quoted 7 lines · kernel test robot

drivers/gpio/gpio-xilinx.c: In function 'xgpio_probe':
drivers/gpio/gpio-xilinx.c:638:10: error: 'struct gpio_chip' has no member named 'of_gpio_n_cells'

     638 |  chip->gc.of_gpio_n_cells = cells;
         |          ^
Quoted 1 line
Quoted 1 line

drivers/gpio/gpio-xilinx.c:639:10: error: 'struct gpio_chip' has no member named 'of_xlate'

     639 |  chip->gc.of_xlate = xgpio_xlate;
         |          ^

This is probably because your driver needs:

depends on OF_GPIO

in KConfig

Yours,
Linus Walleij

#10 lore raw

RE: [PATCH V2 2/3] gpio: xilinx: Add interrupt support

Hi Linus,

Thanks for the review

Quoted 22 lines

-----Original Message-----
From: Linus Walleij <[email protected]>
Sent: Friday, July 24, 2020 2:52 PM
To: kernel test robot <[email protected]>
Cc: Srinivas Neeli <[email protected]>; Bartosz Golaszewski <[email protected]>; Michal Simek <[email protected]>; Shubhrajyoti Datta <[email protected]>; Srinivas Goud <[email protected]>; kbuild-all(a)lists.01.org; open list:GPIO SUBSYSTEM <[email protected]>; Linux ARM <linux-arm- kernel(a)lists.infradead.org>; linux-kernel(a)vger.kernel.org; git <[email protected]>
Subject: Re: [PATCH V2 2/3] gpio: xilinx: Add interrupt support

Quoted 2 lines · kernel test robot

drivers/gpio/gpio-xilinx.c: In function 'xgpio_probe':
drivers/gpio/gpio-xilinx.c:638:10: error: 'struct gpio_chip' has no member

named 'of_gpio_n_cells'

Quoted 3 lines
     638 |  chip->gc.of_gpio_n_cells = cells;
         |          ^
Quoted 1 line
Quoted 1 line

drivers/gpio/gpio-xilinx.c:639:10: error: 'struct gpio_chip' has no

member named 'of_xlate'

Quoted 9 lines
Quoted 2 lines
     639 |  chip->gc.of_xlate = xgpio_xlate;
         |          ^

This is probably because your driver needs:

depends on OF_GPIO

in KConfig

I will address in v3.

Quoted 2 lines

Yours,
Linus Walleij

#11 lore raw

PATCH v2 3/3 MAINTAINERS: add fragment for xilinx GPIO drivers

In reply to Srinivas Neeli

Added entry for xilinx GPIO drivers.

---
 MAINTAINERS | 10 ++++++++++
 1 file changed, 10 insertions(+)
MAINTAINERS +10 -0
index ea296f213e45..71c40b0ddef6 100644
@@ -18900,6 +18900,16 @@ S:	Maintained
 F:	Documentation/devicetree/bindings/net/can/xilinx_can.txt
 F:	drivers/net/can/xilinx_can.c
 
+XILINX GPIO DRIVER
+M:	Shubhrajyoti Datta <[email protected]>
+R:	Srinivas Neeli <[email protected]>
+R:	Michal Simek <[email protected]>
+S:	Maintained
+F:	Documentation/devicetree/bindings/gpio/gpio-xilinx.txt
+F:	Documentation/devicetree/bindings/gpio/gpio-zynq.txt
+F:	drivers/gpio/gpio-xilinx.c
+F:	drivers/gpio/gpio-zynq.c
+
 XILINX SD-FEC IP CORES
 M:	Derek Kiernan <[email protected]>
 M:	Dragan Cvetic <[email protected]>
Signature · 1 line
2.7.4
Acked-by on v2 3/3
#12 lore raw

Re: [PATCH V2 3/3] MAINTAINERS: add fragment for xilinx GPIO drivers

Quoted 19 lines · Srinivas Neeli

Added entry for xilinx GPIO drivers.

---
 MAINTAINERS | 10 ++++++++++
 1 file changed, 10 insertions(+)
MAINTAINERS +3 -0
index ea296f213e45..71c40b0ddef6 100644
@@ -18900,6 +18900,16 @@ S:	Maintained
 F:	Documentation/devicetree/bindings/net/can/xilinx_can.txt
 F:	drivers/net/can/xilinx_can.c
 
+XILINX GPIO DRIVER
+M:	Shubhrajyoti Datta <[email protected]>
+R:	Srinivas Neeli <[email protected]>

MAINTAINERS S: Maintained · line 18915

Quoted 10 lines
MAINTAINERS +7 -0
+R:	Michal Simek <[email protected]>
+S:	Maintained
+F:	Documentation/devicetree/bindings/gpio/gpio-xilinx.txt
+F:	Documentation/devicetree/bindings/gpio/gpio-zynq.txt
+F:	drivers/gpio/gpio-xilinx.c
+F:	drivers/gpio/gpio-zynq.c
+
 XILINX SD-FEC IP CORES
 M:	Derek Kiernan <[email protected]>
 M:	Dragan Cvetic <[email protected]>

Thanks,
Michal

A message that is not in the archive (sent off-list or not yet received): YT1PR01MB3546541973024526CDB6BBECEC1E0@YT1PR01MB3546.CANPRD01.PROD.OUTLOOK.COM

#15 lore raw

Hi Robert,

Will send the next version(v3) after Mainline Window close.

Thanks
Srinivas Neeli.

Quoted 60 lines

-----Original Message-----
From: Robert Hancock <[email protected]>
Sent: Monday, October 19, 2020 11:18 PM
To: Srinivas Neeli <[email protected]>; Michal Simek <[email protected]>; Srinivas Goud <[email protected]>; Shubhrajyoti Datta <[email protected]>
Cc: git <[email protected]>; linux-gpio <[email protected]>
Subject: Re: [PATCH V2 0/3] gpio-xilinx: Update on xilinx gpio driver

Hi Srinivas,

Just checking if there is any update on this patchset? It looks like there was some feedback but I didn't see another version submitted.

Robert Hancock
Senior Hardware Designer, Advanced Technologies www.calian.com www.sedsystems.ca

From: Srinivas Neeli <[email protected]>
Sent: July 23, 2020 8:36 AM
To: bgolaszewski <[email protected]>; linus.walleij <[email protected]>; michal.simek <[email protected]>; sgoud <[email protected]>; shubhrajyoti.datta <[email protected]>
Cc: git <[email protected]>; linux-arm-kernel <linux-arm- [email protected]>; linux-gpio <[email protected]>; linux- kernel <[email protected]>
Subject: [PATCH V2 0/3] gpio-xilinx: Update on xilinx gpio driver

This patch series does the following:

(quoted diff) +0 -3
-Add clock adaption support
-Add interupt support
-Add MAINTAINERS fragment

Changes in V2:

(quoted diff) +0 -5
-Added check for return value of platform_get_irq() API.
-Updated code to support rising edge and falling edge.
-Added xgpio_xlate() API to support switch.
-Added MAINTAINERS fragment.
---

Tested Below scenarios:
-Tested Loop Back.(channel 1.0 connected to channel 2.0) -Tested External switch(Used DIP switch) -Tested Cascade scenario(Here gpio controller acting as
 an interrupt controller).
---

Srinivas Neeli (3):
  gpio: xilinx: Add clock adaptation support
  gpio: xilinx: Add interrupt support
  MAINTAINERS: add fragment for xilinx GPIO drivers

 MAINTAINERS                |  10 ++
 drivers/gpio/Kconfig       |   1 +
 drivers/gpio/gpio-xilinx.c | 404
++++++++++++++++++++++++++++++++++++++++++---

 3 files changed, 395 insertions(+), 20 deletions(-)

--
2.7.4

#16 lore raw

Hi,

let me correct this. Merge Window. :-)
5.10-rc1 should be tagged on Sunday Oct 25. After that patches can be send again.

Thanks,
Michal

Quoted 67 lines · Srinivas Neeli

Hi Robert,

Will send the next version(v3) after Mainline Window close.

Thanks
Srinivas Neeli.

Quoted 60 lines

-----Original Message-----
From: Robert Hancock <[email protected]>
Sent: Monday, October 19, 2020 11:18 PM
To: Srinivas Neeli <[email protected]>; Michal Simek <[email protected]>; Srinivas Goud <[email protected]>; Shubhrajyoti Datta <[email protected]>
Cc: git <[email protected]>; linux-gpio <[email protected]>
Subject: Re: [PATCH V2 0/3] gpio-xilinx: Update on xilinx gpio driver

Hi Srinivas,

Just checking if there is any update on this patchset? It looks like there was some feedback but I didn't see another version submitted.

Robert Hancock
Senior Hardware Designer, Advanced Technologies www.calian.com www.sedsystems.ca

From: Srinivas Neeli <[email protected]>
Sent: July 23, 2020 8:36 AM
To: bgolaszewski <[email protected]>; linus.walleij <[email protected]>; michal.simek <[email protected]>; sgoud <[email protected]>; shubhrajyoti.datta <[email protected]>
Cc: git <[email protected]>; linux-arm-kernel <linux-arm- [email protected]>; linux-gpio <[email protected]>; linux- kernel <[email protected]>
Subject: [PATCH V2 0/3] gpio-xilinx: Update on xilinx gpio driver

This patch series does the following:

(quoted diff) +0 -3
-Add clock adaption support
-Add interupt support
-Add MAINTAINERS fragment

Changes in V2:

(quoted diff) +0 -5
-Added check for return value of platform_get_irq() API.
-Updated code to support rising edge and falling edge.
-Added xgpio_xlate() API to support switch.
-Added MAINTAINERS fragment.
---

Tested Below scenarios:
-Tested Loop Back.(channel 1.0 connected to channel 2.0) -Tested External switch(Used DIP switch) -Tested Cascade scenario(Here gpio controller acting as
 an interrupt controller).
---

Srinivas Neeli (3):
  gpio: xilinx: Add clock adaptation support
  gpio: xilinx: Add interrupt support
  MAINTAINERS: add fragment for xilinx GPIO drivers

 MAINTAINERS                |  10 ++
 drivers/gpio/Kconfig       |   1 +
 drivers/gpio/gpio-xilinx.c | 404
++++++++++++++++++++++++++++++++++++++++++---

 3 files changed, 395 insertions(+), 20 deletions(-)

--
2.7.4

#17 lore raw
Quoted 9 lines · Michal Simek

Hi,

let me correct this. Merge Window. :-)
5.10-rc1 should be tagged on Sunday Oct 25. After that patches can be send again.

Thanks,
Michal

Hi, just wondering if you are still planning to submit a v3 of this patchset?

Quoted 77 lines · Srinivas Neeli
Quoted 76 lines

Hi Robert,

Will send the next version(v3) after Mainline Window close.

Thanks
Srinivas Neeli.

Quoted 69 lines

-----Original Message-----
From: Robert Hancock <[email protected]>
Sent: Monday, October 19, 2020 11:18 PM
To: Srinivas Neeli <[email protected]>; Michal Simek < [email protected]>;
Srinivas Goud <[email protected]>; Shubhrajyoti Datta <[email protected]>
Cc: git <[email protected]>; linux-gpio <[email protected]>
Subject: Re: [PATCH V2 0/3] gpio-xilinx: Update on xilinx gpio driver

Hi Srinivas,

Just checking if there is any update on this patchset? It looks like there was
some feedback but I didn't see another version submitted.

Robert Hancock
Senior Hardware Designer, Advanced Technologies
https://can01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.calian.com%2F&amp;data=04%7C01%7Crobert.hancock%40calian.com%7Cd2512bd3dbac441f436108d874c8ff30%7C23b57807562f49ad92c43bb0f07a1fdf%7C0%7C0%7C637387753918575684%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=nintj27wpUCrWfCJggVTKRqanPiM7AnXH5M2Vcst14c%3D&amp;reserved=0
https://can01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.sedsystems.ca%2F&amp;data=04%7C01%7Crobert.hancock%40calian.com%7Cd2512bd3dbac441f436108d874c8ff30%7C23b57807562f49ad92c43bb0f07a1fdf%7C0%7C0%7C637387753918575684%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=Y0%2Fhy01tuwvrFUAszMqkit6C3Qam9Ktr1q5vNbqkoLc%3D&amp;reserved=0

From: Srinivas Neeli <[email protected]>
Sent: July 23, 2020 8:36 AM
To: bgolaszewski <[email protected]>; linus.walleij <[email protected]>; michal.simek <[email protected]

Quoted 1 line

; sgoud

<[email protected]>; shubhrajyoti.datta < [email protected]>
Cc: git <[email protected]>; linux-arm-kernel <linux-arm- [email protected]>; linux-gpio < [email protected]>; linux-
kernel <[email protected]>
Subject: [PATCH V2 0/3] gpio-xilinx: Update on xilinx gpio driver

This patch series does the following:

(quoted diff) +0 -3
-Add clock adaption support
-Add interupt support
-Add MAINTAINERS fragment

Changes in V2:

(quoted diff) +0 -5
-Added check for return value of platform_get_irq() API.
-Updated code to support rising edge and falling edge.
-Added xgpio_xlate() API to support switch.
-Added MAINTAINERS fragment.
---

Tested Below scenarios:
-Tested Loop Back.(channel 1.0 connected to channel 2.0) -Tested External
switch(Used DIP switch) -Tested Cascade scenario(Here gpio controller acting
as
an interrupt controller).
---

Srinivas Neeli (3):
gpio: xilinx: Add clock adaptation support
gpio: xilinx: Add interrupt support
MAINTAINERS: add fragment for xilinx GPIO drivers

 MAINTAINERS                |  10 ++
 drivers/gpio/Kconfig       |   1 +
 drivers/gpio/gpio-xilinx.c | 404
++++++++++++++++++++++++++++++++++++++++++---
 3 files changed, 395 insertions(+), 20 deletions(-)

--
2.7.4

Signature · 3 lines
Robert Hancock
Senior Hardware Designer, Calian Advanced Technologies
www.calian.com
#18 lore raw

Hi Robert,

Quoted 16 lines

-----Original Message-----
From: Robert Hancock <[email protected]>
Sent: Saturday, November 7, 2020 3:59 AM
To: Shubhrajyoti Datta <[email protected]>; Michal Simek <[email protected]>; Srinivas Neeli <[email protected]>; Srinivas Goud <[email protected]>
Cc: git <[email protected]>; [email protected]
Subject: Re: [PATCH V2 0/3] gpio-xilinx: Update on xilinx gpio driver

Quoted 6 lines · Michal Simek

Hi,

let me correct this. Merge Window. :-)
5.10-rc1 should be tagged on Sunday Oct 25. After that patches can be send again.

Quoted 5 lines
Quoted 3 lines

Thanks,
Michal

Hi, just wondering if you are still planning to submit a v3 of this patchset?

working on it, have to test some functions , will send this week

Thanks
Srinivas Neeli

Quoted 109 lines
Quoted 21 lines · Srinivas Neeli
Quoted 19 lines

Hi Robert,

Will send the next version(v3) after Mainline Window close.

Thanks
Srinivas Neeli.

Quoted 12 lines

-----Original Message-----
From: Robert Hancock <[email protected]>
Sent: Monday, October 19, 2020 11:18 PM
To: Srinivas Neeli <[email protected]>; Michal Simek < [email protected]>; Srinivas Goud <[email protected]>; Shubhrajyoti Datta <[email protected]>
Cc: git <[email protected]>; linux-gpio <[email protected]>
Subject: Re: [PATCH V2 0/3] gpio-xilinx: Update on xilinx gpio driver

Hi Srinivas,

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

Just checking if there is any update on this patchset? It looks like there was some feedback but I didn't see another version submitted.

Robert Hancock
Senior Hardware Designer, Advanced Technologies

https://can01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fw

Quoted 1 line
Quoted 1 line
Quoted 1 line

ww.calian.com%2F&amp;data=04%7C01%7Crobert.hancock%40calian.com% 7C

Quoted 1 line
Quoted 1 line
Quoted 1 line

d2512bd3dbac441f436108d874c8ff30%7C23b57807562f49ad92c43bb0f07a1fd

Quoted 1 line
Quoted 1 line
Quoted 1 line

f%7C0%7C0%7C637387753918575684%7CUnknown%7CTWFpbGZsb3d8eyJWI joiMC4

Quoted 1 line
Quoted 1 line
Quoted 1 line

wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&a mp

Quoted 1 line
Quoted 1 line
Quoted 1 line

;sdata=nintj27wpUCrWfCJggVTKRqanPiM7AnXH5M2Vcst14c%3D&amp;reser ved

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

=0

https://can01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fw

Quoted 1 line
Quoted 1 line
Quoted 1 line

ww.sedsystems.ca%2F&amp;data=04%7C01%7Crobert.hancock%40calian.co m

Quoted 1 line
Quoted 1 line
Quoted 1 line

%7Cd2512bd3dbac441f436108d874c8ff30%7C23b57807562f49ad92c43bb0f07a

Quoted 1 line
Quoted 1 line
Quoted 1 line

1fdf%7C0%7C0%7C637387753918575684%7CUnknown%7CTWFpbGZsb3d8ey JWIjoi

Quoted 1 line
Quoted 1 line
Quoted 1 line

MC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C100 0&

Quoted 1 line
Quoted 1 line
Quoted 1 line

amp;sdata=Y0%2Fhy01tuwvrFUAszMqkit6C3Qam9Ktr1q5vNbqkoLc%3D&am p;res

Quoted 38 lines
Quoted 38 lines
Quoted 38 lines

erved=0

From: Srinivas Neeli <[email protected]>
Sent: July 23, 2020 8:36 AM
To: bgolaszewski <[email protected]>; linus.walleij <[email protected]>; michal.simek <[email protected]

Quoted 1 line

; sgoud

<[email protected]>; shubhrajyoti.datta < [email protected]>
Cc: git <[email protected]>; linux-arm-kernel <linux-arm- [email protected]>; linux-gpio < [email protected]>; linux- kernel <[email protected]>
Subject: [PATCH V2 0/3] gpio-xilinx: Update on xilinx gpio driver

This patch series does the following:

(quoted diff) +0 -3
-Add clock adaption support
-Add interupt support
-Add MAINTAINERS fragment

Changes in V2:

(quoted diff) +0 -5
-Added check for return value of platform_get_irq() API.
-Updated code to support rising edge and falling edge.
-Added xgpio_xlate() API to support switch.
-Added MAINTAINERS fragment.
---

Tested Below scenarios:
-Tested Loop Back.(channel 1.0 connected to channel 2.0) -Tested External switch(Used DIP switch) -Tested Cascade scenario(Here gpio controller acting as an interrupt controller).
---

Srinivas Neeli (3):
gpio: xilinx: Add clock adaptation support
gpio: xilinx: Add interrupt support
MAINTAINERS: add fragment for xilinx GPIO drivers

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
 MAINTAINERS                |  10 ++
 drivers/gpio/Kconfig       |   1 +
 drivers/gpio/gpio-xilinx.c | 404
++++++++++++++++++++++++++++++++++++++++++---
 3 files changed, 395 insertions(+), 20 deletions(-)

--
2.7.4

--
Robert Hancock
Senior Hardware Designer, Calian Advanced Technologies www.calian.com