Lines Matching refs:gc

54 	struct gpio_chip gc;  member
93 static int gpio_mockup_get(struct gpio_chip *gc, unsigned int offset) in gpio_mockup_get() argument
95 struct gpio_mockup_chip *chip = gpiochip_get_data(gc); in gpio_mockup_get()
105 static int gpio_mockup_get_multiple(struct gpio_chip *gc, in gpio_mockup_get_multiple() argument
108 struct gpio_mockup_chip *chip = gpiochip_get_data(gc); in gpio_mockup_get_multiple()
112 for_each_set_bit(bit, mask, gc->ngpio) { in gpio_mockup_get_multiple()
127 static void gpio_mockup_set(struct gpio_chip *gc, in gpio_mockup_set() argument
130 struct gpio_mockup_chip *chip = gpiochip_get_data(gc); in gpio_mockup_set()
137 static void gpio_mockup_set_multiple(struct gpio_chip *gc, in gpio_mockup_set_multiple() argument
140 struct gpio_mockup_chip *chip = gpiochip_get_data(gc); in gpio_mockup_set_multiple()
144 for_each_set_bit(bit, mask, gc->ngpio) in gpio_mockup_set_multiple()
149 static int gpio_mockup_dirout(struct gpio_chip *gc, in gpio_mockup_dirout() argument
152 struct gpio_mockup_chip *chip = gpiochip_get_data(gc); in gpio_mockup_dirout()
162 static int gpio_mockup_dirin(struct gpio_chip *gc, unsigned int offset) in gpio_mockup_dirin() argument
164 struct gpio_mockup_chip *chip = gpiochip_get_data(gc); in gpio_mockup_dirin()
173 static int gpio_mockup_get_direction(struct gpio_chip *gc, unsigned int offset) in gpio_mockup_get_direction() argument
175 struct gpio_mockup_chip *chip = gpiochip_get_data(gc); in gpio_mockup_get_direction()
185 static int gpio_mockup_to_irq(struct gpio_chip *gc, unsigned int offset) in gpio_mockup_to_irq() argument
187 struct gpio_mockup_chip *chip = gpiochip_get_data(gc); in gpio_mockup_to_irq()
192 static void gpio_mockup_free(struct gpio_chip *gc, unsigned int offset) in gpio_mockup_free() argument
194 struct gpio_mockup_chip *chip = gpiochip_get_data(gc); in gpio_mockup_free()
206 struct gpio_chip *gc; in gpio_mockup_debugfs_read() local
216 gc = &chip->gc; in gpio_mockup_debugfs_read()
218 val = gpio_mockup_get(gc, priv->offset); in gpio_mockup_debugfs_read()
233 struct gpio_chip *gc; in gpio_mockup_debugfs_write() local
248 gc = &chip->gc; in gpio_mockup_debugfs_write()
249 desc = &gc->gpiodev->descs[priv->offset]; in gpio_mockup_debugfs_write()
319 struct gpio_chip *gc; in gpio_mockup_debugfs_setup() local
324 gc = &chip->gc; in gpio_mockup_debugfs_setup()
325 devname = dev_name(&gc->gpiodev->dev); in gpio_mockup_debugfs_setup()
329 for (i = 0; i < gc->ngpio; i++) { in gpio_mockup_debugfs_setup()
340 priv->desc = &gc->gpiodev->descs[i]; in gpio_mockup_debugfs_setup()
352 struct gpio_chip *gc = &chip->gc; in gpio_mockup_name_lines() local
356 names = devm_kcalloc(dev, gc->ngpio, sizeof(char *), GFP_KERNEL); in gpio_mockup_name_lines()
360 for (i = 0; i < gc->ngpio; i++) { in gpio_mockup_name_lines()
362 "%s-%d", gc->label, i); in gpio_mockup_name_lines()
367 gc->names = (const char *const *)names; in gpio_mockup_name_lines()
375 struct gpio_chip *gc; in gpio_mockup_probe() local
408 gc = &chip->gc; in gpio_mockup_probe()
409 gc->base = base; in gpio_mockup_probe()
410 gc->ngpio = ngpio; in gpio_mockup_probe()
411 gc->label = name; in gpio_mockup_probe()
412 gc->owner = THIS_MODULE; in gpio_mockup_probe()
413 gc->parent = dev; in gpio_mockup_probe()
414 gc->get = gpio_mockup_get; in gpio_mockup_probe()
415 gc->set = gpio_mockup_set; in gpio_mockup_probe()
416 gc->get_multiple = gpio_mockup_get_multiple; in gpio_mockup_probe()
417 gc->set_multiple = gpio_mockup_set_multiple; in gpio_mockup_probe()
418 gc->direction_output = gpio_mockup_dirout; in gpio_mockup_probe()
419 gc->direction_input = gpio_mockup_dirin; in gpio_mockup_probe()
420 gc->get_direction = gpio_mockup_get_direction; in gpio_mockup_probe()
421 gc->to_irq = gpio_mockup_to_irq; in gpio_mockup_probe()
422 gc->free = gpio_mockup_free; in gpio_mockup_probe()
424 chip->lines = devm_kcalloc(dev, gc->ngpio, in gpio_mockup_probe()
435 rv = devm_irq_sim_init(dev, &chip->irqsim, gc->ngpio); in gpio_mockup_probe()
439 rv = devm_gpiochip_add_data(dev, &chip->gc, chip); in gpio_mockup_probe()