Lines Matching refs:ic
56 static inline void lpc18xx_gpio_pin_ic_isel(struct lpc18xx_gpio_pin_ic *ic, in lpc18xx_gpio_pin_ic_isel() argument
59 u32 val = readl_relaxed(ic->base + LPC18XX_GPIO_PIN_IC_ISEL); in lpc18xx_gpio_pin_ic_isel()
66 writel_relaxed(val, ic->base + LPC18XX_GPIO_PIN_IC_ISEL); in lpc18xx_gpio_pin_ic_isel()
69 static inline void lpc18xx_gpio_pin_ic_set(struct lpc18xx_gpio_pin_ic *ic, in lpc18xx_gpio_pin_ic_set() argument
72 writel_relaxed(BIT(pin), ic->base + reg); in lpc18xx_gpio_pin_ic_set()
77 struct lpc18xx_gpio_pin_ic *ic = d->chip_data; in lpc18xx_gpio_pin_ic_mask() local
80 raw_spin_lock(&ic->lock); in lpc18xx_gpio_pin_ic_mask()
83 lpc18xx_gpio_pin_ic_set(ic, d->hwirq, in lpc18xx_gpio_pin_ic_mask()
87 lpc18xx_gpio_pin_ic_set(ic, d->hwirq, in lpc18xx_gpio_pin_ic_mask()
90 raw_spin_unlock(&ic->lock); in lpc18xx_gpio_pin_ic_mask()
97 struct lpc18xx_gpio_pin_ic *ic = d->chip_data; in lpc18xx_gpio_pin_ic_unmask() local
100 raw_spin_lock(&ic->lock); in lpc18xx_gpio_pin_ic_unmask()
103 lpc18xx_gpio_pin_ic_set(ic, d->hwirq, in lpc18xx_gpio_pin_ic_unmask()
107 lpc18xx_gpio_pin_ic_set(ic, d->hwirq, in lpc18xx_gpio_pin_ic_unmask()
110 raw_spin_unlock(&ic->lock); in lpc18xx_gpio_pin_ic_unmask()
117 struct lpc18xx_gpio_pin_ic *ic = d->chip_data; in lpc18xx_gpio_pin_ic_eoi() local
120 raw_spin_lock(&ic->lock); in lpc18xx_gpio_pin_ic_eoi()
123 lpc18xx_gpio_pin_ic_set(ic, d->hwirq, in lpc18xx_gpio_pin_ic_eoi()
126 raw_spin_unlock(&ic->lock); in lpc18xx_gpio_pin_ic_eoi()
133 struct lpc18xx_gpio_pin_ic *ic = d->chip_data; in lpc18xx_gpio_pin_ic_set_type() local
135 raw_spin_lock(&ic->lock); in lpc18xx_gpio_pin_ic_set_type()
138 lpc18xx_gpio_pin_ic_isel(ic, d->hwirq, true); in lpc18xx_gpio_pin_ic_set_type()
139 lpc18xx_gpio_pin_ic_set(ic, d->hwirq, in lpc18xx_gpio_pin_ic_set_type()
142 lpc18xx_gpio_pin_ic_isel(ic, d->hwirq, true); in lpc18xx_gpio_pin_ic_set_type()
143 lpc18xx_gpio_pin_ic_set(ic, d->hwirq, in lpc18xx_gpio_pin_ic_set_type()
146 lpc18xx_gpio_pin_ic_isel(ic, d->hwirq, false); in lpc18xx_gpio_pin_ic_set_type()
149 raw_spin_unlock(&ic->lock); in lpc18xx_gpio_pin_ic_set_type()
168 struct lpc18xx_gpio_pin_ic *ic = domain->host_data; in lpc18xx_gpio_pin_ic_domain_alloc() local
195 &lpc18xx_gpio_pin_ic, ic); in lpc18xx_gpio_pin_ic_domain_alloc()
209 struct lpc18xx_gpio_pin_ic *ic; in lpc18xx_gpio_pin_ic_probe() local
222 ic = devm_kzalloc(dev, sizeof(*ic), GFP_KERNEL); in lpc18xx_gpio_pin_ic_probe()
223 if (!ic) in lpc18xx_gpio_pin_ic_probe()
237 ic->base = devm_ioremap_resource(dev, &res); in lpc18xx_gpio_pin_ic_probe()
238 if (IS_ERR(ic->base)) { in lpc18xx_gpio_pin_ic_probe()
239 ret = PTR_ERR(ic->base); in lpc18xx_gpio_pin_ic_probe()
243 raw_spin_lock_init(&ic->lock); in lpc18xx_gpio_pin_ic_probe()
245 ic->domain = irq_domain_add_hierarchy(parent_domain, 0, in lpc18xx_gpio_pin_ic_probe()
249 ic); in lpc18xx_gpio_pin_ic_probe()
250 if (!ic->domain) { in lpc18xx_gpio_pin_ic_probe()
256 gc->pin_ic = ic; in lpc18xx_gpio_pin_ic_probe()
261 devm_iounmap(dev, ic->base); in lpc18xx_gpio_pin_ic_probe()
263 devm_kfree(dev, ic); in lpc18xx_gpio_pin_ic_probe()