Lines Matching full:g

61 	struct ixp4xx_gpio *g = gpiochip_get_data(gc);  in ixp4xx_gpio_irq_ack()  local
63 __raw_writel(BIT(d->hwirq), g->base + IXP4XX_REG_GPIS); in ixp4xx_gpio_irq_ack()
77 struct ixp4xx_gpio *g = gpiochip_get_data(gc); in ixp4xx_gpio_irq_unmask() local
80 if (!(g->irq_edge & BIT(d->hwirq))) in ixp4xx_gpio_irq_unmask()
90 struct ixp4xx_gpio *g = gpiochip_get_data(gc); in ixp4xx_gpio_irq_set_type() local
101 g->irq_edge |= BIT(d->hwirq); in ixp4xx_gpio_irq_set_type()
106 g->irq_edge |= BIT(d->hwirq); in ixp4xx_gpio_irq_set_type()
111 g->irq_edge |= BIT(d->hwirq); in ixp4xx_gpio_irq_set_type()
116 g->irq_edge &= ~BIT(d->hwirq); in ixp4xx_gpio_irq_set_type()
121 g->irq_edge &= ~BIT(d->hwirq); in ixp4xx_gpio_irq_set_type()
136 raw_spin_lock_irqsave(&g->gc.bgpio_lock, flags); in ixp4xx_gpio_irq_set_type()
139 val = __raw_readl(g->base + int_reg); in ixp4xx_gpio_irq_set_type()
141 __raw_writel(val, g->base + int_reg); in ixp4xx_gpio_irq_set_type()
143 __raw_writel(BIT(line), g->base + IXP4XX_REG_GPIS); in ixp4xx_gpio_irq_set_type()
146 val = __raw_readl(g->base + int_reg); in ixp4xx_gpio_irq_set_type()
148 __raw_writel(val, g->base + int_reg); in ixp4xx_gpio_irq_set_type()
151 val = __raw_readl(g->base + IXP4XX_REG_GPOE); in ixp4xx_gpio_irq_set_type()
153 __raw_writel(val, g->base + IXP4XX_REG_GPOE); in ixp4xx_gpio_irq_set_type()
155 raw_spin_unlock_irqrestore(&g->gc.bgpio_lock, flags); in ixp4xx_gpio_irq_set_type()
202 struct ixp4xx_gpio *g; in ixp4xx_gpio_probe() local
207 g = devm_kzalloc(dev, sizeof(*g), GFP_KERNEL); in ixp4xx_gpio_probe()
208 if (!g) in ixp4xx_gpio_probe()
210 g->dev = dev; in ixp4xx_gpio_probe()
212 g->base = devm_platform_ioremap_resource(pdev, 0); in ixp4xx_gpio_probe()
213 if (IS_ERR(g->base)) in ixp4xx_gpio_probe()
214 return PTR_ERR(g->base); in ixp4xx_gpio_probe()
226 g->fwnode = of_node_to_fwnode(np); in ixp4xx_gpio_probe()
234 __raw_writel(0x0, g->base + IXP4XX_REG_GPCLK); in ixp4xx_gpio_probe()
252 ret = bgpio_init(&g->gc, dev, 4, in ixp4xx_gpio_probe()
253 g->base + IXP4XX_REG_GPIN, in ixp4xx_gpio_probe()
254 g->base + IXP4XX_REG_GPOUT, in ixp4xx_gpio_probe()
257 g->base + IXP4XX_REG_GPOE, in ixp4xx_gpio_probe()
263 g->gc.ngpio = 16; in ixp4xx_gpio_probe()
264 g->gc.label = "IXP4XX_GPIO_CHIP"; in ixp4xx_gpio_probe()
270 g->gc.base = 0; in ixp4xx_gpio_probe()
271 g->gc.parent = &pdev->dev; in ixp4xx_gpio_probe()
272 g->gc.owner = THIS_MODULE; in ixp4xx_gpio_probe()
274 girq = &g->gc.irq; in ixp4xx_gpio_probe()
276 girq->fwnode = g->fwnode; in ixp4xx_gpio_probe()
282 ret = devm_gpiochip_add_data(dev, &g->gc, g); in ixp4xx_gpio_probe()
288 platform_set_drvdata(pdev, g); in ixp4xx_gpio_probe()