• Home
  • Raw
  • Download

Lines Matching refs:is31

115 	struct is31fl319x_chip *is31 = led->chip;  in is31fl319x_brightness_set()  local
116 int chan = led - is31->leds; in is31fl319x_brightness_set()
121 dev_dbg(&is31->client->dev, "%s %d: %d\n", __func__, chan, brightness); in is31fl319x_brightness_set()
123 mutex_lock(&is31->lock); in is31fl319x_brightness_set()
126 ret = regmap_write(is31->regmap, IS31FL319X_PWM(chan), brightness); in is31fl319x_brightness_set()
131 for (i = 0; i < is31->cdef->num_leds; i++) { in is31fl319x_brightness_set()
140 ret = regmap_read(is31->regmap, IS31FL319X_PWM(i), &pwm_value); in is31fl319x_brightness_set()
141 dev_dbg(&is31->client->dev, "%s read %d: ret=%d: %d\n", in is31fl319x_brightness_set()
154 dev_dbg(&is31->client->dev, "power up %02x %02x\n", in is31fl319x_brightness_set()
156 regmap_write(is31->regmap, IS31FL319X_CTRL1, ctrl1); in is31fl319x_brightness_set()
157 regmap_write(is31->regmap, IS31FL319X_CTRL2, ctrl2); in is31fl319x_brightness_set()
159 regmap_write(is31->regmap, IS31FL319X_DATA_UPDATE, 0x00); in is31fl319x_brightness_set()
161 ret = regmap_write(is31->regmap, IS31FL319X_SHUTDOWN, 0x01); in is31fl319x_brightness_set()
163 dev_dbg(&is31->client->dev, "power down\n"); in is31fl319x_brightness_set()
165 ret = regmap_write(is31->regmap, IS31FL319X_SHUTDOWN, 0x00); in is31fl319x_brightness_set()
169 mutex_unlock(&is31->lock); in is31fl319x_brightness_set()
203 struct is31fl319x_chip *is31) in is31fl319x_parse_dt() argument
212 is31->shutdown_gpio = devm_gpiod_get_optional(dev, in is31fl319x_parse_dt()
215 if (IS_ERR(is31->shutdown_gpio)) { in is31fl319x_parse_dt()
216 ret = PTR_ERR(is31->shutdown_gpio); in is31fl319x_parse_dt()
221 is31->cdef = device_get_match_data(dev); in is31fl319x_parse_dt()
227 if (!count || count > is31->cdef->num_leds) { in is31fl319x_parse_dt()
229 is31->cdef->num_leds); in is31fl319x_parse_dt()
243 if (reg < 1 || reg > is31->cdef->num_leds) { in is31fl319x_parse_dt()
249 led = &is31->leds[reg - 1]; in is31fl319x_parse_dt()
266 is31->audio_gain_db = 0; in is31fl319x_parse_dt()
267 ret = of_property_read_u32(np, "audio-gain-db", &is31->audio_gain_db); in is31fl319x_parse_dt()
269 is31->audio_gain_db = min(is31->audio_gain_db, in is31fl319x_parse_dt()
338 struct is31fl319x_chip *is31; in is31fl319x_probe() local
347 is31 = devm_kzalloc(&client->dev, sizeof(*is31), GFP_KERNEL); in is31fl319x_probe()
348 if (!is31) in is31fl319x_probe()
351 mutex_init(&is31->lock); in is31fl319x_probe()
353 err = is31fl319x_parse_dt(&client->dev, is31); in is31fl319x_probe()
357 if (is31->shutdown_gpio) { in is31fl319x_probe()
358 gpiod_direction_output(is31->shutdown_gpio, 0); in is31fl319x_probe()
360 gpiod_direction_output(is31->shutdown_gpio, 1); in is31fl319x_probe()
363 is31->client = client; in is31fl319x_probe()
364 is31->regmap = devm_regmap_init_i2c(client, &regmap_config); in is31fl319x_probe()
365 if (IS_ERR(is31->regmap)) { in is31fl319x_probe()
367 err = PTR_ERR(is31->regmap); in is31fl319x_probe()
371 i2c_set_clientdata(client, is31); in is31fl319x_probe()
374 err = regmap_write(is31->regmap, IS31FL319X_RESET, 0x00); in is31fl319x_probe()
387 for (i = 0; i < is31->cdef->num_leds; i++) in is31fl319x_probe()
388 if (is31->leds[i].configured && in is31fl319x_probe()
389 is31->leds[i].max_microamp < aggregated_led_microamp) in is31fl319x_probe()
390 aggregated_led_microamp = is31->leds[i].max_microamp; in is31fl319x_probe()
392 regmap_write(is31->regmap, IS31FL319X_CONFIG2, in is31fl319x_probe()
394 is31fl319x_db_to_gain(is31->audio_gain_db)); in is31fl319x_probe()
396 for (i = 0; i < is31->cdef->num_leds; i++) { in is31fl319x_probe()
397 struct is31fl319x_led *led = &is31->leds[i]; in is31fl319x_probe()
402 led->chip = is31; in is31fl319x_probe()
413 mutex_destroy(&is31->lock); in is31fl319x_probe()
419 struct is31fl319x_chip *is31 = i2c_get_clientdata(client); in is31fl319x_remove() local
421 mutex_destroy(&is31->lock); in is31fl319x_remove()