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

Pull LED updates from Pavel Machek:
"This is very quiet release for LEDs, pca963 got blinking support and
that's pretty much it"

* tag 'leds-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds:
leds: pca963: fix misleading indentation
dt-bindings: leds: Document mmc trigger
leds: pca963x: fix blink with hw acceleration

+41 -20
+21 -18
Documentation/devicetree/bindings/leds/common.yaml
··· 79 79 the LED. 80 80 $ref: /schemas/types.yaml#/definitions/string 81 81 82 - enum: 83 - # LED will act as a back-light, controlled by the framebuffer system 84 - - backlight 85 - # LED will turn on (but for leds-gpio see "default-state" property in 86 - # Documentation/devicetree/bindings/leds/leds-gpio.yaml) 87 - - default-on 88 - # LED "double" flashes at a load average based rate 89 - - heartbeat 90 - # LED indicates disk activity 91 - - disk-activity 92 - # LED indicates IDE disk activity (deprecated), in new implementations 93 - # use "disk-activity" 94 - - ide-disk 95 - # LED flashes at a fixed, configurable rate 96 - - timer 97 - # LED alters the brightness for the specified duration with one software 98 - # timer (requires "led-pattern" property) 99 - - pattern 82 + oneOf: 83 + - enum: 84 + # LED will act as a back-light, controlled by the framebuffer system 85 + - backlight 86 + # LED will turn on (but for leds-gpio see "default-state" property in 87 + # Documentation/devicetree/bindings/leds/leds-gpio.yaml) 88 + - default-on 89 + # LED "double" flashes at a load average based rate 90 + - heartbeat 91 + # LED indicates disk activity 92 + - disk-activity 93 + # LED indicates IDE disk activity (deprecated), in new implementations 94 + # use "disk-activity" 95 + - ide-disk 96 + # LED flashes at a fixed, configurable rate 97 + - timer 98 + # LED alters the brightness for the specified duration with one software 99 + # timer (requires "led-pattern" property) 100 + - pattern 101 + # LED is triggered by SD/MMC activity 102 + - pattern: "^mmc[0-9]+$" 100 103 101 104 led-pattern: 102 105 description: |
+20 -2
drivers/leds/leds-pca963x.c
··· 101 101 struct pca963x *chip; 102 102 struct led_classdev led_cdev; 103 103 int led_num; /* 0 .. 15 potentially */ 104 + bool blinking; 104 105 u8 gdc; 105 106 u8 gfrq; 106 107 }; ··· 130 129 131 130 switch (brightness) { 132 131 case LED_FULL: 133 - val = (ledout & ~mask) | (PCA963X_LED_ON << shift); 132 + if (led->blinking) { 133 + val = (ledout & ~mask) | (PCA963X_LED_GRP_PWM << shift); 134 + ret = i2c_smbus_write_byte_data(client, 135 + PCA963X_PWM_BASE + 136 + led->led_num, 137 + LED_FULL); 138 + } else { 139 + val = (ledout & ~mask) | (PCA963X_LED_ON << shift); 140 + } 134 141 ret = i2c_smbus_write_byte_data(client, ledout_addr, val); 135 142 break; 136 143 case LED_OFF: 137 144 val = ledout & ~mask; 138 145 ret = i2c_smbus_write_byte_data(client, ledout_addr, val); 146 + led->blinking = false; 139 147 break; 140 148 default: 141 149 ret = i2c_smbus_write_byte_data(client, ··· 154 144 if (ret < 0) 155 145 return ret; 156 146 157 - val = (ledout & ~mask) | (PCA963X_LED_PWM << shift); 147 + if (led->blinking) 148 + val = (ledout & ~mask) | (PCA963X_LED_GRP_PWM << shift); 149 + else 150 + val = (ledout & ~mask) | (PCA963X_LED_PWM << shift); 151 + 158 152 ret = i2c_smbus_write_byte_data(client, ledout_addr, val); 159 153 break; 160 154 } ··· 195 181 } 196 182 197 183 mutex_unlock(&led->chip->mutex); 184 + led->blinking = true; 198 185 } 199 186 200 187 static int pca963x_power_state(struct pca963x_led *led) ··· 290 275 led->gfrq = gfrq; 291 276 292 277 pca963x_blink(led); 278 + led->led_cdev.brightness = LED_FULL; 279 + pca963x_led_set(led_cdev, LED_FULL); 293 280 294 281 *delay_on = time_on; 295 282 *delay_off = time_off; ··· 354 337 led->led_cdev.brightness_set_blocking = pca963x_led_set; 355 338 if (hw_blink) 356 339 led->led_cdev.blink_set = pca963x_blink_set; 340 + led->blinking = false; 357 341 358 342 init_data.fwnode = child; 359 343 /* for backwards compatibility */