Lines Matching defs:gc
81 * @gc: gpio_chip instance structure; used when GPIO is enabled
97 struct gpio_chip gc;
281 static inline struct mpc52xx_gpt_priv *gc_to_mpc52xx_gpt(struct gpio_chip *gc)
283 return container_of(gc, struct mpc52xx_gpt_priv, gc);
286 static int mpc52xx_gpt_gpio_get(struct gpio_chip *gc, unsigned int gpio)
288 struct mpc52xx_gpt_priv *gpt = gc_to_mpc52xx_gpt(gc);
294 mpc52xx_gpt_gpio_set(struct gpio_chip *gc, unsigned int gpio, int v)
296 struct mpc52xx_gpt_priv *gpt = gc_to_mpc52xx_gpt(gc);
308 static int mpc52xx_gpt_gpio_dir_in(struct gpio_chip *gc, unsigned int gpio)
310 struct mpc52xx_gpt_priv *gpt = gc_to_mpc52xx_gpt(gc);
323 mpc52xx_gpt_gpio_dir_out(struct gpio_chip *gc, unsigned int gpio, int val)
325 mpc52xx_gpt_gpio_set(gc, gpio, val);
339 gpt->gc.label = kstrdup(node->full_name, GFP_KERNEL);
340 if (!gpt->gc.label) {
345 gpt->gc.ngpio = 1;
346 gpt->gc.direction_input = mpc52xx_gpt_gpio_dir_in;
347 gpt->gc.direction_output = mpc52xx_gpt_gpio_dir_out;
348 gpt->gc.get = mpc52xx_gpt_gpio_get;
349 gpt->gc.set = mpc52xx_gpt_gpio_set;
350 gpt->gc.base = -1;
351 gpt->gc.of_node = node;
357 rc = gpiochip_add(&gpt->gc);