aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/devicetree/bindings/gpio/gpio-exar.txt5
-rw-r--r--MAINTAINERS6
-rw-r--r--drivers/gpio/Kconfig1
-rw-r--r--drivers/gpio/gpio-exar.c2
-rw-r--r--drivers/gpio/gpio-lp87565.c46
-rw-r--r--drivers/gpio/gpio-mxc.c3
-rw-r--r--drivers/gpio/gpio-tegra.c6
-rw-r--r--drivers/gpio/gpiolib.c9
-rw-r--r--drivers/pinctrl/stm32/Kconfig9
-rw-r--r--drivers/tty/serial/8250/8250_exar.c4
10 files changed, 54 insertions, 37 deletions
diff --git a/Documentation/devicetree/bindings/gpio/gpio-exar.txt b/Documentation/devicetree/bindings/gpio/gpio-exar.txt
new file mode 100644
index 000000000000..4540d61824af
--- /dev/null
+++ b/Documentation/devicetree/bindings/gpio/gpio-exar.txt
@@ -0,0 +1,5 @@
1Exportable MPIO interface of Exar UART chips
2
3Required properties of the device:
4 - exar,first-pin: first exportable pins (0..15)
5 - ngpios: number of exportable pins (1..16)
diff --git a/MAINTAINERS b/MAINTAINERS
index 567343b8ffaa..44cb004c765d 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -14218,6 +14218,12 @@ F: drivers/watchdog/
14218F: include/linux/watchdog.h 14218F: include/linux/watchdog.h
14219F: include/uapi/linux/watchdog.h 14219F: include/uapi/linux/watchdog.h
14220 14220
14221WHISKEYCOVE PMIC GPIO DRIVER
14222M: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
14223L: linux-gpio@vger.kernel.org
14224S: Maintained
14225F: drivers/gpio/gpio-wcove.c
14226
14221WIIMOTE HID DRIVER 14227WIIMOTE HID DRIVER
14222M: David Herrmann <dh.herrmann@googlemail.com> 14228M: David Herrmann <dh.herrmann@googlemail.com>
14223L: linux-input@vger.kernel.org 14229L: linux-input@vger.kernel.org
diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
index f235eae04c16..461d6fc3688b 100644
--- a/drivers/gpio/Kconfig
+++ b/drivers/gpio/Kconfig
@@ -504,6 +504,7 @@ config GPIO_XGENE_SB
504 depends on ARCH_XGENE && OF_GPIO 504 depends on ARCH_XGENE && OF_GPIO
505 select GPIO_GENERIC 505 select GPIO_GENERIC
506 select GPIOLIB_IRQCHIP 506 select GPIOLIB_IRQCHIP
507 select IRQ_DOMAIN_HIERARCHY
507 help 508 help
508 This driver supports the GPIO block within the APM X-Gene 509 This driver supports the GPIO block within the APM X-Gene
509 Standby Domain. Say yes here to enable the GPIO functionality. 510 Standby Domain. Say yes here to enable the GPIO functionality.
diff --git a/drivers/gpio/gpio-exar.c b/drivers/gpio/gpio-exar.c
index fb8d304cfa17..0ecd2369c2ca 100644
--- a/drivers/gpio/gpio-exar.c
+++ b/drivers/gpio/gpio-exar.c
@@ -132,7 +132,7 @@ static int gpio_exar_probe(struct platform_device *pdev)
132 if (!p) 132 if (!p)
133 return -ENOMEM; 133 return -ENOMEM;
134 134
135 ret = device_property_read_u32(&pdev->dev, "linux,first-pin", 135 ret = device_property_read_u32(&pdev->dev, "exar,first-pin",
136 &first_pin); 136 &first_pin);
137 if (ret) 137 if (ret)
138 return ret; 138 return ret;
diff --git a/drivers/gpio/gpio-lp87565.c b/drivers/gpio/gpio-lp87565.c
index 6313c50bb91b..a121c8f10610 100644
--- a/drivers/gpio/gpio-lp87565.c
+++ b/drivers/gpio/gpio-lp87565.c
@@ -26,6 +26,27 @@ struct lp87565_gpio {
26 struct regmap *map; 26 struct regmap *map;
27}; 27};
28 28
29static int lp87565_gpio_get(struct gpio_chip *chip, unsigned int offset)
30{
31 struct lp87565_gpio *gpio = gpiochip_get_data(chip);
32 int ret, val;
33
34 ret = regmap_read(gpio->map, LP87565_REG_GPIO_IN, &val);
35 if (ret < 0)
36 return ret;
37
38 return !!(val & BIT(offset));
39}
40
41static void lp87565_gpio_set(struct gpio_chip *chip, unsigned int offset,
42 int value)
43{
44 struct lp87565_gpio *gpio = gpiochip_get_data(chip);
45
46 regmap_update_bits(gpio->map, LP87565_REG_GPIO_OUT,
47 BIT(offset), value ? BIT(offset) : 0);
48}
49
29static int lp87565_gpio_get_direction(struct gpio_chip *chip, 50static int lp87565_gpio_get_direction(struct gpio_chip *chip,
30 unsigned int offset) 51 unsigned int offset)
31{ 52{
@@ -54,30 +75,11 @@ static int lp87565_gpio_direction_output(struct gpio_chip *chip,
54{ 75{
55 struct lp87565_gpio *gpio = gpiochip_get_data(chip); 76 struct lp87565_gpio *gpio = gpiochip_get_data(chip);
56 77
78 lp87565_gpio_set(chip, offset, value);
79
57 return regmap_update_bits(gpio->map, 80 return regmap_update_bits(gpio->map,
58 LP87565_REG_GPIO_CONFIG, 81 LP87565_REG_GPIO_CONFIG,
59 BIT(offset), !value ? BIT(offset) : 0); 82 BIT(offset), BIT(offset));
60}
61
62static int lp87565_gpio_get(struct gpio_chip *chip, unsigned int offset)
63{
64 struct lp87565_gpio *gpio = gpiochip_get_data(chip);
65 int ret, val;
66
67 ret = regmap_read(gpio->map, LP87565_REG_GPIO_IN, &val);
68 if (ret < 0)
69 return ret;
70
71 return !!(val & BIT(offset));
72}
73
74static void lp87565_gpio_set(struct gpio_chip *chip, unsigned int offset,
75 int value)
76{
77 struct lp87565_gpio *gpio = gpiochip_get_data(chip);
78
79 regmap_update_bits(gpio->map, LP87565_REG_GPIO_OUT,
80 BIT(offset), value ? BIT(offset) : 0);
81} 83}
82 84
83static int lp87565_gpio_request(struct gpio_chip *gc, unsigned int offset) 85static int lp87565_gpio_request(struct gpio_chip *gc, unsigned int offset)
diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c
index 3abea3f0b307..92692251ade1 100644
--- a/drivers/gpio/gpio-mxc.c
+++ b/drivers/gpio/gpio-mxc.c
@@ -424,6 +424,9 @@ static int mxc_gpio_probe(struct platform_device *pdev)
424 return PTR_ERR(port->base); 424 return PTR_ERR(port->base);
425 425
426 port->irq_high = platform_get_irq(pdev, 1); 426 port->irq_high = platform_get_irq(pdev, 1);
427 if (port->irq_high < 0)
428 port->irq_high = 0;
429
427 port->irq = platform_get_irq(pdev, 0); 430 port->irq = platform_get_irq(pdev, 0);
428 if (port->irq < 0) 431 if (port->irq < 0)
429 return port->irq; 432 return port->irq;
diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c
index 88529d3c06c9..506c6a67c5fc 100644
--- a/drivers/gpio/gpio-tegra.c
+++ b/drivers/gpio/gpio-tegra.c
@@ -360,7 +360,7 @@ static void tegra_gpio_irq_handler(struct irq_desc *desc)
360{ 360{
361 int port; 361 int port;
362 int pin; 362 int pin;
363 int unmasked = 0; 363 bool unmasked = false;
364 int gpio; 364 int gpio;
365 u32 lvl; 365 u32 lvl;
366 unsigned long sta; 366 unsigned long sta;
@@ -384,8 +384,8 @@ static void tegra_gpio_irq_handler(struct irq_desc *desc)
384 * before executing the handler so that we don't 384 * before executing the handler so that we don't
385 * miss edges 385 * miss edges
386 */ 386 */
387 if (lvl & (0x100 << pin)) { 387 if (!unmasked && lvl & (0x100 << pin)) {
388 unmasked = 1; 388 unmasked = true;
389 chained_irq_exit(chip, desc); 389 chained_irq_exit(chip, desc);
390 } 390 }
391 391
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 9568708a550b..cd003b74512f 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -704,24 +704,23 @@ static irqreturn_t lineevent_irq_thread(int irq, void *p)
704{ 704{
705 struct lineevent_state *le = p; 705 struct lineevent_state *le = p;
706 struct gpioevent_data ge; 706 struct gpioevent_data ge;
707 int ret; 707 int ret, level;
708 708
709 ge.timestamp = ktime_get_real_ns(); 709 ge.timestamp = ktime_get_real_ns();
710 level = gpiod_get_value_cansleep(le->desc);
710 711
711 if (le->eflags & GPIOEVENT_REQUEST_RISING_EDGE 712 if (le->eflags & GPIOEVENT_REQUEST_RISING_EDGE
712 && le->eflags & GPIOEVENT_REQUEST_FALLING_EDGE) { 713 && le->eflags & GPIOEVENT_REQUEST_FALLING_EDGE) {
713 int level = gpiod_get_value_cansleep(le->desc);
714
715 if (level) 714 if (level)
716 /* Emit low-to-high event */ 715 /* Emit low-to-high event */
717 ge.id = GPIOEVENT_EVENT_RISING_EDGE; 716 ge.id = GPIOEVENT_EVENT_RISING_EDGE;
718 else 717 else
719 /* Emit high-to-low event */ 718 /* Emit high-to-low event */
720 ge.id = GPIOEVENT_EVENT_FALLING_EDGE; 719 ge.id = GPIOEVENT_EVENT_FALLING_EDGE;
721 } else if (le->eflags & GPIOEVENT_REQUEST_RISING_EDGE) { 720 } else if (le->eflags & GPIOEVENT_REQUEST_RISING_EDGE && level) {
722 /* Emit low-to-high event */ 721 /* Emit low-to-high event */
723 ge.id = GPIOEVENT_EVENT_RISING_EDGE; 722 ge.id = GPIOEVENT_EVENT_RISING_EDGE;
724 } else if (le->eflags & GPIOEVENT_REQUEST_FALLING_EDGE) { 723 } else if (le->eflags & GPIOEVENT_REQUEST_FALLING_EDGE && !level) {
725 /* Emit high-to-low event */ 724 /* Emit high-to-low event */
726 ge.id = GPIOEVENT_EVENT_FALLING_EDGE; 725 ge.id = GPIOEVENT_EVENT_FALLING_EDGE;
727 } else { 726 } else {
diff --git a/drivers/pinctrl/stm32/Kconfig b/drivers/pinctrl/stm32/Kconfig
index 3b8026fca057..7e1fe39a56a5 100644
--- a/drivers/pinctrl/stm32/Kconfig
+++ b/drivers/pinctrl/stm32/Kconfig
@@ -6,29 +6,30 @@ config PINCTRL_STM32
6 select PINMUX 6 select PINMUX
7 select GENERIC_PINCONF 7 select GENERIC_PINCONF
8 select GPIOLIB 8 select GPIOLIB
9 select IRQ_DOMAIN_HIERARCHY
9 select MFD_SYSCON 10 select MFD_SYSCON
10 11
11config PINCTRL_STM32F429 12config PINCTRL_STM32F429
12 bool "STMicroelectronics STM32F429 pin control" if COMPILE_TEST && !MACH_STM32F429 13 bool "STMicroelectronics STM32F429 pin control" if COMPILE_TEST && !MACH_STM32F429
13 depends on OF && IRQ_DOMAIN_HIERARCHY 14 depends on OF
14 default MACH_STM32F429 15 default MACH_STM32F429
15 select PINCTRL_STM32 16 select PINCTRL_STM32
16 17
17config PINCTRL_STM32F469 18config PINCTRL_STM32F469
18 bool "STMicroelectronics STM32F469 pin control" if COMPILE_TEST && !MACH_STM32F469 19 bool "STMicroelectronics STM32F469 pin control" if COMPILE_TEST && !MACH_STM32F469
19 depends on OF && IRQ_DOMAIN_HIERARCHY 20 depends on OF
20 default MACH_STM32F469 21 default MACH_STM32F469
21 select PINCTRL_STM32 22 select PINCTRL_STM32
22 23
23config PINCTRL_STM32F746 24config PINCTRL_STM32F746
24 bool "STMicroelectronics STM32F746 pin control" if COMPILE_TEST && !MACH_STM32F746 25 bool "STMicroelectronics STM32F746 pin control" if COMPILE_TEST && !MACH_STM32F746
25 depends on OF && IRQ_DOMAIN_HIERARCHY 26 depends on OF
26 default MACH_STM32F746 27 default MACH_STM32F746
27 select PINCTRL_STM32 28 select PINCTRL_STM32
28 29
29config PINCTRL_STM32H743 30config PINCTRL_STM32H743
30 bool "STMicroelectronics STM32H743 pin control" if COMPILE_TEST && !MACH_STM32H743 31 bool "STMicroelectronics STM32H743 pin control" if COMPILE_TEST && !MACH_STM32H743
31 depends on OF && IRQ_DOMAIN_HIERARCHY 32 depends on OF
32 default MACH_STM32H743 33 default MACH_STM32H743
33 select PINCTRL_STM32 34 select PINCTRL_STM32
34endif 35endif
diff --git a/drivers/tty/serial/8250/8250_exar.c b/drivers/tty/serial/8250/8250_exar.c
index b5c98e5bf524..c6360fbdf808 100644
--- a/drivers/tty/serial/8250/8250_exar.c
+++ b/drivers/tty/serial/8250/8250_exar.c
@@ -261,7 +261,7 @@ __xr17v35x_register_gpio(struct pci_dev *pcidev,
261} 261}
262 262
263static const struct property_entry exar_gpio_properties[] = { 263static const struct property_entry exar_gpio_properties[] = {
264 PROPERTY_ENTRY_U32("linux,first-pin", 0), 264 PROPERTY_ENTRY_U32("exar,first-pin", 0),
265 PROPERTY_ENTRY_U32("ngpios", 16), 265 PROPERTY_ENTRY_U32("ngpios", 16),
266 { } 266 { }
267}; 267};
@@ -326,7 +326,7 @@ static int iot2040_rs485_config(struct uart_port *port,
326} 326}
327 327
328static const struct property_entry iot2040_gpio_properties[] = { 328static const struct property_entry iot2040_gpio_properties[] = {
329 PROPERTY_ENTRY_U32("linux,first-pin", 10), 329 PROPERTY_ENTRY_U32("exar,first-pin", 10),
330 PROPERTY_ENTRY_U32("ngpios", 1), 330 PROPERTY_ENTRY_U32("ngpios", 1),
331 { } 331 { }
332}; 332};