Lines Matching refs:sub_led
130 struct max77693_sub_led *sub_led) in sub_led_to_led() argument
132 return container_of(sub_led, struct max77693_led_device, in sub_led_to_led()
133 sub_leds[sub_led->fled_id]); in sub_led_to_led()
359 static int max77693_get_flash_faults(struct max77693_sub_led *sub_led) in max77693_get_flash_faults() argument
361 struct max77693_led_device *led = sub_led_to_led(sub_led); in max77693_get_flash_faults()
367 sub_led->flash_faults = 0; in max77693_get_flash_faults()
374 fault_open_mask = (sub_led->fled_id == FLED1) ? in max77693_get_flash_faults()
377 fault_short_mask = (sub_led->fled_id == FLED1) ? in max77693_get_flash_faults()
387 sub_led->flash_faults |= LED_FAULT_OVER_VOLTAGE; in max77693_get_flash_faults()
389 sub_led->flash_faults |= LED_FAULT_SHORT_CIRCUIT; in max77693_get_flash_faults()
391 sub_led->flash_faults |= LED_FAULT_OVER_CURRENT; in max77693_get_flash_faults()
503 struct max77693_sub_led *sub_led = in max77693_led_brightness_set_work() local
506 struct max77693_led_device *led = sub_led_to_led(sub_led); in max77693_led_brightness_set_work()
508 __max77693_led_brightness_set(led, sub_led->fled_id, in max77693_led_brightness_set_work()
509 sub_led->torch_brightness); in max77693_led_brightness_set_work()
519 struct max77693_sub_led *sub_led = flcdev_to_sub_led(fled_cdev); in max77693_led_brightness_set_sync() local
520 struct max77693_led_device *led = sub_led_to_led(sub_led); in max77693_led_brightness_set_sync()
522 return __max77693_led_brightness_set(led, sub_led->fled_id, value); in max77693_led_brightness_set_sync()
530 struct max77693_sub_led *sub_led = flcdev_to_sub_led(fled_cdev); in max77693_led_brightness_set() local
532 sub_led->torch_brightness = value; in max77693_led_brightness_set()
533 schedule_work(&sub_led->work_brightness_set); in max77693_led_brightness_set()
540 struct max77693_sub_led *sub_led = flcdev_to_sub_led(fled_cdev); in max77693_led_flash_brightness_set() local
541 struct max77693_led_device *led = sub_led_to_led(sub_led); in max77693_led_flash_brightness_set()
545 ret = max77693_set_flash_current(led, sub_led->fled_id, brightness); in max77693_led_flash_brightness_set()
555 struct max77693_sub_led *sub_led = flcdev_to_sub_led(fled_cdev); in max77693_led_flash_strobe_set() local
556 struct max77693_led_device *led = sub_led_to_led(sub_led); in max77693_led_flash_strobe_set()
557 int fled_id = sub_led->fled_id; in max77693_led_flash_strobe_set()
567 if (sub_led->flash_timeout != led->current_flash_timeout) { in max77693_led_flash_strobe_set()
568 ret = max77693_set_timeout(led, sub_led->flash_timeout); in max77693_led_flash_strobe_set()
579 ret = max77693_get_flash_faults(sub_led); in max77693_led_flash_strobe_set()
590 struct max77693_sub_led *sub_led = flcdev_to_sub_led(fled_cdev); in max77693_led_flash_fault_get() local
592 *fault = sub_led->flash_faults; in max77693_led_flash_fault_get()
601 struct max77693_sub_led *sub_led = flcdev_to_sub_led(fled_cdev); in max77693_led_flash_strobe_get() local
602 struct max77693_led_device *led = sub_led_to_led(sub_led); in max77693_led_flash_strobe_get()
612 *state = !!(*state && (led->strobing_sub_led_id == sub_led->fled_id)); in max77693_led_flash_strobe_get()
623 struct max77693_sub_led *sub_led = flcdev_to_sub_led(fled_cdev); in max77693_led_flash_timeout_set() local
624 struct max77693_led_device *led = sub_led_to_led(sub_led); in max77693_led_flash_timeout_set()
627 sub_led->flash_timeout = timeout; in max77693_led_flash_timeout_set()
828 static void max77693_init_flash_settings(struct max77693_sub_led *sub_led, in max77693_init_flash_settings() argument
831 struct led_classdev_flash *fled_cdev = &sub_led->fled_cdev; in max77693_init_flash_settings()
832 struct max77693_led_device *led = sub_led_to_led(sub_led); in max77693_init_flash_settings()
833 int fled_id = sub_led->fled_id; in max77693_init_flash_settings()
860 struct max77693_sub_led *sub_led = in max77693_led_external_strobe_set() local
862 struct max77693_led_device *led = sub_led_to_led(sub_led); in max77693_led_external_strobe_set()
863 int fled_id = sub_led->fled_id; in max77693_led_external_strobe_set()
878 static void max77693_init_v4l2_flash_config(struct max77693_sub_led *sub_led, in max77693_init_v4l2_flash_config() argument
882 struct max77693_led_device *led = sub_led_to_led(sub_led); in max77693_init_v4l2_flash_config()
889 "%s %d-%04x", sub_led->fled_cdev.led_cdev.name, in max77693_init_v4l2_flash_config()
894 s->max = sub_led->fled_cdev.led_cdev.max_brightness * TORCH_IOUT_STEP; in max77693_init_v4l2_flash_config()
911 struct max77693_sub_led *sub_led, in max77693_init_v4l2_flash_config() argument
919 static void max77693_init_fled_cdev(struct max77693_sub_led *sub_led, in max77693_init_fled_cdev() argument
922 struct max77693_led_device *led = sub_led_to_led(sub_led); in max77693_init_fled_cdev()
923 int fled_id = sub_led->fled_id; in max77693_init_fled_cdev()
928 fled_cdev = &sub_led->fled_cdev; in max77693_init_fled_cdev()
942 INIT_WORK(&sub_led->work_brightness_set, in max77693_init_fled_cdev()
945 max77693_init_flash_settings(sub_led, led_cfg); in max77693_init_fled_cdev()
948 sub_led->flash_timeout = fled_cdev->timeout.val; in max77693_init_fled_cdev()
951 static int max77693_register_led(struct max77693_sub_led *sub_led, in max77693_register_led() argument
955 struct max77693_led_device *led = sub_led_to_led(sub_led); in max77693_register_led()
956 struct led_classdev_flash *fled_cdev = &sub_led->fled_cdev; in max77693_register_led()
966 max77693_init_v4l2_flash_config(sub_led, led_cfg, &v4l2_sd_cfg); in max77693_register_led()
969 sub_led->v4l2_flash = v4l2_flash_init(dev, sub_node, fled_cdev, NULL, in max77693_register_led()
971 if (IS_ERR(sub_led->v4l2_flash)) { in max77693_register_led()
972 ret = PTR_ERR(sub_led->v4l2_flash); in max77693_register_led()