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 the LED. 80 $ref: /schemas/types.yaml#/definitions/string 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 100 101 led-pattern: 102 description: |
··· 79 the LED. 80 $ref: /schemas/types.yaml#/definitions/string 81 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]+$" 103 104 led-pattern: 105 description: |
+20 -2
drivers/leds/leds-pca963x.c
··· 101 struct pca963x *chip; 102 struct led_classdev led_cdev; 103 int led_num; /* 0 .. 15 potentially */ 104 u8 gdc; 105 u8 gfrq; 106 }; ··· 130 131 switch (brightness) { 132 case LED_FULL: 133 - val = (ledout & ~mask) | (PCA963X_LED_ON << shift); 134 ret = i2c_smbus_write_byte_data(client, ledout_addr, val); 135 break; 136 case LED_OFF: 137 val = ledout & ~mask; 138 ret = i2c_smbus_write_byte_data(client, ledout_addr, val); 139 break; 140 default: 141 ret = i2c_smbus_write_byte_data(client, ··· 154 if (ret < 0) 155 return ret; 156 157 - val = (ledout & ~mask) | (PCA963X_LED_PWM << shift); 158 ret = i2c_smbus_write_byte_data(client, ledout_addr, val); 159 break; 160 } ··· 195 } 196 197 mutex_unlock(&led->chip->mutex); 198 } 199 200 static int pca963x_power_state(struct pca963x_led *led) ··· 290 led->gfrq = gfrq; 291 292 pca963x_blink(led); 293 294 *delay_on = time_on; 295 *delay_off = time_off; ··· 354 led->led_cdev.brightness_set_blocking = pca963x_led_set; 355 if (hw_blink) 356 led->led_cdev.blink_set = pca963x_blink_set; 357 358 init_data.fwnode = child; 359 /* for backwards compatibility */
··· 101 struct pca963x *chip; 102 struct led_classdev led_cdev; 103 int led_num; /* 0 .. 15 potentially */ 104 + bool blinking; 105 u8 gdc; 106 u8 gfrq; 107 }; ··· 129 130 switch (brightness) { 131 case LED_FULL: 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 + } 141 ret = i2c_smbus_write_byte_data(client, ledout_addr, val); 142 break; 143 case LED_OFF: 144 val = ledout & ~mask; 145 ret = i2c_smbus_write_byte_data(client, ledout_addr, val); 146 + led->blinking = false; 147 break; 148 default: 149 ret = i2c_smbus_write_byte_data(client, ··· 144 if (ret < 0) 145 return ret; 146 147 + if (led->blinking) 148 + val = (ledout & ~mask) | (PCA963X_LED_GRP_PWM << shift); 149 + else 150 + val = (ledout & ~mask) | (PCA963X_LED_PWM << shift); 151 + 152 ret = i2c_smbus_write_byte_data(client, ledout_addr, val); 153 break; 154 } ··· 181 } 182 183 mutex_unlock(&led->chip->mutex); 184 + led->blinking = true; 185 } 186 187 static int pca963x_power_state(struct pca963x_led *led) ··· 275 led->gfrq = gfrq; 276 277 pca963x_blink(led); 278 + led->led_cdev.brightness = LED_FULL; 279 + pca963x_led_set(led_cdev, LED_FULL); 280 281 *delay_on = time_on; 282 *delay_off = time_off; ··· 337 led->led_cdev.brightness_set_blocking = pca963x_led_set; 338 if (hw_blink) 339 led->led_cdev.blink_set = pca963x_blink_set; 340 + led->blinking = false; 341 342 init_data.fwnode = child; 343 /* for backwards compatibility */