Lines Matching full:memif

44 	struct mtk_base_afe_memif *memif = &afe->memif[memif_num];  in mtk_afe_fe_startup()  local
48 memif->substream = substream; in mtk_afe_fe_startup()
53 mtk_regmap_update_bits(afe->regmap, memif->data->agent_disable_reg, in mtk_afe_fe_startup()
54 1, 0, memif->data->agent_disable_shift); in mtk_afe_fe_startup()
81 /* dynamic allocate irq to memif */ in mtk_afe_fe_startup()
82 if (memif->irq_usage < 0) { in mtk_afe_fe_startup()
87 memif->irq_usage = irq_id; in mtk_afe_fe_startup()
103 struct mtk_base_afe_memif *memif = &afe->memif[snd_soc_rtd_to_cpu(rtd, 0)->id]; in mtk_afe_fe_shutdown() local
106 irq_id = memif->irq_usage; in mtk_afe_fe_shutdown()
108 mtk_regmap_update_bits(afe->regmap, memif->data->agent_disable_reg, in mtk_afe_fe_shutdown()
109 1, 1, memif->data->agent_disable_shift); in mtk_afe_fe_shutdown()
111 if (!memif->const_irq) { in mtk_afe_fe_shutdown()
113 memif->irq_usage = -1; in mtk_afe_fe_shutdown()
114 memif->substream = NULL; in mtk_afe_fe_shutdown()
126 struct mtk_base_afe_memif *memif = &afe->memif[id]; in mtk_afe_fe_hw_params() local
136 __func__, memif->data->name, in mtk_afe_fe_hw_params()
203 struct mtk_base_afe_memif *memif = &afe->memif[id]; in mtk_afe_fe_trigger() local
204 struct mtk_base_afe_irq *irqs = &afe->irqs[memif->irq_usage]; in mtk_afe_fe_trigger()
210 dev_dbg(afe->dev, "%s %s cmd=%d\n", __func__, memif->data->name, cmd); in mtk_afe_fe_trigger()
217 dev_err(afe->dev, "%s(), error, id %d, memif enable, ret %d\n", in mtk_afe_fe_trigger()
246 dev_err(afe->dev, "%s(), error, id %d, memif enable, ret %d\n", in mtk_afe_fe_trigger()
375 struct mtk_base_afe_memif *memif = &afe->memif[id]; in mtk_memif_set_enable() local
377 if (memif->data->enable_shift < 0) { in mtk_memif_set_enable()
382 return mtk_regmap_update_bits(afe->regmap, memif->data->enable_reg, in mtk_memif_set_enable()
383 1, 1, memif->data->enable_shift); in mtk_memif_set_enable()
389 struct mtk_base_afe_memif *memif = &afe->memif[id]; in mtk_memif_set_disable() local
391 if (memif->data->enable_shift < 0) { in mtk_memif_set_disable()
396 return mtk_regmap_update_bits(afe->regmap, memif->data->enable_reg, in mtk_memif_set_disable()
397 1, 0, memif->data->enable_shift); in mtk_memif_set_disable()
406 struct mtk_base_afe_memif *memif = &afe->memif[id]; in mtk_memif_set_addr() local
411 memif->dma_area = dma_area; in mtk_memif_set_addr()
412 memif->dma_addr = dma_addr; in mtk_memif_set_addr()
413 memif->dma_bytes = dma_bytes; in mtk_memif_set_addr()
416 mtk_regmap_write(afe->regmap, memif->data->reg_ofs_base, in mtk_memif_set_addr()
419 if (memif->data->reg_ofs_end) in mtk_memif_set_addr()
421 memif->data->reg_ofs_end, in mtk_memif_set_addr()
425 memif->data->reg_ofs_base + in mtk_memif_set_addr()
430 if (memif->data->reg_ofs_base_msb) { in mtk_memif_set_addr()
431 mtk_regmap_write(afe->regmap, memif->data->reg_ofs_base_msb, in mtk_memif_set_addr()
434 memif->data->reg_ofs_end_msb, in mtk_memif_set_addr()
439 * set MSB to 33-bit, for memif address in mtk_memif_set_addr()
440 * only for memif base address, if msb_end_reg exists in mtk_memif_set_addr()
442 if (memif->data->msb_reg) in mtk_memif_set_addr()
443 mtk_regmap_update_bits(afe->regmap, memif->data->msb_reg, in mtk_memif_set_addr()
444 1, msb_at_bit33, memif->data->msb_shift); in mtk_memif_set_addr()
446 /* set MSB to 33-bit, for memif end address */ in mtk_memif_set_addr()
447 if (memif->data->msb_end_reg) in mtk_memif_set_addr()
448 mtk_regmap_update_bits(afe->regmap, memif->data->msb_end_reg, in mtk_memif_set_addr()
450 memif->data->msb_end_shift); in mtk_memif_set_addr()
459 struct mtk_base_afe_memif *memif = &afe->memif[id]; in mtk_memif_set_channel() local
462 if (memif->data->mono_shift < 0) in mtk_memif_set_channel()
465 if (memif->data->quad_ch_mask) { in mtk_memif_set_channel()
468 mtk_regmap_update_bits(afe->regmap, memif->data->quad_ch_reg, in mtk_memif_set_channel()
469 memif->data->quad_ch_mask, in mtk_memif_set_channel()
470 quad_ch, memif->data->quad_ch_shift); in mtk_memif_set_channel()
473 if (memif->data->mono_invert) in mtk_memif_set_channel()
478 /* for specific configuration of memif mono mode */ in mtk_memif_set_channel()
479 if (memif->data->int_odd_flag_reg) in mtk_memif_set_channel()
481 memif->data->int_odd_flag_reg, in mtk_memif_set_channel()
483 memif->data->int_odd_flag_shift); in mtk_memif_set_channel()
485 return mtk_regmap_update_bits(afe->regmap, memif->data->mono_reg, in mtk_memif_set_channel()
486 1, mono, memif->data->mono_shift); in mtk_memif_set_channel()
493 struct mtk_base_afe_memif *memif = &afe->memif[id]; in mtk_memif_set_rate_fs() local
495 if (memif->data->fs_shift >= 0) in mtk_memif_set_rate_fs()
496 mtk_regmap_update_bits(afe->regmap, memif->data->fs_reg, in mtk_memif_set_rate_fs()
497 memif->data->fs_maskbit, in mtk_memif_set_rate_fs()
498 fs, memif->data->fs_shift); in mtk_memif_set_rate_fs()
551 struct mtk_base_afe_memif *memif = &afe->memif[id]; in mtk_memif_set_format() local
581 mtk_regmap_update_bits(afe->regmap, memif->data->hd_reg, in mtk_memif_set_format()
582 0x3, hd_audio, memif->data->hd_shift); in mtk_memif_set_format()
584 mtk_regmap_update_bits(afe->regmap, memif->data->hd_align_reg, in mtk_memif_set_format()
585 0x1, hd_align, memif->data->hd_align_mshift); in mtk_memif_set_format()
594 const struct mtk_base_memif_data *memif_data = afe->memif[id].data; in mtk_memif_set_pbuf_size()