]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
ASoC: sun4i-codec: Add playback only flag to quirks
authorMarcus Cooper <codekipper@gmail.com>
Wed, 23 Oct 2024 07:57:00 +0000 (20:57 +1300)
committerMark Brown <broonie@kernel.org>
Thu, 24 Oct 2024 12:22:17 +0000 (13:22 +0100)
Some devices only have the playback side of the codec implemented
so add a quirk to check for this. This flag is only required internally
within the codec driver, as the DAI is configured for playback only
(capture disabled) separately in the create_card() function for these
devices.

Signed-off-by: Marcus Cooper <codekipper@gmail.com>
Signed-off-by: Ryan Walklin <ryan@testtoast.com>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Tested-by: Philippe Simons <simons.philippe@gmail.com>
Link: https://patch.msgid.link/20241023075917.186835-5-ryan@testtoast.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sunxi/sun4i-codec.c

index 37f5678b55291191e7be31e762070b4451ea87bc..312d2655c3f4ed0e79e516bc691cb7864e1d8dce 100644 (file)
@@ -1571,6 +1571,7 @@ struct sun4i_codec_quirks {
        unsigned int reg_dac_txdata;    /* TX FIFO offset for DMA config */
        unsigned int reg_adc_rxdata;    /* RX FIFO offset for DMA config */
        bool has_reset;
+       bool playback_only;
 };
 
 static const struct sun4i_codec_quirks sun4i_codec_quirks = {
@@ -1779,10 +1780,13 @@ static int sun4i_codec_probe(struct platform_device *pdev)
        scodec->playback_dma_data.maxburst = 8;
        scodec->playback_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES;
 
-       /* DMA configuration for RX FIFO */
-       scodec->capture_dma_data.addr = res->start + quirks->reg_adc_rxdata;
-       scodec->capture_dma_data.maxburst = 8;
-       scodec->capture_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES;
+       if (!quirks->playback_only) {
+               /* DMA configuration for RX FIFO */
+               scodec->capture_dma_data.addr = res->start +
+                                               quirks->reg_adc_rxdata;
+               scodec->capture_dma_data.maxburst = 8;
+               scodec->capture_dma_data.addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES;
+       }
 
        ret = devm_snd_soc_register_component(&pdev->dev, quirks->codec,
                                     &sun4i_codec_dai, 1);