Lines Matching refs:aw87390

179 	struct aw87390 *aw87390 = snd_soc_component_get_drvdata(codec);  in aw87390_profile_info()  local
186 count = aw87390->aw_pa->prof_info.count; in aw87390_profile_info()
200 ret = aw87390_dev_get_prof_name(aw87390->aw_pa, count, &prof_name); in aw87390_profile_info()
216 struct aw87390 *aw87390 = snd_soc_component_get_drvdata(codec); in aw87390_profile_get() local
218 ucontrol->value.integer.value[0] = aw87390->aw_pa->prof_index; in aw87390_profile_get()
227 struct aw87390 *aw87390 = snd_soc_component_get_drvdata(codec); in aw87390_profile_set() local
230 mutex_lock(&aw87390->lock); in aw87390_profile_set()
231 ret = aw87390_dev_set_profile_index(aw87390->aw_pa, ucontrol->value.integer.value[0]); in aw87390_profile_set()
234 mutex_unlock(&aw87390->lock); in aw87390_profile_set()
238 if (aw87390->aw_pa->status == AW87390_DEV_PW_ON) { in aw87390_profile_set()
239 aw87390_power_off(aw87390->aw_pa); in aw87390_profile_set()
240 aw87390_power_on(aw87390->aw_pa); in aw87390_profile_set()
243 mutex_unlock(&aw87390->lock); in aw87390_profile_set()
253 static int aw87390_request_firmware_file(struct aw87390 *aw87390) in aw87390_request_firmware_file() argument
258 aw87390->aw_pa->fw_status = AW87390_DEV_FW_FAILED; in aw87390_request_firmware_file()
260 ret = request_firmware(&cont, AW87390_ACF_FILE, aw87390->aw_pa->dev); in aw87390_request_firmware_file()
262 return dev_err_probe(aw87390->aw_pa->dev, ret, in aw87390_request_firmware_file()
265 dev_dbg(aw87390->aw_pa->dev, "loaded %s - size: %zu\n", in aw87390_request_firmware_file()
268 aw87390->aw_cfg = devm_kzalloc(aw87390->aw_pa->dev, in aw87390_request_firmware_file()
269 struct_size(aw87390->aw_cfg, data, cont->size), GFP_KERNEL); in aw87390_request_firmware_file()
270 if (!aw87390->aw_cfg) { in aw87390_request_firmware_file()
275 aw87390->aw_cfg->len = cont->size; in aw87390_request_firmware_file()
276 memcpy(aw87390->aw_cfg->data, cont->data, cont->size); in aw87390_request_firmware_file()
279 ret = aw88395_dev_load_acf_check(aw87390->aw_pa, aw87390->aw_cfg); in aw87390_request_firmware_file()
281 dev_err(aw87390->aw_pa->dev, "load [%s] failed!\n", AW87390_ACF_FILE); in aw87390_request_firmware_file()
285 mutex_lock(&aw87390->lock); in aw87390_request_firmware_file()
287 ret = aw88395_dev_cfg_load(aw87390->aw_pa, aw87390->aw_cfg); in aw87390_request_firmware_file()
289 dev_err(aw87390->aw_pa->dev, "aw_dev acf parse failed\n"); in aw87390_request_firmware_file()
291 mutex_unlock(&aw87390->lock); in aw87390_request_firmware_file()
300 struct aw87390 *aw87390 = snd_soc_component_get_drvdata(component); in aw87390_drv_event() local
301 struct aw_device *aw_dev = aw87390->aw_pa; in aw87390_drv_event()
333 struct aw87390 *aw87390 = snd_soc_component_get_drvdata(component); in aw87390_codec_probe() local
336 ret = aw87390_request_firmware_file(aw87390); in aw87390_codec_probe()
338 return dev_err_probe(aw87390->aw_pa->dev, ret, in aw87390_codec_probe()
354 static void aw87390_parse_channel_dt(struct aw87390 *aw87390) in aw87390_parse_channel_dt() argument
356 struct aw_device *aw_dev = aw87390->aw_pa; in aw87390_parse_channel_dt()
365 static int aw87390_init(struct aw87390 **aw87390, struct i2c_client *i2c, struct regmap *regmap) in aw87390_init() argument
389 (*aw87390)->aw_pa = aw_dev; in aw87390_init()
403 aw87390_parse_channel_dt(*aw87390); in aw87390_init()
410 struct aw87390 *aw87390; in aw87390_i2c_probe() local
417 aw87390 = devm_kzalloc(&i2c->dev, sizeof(*aw87390), GFP_KERNEL); in aw87390_i2c_probe()
418 if (!aw87390) in aw87390_i2c_probe()
421 mutex_init(&aw87390->lock); in aw87390_i2c_probe()
423 i2c_set_clientdata(i2c, aw87390); in aw87390_i2c_probe()
425 aw87390->regmap = devm_regmap_init_i2c(i2c, &aw87390_remap_config); in aw87390_i2c_probe()
426 if (IS_ERR(aw87390->regmap)) in aw87390_i2c_probe()
427 return dev_err_probe(&i2c->dev, PTR_ERR(aw87390->regmap), in aw87390_i2c_probe()
431 ret = aw87390_init(&aw87390, i2c, aw87390->regmap); in aw87390_i2c_probe()
435 ret = regmap_write(aw87390->regmap, AW87390_ID_REG, AW87390_SOFT_RESET_VALUE); in aw87390_i2c_probe()