Lines Matching refs:tc3589x_gpio

27 struct tc3589x_gpio {  struct
37 static inline struct tc3589x_gpio *to_tc3589x_gpio(struct gpio_chip *chip) in to_tc3589x_gpio() argument
39 return container_of(chip, struct tc3589x_gpio, chip); in to_tc3589x_gpio()
44 struct tc3589x_gpio *tc3589x_gpio = to_tc3589x_gpio(chip); in tc3589x_gpio_get() local
45 struct tc3589x *tc3589x = tc3589x_gpio->tc3589x; in tc3589x_gpio_get()
59 struct tc3589x_gpio *tc3589x_gpio = to_tc3589x_gpio(chip); in tc3589x_gpio_set() local
60 struct tc3589x *tc3589x = tc3589x_gpio->tc3589x; in tc3589x_gpio_set()
71 struct tc3589x_gpio *tc3589x_gpio = to_tc3589x_gpio(chip); in tc3589x_gpio_direction_output() local
72 struct tc3589x *tc3589x = tc3589x_gpio->tc3589x; in tc3589x_gpio_direction_output()
84 struct tc3589x_gpio *tc3589x_gpio = to_tc3589x_gpio(chip); in tc3589x_gpio_direction_input() local
85 struct tc3589x *tc3589x = tc3589x_gpio->tc3589x; in tc3589x_gpio_direction_input()
105 struct tc3589x_gpio *tc3589x_gpio = to_tc3589x_gpio(gc); in tc3589x_gpio_irq_set_type() local
111 tc3589x_gpio->regs[REG_IBE][regoffset] |= mask; in tc3589x_gpio_irq_set_type()
115 tc3589x_gpio->regs[REG_IBE][regoffset] &= ~mask; in tc3589x_gpio_irq_set_type()
118 tc3589x_gpio->regs[REG_IS][regoffset] |= mask; in tc3589x_gpio_irq_set_type()
120 tc3589x_gpio->regs[REG_IS][regoffset] &= ~mask; in tc3589x_gpio_irq_set_type()
123 tc3589x_gpio->regs[REG_IEV][regoffset] |= mask; in tc3589x_gpio_irq_set_type()
125 tc3589x_gpio->regs[REG_IEV][regoffset] &= ~mask; in tc3589x_gpio_irq_set_type()
133 struct tc3589x_gpio *tc3589x_gpio = to_tc3589x_gpio(gc); in tc3589x_gpio_irq_lock() local
135 mutex_lock(&tc3589x_gpio->irq_lock); in tc3589x_gpio_irq_lock()
141 struct tc3589x_gpio *tc3589x_gpio = to_tc3589x_gpio(gc); in tc3589x_gpio_irq_sync_unlock() local
142 struct tc3589x *tc3589x = tc3589x_gpio->tc3589x; in tc3589x_gpio_irq_sync_unlock()
153 u8 old = tc3589x_gpio->oldregs[i][j]; in tc3589x_gpio_irq_sync_unlock()
154 u8 new = tc3589x_gpio->regs[i][j]; in tc3589x_gpio_irq_sync_unlock()
159 tc3589x_gpio->oldregs[i][j] = new; in tc3589x_gpio_irq_sync_unlock()
164 mutex_unlock(&tc3589x_gpio->irq_lock); in tc3589x_gpio_irq_sync_unlock()
170 struct tc3589x_gpio *tc3589x_gpio = to_tc3589x_gpio(gc); in tc3589x_gpio_irq_mask() local
175 tc3589x_gpio->regs[REG_IE][regoffset] &= ~mask; in tc3589x_gpio_irq_mask()
181 struct tc3589x_gpio *tc3589x_gpio = to_tc3589x_gpio(gc); in tc3589x_gpio_irq_unmask() local
186 tc3589x_gpio->regs[REG_IE][regoffset] |= mask; in tc3589x_gpio_irq_unmask()
200 struct tc3589x_gpio *tc3589x_gpio = dev; in tc3589x_gpio_irq() local
201 struct tc3589x *tc3589x = tc3589x_gpio->tc3589x; in tc3589x_gpio_irq()
219 int irq = irq_find_mapping(tc3589x_gpio->chip.irqdomain, in tc3589x_gpio_irq()
236 struct tc3589x_gpio *tc3589x_gpio; in tc3589x_gpio_probe() local
249 tc3589x_gpio = devm_kzalloc(&pdev->dev, sizeof(struct tc3589x_gpio), in tc3589x_gpio_probe()
251 if (!tc3589x_gpio) in tc3589x_gpio_probe()
254 mutex_init(&tc3589x_gpio->irq_lock); in tc3589x_gpio_probe()
256 tc3589x_gpio->dev = &pdev->dev; in tc3589x_gpio_probe()
257 tc3589x_gpio->tc3589x = tc3589x; in tc3589x_gpio_probe()
259 tc3589x_gpio->chip = template_chip; in tc3589x_gpio_probe()
260 tc3589x_gpio->chip.ngpio = tc3589x->num_gpio; in tc3589x_gpio_probe()
261 tc3589x_gpio->chip.dev = &pdev->dev; in tc3589x_gpio_probe()
262 tc3589x_gpio->chip.base = -1; in tc3589x_gpio_probe()
263 tc3589x_gpio->chip.of_node = np; in tc3589x_gpio_probe()
274 tc3589x_gpio); in tc3589x_gpio_probe()
280 ret = gpiochip_add(&tc3589x_gpio->chip); in tc3589x_gpio_probe()
286 ret = gpiochip_irqchip_add(&tc3589x_gpio->chip, in tc3589x_gpio_probe()
297 gpiochip_set_chained_irqchip(&tc3589x_gpio->chip, in tc3589x_gpio_probe()
302 platform_set_drvdata(pdev, tc3589x_gpio); in tc3589x_gpio_probe()
309 struct tc3589x_gpio *tc3589x_gpio = platform_get_drvdata(pdev); in tc3589x_gpio_remove() local
311 gpiochip_remove(&tc3589x_gpio->chip); in tc3589x_gpio_remove()