Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'led_fixes-4.14-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds

Pull LED fixes from Jacek Anaszewski:
"Four fixes for the as3645a LED flash controller and one update to
MAINTAINERS"

* tag 'led_fixes-4.14-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds:
MAINTAINERS: Add entry for MediaTek PMIC LED driver
as3645a: Unregister indicator LED on device unbind
as3645a: Use integer numbers for parsing LEDs
dt: bindings: as3645a: Use LED number to refer to LEDs
as3645a: Use ams,input-max-microamp as documented in DT bindings

+57 -16
+18 -10
Documentation/devicetree/bindings/leds/ams,as3645a.txt
··· 15 15 16 16 compatible : Must be "ams,as3645a". 17 17 reg : The I2C address of the device. Typically 0x30. 18 + #address-cells : 1 19 + #size-cells : 0 18 20 19 21 20 - Required properties of the "flash" child node 21 - ============================================= 22 + Required properties of the flash child node (0) 23 + =============================================== 22 24 25 + reg: 0 23 26 flash-timeout-us: Flash timeout in microseconds. The value must be in 24 27 the range [100000, 850000] and divisible by 50000. 25 28 flash-max-microamp: Maximum flash current in microamperes. Has to be ··· 36 33 and divisible by 50000. 37 34 38 35 39 - Optional properties of the "flash" child node 40 - ============================================= 36 + Optional properties of the flash child node 37 + =========================================== 41 38 42 39 label : The label of the flash LED. 43 40 44 41 45 - Required properties of the "indicator" child node 46 - ================================================= 42 + Required properties of the indicator child node (1) 43 + =================================================== 47 44 45 + reg: 1 48 46 led-max-microamp: Maximum indicator current. The allowed values are 49 47 2500, 5000, 7500 and 10000. 50 48 51 - Optional properties of the "indicator" child node 52 - ================================================= 49 + Optional properties of the indicator child node 50 + =============================================== 53 51 54 52 label : The label of the indicator LED. 55 53 ··· 59 55 ======= 60 56 61 57 as3645a@30 { 58 + #address-cells: 1 59 + #size-cells: 0 62 60 reg = <0x30>; 63 61 compatible = "ams,as3645a"; 64 - flash { 62 + flash@0 { 63 + reg = <0x0>; 65 64 flash-timeout-us = <150000>; 66 65 flash-max-microamp = <320000>; 67 66 led-max-microamp = <60000>; 68 67 ams,input-max-microamp = <1750000>; 69 68 label = "as3645a:flash"; 70 69 }; 71 - indicator { 70 + indicator@1 { 71 + reg = <0x1>; 72 72 led-max-microamp = <10000>; 73 73 label = "as3645a:indicator"; 74 74 };
+6
MAINTAINERS
··· 8597 8597 S: Maintained 8598 8598 F: drivers/media/rc/mtk-cir.c 8599 8599 8600 + MEDIATEK PMIC LED DRIVER 8601 + M: Sean Wang <sean.wang@mediatek.com> 8602 + S: Maintained 8603 + F: drivers/leds/leds-mt6323.c 8604 + F: Documentation/devicetree/bindings/leds/leds-mt6323.txt 8605 + 8600 8606 MEDIATEK ETHERNET DRIVER 8601 8607 M: Felix Fietkau <nbd@openwrt.org> 8602 8608 M: John Crispin <john@phrozen.org>
+7 -3
arch/arm/boot/dts/omap3-n950-n9.dtsi
··· 267 267 clock-frequency = <400000>; 268 268 269 269 as3645a@30 { 270 + #address-cells = <1>; 271 + #size-cells = <0>; 270 272 reg = <0x30>; 271 273 compatible = "ams,as3645a"; 272 - flash { 274 + flash@0 { 275 + reg = <0x0>; 273 276 flash-timeout-us = <150000>; 274 277 flash-max-microamp = <320000>; 275 278 led-max-microamp = <60000>; 276 - peak-current-limit = <1750000>; 279 + ams,input-max-microamp = <1750000>; 277 280 }; 278 - indicator { 281 + indicator@1 { 282 + reg = <0x1>; 279 283 led-max-microamp = <10000>; 280 284 }; 281 285 };
+26 -3
drivers/leds/leds-as3645a.c
··· 112 112 #define AS_PEAK_mA_TO_REG(a) \ 113 113 ((min_t(u32, AS_PEAK_mA_MAX, a) - 1250) / 250) 114 114 115 + /* LED numbers for Devicetree */ 116 + #define AS_LED_FLASH 0 117 + #define AS_LED_INDICATOR 1 118 + 115 119 enum as_mode { 116 120 AS_MODE_EXT_TORCH = 0 << AS_CONTROL_MODE_SETTING_SHIFT, 117 121 AS_MODE_INDICATOR = 1 << AS_CONTROL_MODE_SETTING_SHIFT, ··· 495 491 struct device_node *node) 496 492 { 497 493 struct as3645a_config *cfg = &flash->cfg; 494 + struct device_node *child; 498 495 const char *name; 499 496 int rval; 500 497 501 - flash->flash_node = of_get_child_by_name(node, "flash"); 498 + for_each_child_of_node(node, child) { 499 + u32 id = 0; 500 + 501 + of_property_read_u32(child, "reg", &id); 502 + 503 + switch (id) { 504 + case AS_LED_FLASH: 505 + flash->flash_node = of_node_get(child); 506 + break; 507 + case AS_LED_INDICATOR: 508 + flash->indicator_node = of_node_get(child); 509 + break; 510 + default: 511 + dev_warn(&flash->client->dev, 512 + "unknown LED %u encountered, ignoring\n", id); 513 + break; 514 + } 515 + } 516 + 502 517 if (!flash->flash_node) { 503 518 dev_err(&flash->client->dev, "can't find flash node\n"); 504 519 return -ENODEV; ··· 557 534 of_property_read_u32(flash->flash_node, "voltage-reference", 558 535 &cfg->voltage_reference); 559 536 560 - of_property_read_u32(flash->flash_node, "peak-current-limit", 537 + of_property_read_u32(flash->flash_node, "ams,input-max-microamp", 561 538 &cfg->peak); 562 539 cfg->peak = AS_PEAK_mA_TO_REG(cfg->peak); 563 540 564 - flash->indicator_node = of_get_child_by_name(node, "indicator"); 565 541 if (!flash->indicator_node) { 566 542 dev_warn(&flash->client->dev, 567 543 "can't find indicator node\n"); ··· 743 721 as3645a_set_control(flash, AS_MODE_EXT_TORCH, false); 744 722 745 723 v4l2_flash_release(flash->vf); 724 + v4l2_flash_release(flash->vfind); 746 725 747 726 led_classdev_flash_unregister(&flash->fled); 748 727 led_classdev_unregister(&flash->iled_cdev);