Lines Matching full:cfg
92 const struct lp55xx_device_config *cfg = chip->cfg; in lp55xx_wait_opmode_done() local
101 if (cfg->engine_busy.val) { in lp55xx_wait_opmode_done()
102 read_poll_timeout(lp55xx_read, ret, !(val & cfg->engine_busy.mask), in lp55xx_wait_opmode_done()
104 chip, cfg->engine_busy.addr, &val); in lp55xx_wait_opmode_done()
112 const struct lp55xx_device_config *cfg = chip->cfg; in lp55xx_stop_all_engine() local
114 lp55xx_write(chip, cfg->reg_op_mode.addr, LP55xx_MODE_DISABLE_ALL_ENG); in lp55xx_stop_all_engine()
122 const struct lp55xx_device_config *cfg = chip->cfg; in lp55xx_load_engine() local
125 mask = LP55xx_MODE_ENGn_MASK(idx, cfg->reg_op_mode.shift); in lp55xx_load_engine()
126 val = LP55xx_MODE_LOAD_ENG << LP55xx_MODE_ENGn_SHIFT(idx, cfg->reg_op_mode.shift); in lp55xx_load_engine()
128 lp55xx_update_bits(chip, cfg->reg_op_mode.addr, mask, val); in lp55xx_load_engine()
132 if (cfg->pages_per_engine) in lp55xx_load_engine()
134 LP55xx_PAGE_OFFSET(idx, cfg->pages_per_engine)); in lp55xx_load_engine()
140 const struct lp55xx_device_config *cfg = chip->cfg; in lp55xx_run_engine_common() local
145 ret = lp55xx_read(chip, cfg->reg_op_mode.addr, &mode); in lp55xx_run_engine_common()
149 ret = lp55xx_read(chip, cfg->reg_exec.addr, &exec); in lp55xx_run_engine_common()
155 if (LP55xx_MODE_ENGn_GET(i, mode, cfg->reg_op_mode.shift) != LP55xx_MODE_LOAD_ENG) in lp55xx_run_engine_common()
158 mode &= ~LP55xx_MODE_ENGn_MASK(i, cfg->reg_op_mode.shift); in lp55xx_run_engine_common()
159 mode |= LP55xx_MODE_RUN_ENG << LP55xx_MODE_ENGn_SHIFT(i, cfg->reg_op_mode.shift); in lp55xx_run_engine_common()
160 exec &= ~LP55xx_EXEC_ENGn_MASK(i, cfg->reg_exec.shift); in lp55xx_run_engine_common()
161 exec |= LP55xx_EXEC_RUN_ENG << LP55xx_EXEC_ENGn_SHIFT(i, cfg->reg_exec.shift); in lp55xx_run_engine_common()
164 lp55xx_write(chip, cfg->reg_op_mode.addr, mode); in lp55xx_run_engine_common()
166 lp55xx_write(chip, cfg->reg_exec.addr, exec); in lp55xx_run_engine_common()
176 const struct lp55xx_device_config *cfg = chip->cfg; in lp55xx_update_program_memory() local
178 u8 start_addr = cfg->prog_mem_base.addr; in lp55xx_update_program_memory()
183 if (cfg->pages_per_engine) in lp55xx_update_program_memory()
184 program_length *= cfg->pages_per_engine; in lp55xx_update_program_memory()
214 if (!cfg->pages_per_engine) in lp55xx_update_program_memory()
219 if (cfg->pages_per_engine) in lp55xx_update_program_memory()
221 LP55xx_PAGE_OFFSET(idx, cfg->pages_per_engine) + page); in lp55xx_update_program_memory()
241 const struct lp55xx_device_config *cfg = chip->cfg; in lp55xx_firmware_loaded_cb() local
246 if (cfg->pages_per_engine) in lp55xx_firmware_loaded_cb()
247 program_length *= cfg->pages_per_engine; in lp55xx_firmware_loaded_cb()
273 const struct lp55xx_device_config *cfg = chip->cfg; in lp55xx_led_brightness() local
278 ret = lp55xx_write(chip, cfg->reg_led_pwm_base.addr + led->chan_nr, in lp55xx_led_brightness()
287 const struct lp55xx_device_config *cfg = chip->cfg; in lp55xx_multicolor_brightness() local
295 cfg->reg_led_pwm_base.addr + in lp55xx_multicolor_brightness()
309 const struct lp55xx_device_config *cfg = chip->cfg; in lp55xx_set_led_current() local
312 lp55xx_write(led->chip, cfg->reg_led_current_base.addr + led->chan_nr, in lp55xx_set_led_current()
319 const struct lp55xx_device_config *cfg = chip->cfg; in lp55xx_turn_off_channels() local
322 for (i = 0; i < cfg->max_channel; i++) in lp55xx_turn_off_channels()
323 lp55xx_write(chip, cfg->reg_led_pwm_base.addr + i, 0); in lp55xx_turn_off_channels()
330 const struct lp55xx_device_config *cfg = chip->cfg; in lp55xx_stop_engine() local
333 mask = LP55xx_MODE_ENGn_MASK(idx, cfg->reg_op_mode.shift); in lp55xx_stop_engine()
334 lp55xx_update_bits(chip, cfg->reg_op_mode.addr, mask, 0); in lp55xx_stop_engine()
342 const struct lp55xx_device_config *cfg = chip->cfg; in lp55xx_reset_device() local
343 u8 addr = cfg->reset.addr; in lp55xx_reset_device()
344 u8 val = cfg->reset.val; in lp55xx_reset_device()
352 const struct lp55xx_device_config *cfg = chip->cfg; in lp55xx_detect_device() local
353 u8 addr = cfg->enable.addr; in lp55xx_detect_device()
354 u8 val = cfg->enable.val; in lp55xx_detect_device()
367 if (val != cfg->enable.val) in lp55xx_detect_device()
375 const struct lp55xx_device_config *cfg = chip->cfg; in lp55xx_post_init_device() local
377 if (!cfg->post_init_device) in lp55xx_post_init_device()
380 return cfg->post_init_device(chip); in lp55xx_post_init_device()
406 if (!chip->cfg->set_led_current) in led_current_store()
411 chip->cfg->set_led_current(led, (u8)curr); in led_current_store()
440 const struct lp55xx_device_config *cfg = led->chip->cfg; in lp55xx_set_mc_brightness() local
443 return cfg->multicolor_brightness_fn(led); in lp55xx_set_mc_brightness()
451 const struct lp55xx_device_config *cfg = led->chip->cfg; in lp55xx_set_brightness() local
454 return cfg->brightness_fn(led); in lp55xx_set_brightness()
461 const struct lp55xx_device_config *cfg = chip->cfg; in lp55xx_init_led() local
463 int max_channel = cfg->max_channel; in lp55xx_init_led()
549 if (chip->cfg->firmware_cb) in lp55xx_firmware_loaded()
550 chip->cfg->firmware_cb(chip); in lp55xx_firmware_loaded()
615 if (chip->cfg->run_engine) in lp55xx_run_engine()
616 chip->cfg->run_engine(chip, start); in lp55xx_run_engine()
673 const struct lp55xx_device_config *cfg = chip->cfg; in lp55xx_store_engine_mode() local
681 cfg->run_engine(chip, true); in lp55xx_store_engine_mode()
717 const struct lp55xx_device_config *cfg = chip->cfg; in lp55xx_mux_parse() local
721 len = min_t(int, len, cfg->max_channel); in lp55xx_mux_parse()
748 const struct lp55xx_device_config *cfg = chip->cfg; in lp55xx_show_engine_leds() local
752 for (i = 0; i < cfg->max_channel; i++) { in lp55xx_show_engine_leds()
766 const struct lp55xx_device_config *cfg = chip->cfg; in lp55xx_load_mux() local
773 mux_page = cfg->pages_per_engine * LP55XX_ENGINE_MAX + (nr - 1); in lp55xx_load_mux()
778 ret = lp55xx_write(chip, cfg->prog_mem_base.addr, (u8)(mux >> 8)); in lp55xx_load_mux()
782 ret = lp55xx_write(chip, cfg->prog_mem_base.addr + 1, (u8)(mux)); in lp55xx_load_mux()
822 const struct lp55xx_device_config *cfg = chip->cfg; in lp55xx_show_master_fader() local
828 ret = lp55xx_read(chip, cfg->reg_master_fader_base.addr + nr - 1, &val); in lp55xx_show_master_fader()
840 const struct lp55xx_device_config *cfg = chip->cfg; in lp55xx_store_master_fader() local
852 ret = lp55xx_write(chip, cfg->reg_master_fader_base.addr + nr - 1, in lp55xx_store_master_fader()
865 const struct lp55xx_device_config *cfg = chip->cfg; in lp55xx_show_master_fader_leds() local
871 for (i = 0; i < cfg->max_channel; i++) { in lp55xx_show_master_fader_leds()
872 ret = lp55xx_read(chip, cfg->reg_led_ctrl_base.addr + i, &val); in lp55xx_show_master_fader_leds()
894 const struct lp55xx_device_config *cfg = chip->cfg; in lp55xx_store_master_fader_leds() local
898 n = min_t(int, len, cfg->max_channel); in lp55xx_store_master_fader_leds()
906 cfg->reg_led_ctrl_base.addr + i, in lp55xx_store_master_fader_leds()
997 const struct lp55xx_device_config *cfg; in lp55xx_init_device() local
1004 cfg = chip->cfg; in lp55xx_init_device()
1006 if (!pdata || !cfg) in lp55xx_init_device()
1051 const struct lp55xx_device_config *cfg = chip->cfg; in lp55xx_register_leds() local
1058 if (!cfg->brightness_fn) { in lp55xx_register_leds()
1079 if (cfg->set_led_current) in lp55xx_register_leds()
1080 cfg->set_led_current(each, led_current); in lp55xx_register_leds()
1092 const struct lp55xx_device_config *cfg = chip->cfg; in lp55xx_register_sysfs() local
1095 if (!cfg->run_engine || !cfg->firmware_cb) in lp55xx_register_sysfs()
1103 return cfg->dev_attr_group ? in lp55xx_register_sysfs()
1104 sysfs_create_group(&dev->kobj, cfg->dev_attr_group) : 0; in lp55xx_register_sysfs()
1110 const struct lp55xx_device_config *cfg = chip->cfg; in lp55xx_unregister_sysfs() local
1112 if (cfg->dev_attr_group) in lp55xx_unregister_sysfs()
1113 sysfs_remove_group(&dev->kobj, cfg->dev_attr_group); in lp55xx_unregister_sysfs()
1119 struct lp55xx_led_config *cfg, in lp55xx_parse_common_child() argument
1125 &cfg[led_number].name); in lp55xx_parse_common_child()
1127 &cfg[led_number].led_current); in lp55xx_parse_common_child()
1129 &cfg[led_number].max_current); in lp55xx_parse_common_child()
1139 struct lp55xx_led_config *cfg, in lp55xx_parse_multi_led_child() argument
1144 ret = lp55xx_parse_common_child(child, cfg, child_number, &chan_nr); in lp55xx_parse_multi_led_child()
1152 cfg[child_number].color_id[color_number] = color_id; in lp55xx_parse_multi_led_child()
1153 cfg[child_number].output_num[color_number] = chan_nr; in lp55xx_parse_multi_led_child()
1159 struct lp55xx_led_config *cfg, in lp55xx_parse_multi_led() argument
1165 ret = lp55xx_parse_multi_led_child(child, cfg, child_number, in lp55xx_parse_multi_led()
1172 cfg[child_number].num_colors = num_colors; in lp55xx_parse_multi_led()
1178 struct lp55xx_led_config *cfg, in lp55xx_parse_logical_led() argument
1184 cfg[child_number].default_trigger = in lp55xx_parse_logical_led()
1192 return lp55xx_parse_multi_led(np, cfg, child_number); in lp55xx_parse_logical_led()
1194 ret = lp55xx_parse_common_child(np, cfg, child_number, &chan_nr); in lp55xx_parse_logical_led()
1198 cfg[child_number].chan_nr = chan_nr; in lp55xx_parse_logical_led()
1209 struct lp55xx_led_config *cfg; in lp55xx_of_populate_pdata() local
1224 cfg = devm_kcalloc(dev, num_channels, sizeof(*cfg), GFP_KERNEL); in lp55xx_of_populate_pdata()
1225 if (!cfg) in lp55xx_of_populate_pdata()
1228 pdata->led_config = &cfg[0]; in lp55xx_of_populate_pdata()
1230 cfg->max_channel = chip->cfg->max_channel; in lp55xx_of_populate_pdata()
1233 ret = lp55xx_parse_logical_led(child, cfg, i); in lp55xx_of_populate_pdata()
1276 chip->cfg = i2c_get_match_data(client); in lp55xx_probe()
1292 if (chip->cfg->pages_per_engine) in lp55xx_probe()
1293 program_length *= chip->cfg->pages_per_engine; in lp55xx_probe()