Lines Matching refs:gc
39 struct gpio_chip gc; member
65 static int mpc8572_gpio_get(struct gpio_chip *gc, unsigned int gpio) in mpc8572_gpio_get() argument
68 struct mpc8xxx_gpio_chip *mpc8xxx_gc = gpiochip_get_data(gc); in mpc8572_gpio_get()
71 out_mask = gc->read_reg(mpc8xxx_gc->regs + GPIO_DIR); in mpc8572_gpio_get()
72 val = gc->read_reg(mpc8xxx_gc->regs + GPIO_DAT) & ~out_mask; in mpc8572_gpio_get()
73 out_shadow = gc->bgpio_data & out_mask; in mpc8572_gpio_get()
78 static int mpc5121_gpio_dir_out(struct gpio_chip *gc, in mpc5121_gpio_dir_out() argument
81 struct mpc8xxx_gpio_chip *mpc8xxx_gc = gpiochip_get_data(gc); in mpc5121_gpio_dir_out()
86 return mpc8xxx_gc->direction_output(gc, gpio, val); in mpc5121_gpio_dir_out()
89 static int mpc5125_gpio_dir_out(struct gpio_chip *gc, in mpc5125_gpio_dir_out() argument
92 struct mpc8xxx_gpio_chip *mpc8xxx_gc = gpiochip_get_data(gc); in mpc5125_gpio_dir_out()
97 return mpc8xxx_gc->direction_output(gc, gpio, val); in mpc5125_gpio_dir_out()
100 static int mpc8xxx_gpio_to_irq(struct gpio_chip *gc, unsigned offset) in mpc8xxx_gpio_to_irq() argument
102 struct mpc8xxx_gpio_chip *mpc8xxx_gc = gpiochip_get_data(gc); in mpc8xxx_gpio_to_irq()
113 struct gpio_chip *gc = &mpc8xxx_gc->gc; in mpc8xxx_gpio_irq_cascade() local
117 mask = gc->read_reg(mpc8xxx_gc->regs + GPIO_IER) in mpc8xxx_gpio_irq_cascade()
118 & gc->read_reg(mpc8xxx_gc->regs + GPIO_IMR); in mpc8xxx_gpio_irq_cascade()
128 struct gpio_chip *gc = &mpc8xxx_gc->gc; in mpc8xxx_irq_unmask() local
133 gc->write_reg(mpc8xxx_gc->regs + GPIO_IMR, in mpc8xxx_irq_unmask()
134 gc->read_reg(mpc8xxx_gc->regs + GPIO_IMR) in mpc8xxx_irq_unmask()
143 struct gpio_chip *gc = &mpc8xxx_gc->gc; in mpc8xxx_irq_mask() local
148 gc->write_reg(mpc8xxx_gc->regs + GPIO_IMR, in mpc8xxx_irq_mask()
149 gc->read_reg(mpc8xxx_gc->regs + GPIO_IMR) in mpc8xxx_irq_mask()
158 struct gpio_chip *gc = &mpc8xxx_gc->gc; in mpc8xxx_irq_ack() local
160 gc->write_reg(mpc8xxx_gc->regs + GPIO_IER, in mpc8xxx_irq_ack()
167 struct gpio_chip *gc = &mpc8xxx_gc->gc; in mpc8xxx_irq_set_type() local
174 gc->write_reg(mpc8xxx_gc->regs + GPIO_ICR, in mpc8xxx_irq_set_type()
175 gc->read_reg(mpc8xxx_gc->regs + GPIO_ICR) in mpc8xxx_irq_set_type()
182 gc->write_reg(mpc8xxx_gc->regs + GPIO_ICR, in mpc8xxx_irq_set_type()
183 gc->read_reg(mpc8xxx_gc->regs + GPIO_ICR) in mpc8xxx_irq_set_type()
198 struct gpio_chip *gc = &mpc8xxx_gc->gc; in mpc512x_irq_set_type() local
216 gc->write_reg(reg, (gc->read_reg(reg) & ~(3 << shift)) in mpc512x_irq_set_type()
224 gc->write_reg(reg, (gc->read_reg(reg) & ~(3 << shift)) in mpc512x_irq_set_type()
231 gc->write_reg(reg, (gc->read_reg(reg) & ~(3 << shift))); in mpc512x_irq_set_type()
306 struct gpio_chip *gc; in mpc8xxx_probe() local
323 gc = &mpc8xxx_gc->gc; in mpc8xxx_probe()
324 gc->parent = &pdev->dev; in mpc8xxx_probe()
327 ret = bgpio_init(gc, &pdev->dev, 4, in mpc8xxx_probe()
336 ret = bgpio_init(gc, &pdev->dev, 4, in mpc8xxx_probe()
347 mpc8xxx_gc->direction_output = gc->direction_output; in mpc8xxx_probe()
361 gc->direction_output = devtype->gpio_dir_out; in mpc8xxx_probe()
363 gc->get = devtype->gpio_get; in mpc8xxx_probe()
365 gc->to_irq = mpc8xxx_gpio_to_irq; in mpc8xxx_probe()
379 gc->write_reg(mpc8xxx_gc->regs + GPIO_IBE, 0xffffffff); in mpc8xxx_probe()
381 ret = devm_gpiochip_add_data(&pdev->dev, gc, mpc8xxx_gc); in mpc8xxx_probe()
401 gc->write_reg(mpc8xxx_gc->regs + GPIO_IER, 0xffffffff); in mpc8xxx_probe()
402 gc->write_reg(mpc8xxx_gc->regs + GPIO_IMR, 0); in mpc8xxx_probe()