On Fri, Dec 06, 2024 at 10:54:43PM +1100, Stephen Gordon wrote: > Scenario is that DAC's clock pins are tied to ADC's clock pins, with > codec acting as clock producer for the I2S bus, and the CPU has a single > pair of I2S clock pins used for both playback and capture. > ,------------------- > --------- ------------| LRCK DAC > LRCK|-------+--/ -------| BCK (producer) C > CPU | | / | O > BCK|-------|---+--/ | ---------------- D > consumer | \ | | E > --------- ---------------| LRCK ADC C > `-----------| BCK (consumer) > `-------------------- > Both DAI links will have codec acting as a clock producer, but we need > > to configure the codec so that only one of ADC/DAC drives the lines. This looks like something that should be done in the board configuration, not hard coded in the CODEC driver. > Add DT options to support this configuration. adc-force-cons/dac-force-cons > > cause the corresponding component to be configured in consumer mode. Any DT bindings should documented which should be done in a separate patch. > + // Force clock consumer mode if needed > + if (pcm3168a->adc_fc && dai->id == PCM3168A_DAI_ADC) > + ms = 0; > + if (pcm3168a->dac_fc && dai->id == PCM3168A_DAI_DAC) > + ms = 0; The clock consumer mode should just be configured via the standard set_dai_fmt() operation. > + if (dev->of_node) { > + pcm3168a->adc_fc = of_property_read_bool(dev->of_node, > + "adc-force-cons"); > + pcm3168a->dac_fc = of_property_read_bool(dev->of_node, > + "dac-force-cons"); > + } These properties are not documented, and you don't need to query to see if there's an OF node to query if a property is present.
Attachment:
signature.asc
Description: PGP signature
- Follow-Ups:
- Re: [PATCH v2] ASoC: pcm3168a: Add option to force clock consumer
- From: Stephen Gordon
- Re: [PATCH v2] ASoC: pcm3168a: Add option to force clock consumer
- References:
- [PATCH] ASoC: pcm3168a: Add option to force clock consumer
- From: Stephen Gordon
- [PATCH v2] ASoC: pcm3168a: Add option to force clock consumer
- From: Stephen Gordon
- [PATCH] ASoC: pcm3168a: Add option to force clock consumer
- Prev by Date: Re: [PATCH v2] ASoC: pcm3168a: Add option to force clock consumer
- Next by Date: Re: [PATCH] ALSA: au88x0: Modify the incorrect format specifier
- Previous by thread: Re: [PATCH v2] ASoC: pcm3168a: Add option to force clock consumer
- Next by thread: Re: [PATCH v2] ASoC: pcm3168a: Add option to force clock consumer
- Index(es):