On Wed 2019-03-27 05:15:22, Marek Behún wrote: > The controller supports setting brightness of each channel of the RGB > LEDs. Utilize this by adding support for setting continuous brightness > of the entire LED by setting the same brightness on all 3 channels. > > Signed-off-by: Marek Behún <marek.behun@xxxxxx> This is really simple, so it can be merged with the basic support. Acked-by: Pavel Machek <pavel@xxxxxx> > @@ -70,10 +70,20 @@ static int omnia_led_brightness_set_blocking(struct led_classdev *led, > if (brightness) > state |= CMD_LED_STATE_ON; > > + buf[0] = CMD_LED_COLOR; > + buf[1] = idx; > + buf[2] = buf[3] = buf[4] = brightness; > + > mutex_lock(&leds->lock); > + > ret = i2c_smbus_write_byte_data(leds->client, CMD_LED_STATE, state); > - mutex_unlock(&leds->lock); > + if (ret < 0) > + goto unlock; > > + ret = i2c_master_send(leds->client, buf, 5); if (ret >= 0) ret = i2c_master_send(leds->client, buf, 5); so we can get rid of the goto? > + > +unlock: > + mutex_unlock(&leds->lock); > return ret; > } Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Attachment:
signature.asc
Description: Digital signature