@@ -43,13 +43,17 @@ static void azx_clear_corbrp(struct hdac_bus *bus)
4343void snd_hdac_bus_init_cmd_io (struct hdac_bus * bus )
4444{
4545 WARN_ON_ONCE (!bus -> rb .area );
46+ dma_addr_t corb_addr , rirb_addr ;
4647
4748 spin_lock_irq (& bus -> reg_lock );
4849 /* CORB set up */
4950 bus -> corb .addr = bus -> rb .addr ;
5051 bus -> corb .buf = (__le32 * )bus -> rb .area ;
51- snd_hdac_chip_writel (bus , CORBLBASE , (u32 )bus -> corb .addr );
52- snd_hdac_chip_writel (bus , CORBUBASE , upper_32_bits (bus -> corb .addr ));
52+ corb_addr = bus -> corb .addr ;
53+ if (bus -> addr_host_to_hdac )
54+ corb_addr = bus -> addr_host_to_hdac (bus , bus -> corb .addr );
55+ snd_hdac_chip_writel (bus , CORBLBASE , (u32 )corb_addr );
56+ snd_hdac_chip_writel (bus , CORBUBASE , upper_32_bits (corb_addr ));
5357
5458 /* set the corb size to 256 entries (ULI requires explicitly) */
5559 snd_hdac_chip_writeb (bus , CORBSIZE , 0x02 );
@@ -69,8 +73,11 @@ void snd_hdac_bus_init_cmd_io(struct hdac_bus *bus)
6973 bus -> rirb .buf = (__le32 * )(bus -> rb .area + 2048 );
7074 bus -> rirb .wp = bus -> rirb .rp = 0 ;
7175 memset (bus -> rirb .cmds , 0 , sizeof (bus -> rirb .cmds ));
72- snd_hdac_chip_writel (bus , RIRBLBASE , (u32 )bus -> rirb .addr );
73- snd_hdac_chip_writel (bus , RIRBUBASE , upper_32_bits (bus -> rirb .addr ));
76+ rirb_addr = bus -> rirb .addr ;
77+ if (bus -> addr_host_to_hdac )
78+ rirb_addr = bus -> addr_host_to_hdac (bus , bus -> rirb .addr );
79+ snd_hdac_chip_writel (bus , RIRBLBASE , (u32 )rirb_addr );
80+ snd_hdac_chip_writel (bus , RIRBUBASE , upper_32_bits (rirb_addr ));
7481
7582 /* set the rirb size to 256 entries (ULI requires explicitly) */
7683 snd_hdac_chip_writeb (bus , RIRBSIZE , 0x02 );
@@ -552,6 +559,8 @@ static void azx_int_clear(struct hdac_bus *bus)
552559 */
553560bool snd_hdac_bus_init_chip (struct hdac_bus * bus , bool full_reset )
554561{
562+ dma_addr_t posbuf_addr ;
563+
555564 if (bus -> chip_init )
556565 return false;
557566
@@ -569,8 +578,12 @@ bool snd_hdac_bus_init_chip(struct hdac_bus *bus, bool full_reset)
569578
570579 /* program the position buffer */
571580 if (bus -> use_posbuf && bus -> posbuf .addr ) {
572- snd_hdac_chip_writel (bus , DPLBASE , (u32 )bus -> posbuf .addr );
573- snd_hdac_chip_writel (bus , DPUBASE , upper_32_bits (bus -> posbuf .addr ));
581+ posbuf_addr = bus -> posbuf .addr ;
582+ if (bus -> addr_host_to_hdac )
583+ posbuf_addr = bus -> addr_host_to_hdac (bus , bus -> posbuf .addr );
584+
585+ snd_hdac_chip_writel (bus , DPLBASE , (u32 )posbuf_addr );
586+ snd_hdac_chip_writel (bus , DPUBASE , upper_32_bits (posbuf_addr ));
574587 }
575588
576589 bus -> chip_init = true;
0 commit comments