Lines Matching full:wcd

144 int wcd939x_sdw_hw_params(struct wcd939x_sdw_priv *wcd,  in wcd939x_sdw_hw_params()  argument
153 wcd->sconfig.ch_count = 1; in wcd939x_sdw_hw_params()
154 wcd->active_ports = 0; in wcd939x_sdw_hw_params()
156 ch_mask = wcd->port_config[i].ch_mask; in wcd939x_sdw_hw_params()
162 wcd->sconfig.ch_count++; in wcd939x_sdw_hw_params()
164 port_config[wcd->active_ports] = wcd->port_config[i]; in wcd939x_sdw_hw_params()
165 wcd->active_ports++; in wcd939x_sdw_hw_params()
168 wcd->sconfig.bps = 1; in wcd939x_sdw_hw_params()
169 wcd->sconfig.frame_rate = params_rate(params); in wcd939x_sdw_hw_params()
170 if (wcd->is_tx) in wcd939x_sdw_hw_params()
171 wcd->sconfig.direction = SDW_DATA_DIR_TX; in wcd939x_sdw_hw_params()
173 wcd->sconfig.direction = SDW_DATA_DIR_RX; in wcd939x_sdw_hw_params()
175 wcd->sconfig.type = SDW_STREAM_PCM; in wcd939x_sdw_hw_params()
177 return sdw_stream_add_slave(wcd->sdev, &wcd->sconfig, &port_config[0], in wcd939x_sdw_hw_params()
178 wcd->active_ports, wcd->sruntime); in wcd939x_sdw_hw_params()
182 int wcd939x_sdw_free(struct wcd939x_sdw_priv *wcd, in wcd939x_sdw_free() argument
186 sdw_stream_remove_slave(wcd->sdev, wcd->sruntime); in wcd939x_sdw_free()
192 int wcd939x_sdw_set_sdw_stream(struct wcd939x_sdw_priv *wcd, in wcd939x_sdw_set_sdw_stream() argument
196 wcd->sruntime = stream; in wcd939x_sdw_set_sdw_stream()
202 struct regmap *wcd939x_swr_get_regmap(struct wcd939x_sdw_priv *wcd) in wcd939x_swr_get_regmap() argument
204 if (wcd->regmap) in wcd939x_swr_get_regmap()
205 return wcd->regmap; in wcd939x_swr_get_regmap()
214 struct wcd939x_sdw_priv *wcd = dev_get_drvdata(&slave->dev); in wcd9390_update_status() local
216 if (wcd->regmap && status == SDW_SLAVE_ATTACHED) { in wcd9390_update_status()
218 regcache_cache_only(wcd->regmap, false); in wcd9390_update_status()
219 return regcache_sync(wcd->regmap); in wcd9390_update_status()
243 struct wcd939x_sdw_priv *wcd = dev_get_drvdata(&slave->dev); in wcd9390_interrupt_callback() local
244 struct irq_domain *slave_irq = wcd->slave_irq; in wcd9390_interrupt_callback()
249 regmap_read(wcd->regmap, WCD939X_DIGITAL_INTR_STATUS_0, &sts1); in wcd9390_interrupt_callback()
250 regmap_read(wcd->regmap, WCD939X_DIGITAL_INTR_STATUS_1, &sts2); in wcd9390_interrupt_callback()
251 regmap_read(wcd->regmap, WCD939X_DIGITAL_INTR_STATUS_2, &sts3); in wcd9390_interrupt_callback()
1421 struct wcd939x_sdw_priv *wcd; in wcd9390_probe() local
1424 wcd = devm_kzalloc(dev, sizeof(*wcd), GFP_KERNEL); in wcd9390_probe()
1425 if (!wcd) in wcd9390_probe()
1433 wcd->is_tx = true; in wcd9390_probe()
1448 wcd->sdev = pdev; in wcd9390_probe()
1449 dev_set_drvdata(dev, wcd); in wcd9390_probe()
1455 if (wcd->is_tx) { in wcd9390_probe()
1458 wcd->ch_info = &wcd939x_sdw_tx_ch_info[0]; in wcd9390_probe()
1463 wcd->ch_info = &wcd939x_sdw_rx_ch_info[0]; in wcd9390_probe()
1466 if (wcd->is_tx) { in wcd9390_probe()
1472 wcd->regmap = regmap_init_sdw(pdev, &wcd939x_regmap_config); in wcd9390_probe()
1473 if (IS_ERR(wcd->regmap)) in wcd9390_probe()
1474 return dev_err_probe(dev, PTR_ERR(wcd->regmap), in wcd9390_probe()
1478 regcache_cache_only(wcd->regmap, true); in wcd9390_probe()
1494 struct wcd939x_sdw_priv *wcd = dev_get_drvdata(dev); in wcd9390_remove() local
1498 if (wcd->regmap) in wcd9390_remove()
1499 regmap_exit(wcd->regmap); in wcd9390_remove()
1512 struct wcd939x_sdw_priv *wcd = dev_get_drvdata(dev); in wcd939x_sdw_runtime_suspend() local
1514 if (wcd->regmap) { in wcd939x_sdw_runtime_suspend()
1515 regcache_cache_only(wcd->regmap, true); in wcd939x_sdw_runtime_suspend()
1516 regcache_mark_dirty(wcd->regmap); in wcd939x_sdw_runtime_suspend()
1524 struct wcd939x_sdw_priv *wcd = dev_get_drvdata(dev); in wcd939x_sdw_runtime_resume() local
1526 if (wcd->regmap) { in wcd939x_sdw_runtime_resume()
1527 regcache_cache_only(wcd->regmap, false); in wcd939x_sdw_runtime_resume()
1528 regcache_sync(wcd->regmap); in wcd939x_sdw_runtime_resume()