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