[PATCH] gpio: zynq: add a to_irq implementation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This function is required by various gpio consumer implementations as
well as the generic gpiolib-sysfs "edge" attribute.

Signed-off-by: Jean-Francois Dagenais <jeff.dagenais@xxxxxxxxx>
---
 drivers/gpio/gpio-zynq.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpio/gpio-zynq.c b/drivers/gpio/gpio-zynq.c
index 9392edaeec3f..19ba8801a4f2 100644
--- a/drivers/gpio/gpio-zynq.c
+++ b/drivers/gpio/gpio-zynq.c
@@ -379,6 +379,13 @@ static int zynq_gpio_get_direction(struct gpio_chip *chip, unsigned int pin)
 	return !(reg & BIT(bank_pin_num));
 }
 
+static int zynq_gpio_to_irq(struct gpio_chip *chip, unsigned int offset)
+{
+	struct zynq_gpio *gpio = gpiochip_get_data(chip);
+
+	return irq_find_mapping(gpio->chip.irq.domain, offset);
+}
+
 /**
  * zynq_gpio_irq_mask - Disable the interrupts for a gpio pin
  * @irq_data:	per irq and chip data passed down to chip functions
@@ -870,6 +877,7 @@ static int zynq_gpio_probe(struct platform_device *pdev)
 	chip->direction_input = zynq_gpio_dir_in;
 	chip->direction_output = zynq_gpio_dir_out;
 	chip->get_direction = zynq_gpio_get_direction;
+	chip->to_irq = zynq_gpio_to_irq;
 	chip->base = of_alias_get_id(pdev->dev.of_node, "gpio");
 	chip->ngpio = gpio->p_data->ngpio;
 
-- 
2.11.0




[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux