is31 112 drivers/leds/leds-is31fl319x.c struct is31fl319x_chip *is31 = led->chip; is31 113 drivers/leds/leds-is31fl319x.c int chan = led - is31->leds; is31 118 drivers/leds/leds-is31fl319x.c dev_dbg(&is31->client->dev, "%s %d: %d\n", __func__, chan, brightness); is31 120 drivers/leds/leds-is31fl319x.c mutex_lock(&is31->lock); is31 123 drivers/leds/leds-is31fl319x.c ret = regmap_write(is31->regmap, IS31FL319X_PWM(chan), brightness); is31 128 drivers/leds/leds-is31fl319x.c for (i = 0; i < is31->cdef->num_leds; i++) { is31 137 drivers/leds/leds-is31fl319x.c ret = regmap_read(is31->regmap, IS31FL319X_PWM(i), &pwm_value); is31 138 drivers/leds/leds-is31fl319x.c dev_dbg(&is31->client->dev, "%s read %d: ret=%d: %d\n", is31 151 drivers/leds/leds-is31fl319x.c dev_dbg(&is31->client->dev, "power up %02x %02x\n", is31 153 drivers/leds/leds-is31fl319x.c regmap_write(is31->regmap, IS31FL319X_CTRL1, ctrl1); is31 154 drivers/leds/leds-is31fl319x.c regmap_write(is31->regmap, IS31FL319X_CTRL2, ctrl2); is31 156 drivers/leds/leds-is31fl319x.c regmap_write(is31->regmap, IS31FL319X_DATA_UPDATE, 0x00); is31 158 drivers/leds/leds-is31fl319x.c ret = regmap_write(is31->regmap, IS31FL319X_SHUTDOWN, 0x01); is31 160 drivers/leds/leds-is31fl319x.c dev_dbg(&is31->client->dev, "power down\n"); is31 162 drivers/leds/leds-is31fl319x.c ret = regmap_write(is31->regmap, IS31FL319X_SHUTDOWN, 0x00); is31 166 drivers/leds/leds-is31fl319x.c mutex_unlock(&is31->lock); is31 200 drivers/leds/leds-is31fl319x.c struct is31fl319x_chip *is31) is31 216 drivers/leds/leds-is31fl319x.c is31->cdef = of_dev_id->data; is31 223 drivers/leds/leds-is31fl319x.c if (!count || count > is31->cdef->num_leds) { is31 225 drivers/leds/leds-is31fl319x.c is31->cdef->num_leds); is31 239 drivers/leds/leds-is31fl319x.c if (reg < 1 || reg > is31->cdef->num_leds) { is31 245 drivers/leds/leds-is31fl319x.c led = &is31->leds[reg - 1]; is31 262 drivers/leds/leds-is31fl319x.c is31->audio_gain_db = 0; is31 263 drivers/leds/leds-is31fl319x.c ret = of_property_read_u32(np, "audio-gain-db", &is31->audio_gain_db); is31 265 drivers/leds/leds-is31fl319x.c is31->audio_gain_db = min(is31->audio_gain_db, is31 334 drivers/leds/leds-is31fl319x.c struct is31fl319x_chip *is31; is31 343 drivers/leds/leds-is31fl319x.c is31 = devm_kzalloc(&client->dev, sizeof(*is31), GFP_KERNEL); is31 344 drivers/leds/leds-is31fl319x.c if (!is31) is31 347 drivers/leds/leds-is31fl319x.c mutex_init(&is31->lock); is31 349 drivers/leds/leds-is31fl319x.c err = is31fl319x_parse_dt(&client->dev, is31); is31 353 drivers/leds/leds-is31fl319x.c is31->client = client; is31 354 drivers/leds/leds-is31fl319x.c is31->regmap = devm_regmap_init_i2c(client, ®map_config); is31 355 drivers/leds/leds-is31fl319x.c if (IS_ERR(is31->regmap)) { is31 357 drivers/leds/leds-is31fl319x.c err = PTR_ERR(is31->regmap); is31 361 drivers/leds/leds-is31fl319x.c i2c_set_clientdata(client, is31); is31 364 drivers/leds/leds-is31fl319x.c err = regmap_write(is31->regmap, IS31FL319X_RESET, 0x00); is31 377 drivers/leds/leds-is31fl319x.c for (i = 0; i < is31->cdef->num_leds; i++) is31 378 drivers/leds/leds-is31fl319x.c if (is31->leds[i].configured && is31 379 drivers/leds/leds-is31fl319x.c is31->leds[i].max_microamp < aggregated_led_microamp) is31 380 drivers/leds/leds-is31fl319x.c aggregated_led_microamp = is31->leds[i].max_microamp; is31 382 drivers/leds/leds-is31fl319x.c regmap_write(is31->regmap, IS31FL319X_CONFIG2, is31 384 drivers/leds/leds-is31fl319x.c is31fl319x_db_to_gain(is31->audio_gain_db)); is31 386 drivers/leds/leds-is31fl319x.c for (i = 0; i < is31->cdef->num_leds; i++) { is31 387 drivers/leds/leds-is31fl319x.c struct is31fl319x_led *led = &is31->leds[i]; is31 392 drivers/leds/leds-is31fl319x.c led->chip = is31; is31 403 drivers/leds/leds-is31fl319x.c mutex_destroy(&is31->lock); is31 409 drivers/leds/leds-is31fl319x.c struct is31fl319x_chip *is31 = i2c_get_clientdata(client); is31 411 drivers/leds/leds-is31fl319x.c mutex_destroy(&is31->lock);