• Home
  • Raw
  • Download

Lines Matching refs:fwd

309 	struct gpiochip_fwd *fwd = gpiochip_get_data(chip);  in gpio_fwd_get_direction()  local
311 return gpiod_get_direction(fwd->descs[offset]); in gpio_fwd_get_direction()
316 struct gpiochip_fwd *fwd = gpiochip_get_data(chip); in gpio_fwd_direction_input() local
318 return gpiod_direction_input(fwd->descs[offset]); in gpio_fwd_direction_input()
324 struct gpiochip_fwd *fwd = gpiochip_get_data(chip); in gpio_fwd_direction_output() local
326 return gpiod_direction_output(fwd->descs[offset], value); in gpio_fwd_direction_output()
331 struct gpiochip_fwd *fwd = gpiochip_get_data(chip); in gpio_fwd_get() local
333 return chip->can_sleep ? gpiod_get_value_cansleep(fwd->descs[offset]) in gpio_fwd_get()
334 : gpiod_get_value(fwd->descs[offset]); in gpio_fwd_get()
337 static int gpio_fwd_get_multiple(struct gpiochip_fwd *fwd, unsigned long *mask, in gpio_fwd_get_multiple() argument
346 values = &fwd->tmp[0]; in gpio_fwd_get_multiple()
347 descs = (void *)&fwd->tmp[BITS_TO_LONGS(fwd->chip.ngpio)]; in gpio_fwd_get_multiple()
349 bitmap_clear(values, 0, fwd->chip.ngpio); in gpio_fwd_get_multiple()
350 for_each_set_bit(i, mask, fwd->chip.ngpio) in gpio_fwd_get_multiple()
351 descs[j++] = fwd->descs[i]; in gpio_fwd_get_multiple()
353 if (fwd->chip.can_sleep) in gpio_fwd_get_multiple()
361 for_each_set_bit(i, mask, fwd->chip.ngpio) in gpio_fwd_get_multiple()
370 struct gpiochip_fwd *fwd = gpiochip_get_data(chip); in gpio_fwd_get_multiple_locked() local
375 mutex_lock(&fwd->mlock); in gpio_fwd_get_multiple_locked()
376 error = gpio_fwd_get_multiple(fwd, mask, bits); in gpio_fwd_get_multiple_locked()
377 mutex_unlock(&fwd->mlock); in gpio_fwd_get_multiple_locked()
379 spin_lock_irqsave(&fwd->slock, flags); in gpio_fwd_get_multiple_locked()
380 error = gpio_fwd_get_multiple(fwd, mask, bits); in gpio_fwd_get_multiple_locked()
381 spin_unlock_irqrestore(&fwd->slock, flags); in gpio_fwd_get_multiple_locked()
389 struct gpiochip_fwd *fwd = gpiochip_get_data(chip); in gpio_fwd_set() local
392 gpiod_set_value_cansleep(fwd->descs[offset], value); in gpio_fwd_set()
394 gpiod_set_value(fwd->descs[offset], value); in gpio_fwd_set()
397 static void gpio_fwd_set_multiple(struct gpiochip_fwd *fwd, unsigned long *mask, in gpio_fwd_set_multiple() argument
405 values = &fwd->tmp[0]; in gpio_fwd_set_multiple()
406 descs = (void *)&fwd->tmp[BITS_TO_LONGS(fwd->chip.ngpio)]; in gpio_fwd_set_multiple()
408 for_each_set_bit(i, mask, fwd->chip.ngpio) { in gpio_fwd_set_multiple()
410 descs[j++] = fwd->descs[i]; in gpio_fwd_set_multiple()
413 if (fwd->chip.can_sleep) in gpio_fwd_set_multiple()
422 struct gpiochip_fwd *fwd = gpiochip_get_data(chip); in gpio_fwd_set_multiple_locked() local
426 mutex_lock(&fwd->mlock); in gpio_fwd_set_multiple_locked()
427 gpio_fwd_set_multiple(fwd, mask, bits); in gpio_fwd_set_multiple_locked()
428 mutex_unlock(&fwd->mlock); in gpio_fwd_set_multiple_locked()
430 spin_lock_irqsave(&fwd->slock, flags); in gpio_fwd_set_multiple_locked()
431 gpio_fwd_set_multiple(fwd, mask, bits); in gpio_fwd_set_multiple_locked()
432 spin_unlock_irqrestore(&fwd->slock, flags); in gpio_fwd_set_multiple_locked()
439 struct gpiochip_fwd *fwd = gpiochip_get_data(chip); in gpio_fwd_set_config() local
441 return gpiod_set_config(fwd->descs[offset], config); in gpio_fwd_set_config()
463 struct gpiochip_fwd *fwd; in gpiochip_fwd_create() local
468 fwd = devm_kzalloc(dev, struct_size(fwd, tmp, in gpiochip_fwd_create()
470 if (!fwd) in gpiochip_fwd_create()
473 chip = &fwd->chip; in gpiochip_fwd_create()
504 fwd->descs = descs; in gpiochip_fwd_create()
507 mutex_init(&fwd->mlock); in gpiochip_fwd_create()
509 spin_lock_init(&fwd->slock); in gpiochip_fwd_create()
511 error = devm_gpiochip_add_data(dev, chip, fwd); in gpiochip_fwd_create()
515 return fwd; in gpiochip_fwd_create()
527 struct gpiochip_fwd *fwd; in gpio_aggregator_probe() local
544 fwd = gpiochip_fwd_create(dev, n, descs); in gpio_aggregator_probe()
545 if (IS_ERR(fwd)) in gpio_aggregator_probe()
546 return PTR_ERR(fwd); in gpio_aggregator_probe()
548 platform_set_drvdata(pdev, fwd); in gpio_aggregator_probe()