Commit 313bf0b1a0eaeaac17ea8c4b748f16e28fce8b7a

Authored by Kim, Milo
Committed by Bryan Wu
1 parent 48a1d032c9

leds: lm355x, lm3642: support camera LED triggers for flash and torch

LM355x and LM3642 support flash and torch functionality.

 (Camera driver)          (LED trigger for camera)       (LED driver)
 Turn on the flash  ...>  ledtrig_flash_ctrl(true) ...>  LM355x or LM3642
                                                         brightness ctrl
                                                       <actual driving here>

Flash/torch LEDs are controlled by other driver using LED camera trigger
APIs, ledtrig_flash_ctrl()/ledtrig_torch_ctrl().
Then, actual device control is activated by each LED driver such like
LM355x or LM3642.

Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com>
Signed-off-by: Bryan Wu <cooloney@gmail.com>

Showing 2 changed files with 4 additions and 0 deletions Side-by-side Diff

drivers/leds/leds-lm355x.c
... ... @@ -477,6 +477,7 @@
477 477 chip->cdev_flash.name = "flash";
478 478 chip->cdev_flash.max_brightness = 16;
479 479 chip->cdev_flash.brightness_set = lm355x_strobe_brightness_set;
  480 + chip->cdev_flash.default_trigger = "flash";
480 481 err = led_classdev_register((struct device *)
481 482 &client->dev, &chip->cdev_flash);
482 483 if (err < 0)
... ... @@ -486,6 +487,7 @@
486 487 chip->cdev_torch.name = "torch";
487 488 chip->cdev_torch.max_brightness = 8;
488 489 chip->cdev_torch.brightness_set = lm355x_torch_brightness_set;
  490 + chip->cdev_torch.default_trigger = "torch";
489 491 err = led_classdev_register((struct device *)
490 492 &client->dev, &chip->cdev_torch);
491 493 if (err < 0)
drivers/leds/leds-lm3642.c
... ... @@ -363,6 +363,7 @@
363 363 chip->cdev_flash.name = "flash";
364 364 chip->cdev_flash.max_brightness = 16;
365 365 chip->cdev_flash.brightness_set = lm3642_strobe_brightness_set;
  366 + chip->cdev_flash.default_trigger = "flash";
366 367 err = led_classdev_register((struct device *)
367 368 &client->dev, &chip->cdev_flash);
368 369 if (err < 0) {
... ... @@ -380,6 +381,7 @@
380 381 chip->cdev_torch.name = "torch";
381 382 chip->cdev_torch.max_brightness = 8;
382 383 chip->cdev_torch.brightness_set = lm3642_torch_brightness_set;
  384 + chip->cdev_torch.default_trigger = "torch";
383 385 err = led_classdev_register((struct device *)
384 386 &client->dev, &chip->cdev_torch);
385 387 if (err < 0) {