Lines Matching refs:gc

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