2 * Copyright (c) 2016-2017 NVIDIA Corporation
4 * Author: Thierry Reding <treding@nvidia.com>
6 * This software is licensed under the terms of the GNU General Public
7 * License version 2, as published by the Free Software Foundation, and
8 * may be copied, distributed, and modified under those terms.
11 #include <linux/gpio/driver.h>
12 #include <linux/interrupt.h>
13 #include <linux/irq.h>
14 #include <linux/module.h>
15 #include <linux/of_device.h>
16 #include <linux/platform_device.h>
18 #include <dt-bindings/gpio/tegra186-gpio.h>
19 #include <dt-bindings/gpio/tegra194-gpio.h>
21 #define TEGRA186_GPIO_ENABLE_CONFIG 0x00
22 #define TEGRA186_GPIO_ENABLE_CONFIG_ENABLE BIT(0)
23 #define TEGRA186_GPIO_ENABLE_CONFIG_OUT BIT(1)
24 #define TEGRA186_GPIO_ENABLE_CONFIG_TRIGGER_TYPE_NONE (0x0 << 2)
25 #define TEGRA186_GPIO_ENABLE_CONFIG_TRIGGER_TYPE_LEVEL (0x1 << 2)
26 #define TEGRA186_GPIO_ENABLE_CONFIG_TRIGGER_TYPE_SINGLE_EDGE (0x2 << 2)
27 #define TEGRA186_GPIO_ENABLE_CONFIG_TRIGGER_TYPE_DOUBLE_EDGE (0x3 << 2)
28 #define TEGRA186_GPIO_ENABLE_CONFIG_TRIGGER_TYPE_MASK (0x3 << 2)
29 #define TEGRA186_GPIO_ENABLE_CONFIG_TRIGGER_LEVEL BIT(4)
30 #define TEGRA186_GPIO_ENABLE_CONFIG_INTERRUPT BIT(6)
32 #define TEGRA186_GPIO_DEBOUNCE_CONTROL 0x04
33 #define TEGRA186_GPIO_DEBOUNCE_CONTROL_THRESHOLD(x) ((x) & 0xff)
35 #define TEGRA186_GPIO_INPUT 0x08
36 #define TEGRA186_GPIO_INPUT_HIGH BIT(0)
38 #define TEGRA186_GPIO_OUTPUT_CONTROL 0x0c
39 #define TEGRA186_GPIO_OUTPUT_CONTROL_FLOATED BIT(0)
41 #define TEGRA186_GPIO_OUTPUT_VALUE 0x10
42 #define TEGRA186_GPIO_OUTPUT_VALUE_HIGH BIT(0)
44 #define TEGRA186_GPIO_INTERRUPT_CLEAR 0x14
46 #define TEGRA186_GPIO_INTERRUPT_STATUS(x) (0x100 + (x) * 4)
48 struct tegra_gpio_port {
55 struct tegra_gpio_soc {
56 const struct tegra_gpio_port *ports;
57 unsigned int num_ports;
62 struct gpio_chip gpio;
67 const struct tegra_gpio_soc *soc;
72 static const struct tegra_gpio_port *
73 tegra186_gpio_get_port(struct tegra_gpio *gpio, unsigned int *pin)
75 unsigned int start = 0, i;
77 for (i = 0; i < gpio->soc->num_ports; i++) {
78 const struct tegra_gpio_port *port = &gpio->soc->ports[i];
80 if (*pin >= start && *pin < start + port->pins) {
91 static void __iomem *tegra186_gpio_get_base(struct tegra_gpio *gpio,
94 const struct tegra_gpio_port *port;
96 port = tegra186_gpio_get_port(gpio, &pin);
100 return gpio->base + port->offset + pin * 0x20;
103 static int tegra186_gpio_get_direction(struct gpio_chip *chip,
106 struct tegra_gpio *gpio = gpiochip_get_data(chip);
110 base = tegra186_gpio_get_base(gpio, offset);
111 if (WARN_ON(base == NULL))
114 value = readl(base + TEGRA186_GPIO_ENABLE_CONFIG);
115 if (value & TEGRA186_GPIO_ENABLE_CONFIG_OUT)
121 static int tegra186_gpio_direction_input(struct gpio_chip *chip,
124 struct tegra_gpio *gpio = gpiochip_get_data(chip);
128 base = tegra186_gpio_get_base(gpio, offset);
129 if (WARN_ON(base == NULL))
132 value = readl(base + TEGRA186_GPIO_OUTPUT_CONTROL);
133 value |= TEGRA186_GPIO_OUTPUT_CONTROL_FLOATED;
134 writel(value, base + TEGRA186_GPIO_OUTPUT_CONTROL);
136 value = readl(base + TEGRA186_GPIO_ENABLE_CONFIG);
137 value |= TEGRA186_GPIO_ENABLE_CONFIG_ENABLE;
138 value &= ~TEGRA186_GPIO_ENABLE_CONFIG_OUT;
139 writel(value, base + TEGRA186_GPIO_ENABLE_CONFIG);
144 static int tegra186_gpio_direction_output(struct gpio_chip *chip,
145 unsigned int offset, int level)
147 struct tegra_gpio *gpio = gpiochip_get_data(chip);
151 /* configure output level first */
152 chip->set(chip, offset, level);
154 base = tegra186_gpio_get_base(gpio, offset);
155 if (WARN_ON(base == NULL))
158 /* set the direction */
159 value = readl(base + TEGRA186_GPIO_OUTPUT_CONTROL);
160 value &= ~TEGRA186_GPIO_OUTPUT_CONTROL_FLOATED;
161 writel(value, base + TEGRA186_GPIO_OUTPUT_CONTROL);
163 value = readl(base + TEGRA186_GPIO_ENABLE_CONFIG);
164 value |= TEGRA186_GPIO_ENABLE_CONFIG_ENABLE;
165 value |= TEGRA186_GPIO_ENABLE_CONFIG_OUT;
166 writel(value, base + TEGRA186_GPIO_ENABLE_CONFIG);
171 static int tegra186_gpio_get(struct gpio_chip *chip, unsigned int offset)
173 struct tegra_gpio *gpio = gpiochip_get_data(chip);
177 base = tegra186_gpio_get_base(gpio, offset);
178 if (WARN_ON(base == NULL))
181 value = readl(base + TEGRA186_GPIO_ENABLE_CONFIG);
182 if (value & TEGRA186_GPIO_ENABLE_CONFIG_OUT)
183 value = readl(base + TEGRA186_GPIO_OUTPUT_VALUE);
185 value = readl(base + TEGRA186_GPIO_INPUT);
187 return value & BIT(0);
190 static void tegra186_gpio_set(struct gpio_chip *chip, unsigned int offset,
193 struct tegra_gpio *gpio = gpiochip_get_data(chip);
197 base = tegra186_gpio_get_base(gpio, offset);
198 if (WARN_ON(base == NULL))
201 value = readl(base + TEGRA186_GPIO_OUTPUT_VALUE);
203 value &= ~TEGRA186_GPIO_OUTPUT_VALUE_HIGH;
205 value |= TEGRA186_GPIO_OUTPUT_VALUE_HIGH;
207 writel(value, base + TEGRA186_GPIO_OUTPUT_VALUE);
210 static int tegra186_gpio_of_xlate(struct gpio_chip *chip,
211 const struct of_phandle_args *spec,
214 struct tegra_gpio *gpio = gpiochip_get_data(chip);
215 unsigned int port, pin, i, offset = 0;
217 if (WARN_ON(chip->of_gpio_n_cells < 2))
220 if (WARN_ON(spec->args_count < chip->of_gpio_n_cells))
223 port = spec->args[0] / 8;
224 pin = spec->args[0] % 8;
226 if (port >= gpio->soc->num_ports) {
227 dev_err(chip->parent, "invalid port number: %u\n", port);
231 for (i = 0; i < port; i++)
232 offset += gpio->soc->ports[i].pins;
235 *flags = spec->args[1];
240 #define to_tegra_gpio(x) container_of((x), struct tegra_gpio, gpio)
242 static void tegra186_irq_ack(struct irq_data *data)
244 struct gpio_chip *gc = irq_data_get_irq_chip_data(data);
245 struct tegra_gpio *gpio = to_tegra_gpio(gc);
248 base = tegra186_gpio_get_base(gpio, data->hwirq);
249 if (WARN_ON(base == NULL))
252 writel(1, base + TEGRA186_GPIO_INTERRUPT_CLEAR);
255 static void tegra186_irq_mask(struct irq_data *data)
257 struct gpio_chip *gc = irq_data_get_irq_chip_data(data);
258 struct tegra_gpio *gpio = to_tegra_gpio(gc);
262 base = tegra186_gpio_get_base(gpio, data->hwirq);
263 if (WARN_ON(base == NULL))
266 value = readl(base + TEGRA186_GPIO_ENABLE_CONFIG);
267 value &= ~TEGRA186_GPIO_ENABLE_CONFIG_INTERRUPT;
268 writel(value, base + TEGRA186_GPIO_ENABLE_CONFIG);
271 static void tegra186_irq_unmask(struct irq_data *data)
273 struct gpio_chip *gc = irq_data_get_irq_chip_data(data);
274 struct tegra_gpio *gpio = to_tegra_gpio(gc);
278 base = tegra186_gpio_get_base(gpio, data->hwirq);
279 if (WARN_ON(base == NULL))
282 value = readl(base + TEGRA186_GPIO_ENABLE_CONFIG);
283 value |= TEGRA186_GPIO_ENABLE_CONFIG_INTERRUPT;
284 writel(value, base + TEGRA186_GPIO_ENABLE_CONFIG);
287 static int tegra186_irq_set_type(struct irq_data *data, unsigned int flow)
289 struct gpio_chip *gc = irq_data_get_irq_chip_data(data);
290 struct tegra_gpio *gpio = to_tegra_gpio(gc);
294 base = tegra186_gpio_get_base(gpio, data->hwirq);
295 if (WARN_ON(base == NULL))
298 value = readl(base + TEGRA186_GPIO_ENABLE_CONFIG);
299 value &= ~TEGRA186_GPIO_ENABLE_CONFIG_TRIGGER_TYPE_MASK;
300 value &= ~TEGRA186_GPIO_ENABLE_CONFIG_TRIGGER_LEVEL;
302 switch (flow & IRQ_TYPE_SENSE_MASK) {
306 case IRQ_TYPE_EDGE_RISING:
307 value |= TEGRA186_GPIO_ENABLE_CONFIG_TRIGGER_TYPE_SINGLE_EDGE;
308 value |= TEGRA186_GPIO_ENABLE_CONFIG_TRIGGER_LEVEL;
311 case IRQ_TYPE_EDGE_FALLING:
312 value |= TEGRA186_GPIO_ENABLE_CONFIG_TRIGGER_TYPE_SINGLE_EDGE;
315 case IRQ_TYPE_EDGE_BOTH:
316 value |= TEGRA186_GPIO_ENABLE_CONFIG_TRIGGER_TYPE_DOUBLE_EDGE;
319 case IRQ_TYPE_LEVEL_HIGH:
320 value |= TEGRA186_GPIO_ENABLE_CONFIG_TRIGGER_TYPE_LEVEL;
321 value |= TEGRA186_GPIO_ENABLE_CONFIG_TRIGGER_LEVEL;
324 case IRQ_TYPE_LEVEL_LOW:
325 value |= TEGRA186_GPIO_ENABLE_CONFIG_TRIGGER_TYPE_LEVEL;
332 writel(value, base + TEGRA186_GPIO_ENABLE_CONFIG);
334 if ((flow & IRQ_TYPE_EDGE_BOTH) == 0)
335 irq_set_handler_locked(data, handle_level_irq);
337 irq_set_handler_locked(data, handle_edge_irq);
342 static void tegra186_gpio_irq(struct irq_desc *desc)
344 struct tegra_gpio *gpio = irq_desc_get_handler_data(desc);
345 struct irq_domain *domain = gpio->gpio.irq.domain;
346 struct irq_chip *chip = irq_desc_get_chip(desc);
347 unsigned int parent = irq_desc_get_irq(desc);
348 unsigned int i, offset = 0;
350 chained_irq_enter(chip, desc);
352 for (i = 0; i < gpio->soc->num_ports; i++) {
353 const struct tegra_gpio_port *port = &gpio->soc->ports[i];
354 void __iomem *base = gpio->base + port->offset;
355 unsigned int pin, irq;
358 /* skip ports that are not associated with this controller */
359 if (parent != gpio->irq[port->irq])
362 value = readl(base + TEGRA186_GPIO_INTERRUPT_STATUS(1));
364 for_each_set_bit(pin, &value, port->pins) {
365 irq = irq_find_mapping(domain, offset + pin);
366 if (WARN_ON(irq == 0))
369 generic_handle_irq(irq);
373 offset += port->pins;
376 chained_irq_exit(chip, desc);
379 static int tegra186_gpio_irq_domain_xlate(struct irq_domain *domain,
380 struct device_node *np,
381 const u32 *spec, unsigned int size,
382 unsigned long *hwirq,
385 struct tegra_gpio *gpio = gpiochip_get_data(domain->host_data);
386 unsigned int port, pin, i, offset = 0;
394 if (port >= gpio->soc->num_ports) {
395 dev_err(gpio->gpio.parent, "invalid port number: %u\n", port);
399 for (i = 0; i < port; i++)
400 offset += gpio->soc->ports[i].pins;
402 *type = spec[1] & IRQ_TYPE_SENSE_MASK;
403 *hwirq = offset + pin;
408 static const struct irq_domain_ops tegra186_gpio_irq_domain_ops = {
409 .map = gpiochip_irq_map,
410 .unmap = gpiochip_irq_unmap,
411 .xlate = tegra186_gpio_irq_domain_xlate,
414 static int tegra186_gpio_probe(struct platform_device *pdev)
416 unsigned int i, j, offset;
417 struct gpio_irq_chip *irq;
418 struct tegra_gpio *gpio;
419 struct resource *res;
423 gpio = devm_kzalloc(&pdev->dev, sizeof(*gpio), GFP_KERNEL);
427 gpio->soc = of_device_get_match_data(&pdev->dev);
429 res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "gpio");
430 gpio->base = devm_ioremap_resource(&pdev->dev, res);
431 if (IS_ERR(gpio->base))
432 return PTR_ERR(gpio->base);
434 err = platform_irq_count(pdev);
440 gpio->irq = devm_kcalloc(&pdev->dev, gpio->num_irq, sizeof(*gpio->irq),
445 for (i = 0; i < gpio->num_irq; i++) {
446 err = platform_get_irq(pdev, i);
453 gpio->gpio.label = gpio->soc->name;
454 gpio->gpio.parent = &pdev->dev;
456 gpio->gpio.get_direction = tegra186_gpio_get_direction;
457 gpio->gpio.direction_input = tegra186_gpio_direction_input;
458 gpio->gpio.direction_output = tegra186_gpio_direction_output;
459 gpio->gpio.get = tegra186_gpio_get,
460 gpio->gpio.set = tegra186_gpio_set;
462 gpio->gpio.base = -1;
464 for (i = 0; i < gpio->soc->num_ports; i++)
465 gpio->gpio.ngpio += gpio->soc->ports[i].pins;
467 names = devm_kcalloc(gpio->gpio.parent, gpio->gpio.ngpio,
468 sizeof(*names), GFP_KERNEL);
472 for (i = 0, offset = 0; i < gpio->soc->num_ports; i++) {
473 const struct tegra_gpio_port *port = &gpio->soc->ports[i];
476 for (j = 0; j < port->pins; j++) {
477 name = devm_kasprintf(gpio->gpio.parent, GFP_KERNEL,
478 "P%s.%02x", port->name, j);
482 names[offset + j] = name;
485 offset += port->pins;
488 gpio->gpio.names = (const char * const *)names;
490 gpio->gpio.of_node = pdev->dev.of_node;
491 gpio->gpio.of_gpio_n_cells = 2;
492 gpio->gpio.of_xlate = tegra186_gpio_of_xlate;
494 gpio->intc.name = pdev->dev.of_node->name;
495 gpio->intc.irq_ack = tegra186_irq_ack;
496 gpio->intc.irq_mask = tegra186_irq_mask;
497 gpio->intc.irq_unmask = tegra186_irq_unmask;
498 gpio->intc.irq_set_type = tegra186_irq_set_type;
500 irq = &gpio->gpio.irq;
501 irq->chip = &gpio->intc;
502 irq->domain_ops = &tegra186_gpio_irq_domain_ops;
503 irq->handler = handle_simple_irq;
504 irq->default_type = IRQ_TYPE_NONE;
505 irq->parent_handler = tegra186_gpio_irq;
506 irq->parent_handler_data = gpio;
507 irq->num_parents = gpio->num_irq;
508 irq->parents = gpio->irq;
510 irq->map = devm_kcalloc(&pdev->dev, gpio->gpio.ngpio,
511 sizeof(*irq->map), GFP_KERNEL);
515 for (i = 0, offset = 0; i < gpio->soc->num_ports; i++) {
516 const struct tegra_gpio_port *port = &gpio->soc->ports[i];
518 for (j = 0; j < port->pins; j++)
519 irq->map[offset + j] = irq->parents[port->irq];
521 offset += port->pins;
524 platform_set_drvdata(pdev, gpio);
526 err = devm_gpiochip_add_data(&pdev->dev, &gpio->gpio, gpio);
533 static int tegra186_gpio_remove(struct platform_device *pdev)
538 #define TEGRA_MAIN_GPIO_PORT(port, base, count, controller) \
539 [TEGRA_MAIN_GPIO_PORT_##port] = { \
546 static const struct tegra_gpio_port tegra186_main_ports[] = {
547 TEGRA_MAIN_GPIO_PORT( A, 0x2000, 7, 2),
548 TEGRA_MAIN_GPIO_PORT( B, 0x3000, 7, 3),
549 TEGRA_MAIN_GPIO_PORT( C, 0x3200, 7, 3),
550 TEGRA_MAIN_GPIO_PORT( D, 0x3400, 6, 3),
551 TEGRA_MAIN_GPIO_PORT( E, 0x2200, 8, 2),
552 TEGRA_MAIN_GPIO_PORT( F, 0x2400, 6, 2),
553 TEGRA_MAIN_GPIO_PORT( G, 0x4200, 6, 4),
554 TEGRA_MAIN_GPIO_PORT( H, 0x1000, 7, 1),
555 TEGRA_MAIN_GPIO_PORT( I, 0x0800, 8, 0),
556 TEGRA_MAIN_GPIO_PORT( J, 0x5000, 8, 5),
557 TEGRA_MAIN_GPIO_PORT( K, 0x5200, 1, 5),
558 TEGRA_MAIN_GPIO_PORT( L, 0x1200, 8, 1),
559 TEGRA_MAIN_GPIO_PORT( M, 0x5600, 6, 5),
560 TEGRA_MAIN_GPIO_PORT( N, 0x0000, 7, 0),
561 TEGRA_MAIN_GPIO_PORT( O, 0x0200, 4, 0),
562 TEGRA_MAIN_GPIO_PORT( P, 0x4000, 7, 4),
563 TEGRA_MAIN_GPIO_PORT( Q, 0x0400, 6, 0),
564 TEGRA_MAIN_GPIO_PORT( R, 0x0a00, 6, 0),
565 TEGRA_MAIN_GPIO_PORT( T, 0x0600, 4, 0),
566 TEGRA_MAIN_GPIO_PORT( X, 0x1400, 8, 1),
567 TEGRA_MAIN_GPIO_PORT( Y, 0x1600, 7, 1),
568 TEGRA_MAIN_GPIO_PORT(BB, 0x2600, 2, 2),
569 TEGRA_MAIN_GPIO_PORT(CC, 0x5400, 4, 5),
572 static const struct tegra_gpio_soc tegra186_main_soc = {
573 .num_ports = ARRAY_SIZE(tegra186_main_ports),
574 .ports = tegra186_main_ports,
575 .name = "tegra186-gpio",
578 #define TEGRA_AON_GPIO_PORT(port, base, count, controller) \
579 [TEGRA_AON_GPIO_PORT_##port] = { \
586 static const struct tegra_gpio_port tegra186_aon_ports[] = {
587 TEGRA_AON_GPIO_PORT( S, 0x0200, 5, 0),
588 TEGRA_AON_GPIO_PORT( U, 0x0400, 6, 0),
589 TEGRA_AON_GPIO_PORT( V, 0x0800, 8, 0),
590 TEGRA_AON_GPIO_PORT( W, 0x0a00, 8, 0),
591 TEGRA_AON_GPIO_PORT( Z, 0x0e00, 4, 0),
592 TEGRA_AON_GPIO_PORT(AA, 0x0c00, 8, 0),
593 TEGRA_AON_GPIO_PORT(EE, 0x0600, 3, 0),
594 TEGRA_AON_GPIO_PORT(FF, 0x0000, 5, 0),
597 static const struct tegra_gpio_soc tegra186_aon_soc = {
598 .num_ports = ARRAY_SIZE(tegra186_aon_ports),
599 .ports = tegra186_aon_ports,
600 .name = "tegra186-gpio-aon",
603 #define TEGRA194_MAIN_GPIO_PORT(port, base, count, controller) \
604 [TEGRA194_MAIN_GPIO_PORT_##port] = { \
611 static const struct tegra_gpio_port tegra194_main_ports[] = {
612 TEGRA194_MAIN_GPIO_PORT( A, 0x1400, 8, 1),
613 TEGRA194_MAIN_GPIO_PORT( B, 0x4e00, 2, 4),
614 TEGRA194_MAIN_GPIO_PORT( C, 0x4600, 8, 4),
615 TEGRA194_MAIN_GPIO_PORT( D, 0x4800, 4, 4),
616 TEGRA194_MAIN_GPIO_PORT( E, 0x4a00, 8, 4),
617 TEGRA194_MAIN_GPIO_PORT( F, 0x4c00, 6, 4),
618 TEGRA194_MAIN_GPIO_PORT( G, 0x4000, 8, 4),
619 TEGRA194_MAIN_GPIO_PORT( H, 0x4200, 8, 4),
620 TEGRA194_MAIN_GPIO_PORT( I, 0x4400, 5, 4),
621 TEGRA194_MAIN_GPIO_PORT( J, 0x5200, 6, 5),
622 TEGRA194_MAIN_GPIO_PORT( K, 0x3000, 8, 3),
623 TEGRA194_MAIN_GPIO_PORT( L, 0x3200, 4, 3),
624 TEGRA194_MAIN_GPIO_PORT( M, 0x2600, 8, 2),
625 TEGRA194_MAIN_GPIO_PORT( N, 0x2800, 3, 2),
626 TEGRA194_MAIN_GPIO_PORT( O, 0x5000, 6, 5),
627 TEGRA194_MAIN_GPIO_PORT( P, 0x2a00, 8, 2),
628 TEGRA194_MAIN_GPIO_PORT( Q, 0x2c00, 8, 2),
629 TEGRA194_MAIN_GPIO_PORT( R, 0x2e00, 6, 2),
630 TEGRA194_MAIN_GPIO_PORT( S, 0x3600, 8, 3),
631 TEGRA194_MAIN_GPIO_PORT( T, 0x3800, 8, 3),
632 TEGRA194_MAIN_GPIO_PORT( U, 0x3a00, 1, 3),
633 TEGRA194_MAIN_GPIO_PORT( V, 0x1000, 8, 1),
634 TEGRA194_MAIN_GPIO_PORT( W, 0x1200, 2, 1),
635 TEGRA194_MAIN_GPIO_PORT( X, 0x2000, 8, 2),
636 TEGRA194_MAIN_GPIO_PORT( Y, 0x2200, 8, 2),
637 TEGRA194_MAIN_GPIO_PORT( Z, 0x2400, 8, 2),
638 TEGRA194_MAIN_GPIO_PORT(FF, 0x3400, 2, 3),
639 TEGRA194_MAIN_GPIO_PORT(GG, 0x0000, 2, 0)
642 static const struct tegra_gpio_soc tegra194_main_soc = {
643 .num_ports = ARRAY_SIZE(tegra194_main_ports),
644 .ports = tegra194_main_ports,
645 .name = "tegra194-gpio",
648 #define TEGRA194_AON_GPIO_PORT(port, base, count, controller) \
649 [TEGRA194_AON_GPIO_PORT_##port] = { \
656 static const struct tegra_gpio_port tegra194_aon_ports[] = {
657 TEGRA194_AON_GPIO_PORT(AA, 0x0600, 8, 0),
658 TEGRA194_AON_GPIO_PORT(BB, 0x0800, 4, 0),
659 TEGRA194_AON_GPIO_PORT(CC, 0x0200, 8, 0),
660 TEGRA194_AON_GPIO_PORT(DD, 0x0400, 3, 0),
661 TEGRA194_AON_GPIO_PORT(EE, 0x0000, 7, 0)
664 static const struct tegra_gpio_soc tegra194_aon_soc = {
665 .num_ports = ARRAY_SIZE(tegra194_aon_ports),
666 .ports = tegra194_aon_ports,
667 .name = "tegra194-gpio-aon",
670 static const struct of_device_id tegra186_gpio_of_match[] = {
672 .compatible = "nvidia,tegra186-gpio",
673 .data = &tegra186_main_soc
675 .compatible = "nvidia,tegra186-gpio-aon",
676 .data = &tegra186_aon_soc
678 .compatible = "nvidia,tegra194-gpio",
679 .data = &tegra194_main_soc
681 .compatible = "nvidia,tegra194-gpio-aon",
682 .data = &tegra194_aon_soc
688 static struct platform_driver tegra186_gpio_driver = {
690 .name = "tegra186-gpio",
691 .of_match_table = tegra186_gpio_of_match,
693 .probe = tegra186_gpio_probe,
694 .remove = tegra186_gpio_remove,
696 module_platform_driver(tegra186_gpio_driver);
698 MODULE_DESCRIPTION("NVIDIA Tegra186 GPIO controller driver");
699 MODULE_AUTHOR("Thierry Reding <treding@nvidia.com>");
700 MODULE_LICENSE("GPL v2");