Lines Matching refs:gc

26 	struct gpio_chip gc;
54 static int rpi_exp_gpio_get_polarity(struct gpio_chip *gc, unsigned int off)
60 gpio = gpiochip_get_data(gc);
67 dev_err(gc->parent, "Failed to get GPIO %u config (%d %x)\n",
74 static int rpi_exp_gpio_dir_in(struct gpio_chip *gc, unsigned int off)
80 gpio = gpiochip_get_data(gc);
88 ret = rpi_exp_gpio_get_polarity(gc, off);
96 dev_err(gc->parent, "Failed to set GPIO %u to input (%d %x)\n",
103 static int rpi_exp_gpio_dir_out(struct gpio_chip *gc, unsigned int off, int val)
109 gpio = gpiochip_get_data(gc);
117 ret = rpi_exp_gpio_get_polarity(gc, off);
125 dev_err(gc->parent, "Failed to set GPIO %u to output (%d %x)\n",
132 static int rpi_exp_gpio_get_direction(struct gpio_chip *gc, unsigned int off)
138 gpio = gpiochip_get_data(gc);
145 dev_err(gc->parent,
156 static int rpi_exp_gpio_get(struct gpio_chip *gc, unsigned int off)
162 gpio = gpiochip_get_data(gc);
170 dev_err(gc->parent,
178 static void rpi_exp_gpio_set(struct gpio_chip *gc, unsigned int off, int val)
184 gpio = gpiochip_get_data(gc);
192 dev_err(gc->parent,
221 rpi_gpio->gc.parent = dev;
222 rpi_gpio->gc.label = MODULE_NAME;
223 rpi_gpio->gc.owner = THIS_MODULE;
224 rpi_gpio->gc.of_node = np;
225 rpi_gpio->gc.base = -1;
226 rpi_gpio->gc.ngpio = NUM_GPIO;
228 rpi_gpio->gc.direction_input = rpi_exp_gpio_dir_in;
229 rpi_gpio->gc.direction_output = rpi_exp_gpio_dir_out;
230 rpi_gpio->gc.get_direction = rpi_exp_gpio_get_direction;
231 rpi_gpio->gc.get = rpi_exp_gpio_get;
232 rpi_gpio->gc.set = rpi_exp_gpio_set;
233 rpi_gpio->gc.can_sleep = true;
235 return devm_gpiochip_add_data(dev, &rpi_gpio->gc, rpi_gpio);