Re: [PATCH 1/2] ASoC: fsl: fsl_ssi: add ac97 fixed mode support

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

 



Hi Primoz,

On Mon, Oct 5, 2020 at 8:16 AM Primoz Fiser <primoz.fiser@xxxxxxxxx> wrote:
>
> SSI supports "variable" and "fixed" mode of operation in AC'97 mode. Up
> to now, driver always configured SSI port to operate in "variable" AC'97
> mode which is known to be unreliable with some CODECs, see:
> commit 01ca485171e3 ("ASoC: fsl_ssi: only enable proper channel slots in
> AC'97 mode") for more information on issues related to spurious SLOTREQ
> bits. But in summary, when SSI operates in AC'97 variable mode of
> operation, CODECs can sometimes send SLOTREQ bits for non-existent audio
> slots which then "stick" in SSI and completely break audio output.
> Contrary when operating SSI in AC'97 fixed mode, described issues were
> completely gone!
>
> Thus add support for operating SSI in AC'97 Fixed Mode of operation
> which provides better audio reliability when compared to AC'97 Variable
> Mode with some CODECs.
>
> Signed-off-by: Primoz Fiser <primoz.fiser@xxxxxxxxx>
> ---
>  sound/soc/fsl/fsl_ssi.c | 18 ++++++++++++++++--
>  1 file changed, 16 insertions(+), 2 deletions(-)
>
> diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
> index 404be27c15fe..3b89785f6de8 100644
> --- a/sound/soc/fsl/fsl_ssi.c
> +++ b/sound/soc/fsl/fsl_ssi.c
> @@ -243,6 +243,7 @@ struct fsl_ssi_soc_data {
>   * @dma_maxburst: Max number of words to transfer in one go. So far,
>   *                this is always the same as fifo_watermark.
>   * @ac97_reg_lock: Mutex lock to serialize AC97 register access operations
> + * @ac97_fixed_mode: SSI in AC97 fixed mode of operation
>   */
>  struct fsl_ssi {
>         struct regmap *regs;
> @@ -287,6 +288,7 @@ struct fsl_ssi {
>         u32 dma_maxburst;
>
>         struct mutex ac97_reg_lock;
> +       bool ac97_fixed_mode;
>  };
>
>  /*
> @@ -616,7 +618,12 @@ static void fsl_ssi_setup_ac97(struct fsl_ssi *ssi)
>         regmap_write(regs, REG_SSI_SRCCR, SSI_SxCCR_WL(17) | SSI_SxCCR_DC(13));
>
>         /* Enable AC97 mode and startup the SSI */
> -       regmap_write(regs, REG_SSI_SACNT, SSI_SACNT_AC97EN | SSI_SACNT_FV);
> +       if (ssi->ac97_fixed_mode) {
> +               regmap_write(regs, REG_SSI_SACNT, SSI_SACNT_AC97EN);
> +               regmap_write(regs, REG_SSI_SATAG, 0x9800);
> +       } else

Should be } else { because the previous if block used curly braces.

> +               regmap_write(regs, REG_SSI_SACNT,
> +                               SSI_SACNT_AC97EN | SSI_SACNT_FV);



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux