Lines Matching defs:rt1308
3 // rt1308-sdw.c -- rt1308 ALSA SoC audio driver
24 #include "rt1308.h"
25 #include "rt1308-sdw.h"
82 struct rt1308_sdw_priv *rt1308 = dev_get_drvdata(dev);
85 clk_freq = (rt1308->params.curr_dr_freq >> 1);
110 regmap_write(rt1308->regmap, 0xe0, value);
111 regmap_write(rt1308->regmap, 0xf0, value);
164 struct rt1308_sdw_priv *rt1308 = dev_get_drvdata(dev);
169 if (rt1308->hw_init)
172 if (rt1308->first_hw_init) {
173 regcache_cache_only(rt1308->regmap, false);
174 regcache_cache_bypass(rt1308->regmap, true);
180 if (!rt1308->first_hw_init) {
197 regmap_write(rt1308->regmap, RT1308_SDW_RESET, 0);
200 regmap_write(rt1308->regmap, 0xc360, 0x01);
201 regmap_write(rt1308->regmap, 0xc361, 0x80);
202 regmap_write(rt1308->regmap, 0xc7f0, 0x04);
203 regmap_write(rt1308->regmap, 0xc7f1, 0xfe);
205 regmap_write(rt1308->regmap, 0xc7f0, 0x44);
207 regmap_write(rt1308->regmap, 0xc240, 0x10);
209 regmap_read(rt1308->regmap, 0xc861, &tmp);
211 regmap_read(rt1308->regmap, 0xc860, &tmp);
213 regmap_read(rt1308->regmap, 0xc863, &tmp);
215 regmap_read(rt1308->regmap, 0xc862, &tmp);
217 regmap_read(rt1308->regmap, 0xc871, &tmp);
219 regmap_read(rt1308->regmap, 0xc870, &tmp);
221 regmap_read(rt1308->regmap, 0xc873, &tmp);
223 regmap_read(rt1308->regmap, 0xc872, &tmp);
231 regmap_write(rt1308->regmap, 0xc103, 0xc0);
232 regmap_write(rt1308->regmap, 0xc030, 0x17);
233 regmap_write(rt1308->regmap, 0xc031, 0x81);
234 regmap_write(rt1308->regmap, 0xc032, 0x26);
235 regmap_write(rt1308->regmap, 0xc040, 0x80);
236 regmap_write(rt1308->regmap, 0xc041, 0x80);
237 regmap_write(rt1308->regmap, 0xc042, 0x06);
238 regmap_write(rt1308->regmap, 0xc052, 0x0a);
239 regmap_write(rt1308->regmap, 0xc080, 0x0a);
240 regmap_write(rt1308->regmap, 0xc060, 0x02);
241 regmap_write(rt1308->regmap, 0xc061, 0x75);
242 regmap_write(rt1308->regmap, 0xc062, 0x05);
243 regmap_write(rt1308->regmap, 0xc171, 0x07);
244 regmap_write(rt1308->regmap, 0xc173, 0x0d);
245 regmap_write(rt1308->regmap, 0xc311, 0x7f);
246 regmap_write(rt1308->regmap, 0xc900, 0x90);
247 regmap_write(rt1308->regmap, 0xc1a0, 0x84);
248 regmap_write(rt1308->regmap, 0xc1a1, 0x01);
249 regmap_write(rt1308->regmap, 0xc360, 0x78);
250 regmap_write(rt1308->regmap, 0xc361, 0x87);
251 regmap_write(rt1308->regmap, 0xc0a1, 0x71);
252 regmap_write(rt1308->regmap, 0xc210, 0x00);
253 regmap_write(rt1308->regmap, 0xc070, 0x00);
254 regmap_write(rt1308->regmap, 0xc100, 0xd7);
255 regmap_write(rt1308->regmap, 0xc101, 0xd7);
256 regmap_write(rt1308->regmap, 0xc300, 0x09);
258 if (rt1308->first_hw_init) {
259 regcache_cache_bypass(rt1308->regmap, false);
260 regcache_mark_dirty(rt1308->regmap);
262 rt1308->first_hw_init = true;
265 rt1308->hw_init = true;
278 struct rt1308_sdw_priv *rt1308 = dev_get_drvdata(&slave->dev);
281 rt1308->status = status;
284 rt1308->hw_init = false;
290 if (rt1308->hw_init || rt1308->status != SDW_SLAVE_ATTACHED)
300 struct rt1308_sdw_priv *rt1308 = dev_get_drvdata(&slave->dev);
303 memcpy(&rt1308->params, params, sizeof(*params));
505 struct rt1308_sdw_priv *rt1308 =
514 rt1308->rx_mask = rx_mask;
515 rt1308->slots = slots;
525 struct rt1308_sdw_priv *rt1308 =
539 if (!rt1308->sdw_slave)
551 if (rt1308->slots) {
552 num_channels = rt1308->slots;
553 ch_mask = rt1308->rx_mask;
567 retval = sdw_stream_add_slave(rt1308->sdw_slave, &stream_config,
581 struct rt1308_sdw_priv *rt1308 =
586 if (!rt1308->sdw_slave)
589 sdw_stream_remove_slave(rt1308->sdw_slave, stream->sdw_stream);
628 .name = "rt1308-aif",
643 struct rt1308_sdw_priv *rt1308;
646 rt1308 = devm_kzalloc(dev, sizeof(*rt1308), GFP_KERNEL);
647 if (!rt1308)
650 dev_set_drvdata(dev, rt1308);
651 rt1308->sdw_slave = slave;
652 rt1308->regmap = regmap;
658 rt1308->hw_init = false;
659 rt1308->first_hw_init = false;
694 struct rt1308_sdw_priv *rt1308 = dev_get_drvdata(dev);
696 if (!rt1308->hw_init)
699 regcache_cache_only(rt1308->regmap, true);
709 struct rt1308_sdw_priv *rt1308 = dev_get_drvdata(dev);
712 if (!rt1308->first_hw_init)
727 regcache_cache_only(rt1308->regmap, false);
728 regcache_sync_region(rt1308->regmap, 0xc000, 0xcfff);
740 .name = "rt1308",