Lines Matching refs:wsa881x
689 static void wsa881x_init(struct wsa881x_priv *wsa881x) in wsa881x_init() argument
691 struct regmap *rm = wsa881x->regmap; in wsa881x_init()
694 regmap_read(rm, WSA881X_CHIP_ID1, &wsa881x->version); in wsa881x_init()
695 regmap_register_patch(wsa881x->regmap, wsa881x_rev_2_0, in wsa881x_init()
736 struct wsa881x_priv *wsa881x = snd_soc_component_get_drvdata(comp); in wsa881x_component_probe() local
738 snd_soc_component_init_regmap(comp, wsa881x->regmap); in wsa881x_component_probe()
888 struct wsa881x_priv *wsa881x = snd_soc_component_get_drvdata(comp); in wsa881x_visense_txfe_ctrl() local
891 regmap_multi_reg_write(wsa881x->regmap, wsa881x_vi_txfe_en_2_0, in wsa881x_visense_txfe_ctrl()
922 struct wsa881x_priv *wsa881x = snd_soc_component_get_drvdata(comp); in wsa881x_spkr_pa_event() local
929 regmap_multi_reg_write(wsa881x->regmap, wsa881x_pre_pmu_pa_2_0, in wsa881x_spkr_pa_event()
937 if (wsa881x->port_prepared[WSA881X_PORT_VISENSE]) { in wsa881x_spkr_pa_event()
947 if (wsa881x->port_prepared[WSA881X_PORT_VISENSE]) { in wsa881x_spkr_pa_event()
983 struct wsa881x_priv *wsa881x = dev_get_drvdata(dai->dev); in wsa881x_hw_params() local
986 wsa881x->active_ports = 0; in wsa881x_hw_params()
988 if (!wsa881x->port_enable[i]) in wsa881x_hw_params()
991 wsa881x->port_config[wsa881x->active_ports] = in wsa881x_hw_params()
993 wsa881x->active_ports++; in wsa881x_hw_params()
996 return sdw_stream_add_slave(wsa881x->slave, &wsa881x->sconfig, in wsa881x_hw_params()
997 wsa881x->port_config, wsa881x->active_ports, in wsa881x_hw_params()
998 wsa881x->sruntime); in wsa881x_hw_params()
1004 struct wsa881x_priv *wsa881x = dev_get_drvdata(dai->dev); in wsa881x_hw_free() local
1006 sdw_stream_remove_slave(wsa881x->slave, wsa881x->sruntime); in wsa881x_hw_free()
1014 struct wsa881x_priv *wsa881x = dev_get_drvdata(dai->dev); in wsa881x_set_sdw_stream() local
1016 wsa881x->sruntime = stream; in wsa881x_set_sdw_stream()
1023 struct wsa881x_priv *wsa881x = dev_get_drvdata(dai->dev); in wsa881x_digital_mute() local
1026 regmap_update_bits(wsa881x->regmap, WSA881X_SPKR_DRV_EN, 0x80, in wsa881x_digital_mute()
1029 regmap_update_bits(wsa881x->regmap, WSA881X_SPKR_DRV_EN, 0x80, in wsa881x_digital_mute()
1074 struct wsa881x_priv *wsa881x = dev_get_drvdata(&slave->dev); in wsa881x_update_status() local
1077 wsa881x_init(wsa881x); in wsa881x_update_status()
1086 struct wsa881x_priv *wsa881x = dev_get_drvdata(&slave->dev); in wsa881x_port_prep() local
1089 wsa881x->port_prepared[prepare_ch->num - 1] = true; in wsa881x_port_prep()
1091 wsa881x->port_prepared[prepare_ch->num - 1] = false; in wsa881x_port_prep()
1114 struct wsa881x_priv *wsa881x; in wsa881x_probe() local
1117 wsa881x = devm_kzalloc(dev, sizeof(*wsa881x), GFP_KERNEL); in wsa881x_probe()
1118 if (!wsa881x) in wsa881x_probe()
1121 wsa881x->sd_n = devm_gpiod_get_optional(dev, "powerdown", in wsa881x_probe()
1123 if (IS_ERR(wsa881x->sd_n)) in wsa881x_probe()
1124 return dev_err_probe(dev, PTR_ERR(wsa881x->sd_n), in wsa881x_probe()
1143 wsa881x->sd_n_val = gpiod_is_active_low(wsa881x->sd_n); in wsa881x_probe()
1144 if (!wsa881x->sd_n_val) in wsa881x_probe()
1147 dev_set_drvdata(dev, wsa881x); in wsa881x_probe()
1148 wsa881x->slave = pdev; in wsa881x_probe()
1149 wsa881x->dev = dev; in wsa881x_probe()
1150 wsa881x->sconfig.ch_count = 1; in wsa881x_probe()
1151 wsa881x->sconfig.bps = 1; in wsa881x_probe()
1152 wsa881x->sconfig.frame_rate = 48000; in wsa881x_probe()
1153 wsa881x->sconfig.direction = SDW_DATA_DIR_RX; in wsa881x_probe()
1154 wsa881x->sconfig.type = SDW_STREAM_PDM; in wsa881x_probe()
1159 gpiod_direction_output(wsa881x->sd_n, !wsa881x->sd_n_val); in wsa881x_probe()
1161 wsa881x->regmap = devm_regmap_init_sdw(pdev, &wsa881x_regmap_config); in wsa881x_probe()
1162 if (IS_ERR(wsa881x->regmap)) in wsa881x_probe()
1163 return dev_err_probe(dev, PTR_ERR(wsa881x->regmap), "regmap_init failed\n"); in wsa881x_probe()
1180 struct wsa881x_priv *wsa881x = dev_get_drvdata(dev); in wsa881x_runtime_suspend() local
1182 gpiod_direction_output(wsa881x->sd_n, wsa881x->sd_n_val); in wsa881x_runtime_suspend()
1194 struct wsa881x_priv *wsa881x = dev_get_drvdata(dev); in wsa881x_runtime_resume() local
1197 gpiod_direction_output(wsa881x->sd_n, !wsa881x->sd_n_val); in wsa881x_runtime_resume()
1203 gpiod_direction_output(wsa881x->sd_n, wsa881x->sd_n_val); in wsa881x_runtime_resume()