Lines Matching full:gc

38 	struct gpio_chip	gc;  member
64 static int mpc8572_gpio_get(struct gpio_chip *gc, unsigned int gpio) in mpc8572_gpio_get() argument
67 struct mpc8xxx_gpio_chip *mpc8xxx_gc = gpiochip_get_data(gc); in mpc8572_gpio_get()
70 out_mask = gc->read_reg(mpc8xxx_gc->regs + GPIO_DIR); in mpc8572_gpio_get()
71 val = gc->read_reg(mpc8xxx_gc->regs + GPIO_DAT) & ~out_mask; in mpc8572_gpio_get()
72 out_shadow = gc->bgpio_data & out_mask; in mpc8572_gpio_get()
77 static int mpc5121_gpio_dir_out(struct gpio_chip *gc, in mpc5121_gpio_dir_out() argument
80 struct mpc8xxx_gpio_chip *mpc8xxx_gc = gpiochip_get_data(gc); in mpc5121_gpio_dir_out()
85 return mpc8xxx_gc->direction_output(gc, gpio, val); in mpc5121_gpio_dir_out()
88 static int mpc5125_gpio_dir_out(struct gpio_chip *gc, in mpc5125_gpio_dir_out() argument
91 struct mpc8xxx_gpio_chip *mpc8xxx_gc = gpiochip_get_data(gc); in mpc5125_gpio_dir_out()
96 return mpc8xxx_gc->direction_output(gc, gpio, val); in mpc5125_gpio_dir_out()
99 static int mpc8xxx_gpio_to_irq(struct gpio_chip *gc, unsigned offset) in mpc8xxx_gpio_to_irq() argument
101 struct mpc8xxx_gpio_chip *mpc8xxx_gc = gpiochip_get_data(gc); in mpc8xxx_gpio_to_irq()
112 struct gpio_chip *gc = &mpc8xxx_gc->gc; in mpc8xxx_gpio_irq_cascade() local
116 mask = gc->read_reg(mpc8xxx_gc->regs + GPIO_IER) in mpc8xxx_gpio_irq_cascade()
117 & gc->read_reg(mpc8xxx_gc->regs + GPIO_IMR); in mpc8xxx_gpio_irq_cascade()
127 struct gpio_chip *gc = &mpc8xxx_gc->gc; in mpc8xxx_irq_unmask() local
132 gc->write_reg(mpc8xxx_gc->regs + GPIO_IMR, in mpc8xxx_irq_unmask()
133 gc->read_reg(mpc8xxx_gc->regs + GPIO_IMR) in mpc8xxx_irq_unmask()
142 struct gpio_chip *gc = &mpc8xxx_gc->gc; in mpc8xxx_irq_mask() local
147 gc->write_reg(mpc8xxx_gc->regs + GPIO_IMR, in mpc8xxx_irq_mask()
148 gc->read_reg(mpc8xxx_gc->regs + GPIO_IMR) in mpc8xxx_irq_mask()
157 struct gpio_chip *gc = &mpc8xxx_gc->gc; in mpc8xxx_irq_ack() local
159 gc->write_reg(mpc8xxx_gc->regs + GPIO_IER, in mpc8xxx_irq_ack()
166 struct gpio_chip *gc = &mpc8xxx_gc->gc; in mpc8xxx_irq_set_type() local
173 gc->write_reg(mpc8xxx_gc->regs + GPIO_ICR, in mpc8xxx_irq_set_type()
174 gc->read_reg(mpc8xxx_gc->regs + GPIO_ICR) in mpc8xxx_irq_set_type()
181 gc->write_reg(mpc8xxx_gc->regs + GPIO_ICR, in mpc8xxx_irq_set_type()
182 gc->read_reg(mpc8xxx_gc->regs + GPIO_ICR) in mpc8xxx_irq_set_type()
197 struct gpio_chip *gc = &mpc8xxx_gc->gc; in mpc512x_irq_set_type() local
215 gc->write_reg(reg, (gc->read_reg(reg) & ~(3 << shift)) in mpc512x_irq_set_type()
223 gc->write_reg(reg, (gc->read_reg(reg) & ~(3 << shift)) in mpc512x_irq_set_type()
230 gc->write_reg(reg, (gc->read_reg(reg) & ~(3 << shift))); in mpc512x_irq_set_type()
305 struct gpio_chip *gc; in mpc8xxx_probe() local
322 gc = &mpc8xxx_gc->gc; in mpc8xxx_probe()
323 gc->parent = &pdev->dev; in mpc8xxx_probe()
326 ret = bgpio_init(gc, &pdev->dev, 4, in mpc8xxx_probe()
335 ret = bgpio_init(gc, &pdev->dev, 4, in mpc8xxx_probe()
346 mpc8xxx_gc->direction_output = gc->direction_output; in mpc8xxx_probe()
360 gc->direction_output = devtype->gpio_dir_out; in mpc8xxx_probe()
362 gc->get = devtype->gpio_get; in mpc8xxx_probe()
364 gc->to_irq = mpc8xxx_gpio_to_irq; in mpc8xxx_probe()
378 gc->write_reg(mpc8xxx_gc->regs + GPIO_IBE, 0xffffffff); in mpc8xxx_probe()
380 gc->bgpio_data = gc->read_reg(mpc8xxx_gc->regs + GPIO_DAT) & in mpc8xxx_probe()
381 gc->read_reg(mpc8xxx_gc->regs + GPIO_DIR); in mpc8xxx_probe()
384 ret = devm_gpiochip_add_data(&pdev->dev, gc, mpc8xxx_gc); in mpc8xxx_probe()
404 gc->write_reg(mpc8xxx_gc->regs + GPIO_IER, 0xffffffff); in mpc8xxx_probe()
405 gc->write_reg(mpc8xxx_gc->regs + GPIO_IMR, 0); in mpc8xxx_probe()