[0/3] ARM: omap4: embt2ws: Add audio support

Message ID 20230705190324.355282-1-andreas@kemnade.info
Headers
Series ARM: omap4: embt2ws: Add audio support |

Message

Andreas Kemnade July 5, 2023, 7:03 p.m. UTC
  Add audio support for Epson Moverio BT-200.
In the vendor kernel, the MCBSP side is used as master,
so do it here also that way.

Andreas Kemnade (3):
  ASoC: ti: omap-mcbsp: Ignore errors for getting fck_src
  ASoC: tlv320aic3x: use BCLK instead of MCLK if not in master mode
  ARM: dts: omap4: embt2ws: Add audio support

 arch/arm/boot/dts/omap4-epson-embt2ws.dts | 21 +++++++++++++++++++++
 sound/soc/codecs/tlv320aic3x.c            |  4 ++++
 sound/soc/ti/omap-mcbsp.c                 |  4 ++--
 3 files changed, 27 insertions(+), 2 deletions(-)
  

Comments

Mark Brown July 5, 2023, 7:21 p.m. UTC | #1
On Wed, Jul 05, 2023 at 09:03:23PM +0200, Andreas Kemnade wrote:

> +	/* probably no mclk if not master, so rely on bitclk */
> +	if (!aic3x->master)
> +		clk_id = 2;
> +

This is fairly clearly a massive hack, we're just silently ignoring the
clock we were asked to configure and choosing another one which is
likely at a different rate to that we were expecting and sadly the
driver didn't provide an automatic mode due to how old it is.  We also
appear to try to use the configured clock rate during PLL setup which
still happens in hw_params() even with this change which is a bit of a
concern here.  Are you sure hw_params ends up doing the right thing, and
that there are no other systems that get broken by this (perhaps ones
sending a lower BCLK for example)?

It would be nicer to set the clock via the DT bindings, ideally with the
clock bindings...
  
Mark Brown July 5, 2023, 7:23 p.m. UTC | #2
On Wed, Jul 05, 2023 at 09:03:24PM +0200, Andreas Kemnade wrote:

> +	sound {
> +		compatible = "simple-audio-card";

For new usage audio-graph-card2 is preferred, it's a superset of the
functionality and much more flexible.

> +		simple-audio-card,codec {
> +			sound-dai = <&tlv320aic3x>;
> +			system-clock-frequency = <24000000>;
> +		};
> +	};

Are you *sure* the BCLK always comes out at this rate?
  
Mark Brown July 19, 2023, 5:47 p.m. UTC | #3
On Wed, 05 Jul 2023 21:03:21 +0200, Andreas Kemnade wrote:
> Add audio support for Epson Moverio BT-200.
> In the vendor kernel, the MCBSP side is used as master,
> so do it here also that way.
> 
> Andreas Kemnade (3):
>   ASoC: ti: omap-mcbsp: Ignore errors for getting fck_src
>   ASoC: tlv320aic3x: use BCLK instead of MCLK if not in master mode
>   ARM: dts: omap4: embt2ws: Add audio support
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/3] ASoC: ti: omap-mcbsp: Ignore errors for getting fck_src
      commit: 82e7c8b93a0614b1725e0ea11d0a77b04e058716

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark