Lines Matching refs:wsa883x
1006 static void wsa883x_init(struct wsa883x_priv *wsa883x) in wsa883x_init() argument
1008 struct regmap *regmap = wsa883x->regmap; in wsa883x_init()
1012 wsa883x->variant = variant & WSA883X_ID_MASK; in wsa883x_init()
1015 wsa883x->version = version; in wsa883x_init()
1017 switch (wsa883x->variant) { in wsa883x_init()
1019 dev_info(wsa883x->dev, "WSA883X Version 1_%d, Variant: WSA8830\n", in wsa883x_init()
1020 wsa883x->version); in wsa883x_init()
1023 dev_info(wsa883x->dev, "WSA883X Version 1_%d, Variant: WSA8835\n", in wsa883x_init()
1024 wsa883x->version); in wsa883x_init()
1027 dev_info(wsa883x->dev, "WSA883X Version 1_%d, Variant: WSA8832\n", in wsa883x_init()
1028 wsa883x->version); in wsa883x_init()
1031 dev_info(wsa883x->dev, "WSA883X Version 1_%d, Variant: WSA8835_V2\n", in wsa883x_init()
1032 wsa883x->version); in wsa883x_init()
1038 wsa883x->comp_offset = COMP_OFFSET2; in wsa883x_init()
1043 if (wsa883x->variant == WSA8830 || wsa883x->variant == WSA8832) { in wsa883x_init()
1044 wsa883x->comp_offset = COMP_OFFSET3; in wsa883x_init()
1047 wsa883x->comp_offset); in wsa883x_init()
1054 struct wsa883x_priv *wsa883x = dev_get_drvdata(&slave->dev); in wsa883x_update_status() local
1057 wsa883x_init(wsa883x); in wsa883x_update_status()
1066 struct wsa883x_priv *wsa883x = dev_get_drvdata(&slave->dev); in wsa883x_port_prep() local
1069 wsa883x->port_prepared[prepare_ch->num - 1] = true; in wsa883x_port_prep()
1071 wsa883x->port_prepared[prepare_ch->num - 1] = false; in wsa883x_port_prep()
1085 struct wsa883x_priv *wsa883x = snd_soc_component_get_drvdata(component); in wsa_dev_mode_get() local
1087 ucontrol->value.enumerated.item[0] = wsa883x->dev_mode; in wsa_dev_mode_get()
1096 struct wsa883x_priv *wsa883x = snd_soc_component_get_drvdata(component); in wsa_dev_mode_put() local
1098 if (wsa883x->dev_mode == ucontrol->value.enumerated.item[0]) in wsa_dev_mode_put()
1101 wsa883x->dev_mode = ucontrol->value.enumerated.item[0]; in wsa_dev_mode_put()
1148 struct wsa883x_priv *wsa883x = snd_soc_component_get_drvdata(component); in wsa883x_get_comp_offset() local
1150 ucontrol->value.integer.value[0] = wsa883x->comp_offset; in wsa883x_get_comp_offset()
1159 struct wsa883x_priv *wsa883x = snd_soc_component_get_drvdata(component); in wsa883x_set_comp_offset() local
1161 if (wsa883x->comp_offset == ucontrol->value.integer.value[0]) in wsa883x_set_comp_offset()
1164 wsa883x->comp_offset = ucontrol->value.integer.value[0]; in wsa883x_set_comp_offset()
1171 struct wsa883x_priv *wsa883x = snd_soc_component_get_drvdata(comp); in wsa883x_codec_probe() local
1173 snd_soc_component_init_regmap(comp, wsa883x->regmap); in wsa883x_codec_probe()
1182 struct wsa883x_priv *wsa883x = snd_soc_component_get_drvdata(component); in wsa883x_spkr_event() local
1186 switch (wsa883x->dev_mode) { in wsa883x_spkr_event()
1214 if (wsa883x->port_enable[WSA883X_PORT_COMP]) in wsa883x_spkr_event()
1217 wsa883x->comp_offset); in wsa883x_spkr_event()
1287 struct wsa883x_priv *wsa883x = dev_get_drvdata(dai->dev); in wsa883x_hw_params() local
1290 wsa883x->active_ports = 0; in wsa883x_hw_params()
1292 if (!wsa883x->port_enable[i]) in wsa883x_hw_params()
1295 wsa883x->port_config[wsa883x->active_ports] = wsa883x_pconfig[i]; in wsa883x_hw_params()
1296 wsa883x->active_ports++; in wsa883x_hw_params()
1299 wsa883x->sconfig.frame_rate = params_rate(params); in wsa883x_hw_params()
1301 return sdw_stream_add_slave(wsa883x->slave, &wsa883x->sconfig, in wsa883x_hw_params()
1302 wsa883x->port_config, wsa883x->active_ports, in wsa883x_hw_params()
1303 wsa883x->sruntime); in wsa883x_hw_params()
1309 struct wsa883x_priv *wsa883x = dev_get_drvdata(dai->dev); in wsa883x_hw_free() local
1311 sdw_stream_remove_slave(wsa883x->slave, wsa883x->sruntime); in wsa883x_hw_free()
1319 struct wsa883x_priv *wsa883x = dev_get_drvdata(dai->dev); in wsa883x_set_sdw_stream() local
1321 wsa883x->sruntime = stream; in wsa883x_set_sdw_stream()
1374 struct wsa883x_priv *wsa883x; in wsa883x_probe() local
1378 wsa883x = devm_kzalloc(&pdev->dev, sizeof(*wsa883x), GFP_KERNEL); in wsa883x_probe()
1379 if (!wsa883x) in wsa883x_probe()
1382 wsa883x->vdd = devm_regulator_get(dev, "vdd"); in wsa883x_probe()
1383 if (IS_ERR(wsa883x->vdd)) { in wsa883x_probe()
1385 return PTR_ERR(wsa883x->vdd); in wsa883x_probe()
1388 ret = regulator_enable(wsa883x->vdd); in wsa883x_probe()
1394 wsa883x->sd_n = devm_gpiod_get_optional(&pdev->dev, "powerdown", in wsa883x_probe()
1396 if (IS_ERR(wsa883x->sd_n)) { in wsa883x_probe()
1398 ret = PTR_ERR(wsa883x->sd_n); in wsa883x_probe()
1402 dev_set_drvdata(&pdev->dev, wsa883x); in wsa883x_probe()
1403 wsa883x->slave = pdev; in wsa883x_probe()
1404 wsa883x->dev = &pdev->dev; in wsa883x_probe()
1405 wsa883x->sconfig.ch_count = 1; in wsa883x_probe()
1406 wsa883x->sconfig.bps = 1; in wsa883x_probe()
1407 wsa883x->sconfig.direction = SDW_DATA_DIR_RX; in wsa883x_probe()
1408 wsa883x->sconfig.type = SDW_STREAM_PDM; in wsa883x_probe()
1414 gpiod_direction_output(wsa883x->sd_n, 0); in wsa883x_probe()
1416 wsa883x->regmap = devm_regmap_init_sdw(pdev, &wsa883x_regmap_config); in wsa883x_probe()
1417 if (IS_ERR(wsa883x->regmap)) { in wsa883x_probe()
1419 ret = PTR_ERR(wsa883x->regmap); in wsa883x_probe()
1434 regulator_disable(wsa883x->vdd); in wsa883x_probe()