Lines Matching refs:mod
33 struct rsnd_mod mod; member
44 #define rsnd_src_sync_is_enabled(mod) (rsnd_mod_to_src(mod)->sen.val) argument
47 container_of((_mod), struct rsnd_src, mod)
66 static void rsnd_src_activation(struct rsnd_mod *mod) in rsnd_src_activation() argument
68 rsnd_mod_write(mod, SRC_SWRSR, 0); in rsnd_src_activation()
69 rsnd_mod_write(mod, SRC_SWRSR, 1); in rsnd_src_activation()
72 static void rsnd_src_halt(struct rsnd_mod *mod) in rsnd_src_halt() argument
74 rsnd_mod_write(mod, SRC_SRCIR, 1); in rsnd_src_halt()
75 rsnd_mod_write(mod, SRC_SWRSR, 0); in rsnd_src_halt()
79 struct rsnd_mod *mod) in rsnd_src_dma_req() argument
81 struct rsnd_priv *priv = rsnd_mod_to_priv(mod); in rsnd_src_dma_req()
85 SRC_NAME, mod, in rsnd_src_dma_req()
90 struct rsnd_mod *mod) in rsnd_src_convert_rate() argument
93 struct rsnd_src *src = rsnd_mod_to_src(mod); in rsnd_src_convert_rate()
99 if (!rsnd_src_sync_is_enabled(mod)) in rsnd_src_convert_rate()
201 struct rsnd_mod *mod) in rsnd_src_set_convert_rate() argument
203 struct rsnd_priv *priv = rsnd_mod_to_priv(mod); in rsnd_src_set_convert_rate()
239 use_src = (fin != fout) | rsnd_src_sync_is_enabled(mod); in rsnd_src_set_convert_rate()
244 adinr = rsnd_get_adinr_bit(mod, io) | chan; in rsnd_src_set_convert_rate()
268 if (rsnd_src_sync_is_enabled(mod)) { in rsnd_src_set_convert_rate()
282 switch (rsnd_mod_id(mod)) { in rsnd_src_set_convert_rate()
313 switch (rsnd_mod_id(mod)) { in rsnd_src_set_convert_rate()
328 tmp = rsnd_get_busif_shift(io, mod); in rsnd_src_set_convert_rate()
332 rsnd_mod_write(mod, SRC_ROUTE_MODE0, route); in rsnd_src_set_convert_rate()
334 rsnd_mod_write(mod, SRC_SRCIR, 1); /* initialize */ in rsnd_src_set_convert_rate()
335 rsnd_mod_write(mod, SRC_ADINR, adinr); in rsnd_src_set_convert_rate()
336 rsnd_mod_write(mod, SRC_IFSCR, ifscr); in rsnd_src_set_convert_rate()
337 rsnd_mod_write(mod, SRC_IFSVR, fsrate); in rsnd_src_set_convert_rate()
338 rsnd_mod_write(mod, SRC_SRCCR, cr); in rsnd_src_set_convert_rate()
339 rsnd_mod_write(mod, SRC_BSDSR, bsdsr_table[idx]); in rsnd_src_set_convert_rate()
340 rsnd_mod_write(mod, SRC_BSISR, bsisr_table[idx]); in rsnd_src_set_convert_rate()
341 rsnd_mod_write(mod, SRC_SRCIR, 0); /* cancel initialize */ in rsnd_src_set_convert_rate()
343 rsnd_mod_write(mod, SRC_I_BUSIF_MODE, i_busif); in rsnd_src_set_convert_rate()
344 rsnd_mod_write(mod, SRC_O_BUSIF_MODE, o_busif); in rsnd_src_set_convert_rate()
346 rsnd_mod_write(mod, SRC_BUSIF_DALIGN, rsnd_get_dalign(mod, io)); in rsnd_src_set_convert_rate()
348 rsnd_adg_set_src_timesel_gen2(mod, io, fin, fout); in rsnd_src_set_convert_rate()
356 static int rsnd_src_irq(struct rsnd_mod *mod, in rsnd_src_irq() argument
361 struct rsnd_src *src = rsnd_mod_to_src(mod); in rsnd_src_irq()
364 int id = rsnd_mod_id(mod); in rsnd_src_irq()
385 if (rsnd_src_sync_is_enabled(mod)) in rsnd_src_irq()
388 rsnd_mod_write(mod, SRC_INT_ENABLE0, int_val); in rsnd_src_irq()
389 rsnd_mod_bset(mod, SCU_SYS_INT_EN0, sys_int_mask, sys_int_val); in rsnd_src_irq()
390 rsnd_mod_bset(mod, SCU_SYS_INT_EN1, sys_int_mask, sys_int_val); in rsnd_src_irq()
395 static void rsnd_src_status_clear(struct rsnd_mod *mod) in rsnd_src_status_clear() argument
397 u32 val = OUF_SRC(rsnd_mod_id(mod)); in rsnd_src_status_clear()
399 rsnd_mod_write(mod, SCU_SYS_STATUS0, val); in rsnd_src_status_clear()
400 rsnd_mod_write(mod, SCU_SYS_STATUS1, val); in rsnd_src_status_clear()
403 static bool rsnd_src_error_occurred(struct rsnd_mod *mod) in rsnd_src_error_occurred() argument
405 struct rsnd_priv *priv = rsnd_mod_to_priv(mod); in rsnd_src_error_occurred()
411 val0 = val1 = OUF_SRC(rsnd_mod_id(mod)); in rsnd_src_error_occurred()
418 if (rsnd_src_sync_is_enabled(mod)) in rsnd_src_error_occurred()
421 status0 = rsnd_mod_read(mod, SCU_SYS_STATUS0); in rsnd_src_error_occurred()
422 status1 = rsnd_mod_read(mod, SCU_SYS_STATUS1); in rsnd_src_error_occurred()
425 rsnd_mod_name(mod), status0, status1); in rsnd_src_error_occurred()
433 static int rsnd_src_start(struct rsnd_mod *mod, in rsnd_src_start() argument
444 val = (rsnd_io_to_mod_dvc(io) && !rsnd_src_sync_is_enabled(mod)) ? in rsnd_src_start()
447 rsnd_mod_write(mod, SRC_CTRL, val); in rsnd_src_start()
452 static int rsnd_src_stop(struct rsnd_mod *mod, in rsnd_src_stop() argument
456 rsnd_mod_write(mod, SRC_CTRL, 0); in rsnd_src_stop()
461 static int rsnd_src_init(struct rsnd_mod *mod, in rsnd_src_init() argument
465 struct rsnd_src *src = rsnd_mod_to_src(mod); in rsnd_src_init()
471 ret = rsnd_mod_power_on(mod); in rsnd_src_init()
475 rsnd_src_activation(mod); in rsnd_src_init()
477 rsnd_src_set_convert_rate(io, mod); in rsnd_src_init()
479 rsnd_src_status_clear(mod); in rsnd_src_init()
484 static int rsnd_src_quit(struct rsnd_mod *mod, in rsnd_src_quit() argument
488 struct rsnd_src *src = rsnd_mod_to_src(mod); in rsnd_src_quit()
490 rsnd_src_halt(mod); in rsnd_src_quit()
492 rsnd_mod_power_off(mod); in rsnd_src_quit()
500 static void __rsnd_src_interrupt(struct rsnd_mod *mod, in __rsnd_src_interrupt() argument
503 struct rsnd_priv *priv = rsnd_mod_to_priv(mod); in __rsnd_src_interrupt()
512 if (rsnd_src_error_occurred(mod)) in __rsnd_src_interrupt()
515 rsnd_src_status_clear(mod); in __rsnd_src_interrupt()
526 struct rsnd_mod *mod = data; in rsnd_src_interrupt() local
528 rsnd_mod_interrupt(mod, __rsnd_src_interrupt); in rsnd_src_interrupt()
533 static int rsnd_src_probe_(struct rsnd_mod *mod, in rsnd_src_probe_() argument
537 struct rsnd_src *src = rsnd_mod_to_src(mod); in rsnd_src_probe_()
551 dev_name(dev), mod); in rsnd_src_probe_()
556 ret = rsnd_dma_attach(io, mod, &src->dma); in rsnd_src_probe_()
561 static int rsnd_src_pcm_new(struct rsnd_mod *mod, in rsnd_src_pcm_new() argument
565 struct rsnd_src *src = rsnd_mod_to_src(mod); in rsnd_src_pcm_new()
582 ret = rsnd_kctrl_new_s(mod, io, rtd, in rsnd_src_pcm_new()
592 ret = rsnd_kctrl_new_s(mod, io, rtd, in rsnd_src_pcm_new()
606 struct rsnd_mod *mod) in rsnd_src_debug_info() argument
608 rsnd_debugfs_mod_reg_show(m, mod, RSND_GEN2_SCU, in rsnd_src_debug_info()
609 rsnd_mod_id(mod) * 0x20, 0x20); in rsnd_src_debug_info()
611 rsnd_debugfs_mod_reg_show(m, mod, RSND_GEN2_SCU, in rsnd_src_debug_info()
614 rsnd_debugfs_mod_reg_show(m, mod, RSND_GEN2_SCU, in rsnd_src_debug_info()
615 0x200 + rsnd_mod_id(mod) * 0x40, 0x40); in rsnd_src_debug_info()