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

Merge tag 'leds-5.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds

Pull LED updates from Pavel Machek:
"Nothing too exciting here, just some fixes"

* tag 'leds-5.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds:
leds: pca9532: Assign gpio base dynamically
leds: trigger: pattern: Switch to using the new API kobj_to_dev()
leds: LEDS_BLINK_LGM should depend on X86
leds: lgm: Fix spelling mistake "prepate" -> "prepare"
MAINTAINERS: Remove Dan Murphy's bouncing email
leds-lm3642: convert comma to semicolon
leds: rt4505: Add support for Richtek RT4505 flash LED controller
leds: rt4505: Add DT binding document for Richtek RT4505
leds: Kconfig: LEDS_CLASS is usually selected.
leds: lgm: Improve Kconfig help
leds: lgm: fix gpiolib dependency

+525 -28
+57
Documentation/devicetree/bindings/leds/leds-rt4505.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/leds/leds-rt4505.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Richtek RT4505 Single Channel LED Driver 8 + 9 + maintainers: 10 + - ChiYuan Huang <cy_huang@richtek.com> 11 + 12 + description: | 13 + The RT4505 is a flash LED driver that can support up to 375mA and 1.5A for 14 + torch and flash mode, respectively. 15 + 16 + The data sheet can be found at: 17 + https://www.richtek.com/assets/product_file/RT4505/DS4505-02.pdf 18 + 19 + properties: 20 + compatible: 21 + const: richtek,rt4505 22 + 23 + reg: 24 + description: I2C slave address of the controller. 25 + maxItems: 1 26 + 27 + led: 28 + type: object 29 + $ref: common.yaml# 30 + 31 + required: 32 + - compatible 33 + - reg 34 + 35 + additionalProperties: false 36 + 37 + examples: 38 + - | 39 + #include <dt-bindings/leds/common.h> 40 + 41 + i2c0 { 42 + #address-cells = <1>; 43 + #size-cells = <0>; 44 + 45 + led-controller@63 { 46 + compatible = "richtek,rt4505"; 47 + reg = <0x63>; 48 + 49 + rt4505_flash: led { 50 + function = LED_FUNCTION_FLASH; 51 + color = <LED_COLOR_ID_WHITE>; 52 + led-max-microamp = <375000>; 53 + flash-max-microamp = <1500000>; 54 + flash-max-timeout-us = <800000>; 55 + }; 56 + }; 57 + };
+3 -4
drivers/leds/Kconfig
··· 18 18 tristate "LED Class Support" 19 19 help 20 20 This option enables the LED sysfs class in /sys/class/leds. You'll 21 - need this to do anything useful with LEDs. If unsure, say N. 21 + need this to do anything useful with LEDs. If unsure, say Y. 22 22 23 23 config LEDS_CLASS_FLASH 24 24 tristate "LED Flash Class Support" ··· 928 928 This option enables support for the Power Button LED of 929 929 Acer Iconia Tab A500. 930 930 931 + source "drivers/leds/blink/Kconfig" 932 + 931 933 comment "Flash and Torch LED drivers" 932 934 source "drivers/leds/flash/Kconfig" 933 935 934 936 comment "LED Triggers" 935 937 source "drivers/leds/trigger/Kconfig" 936 - 937 - comment "LED Blink" 938 - source "drivers/leds/blink/Kconfig" 939 938 940 939 endif # NEW_LEDS
+1 -1
drivers/leds/Makefile
··· 110 110 obj-$(CONFIG_LEDS_TRIGGERS) += trigger/ 111 111 112 112 # LED Blink 113 - obj-$(CONFIG_LEDS_BLINK) += blink/ 113 + obj-y += blink/
+15 -18
drivers/leds/blink/Kconfig
··· 1 - menuconfig LEDS_BLINK 2 - bool "LED Blink support" 3 - depends on LEDS_CLASS 4 - help 5 - This option enables blink support for the leds class. 6 - If unsure, say Y. 1 + config LEDS_LGM 2 + tristate "LED support for LGM SoC series" 3 + depends on X86 || COMPILE_TEST 4 + depends on GPIOLIB && LEDS_CLASS && MFD_SYSCON && OF 5 + help 6 + This option enables support for LEDs connected to GPIO lines on 7 + Lightning Mountain (LGM) SoC. Lightning Mountain is a AnyWAN 8 + gateway-on-a-chip SoC to be shipped on mid and high end home 9 + gateways and routers. 7 10 8 - if LEDS_BLINK 11 + These LEDs are driven by a Serial Shift Output (SSO) controller. 12 + The driver supports hardware blinking and the LEDs can be configured 13 + to be triggered by software/CPU or by hardware. 9 14 10 - config LEDS_BLINK_LGM 11 - tristate "LED support for Intel LGM SoC series" 12 - depends on LEDS_CLASS 13 - depends on MFD_SYSCON 14 - depends on OF 15 - help 16 - Parallel to serial conversion, which is also called SSO controller, 17 - can drive external shift register for LED outputs. 18 - This enables LED support for Serial Shift Output controller(SSO). 19 - 20 - endif # LEDS_BLINK 15 + Say 'Y' here if you are working on LGM SoC based platform. Otherwise, 16 + say 'N'. To compile this driver as a module, choose M here: the module 17 + will be called leds-lgm-sso.
+1 -1
drivers/leds/blink/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 - obj-$(CONFIG_LEDS_BLINK_LGM) += leds-lgm-sso.o 2 + obj-$(CONFIG_LEDS_LGM) += leds-lgm-sso.o
+1 -1
drivers/leds/blink/leds-lgm-sso.c
··· 793 793 794 794 ret = clk_prepare_enable(priv->gclk); 795 795 if (ret) { 796 - dev_err(dev, "Failed to prepate/enable sso gate clock!\n"); 796 + dev_err(dev, "Failed to prepare/enable sso gate clock!\n"); 797 797 return ret; 798 798 } 799 799
+11
drivers/leds/flash/Kconfig
··· 2 2 3 3 if LEDS_CLASS_FLASH 4 4 5 + config LEDS_RT4505 6 + tristate "LED support for RT4505 flashlight controller" 7 + depends on I2C && OF 8 + depends on V4L2_FLASH_LED_CLASS || !V4L2_FLASH_LED_CLASS 9 + select REGMAP_I2C 10 + help 11 + This option enables support for the RT4505 flash LED controller. 12 + RT4505 includes torch and flash functions with programmable current. 13 + And it's commonly used to compensate the illuminance for the camera 14 + inside the mobile product like as phones or tablets. 15 + 5 16 config LEDS_RT8515 6 17 tristate "LED support for Richtek RT8515 flash/torch LED" 7 18 depends on GPIOLIB
+1
drivers/leds/flash/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 3 + obj-$(CONFIG_LEDS_RT4505) += leds-rt4505.o 3 4 obj-$(CONFIG_LEDS_RT8515) += leds-rt8515.o
+430
drivers/leds/flash/leds-rt4505.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-only 2 + 3 + #include <linux/bitops.h> 4 + #include <linux/i2c.h> 5 + #include <linux/kernel.h> 6 + #include <linux/led-class-flash.h> 7 + #include <linux/module.h> 8 + #include <linux/mutex.h> 9 + #include <linux/property.h> 10 + #include <linux/regmap.h> 11 + #include <media/v4l2-flash-led-class.h> 12 + 13 + #define RT4505_REG_RESET 0x0 14 + #define RT4505_REG_CONFIG 0x8 15 + #define RT4505_REG_ILED 0x9 16 + #define RT4505_REG_ENABLE 0xA 17 + #define RT4505_REG_FLAGS 0xB 18 + 19 + #define RT4505_RESET_MASK BIT(7) 20 + #define RT4505_FLASHTO_MASK GENMASK(2, 0) 21 + #define RT4505_ITORCH_MASK GENMASK(7, 5) 22 + #define RT4505_ITORCH_SHIFT 5 23 + #define RT4505_IFLASH_MASK GENMASK(4, 0) 24 + #define RT4505_ENABLE_MASK GENMASK(5, 0) 25 + #define RT4505_TORCH_SET (BIT(0) | BIT(4)) 26 + #define RT4505_FLASH_SET (BIT(0) | BIT(1) | BIT(2) | BIT(4)) 27 + #define RT4505_EXT_FLASH_SET (BIT(0) | BIT(1) | BIT(4) | BIT(5)) 28 + #define RT4505_FLASH_GET (BIT(0) | BIT(1) | BIT(4)) 29 + #define RT4505_OVP_MASK BIT(3) 30 + #define RT4505_SHORT_MASK BIT(2) 31 + #define RT4505_OTP_MASK BIT(1) 32 + #define RT4505_TIMEOUT_MASK BIT(0) 33 + 34 + #define RT4505_ITORCH_MINUA 46000 35 + #define RT4505_ITORCH_MAXUA 375000 36 + #define RT4505_ITORCH_STPUA 47000 37 + #define RT4505_IFLASH_MINUA 93750 38 + #define RT4505_IFLASH_MAXUA 1500000 39 + #define RT4505_IFLASH_STPUA 93750 40 + #define RT4505_FLASHTO_MINUS 100000 41 + #define RT4505_FLASHTO_MAXUS 800000 42 + #define RT4505_FLASHTO_STPUS 100000 43 + 44 + struct rt4505_priv { 45 + struct device *dev; 46 + struct regmap *regmap; 47 + struct mutex lock; 48 + struct led_classdev_flash flash; 49 + struct v4l2_flash *v4l2_flash; 50 + }; 51 + 52 + static int rt4505_torch_brightness_set(struct led_classdev *lcdev, 53 + enum led_brightness level) 54 + { 55 + struct rt4505_priv *priv = 56 + container_of(lcdev, struct rt4505_priv, flash.led_cdev); 57 + u32 val = 0; 58 + int ret; 59 + 60 + mutex_lock(&priv->lock); 61 + 62 + if (level != LED_OFF) { 63 + ret = regmap_update_bits(priv->regmap, 64 + RT4505_REG_ILED, RT4505_ITORCH_MASK, 65 + (level - 1) << RT4505_ITORCH_SHIFT); 66 + if (ret) 67 + goto unlock; 68 + 69 + val = RT4505_TORCH_SET; 70 + } 71 + 72 + ret = regmap_update_bits(priv->regmap, RT4505_REG_ENABLE, 73 + RT4505_ENABLE_MASK, val); 74 + 75 + unlock: 76 + mutex_unlock(&priv->lock); 77 + return ret; 78 + } 79 + 80 + static enum led_brightness rt4505_torch_brightness_get( 81 + struct led_classdev *lcdev) 82 + { 83 + struct rt4505_priv *priv = 84 + container_of(lcdev, struct rt4505_priv, flash.led_cdev); 85 + u32 val; 86 + int ret; 87 + 88 + mutex_lock(&priv->lock); 89 + 90 + ret = regmap_read(priv->regmap, RT4505_REG_ENABLE, &val); 91 + if (ret) { 92 + dev_err(lcdev->dev, "Failed to get LED enable\n"); 93 + ret = LED_OFF; 94 + goto unlock; 95 + } 96 + 97 + if ((val & RT4505_ENABLE_MASK) != RT4505_TORCH_SET) { 98 + ret = LED_OFF; 99 + goto unlock; 100 + } 101 + 102 + ret = regmap_read(priv->regmap, RT4505_REG_ILED, &val); 103 + if (ret) { 104 + dev_err(lcdev->dev, "Failed to get LED brightness\n"); 105 + ret = LED_OFF; 106 + goto unlock; 107 + } 108 + 109 + ret = ((val & RT4505_ITORCH_MASK) >> RT4505_ITORCH_SHIFT) + 1; 110 + 111 + unlock: 112 + mutex_unlock(&priv->lock); 113 + return ret; 114 + } 115 + 116 + static int rt4505_flash_brightness_set(struct led_classdev_flash *fled_cdev, 117 + u32 brightness) 118 + { 119 + struct rt4505_priv *priv = 120 + container_of(fled_cdev, struct rt4505_priv, flash); 121 + struct led_flash_setting *s = &fled_cdev->brightness; 122 + u32 val = (brightness - s->min) / s->step; 123 + int ret; 124 + 125 + mutex_lock(&priv->lock); 126 + ret = regmap_update_bits(priv->regmap, RT4505_REG_ILED, 127 + RT4505_IFLASH_MASK, val); 128 + mutex_unlock(&priv->lock); 129 + 130 + return ret; 131 + } 132 + 133 + static int rt4505_flash_strobe_set(struct led_classdev_flash *fled_cdev, 134 + bool state) 135 + { 136 + struct rt4505_priv *priv = 137 + container_of(fled_cdev, struct rt4505_priv, flash); 138 + u32 val = state ? RT4505_FLASH_SET : 0; 139 + int ret; 140 + 141 + mutex_lock(&priv->lock); 142 + ret = regmap_update_bits(priv->regmap, RT4505_REG_ENABLE, 143 + RT4505_ENABLE_MASK, val); 144 + mutex_unlock(&priv->lock); 145 + 146 + return ret; 147 + } 148 + 149 + static int rt4505_flash_strobe_get(struct led_classdev_flash *fled_cdev, 150 + bool *state) 151 + { 152 + struct rt4505_priv *priv = 153 + container_of(fled_cdev, struct rt4505_priv, flash); 154 + u32 val; 155 + int ret; 156 + 157 + mutex_lock(&priv->lock); 158 + 159 + ret = regmap_read(priv->regmap, RT4505_REG_ENABLE, &val); 160 + if (ret) 161 + goto unlock; 162 + 163 + *state = (val & RT4505_FLASH_GET) == RT4505_FLASH_GET; 164 + 165 + unlock: 166 + mutex_unlock(&priv->lock); 167 + return ret; 168 + } 169 + 170 + static int rt4505_flash_timeout_set(struct led_classdev_flash *fled_cdev, 171 + u32 timeout) 172 + { 173 + struct rt4505_priv *priv = 174 + container_of(fled_cdev, struct rt4505_priv, flash); 175 + struct led_flash_setting *s = &fled_cdev->timeout; 176 + u32 val = (timeout - s->min) / s->step; 177 + int ret; 178 + 179 + mutex_lock(&priv->lock); 180 + ret = regmap_update_bits(priv->regmap, RT4505_REG_CONFIG, 181 + RT4505_FLASHTO_MASK, val); 182 + mutex_unlock(&priv->lock); 183 + 184 + return ret; 185 + } 186 + 187 + static int rt4505_fault_get(struct led_classdev_flash *fled_cdev, u32 *fault) 188 + { 189 + struct rt4505_priv *priv = 190 + container_of(fled_cdev, struct rt4505_priv, flash); 191 + u32 val, led_faults = 0; 192 + int ret; 193 + 194 + ret = regmap_read(priv->regmap, RT4505_REG_FLAGS, &val); 195 + if (ret) 196 + return ret; 197 + 198 + if (val & RT4505_OVP_MASK) 199 + led_faults |= LED_FAULT_OVER_VOLTAGE; 200 + 201 + if (val & RT4505_SHORT_MASK) 202 + led_faults |= LED_FAULT_SHORT_CIRCUIT; 203 + 204 + if (val & RT4505_OTP_MASK) 205 + led_faults |= LED_FAULT_OVER_TEMPERATURE; 206 + 207 + if (val & RT4505_TIMEOUT_MASK) 208 + led_faults |= LED_FAULT_TIMEOUT; 209 + 210 + *fault = led_faults; 211 + return 0; 212 + } 213 + 214 + static const struct led_flash_ops rt4505_flash_ops = { 215 + .flash_brightness_set = rt4505_flash_brightness_set, 216 + .strobe_set = rt4505_flash_strobe_set, 217 + .strobe_get = rt4505_flash_strobe_get, 218 + .timeout_set = rt4505_flash_timeout_set, 219 + .fault_get = rt4505_fault_get, 220 + }; 221 + 222 + static bool rt4505_is_accessible_reg(struct device *dev, unsigned int reg) 223 + { 224 + if (reg == RT4505_REG_RESET || 225 + (reg >= RT4505_REG_CONFIG && reg <= RT4505_REG_FLAGS)) 226 + return true; 227 + return false; 228 + } 229 + 230 + static const struct regmap_config rt4505_regmap_config = { 231 + .reg_bits = 8, 232 + .val_bits = 8, 233 + .max_register = RT4505_REG_FLAGS, 234 + 235 + .readable_reg = rt4505_is_accessible_reg, 236 + .writeable_reg = rt4505_is_accessible_reg, 237 + }; 238 + 239 + #if IS_ENABLED(CONFIG_V4L2_FLASH_LED_CLASS) 240 + static int rt4505_flash_external_strobe_set(struct v4l2_flash *v4l2_flash, 241 + bool enable) 242 + { 243 + struct led_classdev_flash *flash = v4l2_flash->fled_cdev; 244 + struct rt4505_priv *priv = 245 + container_of(flash, struct rt4505_priv, flash); 246 + u32 val = enable ? RT4505_EXT_FLASH_SET : 0; 247 + int ret; 248 + 249 + mutex_lock(&priv->lock); 250 + ret = regmap_update_bits(priv->regmap, RT4505_REG_ENABLE, 251 + RT4505_ENABLE_MASK, val); 252 + mutex_unlock(&priv->lock); 253 + 254 + return ret; 255 + } 256 + 257 + static const struct v4l2_flash_ops v4l2_flash_ops = { 258 + .external_strobe_set = rt4505_flash_external_strobe_set, 259 + }; 260 + 261 + static void rt4505_init_v4l2_config(struct rt4505_priv *priv, 262 + struct v4l2_flash_config *config) 263 + { 264 + struct led_classdev_flash *flash = &priv->flash; 265 + struct led_classdev *lcdev = &flash->led_cdev; 266 + struct led_flash_setting *s; 267 + 268 + strscpy(config->dev_name, lcdev->dev->kobj.name, 269 + sizeof(config->dev_name)); 270 + 271 + s = &config->intensity; 272 + s->min = RT4505_ITORCH_MINUA; 273 + s->step = RT4505_ITORCH_STPUA; 274 + s->max = s->val = s->min + (lcdev->max_brightness - 1) * s->step; 275 + 276 + config->flash_faults = LED_FAULT_OVER_VOLTAGE | 277 + LED_FAULT_SHORT_CIRCUIT | 278 + LED_FAULT_LED_OVER_TEMPERATURE | 279 + LED_FAULT_TIMEOUT; 280 + config->has_external_strobe = 1; 281 + } 282 + #else 283 + static const struct v4l2_flash_ops v4l2_flash_ops; 284 + static void rt4505_init_v4l2_config(struct rt4505_priv *priv, 285 + struct v4l2_flash_config *config) 286 + { 287 + } 288 + #endif 289 + 290 + static void rt4505_init_flash_properties(struct rt4505_priv *priv, 291 + struct fwnode_handle *child) 292 + { 293 + struct led_classdev_flash *flash = &priv->flash; 294 + struct led_classdev *lcdev = &flash->led_cdev; 295 + struct led_flash_setting *s; 296 + u32 val; 297 + int ret; 298 + 299 + ret = fwnode_property_read_u32(child, "led-max-microamp", &val); 300 + if (ret) { 301 + dev_warn(priv->dev, "led-max-microamp DT property missing\n"); 302 + val = RT4505_ITORCH_MINUA; 303 + } else 304 + val = clamp_val(val, RT4505_ITORCH_MINUA, RT4505_ITORCH_MAXUA); 305 + 306 + lcdev->max_brightness = 307 + (val - RT4505_ITORCH_MINUA) / RT4505_ITORCH_STPUA + 1; 308 + lcdev->brightness_set_blocking = rt4505_torch_brightness_set; 309 + lcdev->brightness_get = rt4505_torch_brightness_get; 310 + lcdev->flags |= LED_DEV_CAP_FLASH; 311 + 312 + ret = fwnode_property_read_u32(child, "flash-max-microamp", &val); 313 + if (ret) { 314 + dev_warn(priv->dev, "flash-max-microamp DT property missing\n"); 315 + val = RT4505_IFLASH_MINUA; 316 + } else 317 + val = clamp_val(val, RT4505_IFLASH_MINUA, RT4505_IFLASH_MAXUA); 318 + 319 + s = &flash->brightness; 320 + s->min = RT4505_IFLASH_MINUA; 321 + s->step = RT4505_IFLASH_STPUA; 322 + s->max = s->val = val; 323 + 324 + ret = fwnode_property_read_u32(child, "flash-max-timeout-us", &val); 325 + if (ret) { 326 + dev_warn(priv->dev, 327 + "flash-max-timeout-us DT property missing\n"); 328 + val = RT4505_FLASHTO_MINUS; 329 + } else 330 + val = clamp_val(val, RT4505_FLASHTO_MINUS, 331 + RT4505_FLASHTO_MAXUS); 332 + 333 + s = &flash->timeout; 334 + s->min = RT4505_FLASHTO_MINUS; 335 + s->step = RT4505_FLASHTO_STPUS; 336 + s->max = s->val = val; 337 + 338 + flash->ops = &rt4505_flash_ops; 339 + } 340 + 341 + static int rt4505_probe(struct i2c_client *client) 342 + { 343 + struct rt4505_priv *priv; 344 + struct fwnode_handle *child; 345 + struct led_init_data init_data = {}; 346 + struct v4l2_flash_config v4l2_config = {}; 347 + int ret; 348 + 349 + priv = devm_kzalloc(&client->dev, sizeof(*priv), GFP_KERNEL); 350 + if (!priv) 351 + return -ENOMEM; 352 + 353 + priv->dev = &client->dev; 354 + mutex_init(&priv->lock); 355 + 356 + priv->regmap = devm_regmap_init_i2c(client, &rt4505_regmap_config); 357 + if (IS_ERR(priv->regmap)) { 358 + dev_err(priv->dev, "Failed to allocate register map\n"); 359 + return PTR_ERR(priv->regmap); 360 + } 361 + 362 + ret = regmap_write(priv->regmap, RT4505_REG_RESET, RT4505_RESET_MASK); 363 + if (ret) { 364 + dev_err(priv->dev, "Failed to reset registers\n"); 365 + return ret; 366 + } 367 + 368 + child = fwnode_get_next_available_child_node(client->dev.fwnode, NULL); 369 + if (!child) { 370 + dev_err(priv->dev, "Failed to get child node\n"); 371 + return -EINVAL; 372 + } 373 + init_data.fwnode = child; 374 + 375 + rt4505_init_flash_properties(priv, child); 376 + ret = devm_led_classdev_flash_register_ext(priv->dev, &priv->flash, 377 + &init_data); 378 + if (ret) { 379 + dev_err(priv->dev, "Failed to register flash\n"); 380 + return ret; 381 + } 382 + 383 + rt4505_init_v4l2_config(priv, &v4l2_config); 384 + priv->v4l2_flash = v4l2_flash_init(priv->dev, init_data.fwnode, 385 + &priv->flash, &v4l2_flash_ops, 386 + &v4l2_config); 387 + if (IS_ERR(priv->v4l2_flash)) { 388 + dev_err(priv->dev, "Failed to register v4l2 flash\n"); 389 + return PTR_ERR(priv->v4l2_flash); 390 + } 391 + 392 + i2c_set_clientdata(client, priv); 393 + return 0; 394 + } 395 + 396 + static int rt4505_remove(struct i2c_client *client) 397 + { 398 + struct rt4505_priv *priv = i2c_get_clientdata(client); 399 + 400 + v4l2_flash_release(priv->v4l2_flash); 401 + return 0; 402 + } 403 + 404 + static void rt4505_shutdown(struct i2c_client *client) 405 + { 406 + struct rt4505_priv *priv = i2c_get_clientdata(client); 407 + 408 + /* Reset registers to make sure all off before shutdown */ 409 + regmap_write(priv->regmap, RT4505_REG_RESET, RT4505_RESET_MASK); 410 + } 411 + 412 + static const struct of_device_id __maybe_unused rt4505_leds_match[] = { 413 + { .compatible = "richtek,rt4505", }, 414 + {} 415 + }; 416 + MODULE_DEVICE_TABLE(of, rt4505_leds_match); 417 + 418 + static struct i2c_driver rt4505_driver = { 419 + .driver = { 420 + .name = "rt4505", 421 + .of_match_table = of_match_ptr(rt4505_leds_match), 422 + }, 423 + .probe_new = rt4505_probe, 424 + .remove = rt4505_remove, 425 + .shutdown = rt4505_shutdown, 426 + }; 427 + module_i2c_driver(rt4505_driver); 428 + 429 + MODULE_AUTHOR("ChiYuan Huang <cy_huang@richtek.com>"); 430 + MODULE_LICENSE("GPL v2");
+2 -2
drivers/leds/leds-lm3642.c
··· 339 339 chip->cdev_flash.max_brightness = 16; 340 340 chip->cdev_flash.brightness_set_blocking = lm3642_strobe_brightness_set; 341 341 chip->cdev_flash.default_trigger = "flash"; 342 - chip->cdev_flash.groups = lm3642_flash_groups, 342 + chip->cdev_flash.groups = lm3642_flash_groups; 343 343 err = led_classdev_register(&client->dev, &chip->cdev_flash); 344 344 if (err < 0) { 345 345 dev_err(chip->dev, "failed to register flash\n"); ··· 351 351 chip->cdev_torch.max_brightness = 8; 352 352 chip->cdev_torch.brightness_set_blocking = lm3642_torch_brightness_set; 353 353 chip->cdev_torch.default_trigger = "torch"; 354 - chip->cdev_torch.groups = lm3642_torch_groups, 354 + chip->cdev_torch.groups = lm3642_torch_groups; 355 355 err = led_classdev_register(&client->dev, &chip->cdev_torch); 356 356 if (err < 0) { 357 357 dev_err(chip->dev, "failed to register torch\n");
+2
drivers/leds/leds-pca9532.c
··· 480 480 if (!pdata) 481 481 return ERR_PTR(-ENOMEM); 482 482 483 + pdata->gpio_base = -1; 484 + 483 485 of_property_read_u8_array(np, "nxp,pwm", &pdata->pwm[0], 484 486 ARRAY_SIZE(pdata->pwm)); 485 487 of_property_read_u8_array(np, "nxp,psc", &pdata->psc[0],
+1 -1
drivers/leds/trigger/ledtrig-pattern.c
··· 333 333 static umode_t pattern_trig_attrs_mode(struct kobject *kobj, 334 334 struct attribute *attr, int index) 335 335 { 336 - struct device *dev = container_of(kobj, struct device, kobj); 336 + struct device *dev = kobj_to_dev(kobj); 337 337 struct led_classdev *led_cdev = dev_get_drvdata(dev); 338 338 339 339 if (attr == &dev_attr_repeat.attr || attr == &dev_attr_pattern.attr)