Lines Matching refs:wcd
102 int wcd938x_sdw_hw_params(struct wcd938x_sdw_priv *wcd,
111 wcd->sconfig.ch_count = 1;
112 wcd->active_ports = 0;
114 ch_mask = wcd->port_config[i].ch_mask;
120 wcd->sconfig.ch_count++;
122 port_config[wcd->active_ports] = wcd->port_config[i];
123 wcd->active_ports++;
126 wcd->sconfig.bps = 1;
127 wcd->sconfig.frame_rate = params_rate(params);
128 if (wcd->is_tx)
129 wcd->sconfig.direction = SDW_DATA_DIR_TX;
131 wcd->sconfig.direction = SDW_DATA_DIR_RX;
133 wcd->sconfig.type = SDW_STREAM_PCM;
135 return sdw_stream_add_slave(wcd->sdev, &wcd->sconfig,
136 &port_config[0], wcd->active_ports,
137 wcd->sruntime);
141 int wcd938x_sdw_free(struct wcd938x_sdw_priv *wcd,
145 sdw_stream_remove_slave(wcd->sdev, wcd->sruntime);
151 int wcd938x_sdw_set_sdw_stream(struct wcd938x_sdw_priv *wcd,
155 wcd->sruntime = stream;
164 struct wcd938x_sdw_priv *wcd = dev_get_drvdata(&slave->dev);
166 if (wcd->regmap && (status == SDW_SLAVE_ATTACHED)) {
168 regcache_cache_only(wcd->regmap, false);
169 return regcache_sync(wcd->regmap);
186 struct wcd938x_sdw_priv *wcd = dev_get_drvdata(&slave->dev);
187 struct irq_domain *slave_irq = wcd->slave_irq;
192 regmap_read(wcd->regmap, WCD938X_DIGITAL_INTR_STATUS_0, &sts1);
193 regmap_read(wcd->regmap, WCD938X_DIGITAL_INTR_STATUS_1, &sts2);
194 regmap_read(wcd->regmap, WCD938X_DIGITAL_INTR_STATUS_2, &sts3);
1221 struct wcd938x_sdw_priv *wcd;
1224 wcd = devm_kzalloc(dev, sizeof(*wcd), GFP_KERNEL);
1225 if (!wcd)
1233 wcd->is_tx = true;
1246 wcd->sdev = pdev;
1247 dev_set_drvdata(dev, wcd);
1254 if (wcd->is_tx) {
1257 wcd->ch_info = &wcd938x_sdw_tx_ch_info[0];
1262 wcd->ch_info = &wcd938x_sdw_rx_ch_info[0];
1265 if (wcd->is_tx) {
1266 wcd->regmap = devm_regmap_init_sdw(pdev, &wcd938x_regmap_config);
1267 if (IS_ERR(wcd->regmap))
1268 return dev_err_probe(dev, PTR_ERR(wcd->regmap),
1272 regcache_cache_only(wcd->regmap, true);
1316 struct wcd938x_sdw_priv *wcd = dev_get_drvdata(dev);
1318 if (wcd->regmap) {
1319 regcache_cache_only(wcd->regmap, true);
1320 regcache_mark_dirty(wcd->regmap);
1328 struct wcd938x_sdw_priv *wcd = dev_get_drvdata(dev);
1330 if (wcd->regmap) {
1331 regcache_cache_only(wcd->regmap, false);
1332 regcache_sync(wcd->regmap);