Lines Matching defs:gc

37 	struct gpio_chip	gc;
63 static int mpc8572_gpio_get(struct gpio_chip *gc, unsigned int gpio)
66 struct mpc8xxx_gpio_chip *mpc8xxx_gc = gpiochip_get_data(gc);
69 out_mask = gc->read_reg(mpc8xxx_gc->regs + GPIO_DIR);
70 val = gc->read_reg(mpc8xxx_gc->regs + GPIO_DAT) & ~out_mask;
71 out_shadow = gc->bgpio_data & out_mask;
76 static int mpc5121_gpio_dir_out(struct gpio_chip *gc,
79 struct mpc8xxx_gpio_chip *mpc8xxx_gc = gpiochip_get_data(gc);
84 return mpc8xxx_gc->direction_output(gc, gpio, val);
87 static int mpc5125_gpio_dir_out(struct gpio_chip *gc,
90 struct mpc8xxx_gpio_chip *mpc8xxx_gc = gpiochip_get_data(gc);
95 return mpc8xxx_gc->direction_output(gc, gpio, val);
98 static int mpc8xxx_gpio_to_irq(struct gpio_chip *gc, unsigned offset)
100 struct mpc8xxx_gpio_chip *mpc8xxx_gc = gpiochip_get_data(gc);
111 struct gpio_chip *gc = &mpc8xxx_gc->gc;
115 mask = gc->read_reg(mpc8xxx_gc->regs + GPIO_IER)
116 & gc->read_reg(mpc8xxx_gc->regs + GPIO_IMR);
126 struct gpio_chip *gc = &mpc8xxx_gc->gc;
131 gc->write_reg(mpc8xxx_gc->regs + GPIO_IMR,
132 gc->read_reg(mpc8xxx_gc->regs + GPIO_IMR)
141 struct gpio_chip *gc = &mpc8xxx_gc->gc;
146 gc->write_reg(mpc8xxx_gc->regs + GPIO_IMR,
147 gc->read_reg(mpc8xxx_gc->regs + GPIO_IMR)
156 struct gpio_chip *gc = &mpc8xxx_gc->gc;
158 gc->write_reg(mpc8xxx_gc->regs + GPIO_IER,
165 struct gpio_chip *gc = &mpc8xxx_gc->gc;
172 gc->write_reg(mpc8xxx_gc->regs + GPIO_ICR,
173 gc->read_reg(mpc8xxx_gc->regs + GPIO_ICR)
180 gc->write_reg(mpc8xxx_gc->regs + GPIO_ICR,
181 gc->read_reg(mpc8xxx_gc->regs + GPIO_ICR)
196 struct gpio_chip *gc = &mpc8xxx_gc->gc;
214 gc->write_reg(reg, (gc->read_reg(reg) & ~(3 << shift))
222 gc->write_reg(reg, (gc->read_reg(reg) & ~(3 << shift))
229 gc->write_reg(reg, (gc->read_reg(reg) & ~(3 << shift)));
307 struct gpio_chip *gc;
322 gc = &mpc8xxx_gc->gc;
323 gc->parent = dev;
326 ret = bgpio_init(gc, dev, 4, mpc8xxx_gc->regs + GPIO_DAT,
333 ret = bgpio_init(gc, dev, 4, mpc8xxx_gc->regs + GPIO_DAT,
342 mpc8xxx_gc->direction_output = gc->direction_output;
356 gc->direction_output = devtype->gpio_dir_out;
358 gc->get = devtype->gpio_get;
360 gc->to_irq = mpc8xxx_gpio_to_irq;
374 gc->write_reg(mpc8xxx_gc->regs + GPIO_IBE, 0xffffffff);
376 gc->bgpio_data = gc->read_reg(mpc8xxx_gc->regs + GPIO_DAT) &
377 gc->read_reg(mpc8xxx_gc->regs + GPIO_DIR);
380 ret = devm_gpiochip_add_data(dev, gc, mpc8xxx_gc);
400 gc->write_reg(mpc8xxx_gc->regs + GPIO_IER, 0xffffffff);
401 gc->write_reg(mpc8xxx_gc->regs + GPIO_IMR, 0);