mbox series

[0/7] Add dts for Rpi4 + Cirrus Lochnagar and codecs

Message ID 20201014145418.31838-1-rf@opensource.cirrus.com
Headers show
Series Add dts for Rpi4 + Cirrus Lochnagar and codecs | expand

Message

Richard Fitzgerald Oct. 14, 2020, 2:54 p.m. UTC
This set of patches provides support for using the Cirrus Logic
Lochnagar audio development platform plus Cirrus Logic Madera/Arizona
codecs with the simple-card machine driver and a Raspberry Pi4. The
ultimate aim is to provide the dts file but some updates are needed to
the simple-card machine driver.

Patches are needed to simple-card to enable support for setting the
component sysclks and plls. The codec sysclks and plls cannot be
placed under the clock framwork because they are I2C/SPI-connected
peripherals and access to the registers would cause a nested get
of the I2C/SPI bus clock. The clock framework does not support this
and it would result in a deadlock.

Richard Fitzgerald (7):
  of: base: Add of_count_phandle_with_fixed_args()
  ASoC: simple-card: Add plls and sysclks DT schema
  ASoC: simple-card: Support setting component plls and sysclks
  ASoC: arizona: Allow codecs to be selected from kernel config
  ASoC: madera: Allow codecs to be selected from kernel config
  ARM: dts: Add dts for Raspberry Pi 4 + Cirrus Logic Lochnagar2
  MAINTAINERS: Add dts for Cirrus Logic Lochnagar on RPi4

 .../bindings/sound/simple-card.yaml           |   56 +
 MAINTAINERS                                   |    1 +
 arch/arm/boot/dts/Makefile                    |    1 +
 .../dts/bcm2711-rpi4b-cirrus-lochnagar.dts    | 1296 +++++++++++++++++
 drivers/of/base.c                             |   42 +
 include/linux/of.h                            |    9 +
 include/sound/simple_card_utils.h             |   24 +
 sound/soc/codecs/Kconfig                      |   18 +-
 sound/soc/generic/simple-card-utils.c         |  184 +++
 sound/soc/generic/simple-card.c               |   14 +-
 10 files changed, 1635 insertions(+), 10 deletions(-)
 create mode 100644 arch/arm/boot/dts/bcm2711-rpi4b-cirrus-lochnagar.dts

Comments

Mark Brown Oct. 16, 2020, 3:18 p.m. UTC | #1
On Fri, Oct 16, 2020 at 02:30:08PM +0100, Richard Fitzgerald wrote:
> On 14/10/2020 19:56, Mark Brown wrote:

> > Why extend simple-card and not the more modern and flexible
> > audio-graph-card?

> I'm struggling to understand how to use audio-graph-card where there are
> multiple alternative codecs. The host I2S endpoint has to point back to
> the codec endpoint, like this:

OK, this seems like a more urgent problem to address given that the
graph card is supposed to be able to support things like TDM.
However...

> 	cpu_i2s_ep_cs47l15: endpoint {
> 		remote-endpoint = <&cs47l15_aif1>;
> 	};

> But obviously that depends on which codec node was enabled. Listing
> multiple endpoints makes the whole port node disabled if any remote
> endpoint is in a disabled node. I've tried adding status="disabled"
> to endpoints or multiple port definitions with status="disabled" but
> I haven't figured out a solution.

...it seems like the issue here is that you're essentially trying to
define multiple cards at once in the same overlay.  TBH this feels like
you want two nested levels of overlay, with the extra layer patching the
CODEC compatible.  Or if this is mainly as an example for people you
could just pick one and use that?