Re: [PATCH v3 3/9] ALSA: hda: Introduce snd_hdac_stream_wait_drsm()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 27 Oct 2022 10:23:25 +0200,
Cezary Rojewski wrote:
> --- a/sound/hda/hdac_stream.c
> +++ b/sound/hda/hdac_stream.c
> @@ -821,6 +821,27 @@ void snd_hdac_stream_drsm_enable(struct hdac_bus *bus,
>  }
>  EXPORT_SYMBOL_GPL(snd_hdac_stream_drsm_enable);
>  
> +/*
> + * snd_hdac_stream_wait_drsm - wait for HW to clear RSM for a stream
> + * @azx_dev: HD-audio core stream to await RSM for
> + *
> + * Returns 0 on success and -ETIMEDOUT upon a timeout.
> + */
> +int snd_hdac_stream_wait_drsm(struct hdac_stream *azx_dev)
> +{
> +	struct hdac_bus *bus = azx_dev->bus;
> +	u32 mask, reg;
> +	int ret;
> +
> +	mask = 1 << azx_dev->index;
> +
> +	ret = readb_poll_timeout(bus->drsmcap + AZX_REG_DRSM_CTL, reg, !(reg & mask), 250, 2000);

Remember that HD-audio bus doesn't always allow readb().  Tegra
requires the aligned access, for example.


Takashi



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux