Lines Matching +full:gpi +full:- +full:config
1 // SPDX-License-Identifier: GPL-2.0-only
25 /* input-only flavor */
28 /* output-only flavor */
50 struct gpio_regmap_config *config) in sl28cpld_gpio_irq_init() argument
54 struct device *dev = &pdev->dev; in sl28cpld_gpio_irq_init()
57 if (!device_property_read_bool(dev, "interrupt-controller")) in sl28cpld_gpio_irq_init()
66 return -ENOMEM; in sl28cpld_gpio_irq_init()
68 irq_chip->name = "sl28cpld-gpio-irq"; in sl28cpld_gpio_irq_init()
69 irq_chip->irqs = sl28cpld_gpio_irqs; in sl28cpld_gpio_irq_init()
70 irq_chip->num_irqs = ARRAY_SIZE(sl28cpld_gpio_irqs); in sl28cpld_gpio_irq_init()
71 irq_chip->num_regs = 1; in sl28cpld_gpio_irq_init()
72 irq_chip->status_base = base + GPIO_REG_IP; in sl28cpld_gpio_irq_init()
73 irq_chip->unmask_base = base + GPIO_REG_IE; in sl28cpld_gpio_irq_init()
74 irq_chip->ack_base = base + GPIO_REG_IP; in sl28cpld_gpio_irq_init()
77 config->regmap, irq, in sl28cpld_gpio_irq_init()
83 config->irq_domain = regmap_irq_get_domain(irq_data); in sl28cpld_gpio_irq_init()
90 struct gpio_regmap_config config = {0}; in sl28cpld_gpio_probe() local
96 if (!pdev->dev.parent) in sl28cpld_gpio_probe()
97 return -ENODEV; in sl28cpld_gpio_probe()
99 type = (uintptr_t)device_get_match_data(&pdev->dev); in sl28cpld_gpio_probe()
101 return -ENODEV; in sl28cpld_gpio_probe()
103 ret = device_property_read_u32(&pdev->dev, "reg", &base); in sl28cpld_gpio_probe()
105 return -EINVAL; in sl28cpld_gpio_probe()
107 regmap = dev_get_regmap(pdev->dev.parent, NULL); in sl28cpld_gpio_probe()
109 return -ENODEV; in sl28cpld_gpio_probe()
111 config.regmap = regmap; in sl28cpld_gpio_probe()
112 config.parent = &pdev->dev; in sl28cpld_gpio_probe()
113 config.ngpio = 8; in sl28cpld_gpio_probe()
117 config.reg_dat_base = base + GPIO_REG_IN; in sl28cpld_gpio_probe()
118 config.reg_set_base = base + GPIO_REG_OUT; in sl28cpld_gpio_probe()
120 config.reg_dir_out_base = GPIO_REGMAP_ADDR(base + GPIO_REG_DIR); in sl28cpld_gpio_probe()
123 ret = sl28cpld_gpio_irq_init(pdev, base, &config); in sl28cpld_gpio_probe()
128 config.reg_set_base = base + GPO_REG_OUT; in sl28cpld_gpio_probe()
131 config.reg_dat_base = base + GPI_REG_IN; in sl28cpld_gpio_probe()
134 dev_err(&pdev->dev, "unknown type %d\n", type); in sl28cpld_gpio_probe()
135 return -ENODEV; in sl28cpld_gpio_probe()
138 return PTR_ERR_OR_ZERO(devm_gpio_regmap_register(&pdev->dev, &config)); in sl28cpld_gpio_probe()
142 { .compatible = "kontron,sl28cpld-gpio", .data = (void *)SL28CPLD_GPIO },
143 { .compatible = "kontron,sl28cpld-gpi", .data = (void *)SL28CPLD_GPI },
144 { .compatible = "kontron,sl28cpld-gpo", .data = (void *)SL28CPLD_GPO },
152 .name = "sl28cpld-gpio",