Lines Matching refs:gc

36 	struct gpio_chip	gc;  member
62 static int mpc8572_gpio_get(struct gpio_chip *gc, unsigned int gpio) in mpc8572_gpio_get() argument
65 struct mpc8xxx_gpio_chip *mpc8xxx_gc = gpiochip_get_data(gc); in mpc8572_gpio_get()
68 out_mask = gc->read_reg(mpc8xxx_gc->regs + GPIO_DIR); in mpc8572_gpio_get()
69 val = gc->read_reg(mpc8xxx_gc->regs + GPIO_DAT) & ~out_mask; in mpc8572_gpio_get()
70 out_shadow = gc->bgpio_data & out_mask; in mpc8572_gpio_get()
75 static int mpc5121_gpio_dir_out(struct gpio_chip *gc, in mpc5121_gpio_dir_out() argument
78 struct mpc8xxx_gpio_chip *mpc8xxx_gc = gpiochip_get_data(gc); in mpc5121_gpio_dir_out()
83 return mpc8xxx_gc->direction_output(gc, gpio, val); in mpc5121_gpio_dir_out()
86 static int mpc5125_gpio_dir_out(struct gpio_chip *gc, in mpc5125_gpio_dir_out() argument
89 struct mpc8xxx_gpio_chip *mpc8xxx_gc = gpiochip_get_data(gc); in mpc5125_gpio_dir_out()
94 return mpc8xxx_gc->direction_output(gc, gpio, val); in mpc5125_gpio_dir_out()
97 static int mpc8xxx_gpio_to_irq(struct gpio_chip *gc, unsigned offset) in mpc8xxx_gpio_to_irq() argument
99 struct mpc8xxx_gpio_chip *mpc8xxx_gc = gpiochip_get_data(gc); in mpc8xxx_gpio_to_irq()
110 struct gpio_chip *gc = &mpc8xxx_gc->gc; in mpc8xxx_gpio_irq_cascade() local
114 mask = gc->read_reg(mpc8xxx_gc->regs + GPIO_IER) in mpc8xxx_gpio_irq_cascade()
115 & gc->read_reg(mpc8xxx_gc->regs + GPIO_IMR); in mpc8xxx_gpio_irq_cascade()
125 struct gpio_chip *gc = &mpc8xxx_gc->gc; in mpc8xxx_irq_unmask() local
130 gc->write_reg(mpc8xxx_gc->regs + GPIO_IMR, in mpc8xxx_irq_unmask()
131 gc->read_reg(mpc8xxx_gc->regs + GPIO_IMR) in mpc8xxx_irq_unmask()
140 struct gpio_chip *gc = &mpc8xxx_gc->gc; in mpc8xxx_irq_mask() local
145 gc->write_reg(mpc8xxx_gc->regs + GPIO_IMR, in mpc8xxx_irq_mask()
146 gc->read_reg(mpc8xxx_gc->regs + GPIO_IMR) in mpc8xxx_irq_mask()
155 struct gpio_chip *gc = &mpc8xxx_gc->gc; in mpc8xxx_irq_ack() local
157 gc->write_reg(mpc8xxx_gc->regs + GPIO_IER, in mpc8xxx_irq_ack()
164 struct gpio_chip *gc = &mpc8xxx_gc->gc; in mpc8xxx_irq_set_type() local
171 gc->write_reg(mpc8xxx_gc->regs + GPIO_ICR, in mpc8xxx_irq_set_type()
172 gc->read_reg(mpc8xxx_gc->regs + GPIO_ICR) in mpc8xxx_irq_set_type()
179 gc->write_reg(mpc8xxx_gc->regs + GPIO_ICR, in mpc8xxx_irq_set_type()
180 gc->read_reg(mpc8xxx_gc->regs + GPIO_ICR) in mpc8xxx_irq_set_type()
195 struct gpio_chip *gc = &mpc8xxx_gc->gc; in mpc512x_irq_set_type() local
213 gc->write_reg(reg, (gc->read_reg(reg) & ~(3 << shift)) in mpc512x_irq_set_type()
221 gc->write_reg(reg, (gc->read_reg(reg) & ~(3 << shift)) in mpc512x_irq_set_type()
228 gc->write_reg(reg, (gc->read_reg(reg) & ~(3 << shift))); in mpc512x_irq_set_type()
303 struct gpio_chip *gc; in mpc8xxx_probe() local
320 gc = &mpc8xxx_gc->gc; in mpc8xxx_probe()
321 gc->parent = &pdev->dev; in mpc8xxx_probe()
324 ret = bgpio_init(gc, &pdev->dev, 4, in mpc8xxx_probe()
333 ret = bgpio_init(gc, &pdev->dev, 4, in mpc8xxx_probe()
344 mpc8xxx_gc->direction_output = gc->direction_output; in mpc8xxx_probe()
358 gc->direction_output = devtype->gpio_dir_out; in mpc8xxx_probe()
360 gc->get = devtype->gpio_get; in mpc8xxx_probe()
362 gc->to_irq = mpc8xxx_gpio_to_irq; in mpc8xxx_probe()
376 gc->write_reg(mpc8xxx_gc->regs + GPIO_IBE, 0xffffffff); in mpc8xxx_probe()
378 gc->bgpio_data = gc->read_reg(mpc8xxx_gc->regs + GPIO_DAT) & in mpc8xxx_probe()
379 gc->read_reg(mpc8xxx_gc->regs + GPIO_DIR); in mpc8xxx_probe()
382 ret = devm_gpiochip_add_data(&pdev->dev, gc, mpc8xxx_gc); in mpc8xxx_probe()
402 gc->write_reg(mpc8xxx_gc->regs + GPIO_IER, 0xffffffff); in mpc8xxx_probe()
403 gc->write_reg(mpc8xxx_gc->regs + GPIO_IMR, 0); in mpc8xxx_probe()