Lines Matching +full:child +full:- +full:interrupt +full:- +full:base
1 // SPDX-License-Identifier: GPL-2.0
14 #include <linux/interrupt.h>
33 void __iomem *base; member
50 spin_lock_irqsave(&priv->lock, flags); in visconti_gpio_irq_set_type()
52 odata = readl(priv->base + GPIO_ODATA); in visconti_gpio_irq_set_type()
53 intmode = readl(priv->base + GPIO_INTMODE); in visconti_gpio_irq_set_type()
78 ret = -EINVAL; in visconti_gpio_irq_set_type()
82 writel(odata, priv->base + GPIO_ODATA); in visconti_gpio_irq_set_type()
83 writel(intmode, priv->base + GPIO_INTMODE); in visconti_gpio_irq_set_type()
88 spin_unlock_irqrestore(&priv->lock, flags); in visconti_gpio_irq_set_type()
93 unsigned int child, in visconti_gpio_child_to_parent_hwirq() argument
99 if (child < 16) { in visconti_gpio_child_to_parent_hwirq()
102 *parent = child + BASE_HW_IRQ; in visconti_gpio_child_to_parent_hwirq()
105 return -EINVAL; in visconti_gpio_child_to_parent_hwirq()
113 struct irq_fwspec *fwspec = &gfwspec->fwspec; in visconti_gpio_populate_parent_fwspec()
115 fwspec->fwnode = chip->irq.parent_domain->fwnode; in visconti_gpio_populate_parent_fwspec()
116 fwspec->param_count = 3; in visconti_gpio_populate_parent_fwspec()
117 fwspec->param[0] = 0; in visconti_gpio_populate_parent_fwspec()
118 fwspec->param[1] = parent_hwirq; in visconti_gpio_populate_parent_fwspec()
119 fwspec->param[2] = parent_type; in visconti_gpio_populate_parent_fwspec()
145 seq_printf(p, dev_name(priv->dev)); in visconti_gpio_irq_print_chip()
161 struct device *dev = &pdev->dev; in visconti_gpio_probe()
170 return -ENOMEM; in visconti_gpio_probe()
172 spin_lock_init(&priv->lock); in visconti_gpio_probe()
173 priv->dev = dev; in visconti_gpio_probe()
175 priv->base = devm_platform_ioremap_resource(pdev, 0); in visconti_gpio_probe()
176 if (IS_ERR(priv->base)) in visconti_gpio_probe()
177 return PTR_ERR(priv->base); in visconti_gpio_probe()
179 irq_parent = of_irq_find_parent(dev->of_node); in visconti_gpio_probe()
182 return -ENODEV; in visconti_gpio_probe()
189 return -ENODEV; in visconti_gpio_probe()
192 ret = bgpio_init(&priv->gpio_chip, dev, 4, in visconti_gpio_probe()
193 priv->base + GPIO_IDATA, in visconti_gpio_probe()
194 priv->base + GPIO_OSET, in visconti_gpio_probe()
195 priv->base + GPIO_OCLR, in visconti_gpio_probe()
196 priv->base + GPIO_DIR, in visconti_gpio_probe()
204 girq = &priv->gpio_chip.irq; in visconti_gpio_probe()
206 girq->fwnode = dev_fwnode(dev); in visconti_gpio_probe()
207 girq->parent_domain = parent; in visconti_gpio_probe()
208 girq->child_to_parent_hwirq = visconti_gpio_child_to_parent_hwirq; in visconti_gpio_probe()
209 girq->populate_parent_alloc_arg = visconti_gpio_populate_parent_fwspec; in visconti_gpio_probe()
210 girq->default_type = IRQ_TYPE_NONE; in visconti_gpio_probe()
211 girq->handler = handle_level_irq; in visconti_gpio_probe()
213 return devm_gpiochip_add_data(dev, &priv->gpio_chip, priv); in visconti_gpio_probe()
217 { .compatible = "toshiba,gpio-tmpv7708", },