Lines Matching refs:gc
22 struct gpio_chip gc; member
31 #define to_gpio_reg(x) container_of(x, struct gpio_reg, gc)
33 static int gpio_reg_get_direction(struct gpio_chip *gc, unsigned offset) in gpio_reg_get_direction() argument
35 struct gpio_reg *r = to_gpio_reg(gc); in gpio_reg_get_direction()
41 static int gpio_reg_direction_output(struct gpio_chip *gc, unsigned offset, in gpio_reg_direction_output() argument
44 struct gpio_reg *r = to_gpio_reg(gc); in gpio_reg_direction_output()
49 gc->set(gc, offset, value); in gpio_reg_direction_output()
53 static int gpio_reg_direction_input(struct gpio_chip *gc, unsigned offset) in gpio_reg_direction_input() argument
55 struct gpio_reg *r = to_gpio_reg(gc); in gpio_reg_direction_input()
60 static void gpio_reg_set(struct gpio_chip *gc, unsigned offset, int value) in gpio_reg_set() argument
62 struct gpio_reg *r = to_gpio_reg(gc); in gpio_reg_set()
77 static int gpio_reg_get(struct gpio_chip *gc, unsigned offset) in gpio_reg_get() argument
79 struct gpio_reg *r = to_gpio_reg(gc); in gpio_reg_get()
95 static void gpio_reg_set_multiple(struct gpio_chip *gc, unsigned long *mask, in gpio_reg_set_multiple() argument
98 struct gpio_reg *r = to_gpio_reg(gc); in gpio_reg_set_multiple()
107 static int gpio_reg_to_irq(struct gpio_chip *gc, unsigned offset) in gpio_reg_to_irq() argument
109 struct gpio_reg *r = to_gpio_reg(gc); in gpio_reg_to_irq()
156 r->gc.label = label; in gpio_reg_init()
157 r->gc.get_direction = gpio_reg_get_direction; in gpio_reg_init()
158 r->gc.direction_input = gpio_reg_direction_input; in gpio_reg_init()
159 r->gc.direction_output = gpio_reg_direction_output; in gpio_reg_init()
160 r->gc.set = gpio_reg_set; in gpio_reg_init()
161 r->gc.get = gpio_reg_get; in gpio_reg_init()
162 r->gc.set_multiple = gpio_reg_set_multiple; in gpio_reg_init()
164 r->gc.to_irq = gpio_reg_to_irq; in gpio_reg_init()
165 r->gc.base = base; in gpio_reg_init()
166 r->gc.ngpio = num; in gpio_reg_init()
167 r->gc.names = names; in gpio_reg_init()
174 ret = devm_gpiochip_add_data(dev, &r->gc, r); in gpio_reg_init()
176 ret = gpiochip_add_data(&r->gc, r); in gpio_reg_init()
178 return ret ? ERR_PTR(ret) : &r->gc; in gpio_reg_init()
181 int gpio_reg_resume(struct gpio_chip *gc) in gpio_reg_resume() argument
183 struct gpio_reg *r = to_gpio_reg(gc); in gpio_reg_resume()