Post Go back to editing

Daisy Chaining two AD1938 codecs - ALSA System on Chip driver

Hi there,

we are trying to extend our audio system by daisy chaining two AD1938 audio codecs. From the datasheet I got the information that both codecs are configured equally (512 fs DACs / 256 fs ADCs / single line TDM mode). So, of course, both codecs appear as one codec to the platform DAI. I think it should work, if both codecs are configured equally in series via regmap in the codec driver. For example:

static int ad193x_hw_params(...){

   ...

   regmap_update_bits(ad193x_0->regmap, AD193X_PLL_CLK_CTRL0, AD193X_PLL_INPUT_MASK, master_rate);

   regmap_update_bits(ad193x_1->regmap, AD193X_PLL_CLK_CTRL0, AD193X_PLL_INPUT_MASK, master_rate);

   ...

}

Does anybody know, how to pass two regmap configs to the driver, so that I can configure both codecs in the same way? Or any other idea how to get two daisy chained codecs working with ALSA?

Thanks!

Parents
  • Hi DaveThib,

    thanks for you reply!

    I think I explained it a little bit vague.

    The code snippets I added are only an example, that both codecs are configured equally. 

    ad193x_0->regmap and ad193x_1->regmap are just placeholders for the regmap configurations of the single codecs.

    So I would extend the codec driver to configure both codecs in the same way in the callback functions.

    My question is how to pass the SPI master device with two chipselects to my codec driver, that I can create two different regmap configurations?

    By default, the codec driver is probed with struct spi_device *spi as parameter, which corresponds to a single codec (client) connected to the SPI master.

    A electrical circuit plan is attached. I think I have to swap ASDATA2 with ASDATA1 on the second codec (as well as DSDATA2 with DSDATA1), right?

    Thanks a lot!

Reply
  • Hi DaveThib,

    thanks for you reply!

    I think I explained it a little bit vague.

    The code snippets I added are only an example, that both codecs are configured equally. 

    ad193x_0->regmap and ad193x_1->regmap are just placeholders for the regmap configurations of the single codecs.

    So I would extend the codec driver to configure both codecs in the same way in the callback functions.

    My question is how to pass the SPI master device with two chipselects to my codec driver, that I can create two different regmap configurations?

    By default, the codec driver is probed with struct spi_device *spi as parameter, which corresponds to a single codec (client) connected to the SPI master.

    A electrical circuit plan is attached. I think I have to swap ASDATA2 with ASDATA1 on the second codec (as well as DSDATA2 with DSDATA1), right?

    Thanks a lot!

Children
No Data