xref: /linux/sound/soc/qcom/lpass-sc7180.c (revision cf9d21984da2c8e852320d12c03ddb7d11760a32)
124caf8d9SAjit Pandey // SPDX-License-Identifier: GPL-2.0-only
224caf8d9SAjit Pandey /*
324caf8d9SAjit Pandey  * Copyright (c) 2020, The Linux Foundation. All rights reserved.
424caf8d9SAjit Pandey  *
524caf8d9SAjit Pandey  * lpass-sc7180.c -- ALSA SoC platform-machine driver for QTi LPASS
624caf8d9SAjit Pandey  */
724caf8d9SAjit Pandey 
824caf8d9SAjit Pandey #include <linux/clk.h>
924caf8d9SAjit Pandey #include <linux/device.h>
1024caf8d9SAjit Pandey #include <linux/err.h>
1124caf8d9SAjit Pandey #include <linux/kernel.h>
1224caf8d9SAjit Pandey #include <linux/module.h>
1324caf8d9SAjit Pandey #include <linux/of.h>
1424caf8d9SAjit Pandey #include <linux/platform_device.h>
1524caf8d9SAjit Pandey #include <dt-bindings/sound/sc7180-lpass.h>
1624caf8d9SAjit Pandey #include <sound/pcm.h>
1724caf8d9SAjit Pandey #include <sound/soc.h>
1824caf8d9SAjit Pandey 
1924caf8d9SAjit Pandey #include "lpass-lpaif-reg.h"
2024caf8d9SAjit Pandey #include "lpass.h"
2124caf8d9SAjit Pandey 
2224caf8d9SAjit Pandey static struct snd_soc_dai_driver sc7180_lpass_cpu_dai_driver[] = {
2324caf8d9SAjit Pandey 	[MI2S_PRIMARY] = {
2424caf8d9SAjit Pandey 		.id = MI2S_PRIMARY,
2524caf8d9SAjit Pandey 		.name = "Primary MI2S",
2624caf8d9SAjit Pandey 		.playback = {
2724caf8d9SAjit Pandey 			.stream_name = "Primary Playback",
2824caf8d9SAjit Pandey 			.formats	= SNDRV_PCM_FMTBIT_S16,
2924caf8d9SAjit Pandey 			.rates = SNDRV_PCM_RATE_48000,
3024caf8d9SAjit Pandey 			.rate_min	= 48000,
3124caf8d9SAjit Pandey 			.rate_max	= 48000,
3224caf8d9SAjit Pandey 			.channels_min	= 2,
3324caf8d9SAjit Pandey 			.channels_max	= 2,
3424caf8d9SAjit Pandey 		},
3524caf8d9SAjit Pandey 		.capture = {
3624caf8d9SAjit Pandey 			.stream_name = "Primary Capture",
3724caf8d9SAjit Pandey 			.formats = SNDRV_PCM_FMTBIT_S16,
3824caf8d9SAjit Pandey 			.rates = SNDRV_PCM_RATE_48000,
3924caf8d9SAjit Pandey 			.rate_min	= 48000,
4024caf8d9SAjit Pandey 			.rate_max	= 48000,
4124caf8d9SAjit Pandey 			.channels_min	= 2,
4224caf8d9SAjit Pandey 			.channels_max	= 2,
4324caf8d9SAjit Pandey 		},
4424caf8d9SAjit Pandey 		.probe	= &asoc_qcom_lpass_cpu_dai_probe,
4524caf8d9SAjit Pandey 		.ops    = &asoc_qcom_lpass_cpu_dai_ops,
4624caf8d9SAjit Pandey 	},
4724caf8d9SAjit Pandey 
4824caf8d9SAjit Pandey 	[MI2S_SECONDARY] = {
4924caf8d9SAjit Pandey 		.id = MI2S_SECONDARY,
5024caf8d9SAjit Pandey 		.name = "Secondary MI2S",
5124caf8d9SAjit Pandey 		.playback = {
5224caf8d9SAjit Pandey 			.stream_name = "Secondary Playback",
5324caf8d9SAjit Pandey 			.formats	= SNDRV_PCM_FMTBIT_S16,
5424caf8d9SAjit Pandey 			.rates = SNDRV_PCM_RATE_48000,
5524caf8d9SAjit Pandey 			.rate_min	= 48000,
5624caf8d9SAjit Pandey 			.rate_max	= 48000,
5724caf8d9SAjit Pandey 			.channels_min	= 2,
5824caf8d9SAjit Pandey 			.channels_max	= 2,
5924caf8d9SAjit Pandey 		},
6024caf8d9SAjit Pandey 		.probe	= &asoc_qcom_lpass_cpu_dai_probe,
6124caf8d9SAjit Pandey 		.ops    = &asoc_qcom_lpass_cpu_dai_ops,
6224caf8d9SAjit Pandey 	},
632ad63dc8SV Sujith Kumar Reddy 	[LPASS_DP_RX] = {
642ad63dc8SV Sujith Kumar Reddy 		.id = LPASS_DP_RX,
652ad63dc8SV Sujith Kumar Reddy 		.name = "Hdmi",
662ad63dc8SV Sujith Kumar Reddy 		.playback = {
672ad63dc8SV Sujith Kumar Reddy 			.stream_name = "Hdmi Playback",
682ad63dc8SV Sujith Kumar Reddy 			.formats	= SNDRV_PCM_FMTBIT_S24,
692ad63dc8SV Sujith Kumar Reddy 			.rates = SNDRV_PCM_RATE_48000,
702ad63dc8SV Sujith Kumar Reddy 			.rate_min	= 48000,
712ad63dc8SV Sujith Kumar Reddy 			.rate_max	= 48000,
722ad63dc8SV Sujith Kumar Reddy 			.channels_min	= 2,
732ad63dc8SV Sujith Kumar Reddy 			.channels_max	= 2,
742ad63dc8SV Sujith Kumar Reddy 		},
752ad63dc8SV Sujith Kumar Reddy 		.ops    = &asoc_qcom_lpass_hdmi_dai_ops,
762ad63dc8SV Sujith Kumar Reddy 	},
7724caf8d9SAjit Pandey };
7824caf8d9SAjit Pandey 
7924caf8d9SAjit Pandey static int sc7180_lpass_alloc_dma_channel(struct lpass_data *drvdata,
802ad63dc8SV Sujith Kumar Reddy 					   int direction, unsigned int dai_id)
8124caf8d9SAjit Pandey {
8224caf8d9SAjit Pandey 	struct lpass_variant *v = drvdata->variant;
8324caf8d9SAjit Pandey 	int chan = 0;
8424caf8d9SAjit Pandey 
852ad63dc8SV Sujith Kumar Reddy 	if (dai_id == LPASS_DP_RX) {
862ad63dc8SV Sujith Kumar Reddy 		if (direction == SNDRV_PCM_STREAM_PLAYBACK) {
872ad63dc8SV Sujith Kumar Reddy 			chan = find_first_zero_bit(&drvdata->hdmi_dma_ch_bit_map,
882ad63dc8SV Sujith Kumar Reddy 						v->hdmi_rdma_channels);
892ad63dc8SV Sujith Kumar Reddy 
902ad63dc8SV Sujith Kumar Reddy 			if (chan >= v->hdmi_rdma_channels)
912ad63dc8SV Sujith Kumar Reddy 				return -EBUSY;
922ad63dc8SV Sujith Kumar Reddy 		}
932ad63dc8SV Sujith Kumar Reddy 		set_bit(chan, &drvdata->hdmi_dma_ch_bit_map);
942ad63dc8SV Sujith Kumar Reddy 	} else {
9524caf8d9SAjit Pandey 		if (direction == SNDRV_PCM_STREAM_PLAYBACK) {
9624caf8d9SAjit Pandey 			chan = find_first_zero_bit(&drvdata->dma_ch_bit_map,
9724caf8d9SAjit Pandey 						v->rdma_channels);
9824caf8d9SAjit Pandey 
9924caf8d9SAjit Pandey 		if (chan >= v->rdma_channels)
10024caf8d9SAjit Pandey 			return -EBUSY;
10124caf8d9SAjit Pandey 		} else {
10224caf8d9SAjit Pandey 			chan = find_next_zero_bit(&drvdata->dma_ch_bit_map,
10324caf8d9SAjit Pandey 					v->wrdma_channel_start +
10424caf8d9SAjit Pandey 					v->wrdma_channels,
10524caf8d9SAjit Pandey 					v->wrdma_channel_start);
10624caf8d9SAjit Pandey 
10724caf8d9SAjit Pandey 			if (chan >=  v->wrdma_channel_start + v->wrdma_channels)
10824caf8d9SAjit Pandey 				return -EBUSY;
10924caf8d9SAjit Pandey 		}
11024caf8d9SAjit Pandey 
11124caf8d9SAjit Pandey 		set_bit(chan, &drvdata->dma_ch_bit_map);
1122ad63dc8SV Sujith Kumar Reddy 	}
11324caf8d9SAjit Pandey 	return chan;
11424caf8d9SAjit Pandey }
11524caf8d9SAjit Pandey 
1162ad63dc8SV Sujith Kumar Reddy static int sc7180_lpass_free_dma_channel(struct lpass_data *drvdata, int chan, unsigned int dai_id)
11724caf8d9SAjit Pandey {
1182ad63dc8SV Sujith Kumar Reddy 	if (dai_id == LPASS_DP_RX)
1192ad63dc8SV Sujith Kumar Reddy 		clear_bit(chan, &drvdata->hdmi_dma_ch_bit_map);
1202ad63dc8SV Sujith Kumar Reddy 	else
12124caf8d9SAjit Pandey 		clear_bit(chan, &drvdata->dma_ch_bit_map);
12224caf8d9SAjit Pandey 
12324caf8d9SAjit Pandey 	return 0;
12424caf8d9SAjit Pandey }
12524caf8d9SAjit Pandey 
12624caf8d9SAjit Pandey static int sc7180_lpass_init(struct platform_device *pdev)
12724caf8d9SAjit Pandey {
12824caf8d9SAjit Pandey 	struct lpass_data *drvdata = platform_get_drvdata(pdev);
12924caf8d9SAjit Pandey 	struct lpass_variant *variant = drvdata->variant;
13024caf8d9SAjit Pandey 	struct device *dev = &pdev->dev;
13124caf8d9SAjit Pandey 	int ret, i;
13224caf8d9SAjit Pandey 
13324caf8d9SAjit Pandey 	drvdata->clks = devm_kcalloc(dev, variant->num_clks,
13424caf8d9SAjit Pandey 				     sizeof(*drvdata->clks), GFP_KERNEL);
13524caf8d9SAjit Pandey 	drvdata->num_clks = variant->num_clks;
13624caf8d9SAjit Pandey 
13724caf8d9SAjit Pandey 	for (i = 0; i < drvdata->num_clks; i++)
13824caf8d9SAjit Pandey 		drvdata->clks[i].id = variant->clk_name[i];
13924caf8d9SAjit Pandey 
14024caf8d9SAjit Pandey 	ret = devm_clk_bulk_get(dev, drvdata->num_clks, drvdata->clks);
14124caf8d9SAjit Pandey 	if (ret) {
14224caf8d9SAjit Pandey 		dev_err(dev, "Failed to get clocks %d\n", ret);
14324caf8d9SAjit Pandey 		return ret;
14424caf8d9SAjit Pandey 	}
14524caf8d9SAjit Pandey 
14624caf8d9SAjit Pandey 	ret = clk_bulk_prepare_enable(drvdata->num_clks, drvdata->clks);
14724caf8d9SAjit Pandey 	if (ret) {
14824caf8d9SAjit Pandey 		dev_err(dev, "sc7180 clk_enable failed\n");
14924caf8d9SAjit Pandey 		return ret;
15024caf8d9SAjit Pandey 	}
15124caf8d9SAjit Pandey 
15224caf8d9SAjit Pandey 	return 0;
15324caf8d9SAjit Pandey }
15424caf8d9SAjit Pandey 
15524caf8d9SAjit Pandey static int sc7180_lpass_exit(struct platform_device *pdev)
15624caf8d9SAjit Pandey {
15724caf8d9SAjit Pandey 	struct lpass_data *drvdata = platform_get_drvdata(pdev);
15824caf8d9SAjit Pandey 
15924caf8d9SAjit Pandey 	clk_bulk_disable_unprepare(drvdata->num_clks, drvdata->clks);
16024caf8d9SAjit Pandey 
16124caf8d9SAjit Pandey 	return 0;
16224caf8d9SAjit Pandey }
16324caf8d9SAjit Pandey 
16424caf8d9SAjit Pandey static struct lpass_variant sc7180_data = {
16524caf8d9SAjit Pandey 	.i2sctrl_reg_base	= 0x1000,
16624caf8d9SAjit Pandey 	.i2sctrl_reg_stride	= 0x1000,
16724caf8d9SAjit Pandey 	.i2s_ports		= 3,
16824caf8d9SAjit Pandey 	.irq_reg_base		= 0x9000,
16924caf8d9SAjit Pandey 	.irq_reg_stride		= 0x1000,
17024caf8d9SAjit Pandey 	.irq_ports		= 3,
17124caf8d9SAjit Pandey 	.rdma_reg_base		= 0xC000,
17224caf8d9SAjit Pandey 	.rdma_reg_stride	= 0x1000,
17324caf8d9SAjit Pandey 	.rdma_channels		= 5,
1742ad63dc8SV Sujith Kumar Reddy 	.hdmi_rdma_reg_base		= 0x64000,
1752ad63dc8SV Sujith Kumar Reddy 	.hdmi_rdma_reg_stride	= 0x1000,
1762ad63dc8SV Sujith Kumar Reddy 	.hdmi_rdma_channels		= 4,
17724caf8d9SAjit Pandey 	.dmactl_audif_start	= 1,
17824caf8d9SAjit Pandey 	.wrdma_reg_base		= 0x18000,
17924caf8d9SAjit Pandey 	.wrdma_reg_stride	= 0x1000,
18024caf8d9SAjit Pandey 	.wrdma_channel_start	= 5,
18124caf8d9SAjit Pandey 	.wrdma_channels		= 4,
18224caf8d9SAjit Pandey 
18324caf8d9SAjit Pandey 	.loopback		= REG_FIELD_ID(0x1000, 17, 17, 3, 0x1000),
18424caf8d9SAjit Pandey 	.spken			= REG_FIELD_ID(0x1000, 16, 16, 3, 0x1000),
18524caf8d9SAjit Pandey 	.spkmode		= REG_FIELD_ID(0x1000, 11, 15, 3, 0x1000),
18624caf8d9SAjit Pandey 	.spkmono		= REG_FIELD_ID(0x1000, 10, 10, 3, 0x1000),
18724caf8d9SAjit Pandey 	.micen			= REG_FIELD_ID(0x1000, 9, 9, 3, 0x1000),
18824caf8d9SAjit Pandey 	.micmode		= REG_FIELD_ID(0x1000, 4, 8, 3, 0x1000),
18924caf8d9SAjit Pandey 	.micmono		= REG_FIELD_ID(0x1000, 3, 3, 3, 0x1000),
19024caf8d9SAjit Pandey 	.wssrc			= REG_FIELD_ID(0x1000, 2, 2, 3, 0x1000),
191*cf9d2198SV Sujith Kumar Reddy 	.bitwidth		= REG_FIELD_ID(0x1000, 0, 1, 3, 0x1000),
19224caf8d9SAjit Pandey 
19324caf8d9SAjit Pandey 	.rdma_dyncclk		= REG_FIELD_ID(0xC000, 21, 21, 5, 0x1000),
19424caf8d9SAjit Pandey 	.rdma_bursten		= REG_FIELD_ID(0xC000, 20, 20, 5, 0x1000),
19524caf8d9SAjit Pandey 	.rdma_wpscnt		= REG_FIELD_ID(0xC000, 16, 19, 5, 0x1000),
19624caf8d9SAjit Pandey 	.rdma_intf			= REG_FIELD_ID(0xC000, 12, 15, 5, 0x1000),
19724caf8d9SAjit Pandey 	.rdma_fifowm		= REG_FIELD_ID(0xC000, 1, 5, 5, 0x1000),
19824caf8d9SAjit Pandey 	.rdma_enable		= REG_FIELD_ID(0xC000, 0, 0, 5, 0x1000),
19924caf8d9SAjit Pandey 
20024caf8d9SAjit Pandey 	.wrdma_dyncclk		= REG_FIELD_ID(0x18000, 22, 22, 4, 0x1000),
20124caf8d9SAjit Pandey 	.wrdma_bursten		= REG_FIELD_ID(0x18000, 21, 21, 4, 0x1000),
20224caf8d9SAjit Pandey 	.wrdma_wpscnt		= REG_FIELD_ID(0x18000, 17, 20, 4, 0x1000),
20324caf8d9SAjit Pandey 	.wrdma_intf		= REG_FIELD_ID(0x18000, 12, 16, 4, 0x1000),
20424caf8d9SAjit Pandey 	.wrdma_fifowm		= REG_FIELD_ID(0x18000, 1, 5, 4, 0x1000),
20524caf8d9SAjit Pandey 	.wrdma_enable		= REG_FIELD_ID(0x18000, 0, 0, 4, 0x1000),
20624caf8d9SAjit Pandey 
2072ad63dc8SV Sujith Kumar Reddy 	.hdmi_tx_ctl_addr	= 0x1000,
2082ad63dc8SV Sujith Kumar Reddy 	.hdmi_legacy_addr	= 0x1008,
2092ad63dc8SV Sujith Kumar Reddy 	.hdmi_vbit_addr		= 0x610c0,
2102ad63dc8SV Sujith Kumar Reddy 	.hdmi_ch_lsb_addr	= 0x61048,
2112ad63dc8SV Sujith Kumar Reddy 	.hdmi_ch_msb_addr	= 0x6104c,
2122ad63dc8SV Sujith Kumar Reddy 	.ch_stride		= 0x8,
2132ad63dc8SV Sujith Kumar Reddy 	.hdmi_parity_addr	= 0x61034,
2142ad63dc8SV Sujith Kumar Reddy 	.hdmi_dmactl_addr	= 0x61038,
2152ad63dc8SV Sujith Kumar Reddy 	.hdmi_dma_stride	= 0x4,
2162ad63dc8SV Sujith Kumar Reddy 	.hdmi_DP_addr		= 0x610c8,
2172ad63dc8SV Sujith Kumar Reddy 	.hdmi_sstream_addr	= 0x6101c,
2182ad63dc8SV Sujith Kumar Reddy 	.hdmi_irq_reg_base		= 0x63000,
2192ad63dc8SV Sujith Kumar Reddy 	.hdmi_irq_ports		= 1,
2202ad63dc8SV Sujith Kumar Reddy 
2212ad63dc8SV Sujith Kumar Reddy 	.hdmi_rdma_dyncclk		= REG_FIELD_ID(0x64000, 14, 14, 4, 0x1000),
2222ad63dc8SV Sujith Kumar Reddy 	.hdmi_rdma_bursten		= REG_FIELD_ID(0x64000, 13, 13, 4, 0x1000),
2232ad63dc8SV Sujith Kumar Reddy 	.hdmi_rdma_burst8		= REG_FIELD_ID(0x64000, 15, 15, 4, 0x1000),
2242ad63dc8SV Sujith Kumar Reddy 	.hdmi_rdma_burst16		= REG_FIELD_ID(0x64000, 16, 16, 4, 0x1000),
2252ad63dc8SV Sujith Kumar Reddy 	.hdmi_rdma_dynburst		= REG_FIELD_ID(0x64000, 18, 18, 4, 0x1000),
2262ad63dc8SV Sujith Kumar Reddy 	.hdmi_rdma_wpscnt		= REG_FIELD_ID(0x64000, 10, 12, 4, 0x1000),
2272ad63dc8SV Sujith Kumar Reddy 	.hdmi_rdma_fifowm		= REG_FIELD_ID(0x64000, 1, 5, 4, 0x1000),
2282ad63dc8SV Sujith Kumar Reddy 	.hdmi_rdma_enable		= REG_FIELD_ID(0x64000, 0, 0, 4, 0x1000),
2292ad63dc8SV Sujith Kumar Reddy 
2302ad63dc8SV Sujith Kumar Reddy 	.sstream_en		= REG_FIELD(0x6101c, 0, 0),
2312ad63dc8SV Sujith Kumar Reddy 	.dma_sel			= REG_FIELD(0x6101c, 1, 2),
2322ad63dc8SV Sujith Kumar Reddy 	.auto_bbit_en	= REG_FIELD(0x6101c, 3, 3),
2332ad63dc8SV Sujith Kumar Reddy 	.layout			= REG_FIELD(0x6101c, 4, 4),
2342ad63dc8SV Sujith Kumar Reddy 	.layout_sp		= REG_FIELD(0x6101c, 5, 8),
2352ad63dc8SV Sujith Kumar Reddy 	.set_sp_on_en	= REG_FIELD(0x6101c, 10, 10),
2362ad63dc8SV Sujith Kumar Reddy 	.dp_audio		= REG_FIELD(0x6101c, 11, 11),
2372ad63dc8SV Sujith Kumar Reddy 	.dp_staffing_en	= REG_FIELD(0x6101c, 12, 12),
2382ad63dc8SV Sujith Kumar Reddy 	.dp_sp_b_hw_en	= REG_FIELD(0x6101c, 13, 13),
2392ad63dc8SV Sujith Kumar Reddy 
2402ad63dc8SV Sujith Kumar Reddy 	.mute			= REG_FIELD(0x610c8, 0, 0),
2412ad63dc8SV Sujith Kumar Reddy 	.as_sdp_cc		= REG_FIELD(0x610c8, 1, 3),
2422ad63dc8SV Sujith Kumar Reddy 	.as_sdp_ct		= REG_FIELD(0x610c8, 4, 7),
2432ad63dc8SV Sujith Kumar Reddy 	.aif_db4			= REG_FIELD(0x610c8, 8, 15),
2442ad63dc8SV Sujith Kumar Reddy 	.frequency		= REG_FIELD(0x610c8, 16, 21),
2452ad63dc8SV Sujith Kumar Reddy 	.mst_index		= REG_FIELD(0x610c8, 28, 29),
2462ad63dc8SV Sujith Kumar Reddy 	.dptx_index		= REG_FIELD(0x610c8, 30, 31),
2472ad63dc8SV Sujith Kumar Reddy 
2482ad63dc8SV Sujith Kumar Reddy 	.soft_reset		= REG_FIELD(0x1000, 31, 31),
2492ad63dc8SV Sujith Kumar Reddy 	.force_reset	= REG_FIELD(0x1000, 30, 30),
2502ad63dc8SV Sujith Kumar Reddy 
2512ad63dc8SV Sujith Kumar Reddy 	.use_hw_chs		= REG_FIELD(0x61038, 0, 0),
2522ad63dc8SV Sujith Kumar Reddy 	.use_hw_usr		= REG_FIELD(0x61038, 1, 1),
2532ad63dc8SV Sujith Kumar Reddy 	.hw_chs_sel		= REG_FIELD(0x61038, 2, 4),
2542ad63dc8SV Sujith Kumar Reddy 	.hw_usr_sel		= REG_FIELD(0x61038, 5, 6),
2552ad63dc8SV Sujith Kumar Reddy 
2562ad63dc8SV Sujith Kumar Reddy 	.replace_vbit	= REG_FIELD(0x610c0, 0, 0),
2572ad63dc8SV Sujith Kumar Reddy 	.vbit_stream	= REG_FIELD(0x610c0, 1, 1),
2582ad63dc8SV Sujith Kumar Reddy 
2592ad63dc8SV Sujith Kumar Reddy 	.legacy_en		=  REG_FIELD(0x1008, 0, 0),
2602ad63dc8SV Sujith Kumar Reddy 	.calc_en		=  REG_FIELD(0x61034, 0, 0),
2612ad63dc8SV Sujith Kumar Reddy 	.lsb_bits		=  REG_FIELD(0x61048, 0, 31),
2622ad63dc8SV Sujith Kumar Reddy 	.msb_bits		=  REG_FIELD(0x6104c, 0, 31),
2632ad63dc8SV Sujith Kumar Reddy 
2642ad63dc8SV Sujith Kumar Reddy 
26524caf8d9SAjit Pandey 	.clk_name		= (const char*[]) {
26624caf8d9SAjit Pandey 				   "pcnoc-sway-clk",
26724caf8d9SAjit Pandey 				   "audio-core",
26824caf8d9SAjit Pandey 				   "pcnoc-mport-clk",
26924caf8d9SAjit Pandey 				},
27024caf8d9SAjit Pandey 	.num_clks		= 3,
27124caf8d9SAjit Pandey 	.dai_driver		= sc7180_lpass_cpu_dai_driver,
27224caf8d9SAjit Pandey 	.num_dai		= ARRAY_SIZE(sc7180_lpass_cpu_dai_driver),
27324caf8d9SAjit Pandey 	.dai_osr_clk_names      = (const char *[]) {
27424caf8d9SAjit Pandey 				   "mclk0",
27524caf8d9SAjit Pandey 				   "null",
27624caf8d9SAjit Pandey 				},
27724caf8d9SAjit Pandey 	.dai_bit_clk_names      = (const char *[]) {
27824caf8d9SAjit Pandey 				   "mi2s-bit-clk0",
27924caf8d9SAjit Pandey 				   "mi2s-bit-clk1",
28024caf8d9SAjit Pandey 				},
28124caf8d9SAjit Pandey 	.init			= sc7180_lpass_init,
28224caf8d9SAjit Pandey 	.exit			= sc7180_lpass_exit,
28324caf8d9SAjit Pandey 	.alloc_dma_channel	= sc7180_lpass_alloc_dma_channel,
28424caf8d9SAjit Pandey 	.free_dma_channel	= sc7180_lpass_free_dma_channel,
28524caf8d9SAjit Pandey };
28624caf8d9SAjit Pandey 
28724caf8d9SAjit Pandey static const struct of_device_id sc7180_lpass_cpu_device_id[] = {
28824caf8d9SAjit Pandey 	{.compatible = "qcom,sc7180-lpass-cpu", .data = &sc7180_data},
28924caf8d9SAjit Pandey 	{}
29024caf8d9SAjit Pandey };
291dcde34c4SDouglas Anderson MODULE_DEVICE_TABLE(of, sc7180_lpass_cpu_device_id);
29224caf8d9SAjit Pandey 
29324caf8d9SAjit Pandey static struct platform_driver sc7180_lpass_cpu_platform_driver = {
29424caf8d9SAjit Pandey 	.driver = {
29524caf8d9SAjit Pandey 		.name = "sc7180-lpass-cpu",
29624caf8d9SAjit Pandey 		.of_match_table = of_match_ptr(sc7180_lpass_cpu_device_id),
29724caf8d9SAjit Pandey 	},
29824caf8d9SAjit Pandey 	.probe = asoc_qcom_lpass_cpu_platform_probe,
29924caf8d9SAjit Pandey 	.remove = asoc_qcom_lpass_cpu_platform_remove,
30024caf8d9SAjit Pandey };
30124caf8d9SAjit Pandey 
30224caf8d9SAjit Pandey module_platform_driver(sc7180_lpass_cpu_platform_driver);
30324caf8d9SAjit Pandey 
30424caf8d9SAjit Pandey MODULE_DESCRIPTION("SC7180 LPASS CPU DRIVER");
30524caf8d9SAjit Pandey MODULE_LICENSE("GPL v2");
306