~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/sound/soc/qcom/lpass-sc7180.c

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /sound/soc/qcom/lpass-sc7180.c (Version linux-6.12-rc7) and /sound/soc/qcom/lpass-sc7180.c (Version linux-6.4.16)


  1 // SPDX-License-Identifier: GPL-2.0-only            1 // SPDX-License-Identifier: GPL-2.0-only
  2 /*                                                  2 /*
  3  * Copyright (c) 2020, The Linux Foundation. A      3  * Copyright (c) 2020, The Linux Foundation. All rights reserved.
  4  *                                                  4  *
  5  * lpass-sc7180.c -- ALSA SoC platform-machine      5  * lpass-sc7180.c -- ALSA SoC platform-machine driver for QTi LPASS
  6  */                                                 6  */
  7                                                     7 
  8 #include <linux/clk.h>                              8 #include <linux/clk.h>
  9 #include <linux/device.h>                           9 #include <linux/device.h>
 10 #include <linux/err.h>                             10 #include <linux/err.h>
 11 #include <linux/kernel.h>                          11 #include <linux/kernel.h>
 12 #include <linux/module.h>                          12 #include <linux/module.h>
 13 #include <linux/of.h>                              13 #include <linux/of.h>
 14 #include <linux/platform_device.h>                 14 #include <linux/platform_device.h>
 15 #include <linux/pm.h>                          !!  15 #include <linux/pm_runtime.h>
 16 #include <dt-bindings/sound/sc7180-lpass.h>        16 #include <dt-bindings/sound/sc7180-lpass.h>
 17 #include <sound/pcm.h>                             17 #include <sound/pcm.h>
 18 #include <sound/soc.h>                             18 #include <sound/soc.h>
 19                                                    19 
 20 #include "lpass-lpaif-reg.h"                       20 #include "lpass-lpaif-reg.h"
 21 #include "lpass.h"                                 21 #include "lpass.h"
 22                                                    22 
 23 static struct snd_soc_dai_driver sc7180_lpass_     23 static struct snd_soc_dai_driver sc7180_lpass_cpu_dai_driver[] = {
 24         {                                          24         {
 25                 .id = MI2S_PRIMARY,                25                 .id = MI2S_PRIMARY,
 26                 .name = "Primary MI2S",            26                 .name = "Primary MI2S",
 27                 .playback = {                      27                 .playback = {
 28                         .stream_name = "Primar     28                         .stream_name = "Primary Playback",
 29                         .formats        = SNDR     29                         .formats        = SNDRV_PCM_FMTBIT_S16,
 30                         .rates = SNDRV_PCM_RAT     30                         .rates = SNDRV_PCM_RATE_48000,
 31                         .rate_min       = 4800     31                         .rate_min       = 48000,
 32                         .rate_max       = 4800     32                         .rate_max       = 48000,
 33                         .channels_min   = 2,       33                         .channels_min   = 2,
 34                         .channels_max   = 2,       34                         .channels_max   = 2,
 35                 },                                 35                 },
 36                 .capture = {                       36                 .capture = {
 37                         .stream_name = "Primar     37                         .stream_name = "Primary Capture",
 38                         .formats = SNDRV_PCM_F     38                         .formats = SNDRV_PCM_FMTBIT_S16 |
 39                                 SNDRV_PCM_FMTB     39                                 SNDRV_PCM_FMTBIT_S32,
 40                         .rates = SNDRV_PCM_RAT     40                         .rates = SNDRV_PCM_RATE_48000,
 41                         .rate_min       = 4800     41                         .rate_min       = 48000,
 42                         .rate_max       = 4800     42                         .rate_max       = 48000,
 43                         .channels_min   = 2,       43                         .channels_min   = 2,
 44                         .channels_max   = 2,       44                         .channels_max   = 2,
 45                 },                                 45                 },
                                                   >>  46                 .probe  = &asoc_qcom_lpass_cpu_dai_probe,
 46                 .ops    = &asoc_qcom_lpass_cpu     47                 .ops    = &asoc_qcom_lpass_cpu_dai_ops,
 47         }, {                                       48         }, {
 48                 .id = MI2S_SECONDARY,              49                 .id = MI2S_SECONDARY,
 49                 .name = "Secondary MI2S",          50                 .name = "Secondary MI2S",
 50                 .playback = {                      51                 .playback = {
 51                         .stream_name = "Second     52                         .stream_name = "Secondary Playback",
 52                         .formats        = SNDR     53                         .formats        = SNDRV_PCM_FMTBIT_S16,
 53                         .rates = SNDRV_PCM_RAT     54                         .rates = SNDRV_PCM_RATE_48000,
 54                         .rate_min       = 4800     55                         .rate_min       = 48000,
 55                         .rate_max       = 4800     56                         .rate_max       = 48000,
 56                         .channels_min   = 2,       57                         .channels_min   = 2,
 57                         .channels_max   = 2,       58                         .channels_max   = 2,
 58                 },                                 59                 },
 59                 .ops    = &asoc_qcom_lpass_cpu !!  60                 .probe  = &asoc_qcom_lpass_cpu_dai_probe,
                                                   >>  61                 .ops    = &asoc_qcom_lpass_cpu_dai_ops,
                                                   >>  62                 .pcm_new = lpass_cpu_pcm_new,
 60         }, {                                       63         }, {
 61                 .id = LPASS_DP_RX,                 64                 .id = LPASS_DP_RX,
 62                 .name = "Hdmi",                    65                 .name = "Hdmi",
 63                 .playback = {                      66                 .playback = {
 64                         .stream_name = "Hdmi P     67                         .stream_name = "Hdmi Playback",
 65                         .formats        = SNDR     68                         .formats        = SNDRV_PCM_FMTBIT_S24,
 66                         .rates = SNDRV_PCM_RAT     69                         .rates = SNDRV_PCM_RATE_48000,
 67                         .rate_min       = 4800     70                         .rate_min       = 48000,
 68                         .rate_max       = 4800     71                         .rate_max       = 48000,
 69                         .channels_min   = 2,       72                         .channels_min   = 2,
 70                         .channels_max   = 2,       73                         .channels_max   = 2,
 71                 },                                 74                 },
 72                 .ops    = &asoc_qcom_lpass_hdm     75                 .ops    = &asoc_qcom_lpass_hdmi_dai_ops,
 73         },                                         76         },
 74 };                                                 77 };
 75                                                    78 
 76 static int sc7180_lpass_alloc_dma_channel(stru     79 static int sc7180_lpass_alloc_dma_channel(struct lpass_data *drvdata,
 77                                            int     80                                            int direction, unsigned int dai_id)
 78 {                                                  81 {
 79         const struct lpass_variant *v = drvdat !!  82         struct lpass_variant *v = drvdata->variant;
 80         int chan = 0;                              83         int chan = 0;
 81                                                    84 
 82         if (dai_id == LPASS_DP_RX) {               85         if (dai_id == LPASS_DP_RX) {
 83                 if (direction == SNDRV_PCM_STR     86                 if (direction == SNDRV_PCM_STREAM_PLAYBACK) {
 84                         chan = find_first_zero     87                         chan = find_first_zero_bit(&drvdata->hdmi_dma_ch_bit_map,
 85                                                    88                                                 v->hdmi_rdma_channels);
 86                                                    89 
 87                         if (chan >= v->hdmi_rd     90                         if (chan >= v->hdmi_rdma_channels)
 88                                 return -EBUSY;     91                                 return -EBUSY;
 89                 }                                  92                 }
 90                 set_bit(chan, &drvdata->hdmi_d     93                 set_bit(chan, &drvdata->hdmi_dma_ch_bit_map);
 91         } else {                                   94         } else {
 92                 if (direction == SNDRV_PCM_STR     95                 if (direction == SNDRV_PCM_STREAM_PLAYBACK) {
 93                         chan = find_first_zero     96                         chan = find_first_zero_bit(&drvdata->dma_ch_bit_map,
 94                                                    97                                                 v->rdma_channels);
 95                                                    98 
 96                         if (chan >= v->rdma_ch     99                         if (chan >= v->rdma_channels)
 97                                 return -EBUSY;    100                                 return -EBUSY;
 98                 } else {                          101                 } else {
 99                         chan = find_next_zero_    102                         chan = find_next_zero_bit(&drvdata->dma_ch_bit_map,
100                                         v->wrd    103                                         v->wrdma_channel_start +
101                                         v->wrd    104                                         v->wrdma_channels,
102                                         v->wrd    105                                         v->wrdma_channel_start);
103                                                   106 
104                         if (chan >=  v->wrdma_    107                         if (chan >=  v->wrdma_channel_start + v->wrdma_channels)
105                                 return -EBUSY;    108                                 return -EBUSY;
106                 }                                 109                 }
107                                                   110 
108                 set_bit(chan, &drvdata->dma_ch    111                 set_bit(chan, &drvdata->dma_ch_bit_map);
109         }                                         112         }
110         return chan;                              113         return chan;
111 }                                                 114 }
112                                                   115 
113 static int sc7180_lpass_free_dma_channel(struc    116 static int sc7180_lpass_free_dma_channel(struct lpass_data *drvdata, int chan, unsigned int dai_id)
114 {                                                 117 {
115         if (dai_id == LPASS_DP_RX)                118         if (dai_id == LPASS_DP_RX)
116                 clear_bit(chan, &drvdata->hdmi    119                 clear_bit(chan, &drvdata->hdmi_dma_ch_bit_map);
117         else                                      120         else
118                 clear_bit(chan, &drvdata->dma_    121                 clear_bit(chan, &drvdata->dma_ch_bit_map);
119                                                   122 
120         return 0;                                 123         return 0;
121 }                                                 124 }
122                                                   125 
123 static int sc7180_lpass_init(struct platform_d    126 static int sc7180_lpass_init(struct platform_device *pdev)
124 {                                                 127 {
125         struct lpass_data *drvdata = platform_    128         struct lpass_data *drvdata = platform_get_drvdata(pdev);
126         const struct lpass_variant *variant =  !! 129         struct lpass_variant *variant = drvdata->variant;
127         struct device *dev = &pdev->dev;          130         struct device *dev = &pdev->dev;
128         int ret, i;                               131         int ret, i;
129                                                   132 
130         drvdata->clks = devm_kcalloc(dev, vari    133         drvdata->clks = devm_kcalloc(dev, variant->num_clks,
131                                      sizeof(*d    134                                      sizeof(*drvdata->clks), GFP_KERNEL);
132         if (!drvdata->clks)                       135         if (!drvdata->clks)
133                 return -ENOMEM;                   136                 return -ENOMEM;
134                                                   137 
135         drvdata->num_clks = variant->num_clks;    138         drvdata->num_clks = variant->num_clks;
136                                                   139 
137         for (i = 0; i < drvdata->num_clks; i++    140         for (i = 0; i < drvdata->num_clks; i++)
138                 drvdata->clks[i].id = variant-    141                 drvdata->clks[i].id = variant->clk_name[i];
139                                                   142 
140         ret = devm_clk_bulk_get(dev, drvdata->    143         ret = devm_clk_bulk_get(dev, drvdata->num_clks, drvdata->clks);
141         if (ret) {                                144         if (ret) {
142                 dev_err(dev, "Failed to get cl    145                 dev_err(dev, "Failed to get clocks %d\n", ret);
143                 return ret;                       146                 return ret;
144         }                                         147         }
145                                                   148 
146         ret = clk_bulk_prepare_enable(drvdata-    149         ret = clk_bulk_prepare_enable(drvdata->num_clks, drvdata->clks);
147         if (ret) {                                150         if (ret) {
148                 dev_err(dev, "sc7180 clk_enabl    151                 dev_err(dev, "sc7180 clk_enable failed\n");
149                 return ret;                       152                 return ret;
150         }                                         153         }
151                                                   154 
152         return 0;                                 155         return 0;
153 }                                                 156 }
154                                                   157 
155 static int sc7180_lpass_exit(struct platform_d    158 static int sc7180_lpass_exit(struct platform_device *pdev)
156 {                                                 159 {
157         struct lpass_data *drvdata = platform_    160         struct lpass_data *drvdata = platform_get_drvdata(pdev);
158                                                   161 
159         clk_bulk_disable_unprepare(drvdata->nu    162         clk_bulk_disable_unprepare(drvdata->num_clks, drvdata->clks);
160         return 0;                                 163         return 0;
161 }                                                 164 }
162                                                   165 
163 static int __maybe_unused sc7180_lpass_dev_res    166 static int __maybe_unused sc7180_lpass_dev_resume(struct device *dev)
164 {                                                 167 {
165         struct lpass_data *drvdata = dev_get_d    168         struct lpass_data *drvdata = dev_get_drvdata(dev);
166                                                   169 
167         return clk_bulk_prepare_enable(drvdata    170         return clk_bulk_prepare_enable(drvdata->num_clks, drvdata->clks);
168 }                                                 171 }
169                                                   172 
170 static int __maybe_unused sc7180_lpass_dev_sus    173 static int __maybe_unused sc7180_lpass_dev_suspend(struct device *dev)
171 {                                                 174 {
172         struct lpass_data *drvdata = dev_get_d    175         struct lpass_data *drvdata = dev_get_drvdata(dev);
173                                                   176 
174         clk_bulk_disable_unprepare(drvdata->nu    177         clk_bulk_disable_unprepare(drvdata->num_clks, drvdata->clks);
175         return 0;                                 178         return 0;
176 }                                                 179 }
177                                                   180 
178 static const struct dev_pm_ops sc7180_lpass_pm    181 static const struct dev_pm_ops sc7180_lpass_pm_ops = {
179         SET_SYSTEM_SLEEP_PM_OPS(sc7180_lpass_d    182         SET_SYSTEM_SLEEP_PM_OPS(sc7180_lpass_dev_suspend, sc7180_lpass_dev_resume)
180 };                                                183 };
181                                                   184 
182 static const struct lpass_variant sc7180_data  !! 185 static struct lpass_variant sc7180_data = {
183         .i2sctrl_reg_base       = 0x1000,         186         .i2sctrl_reg_base       = 0x1000,
184         .i2sctrl_reg_stride     = 0x1000,         187         .i2sctrl_reg_stride     = 0x1000,
185         .i2s_ports              = 3,              188         .i2s_ports              = 3,
186         .irq_reg_base           = 0x9000,         189         .irq_reg_base           = 0x9000,
187         .irq_reg_stride         = 0x1000,         190         .irq_reg_stride         = 0x1000,
188         .irq_ports              = 3,              191         .irq_ports              = 3,
189         .rdma_reg_base          = 0xC000,         192         .rdma_reg_base          = 0xC000,
190         .rdma_reg_stride        = 0x1000,         193         .rdma_reg_stride        = 0x1000,
191         .rdma_channels          = 5,              194         .rdma_channels          = 5,
192         .hdmi_rdma_reg_base             = 0x64    195         .hdmi_rdma_reg_base             = 0x64000,
193         .hdmi_rdma_reg_stride   = 0x1000,         196         .hdmi_rdma_reg_stride   = 0x1000,
194         .hdmi_rdma_channels             = 4,      197         .hdmi_rdma_channels             = 4,
195         .dmactl_audif_start     = 1,              198         .dmactl_audif_start     = 1,
196         .wrdma_reg_base         = 0x18000,        199         .wrdma_reg_base         = 0x18000,
197         .wrdma_reg_stride       = 0x1000,         200         .wrdma_reg_stride       = 0x1000,
198         .wrdma_channel_start    = 5,              201         .wrdma_channel_start    = 5,
199         .wrdma_channels         = 4,              202         .wrdma_channels         = 4,
200                                                   203 
201         .loopback               = REG_FIELD_ID    204         .loopback               = REG_FIELD_ID(0x1000, 17, 17, 3, 0x1000),
202         .spken                  = REG_FIELD_ID    205         .spken                  = REG_FIELD_ID(0x1000, 16, 16, 3, 0x1000),
203         .spkmode                = REG_FIELD_ID    206         .spkmode                = REG_FIELD_ID(0x1000, 11, 15, 3, 0x1000),
204         .spkmono                = REG_FIELD_ID    207         .spkmono                = REG_FIELD_ID(0x1000, 10, 10, 3, 0x1000),
205         .micen                  = REG_FIELD_ID    208         .micen                  = REG_FIELD_ID(0x1000, 9, 9, 3, 0x1000),
206         .micmode                = REG_FIELD_ID    209         .micmode                = REG_FIELD_ID(0x1000, 4, 8, 3, 0x1000),
207         .micmono                = REG_FIELD_ID    210         .micmono                = REG_FIELD_ID(0x1000, 3, 3, 3, 0x1000),
208         .wssrc                  = REG_FIELD_ID    211         .wssrc                  = REG_FIELD_ID(0x1000, 2, 2, 3, 0x1000),
209         .bitwidth               = REG_FIELD_ID    212         .bitwidth               = REG_FIELD_ID(0x1000, 0, 1, 3, 0x1000),
210                                                   213 
211         .rdma_dyncclk           = REG_FIELD_ID    214         .rdma_dyncclk           = REG_FIELD_ID(0xC000, 21, 21, 5, 0x1000),
212         .rdma_bursten           = REG_FIELD_ID    215         .rdma_bursten           = REG_FIELD_ID(0xC000, 20, 20, 5, 0x1000),
213         .rdma_wpscnt            = REG_FIELD_ID    216         .rdma_wpscnt            = REG_FIELD_ID(0xC000, 16, 19, 5, 0x1000),
214         .rdma_intf                      = REG_    217         .rdma_intf                      = REG_FIELD_ID(0xC000, 12, 15, 5, 0x1000),
215         .rdma_fifowm            = REG_FIELD_ID    218         .rdma_fifowm            = REG_FIELD_ID(0xC000, 1, 5, 5, 0x1000),
216         .rdma_enable            = REG_FIELD_ID    219         .rdma_enable            = REG_FIELD_ID(0xC000, 0, 0, 5, 0x1000),
217                                                   220 
218         .wrdma_dyncclk          = REG_FIELD_ID    221         .wrdma_dyncclk          = REG_FIELD_ID(0x18000, 22, 22, 4, 0x1000),
219         .wrdma_bursten          = REG_FIELD_ID    222         .wrdma_bursten          = REG_FIELD_ID(0x18000, 21, 21, 4, 0x1000),
220         .wrdma_wpscnt           = REG_FIELD_ID    223         .wrdma_wpscnt           = REG_FIELD_ID(0x18000, 17, 20, 4, 0x1000),
221         .wrdma_intf             = REG_FIELD_ID    224         .wrdma_intf             = REG_FIELD_ID(0x18000, 12, 16, 4, 0x1000),
222         .wrdma_fifowm           = REG_FIELD_ID    225         .wrdma_fifowm           = REG_FIELD_ID(0x18000, 1, 5, 4, 0x1000),
223         .wrdma_enable           = REG_FIELD_ID    226         .wrdma_enable           = REG_FIELD_ID(0x18000, 0, 0, 4, 0x1000),
224                                                   227 
225         .hdmi_tx_ctl_addr       = 0x1000,         228         .hdmi_tx_ctl_addr       = 0x1000,
226         .hdmi_legacy_addr       = 0x1008,         229         .hdmi_legacy_addr       = 0x1008,
227         .hdmi_vbit_addr         = 0x610c0,        230         .hdmi_vbit_addr         = 0x610c0,
228         .hdmi_ch_lsb_addr       = 0x61048,        231         .hdmi_ch_lsb_addr       = 0x61048,
229         .hdmi_ch_msb_addr       = 0x6104c,        232         .hdmi_ch_msb_addr       = 0x6104c,
230         .ch_stride              = 0x8,            233         .ch_stride              = 0x8,
231         .hdmi_parity_addr       = 0x61034,        234         .hdmi_parity_addr       = 0x61034,
232         .hdmi_dmactl_addr       = 0x61038,        235         .hdmi_dmactl_addr       = 0x61038,
233         .hdmi_dma_stride        = 0x4,            236         .hdmi_dma_stride        = 0x4,
234         .hdmi_DP_addr           = 0x610c8,        237         .hdmi_DP_addr           = 0x610c8,
235         .hdmi_sstream_addr      = 0x6101c,        238         .hdmi_sstream_addr      = 0x6101c,
236         .hdmi_irq_reg_base              = 0x63    239         .hdmi_irq_reg_base              = 0x63000,
237         .hdmi_irq_ports         = 1,              240         .hdmi_irq_ports         = 1,
238                                                   241 
239         .hdmi_rdma_dyncclk              = REG_    242         .hdmi_rdma_dyncclk              = REG_FIELD_ID(0x64000, 14, 14, 4, 0x1000),
240         .hdmi_rdma_bursten              = REG_    243         .hdmi_rdma_bursten              = REG_FIELD_ID(0x64000, 13, 13, 4, 0x1000),
241         .hdmi_rdma_burst8               = REG_    244         .hdmi_rdma_burst8               = REG_FIELD_ID(0x64000, 15, 15, 4, 0x1000),
242         .hdmi_rdma_burst16              = REG_    245         .hdmi_rdma_burst16              = REG_FIELD_ID(0x64000, 16, 16, 4, 0x1000),
243         .hdmi_rdma_dynburst             = REG_    246         .hdmi_rdma_dynburst             = REG_FIELD_ID(0x64000, 18, 18, 4, 0x1000),
244         .hdmi_rdma_wpscnt               = REG_    247         .hdmi_rdma_wpscnt               = REG_FIELD_ID(0x64000, 10, 12, 4, 0x1000),
245         .hdmi_rdma_fifowm               = REG_    248         .hdmi_rdma_fifowm               = REG_FIELD_ID(0x64000, 1, 5, 4, 0x1000),
246         .hdmi_rdma_enable               = REG_    249         .hdmi_rdma_enable               = REG_FIELD_ID(0x64000, 0, 0, 4, 0x1000),
247                                                   250 
248         .sstream_en             = REG_FIELD(0x    251         .sstream_en             = REG_FIELD(0x6101c, 0, 0),
249         .dma_sel                        = REG_    252         .dma_sel                        = REG_FIELD(0x6101c, 1, 2),
250         .auto_bbit_en   = REG_FIELD(0x6101c, 3    253         .auto_bbit_en   = REG_FIELD(0x6101c, 3, 3),
251         .layout                 = REG_FIELD(0x    254         .layout                 = REG_FIELD(0x6101c, 4, 4),
252         .layout_sp              = REG_FIELD(0x    255         .layout_sp              = REG_FIELD(0x6101c, 5, 8),
253         .set_sp_on_en   = REG_FIELD(0x6101c, 1    256         .set_sp_on_en   = REG_FIELD(0x6101c, 10, 10),
254         .dp_audio               = REG_FIELD(0x    257         .dp_audio               = REG_FIELD(0x6101c, 11, 11),
255         .dp_staffing_en = REG_FIELD(0x6101c, 1    258         .dp_staffing_en = REG_FIELD(0x6101c, 12, 12),
256         .dp_sp_b_hw_en  = REG_FIELD(0x6101c, 1    259         .dp_sp_b_hw_en  = REG_FIELD(0x6101c, 13, 13),
257                                                   260 
258         .mute                   = REG_FIELD(0x    261         .mute                   = REG_FIELD(0x610c8, 0, 0),
259         .as_sdp_cc              = REG_FIELD(0x    262         .as_sdp_cc              = REG_FIELD(0x610c8, 1, 3),
260         .as_sdp_ct              = REG_FIELD(0x    263         .as_sdp_ct              = REG_FIELD(0x610c8, 4, 7),
261         .aif_db4                        = REG_    264         .aif_db4                        = REG_FIELD(0x610c8, 8, 15),
262         .frequency              = REG_FIELD(0x    265         .frequency              = REG_FIELD(0x610c8, 16, 21),
263         .mst_index              = REG_FIELD(0x    266         .mst_index              = REG_FIELD(0x610c8, 28, 29),
264         .dptx_index             = REG_FIELD(0x    267         .dptx_index             = REG_FIELD(0x610c8, 30, 31),
265                                                   268 
266         .soft_reset             = REG_FIELD(0x    269         .soft_reset             = REG_FIELD(0x1000, 31, 31),
267         .force_reset    = REG_FIELD(0x1000, 30    270         .force_reset    = REG_FIELD(0x1000, 30, 30),
268                                                   271 
269         .use_hw_chs             = REG_FIELD(0x    272         .use_hw_chs             = REG_FIELD(0x61038, 0, 0),
270         .use_hw_usr             = REG_FIELD(0x    273         .use_hw_usr             = REG_FIELD(0x61038, 1, 1),
271         .hw_chs_sel             = REG_FIELD(0x    274         .hw_chs_sel             = REG_FIELD(0x61038, 2, 4),
272         .hw_usr_sel             = REG_FIELD(0x    275         .hw_usr_sel             = REG_FIELD(0x61038, 5, 6),
273                                                   276 
274         .replace_vbit   = REG_FIELD(0x610c0, 0    277         .replace_vbit   = REG_FIELD(0x610c0, 0, 0),
275         .vbit_stream    = REG_FIELD(0x610c0, 1    278         .vbit_stream    = REG_FIELD(0x610c0, 1, 1),
276                                                   279 
277         .legacy_en              =  REG_FIELD(0    280         .legacy_en              =  REG_FIELD(0x1008, 0, 0),
278         .calc_en                =  REG_FIELD(0    281         .calc_en                =  REG_FIELD(0x61034, 0, 0),
279         .lsb_bits               =  REG_FIELD(0    282         .lsb_bits               =  REG_FIELD(0x61048, 0, 31),
280         .msb_bits               =  REG_FIELD(0    283         .msb_bits               =  REG_FIELD(0x6104c, 0, 31),
281                                                   284 
282                                                   285 
283         .clk_name               = (const char*    286         .clk_name               = (const char*[]) {
284                                    "pcnoc-sway    287                                    "pcnoc-sway-clk",
285                                    "audio-core    288                                    "audio-core",
286                                    "pcnoc-mpor    289                                    "pcnoc-mport-clk",
287                                 },                290                                 },
288         .num_clks               = 3,              291         .num_clks               = 3,
289         .dai_driver             = sc7180_lpass    292         .dai_driver             = sc7180_lpass_cpu_dai_driver,
290         .num_dai                = ARRAY_SIZE(s    293         .num_dai                = ARRAY_SIZE(sc7180_lpass_cpu_dai_driver),
291         .dai_osr_clk_names      = (const char     294         .dai_osr_clk_names      = (const char *[]) {
292                                    "mclk0",       295                                    "mclk0",
293                                    "null",        296                                    "null",
294                                 },                297                                 },
295         .dai_bit_clk_names      = (const char     298         .dai_bit_clk_names      = (const char *[]) {
296                                    "mi2s-bit-c    299                                    "mi2s-bit-clk0",
297                                    "mi2s-bit-c    300                                    "mi2s-bit-clk1",
298                                 },                301                                 },
299         .init                   = sc7180_lpass    302         .init                   = sc7180_lpass_init,
300         .exit                   = sc7180_lpass    303         .exit                   = sc7180_lpass_exit,
301         .alloc_dma_channel      = sc7180_lpass    304         .alloc_dma_channel      = sc7180_lpass_alloc_dma_channel,
302         .free_dma_channel       = sc7180_lpass    305         .free_dma_channel       = sc7180_lpass_free_dma_channel,
303 };                                                306 };
304                                                   307 
305 static const struct of_device_id sc7180_lpass_    308 static const struct of_device_id sc7180_lpass_cpu_device_id[] __maybe_unused = {
306         {.compatible = "qcom,sc7180-lpass-cpu"    309         {.compatible = "qcom,sc7180-lpass-cpu", .data = &sc7180_data},
307         {}                                        310         {}
308 };                                                311 };
309 MODULE_DEVICE_TABLE(of, sc7180_lpass_cpu_devic    312 MODULE_DEVICE_TABLE(of, sc7180_lpass_cpu_device_id);
310                                                   313 
311 static struct platform_driver sc7180_lpass_cpu    314 static struct platform_driver sc7180_lpass_cpu_platform_driver = {
312         .driver = {                               315         .driver = {
313                 .name = "sc7180-lpass-cpu",       316                 .name = "sc7180-lpass-cpu",
314                 .of_match_table = of_match_ptr    317                 .of_match_table = of_match_ptr(sc7180_lpass_cpu_device_id),
315                 .pm = &sc7180_lpass_pm_ops,       318                 .pm = &sc7180_lpass_pm_ops,
316         },                                        319         },
317         .probe = asoc_qcom_lpass_cpu_platform_    320         .probe = asoc_qcom_lpass_cpu_platform_probe,
318         .remove = asoc_qcom_lpass_cpu_platform    321         .remove = asoc_qcom_lpass_cpu_platform_remove,
319         .shutdown = asoc_qcom_lpass_cpu_platfo    322         .shutdown = asoc_qcom_lpass_cpu_platform_shutdown,
320 };                                                323 };
321                                                   324 
322 module_platform_driver(sc7180_lpass_cpu_platfo    325 module_platform_driver(sc7180_lpass_cpu_platform_driver);
323                                                   326 
324 MODULE_DESCRIPTION("SC7180 LPASS CPU DRIVER");    327 MODULE_DESCRIPTION("SC7180 LPASS CPU DRIVER");
325 MODULE_LICENSE("GPL");                         !! 328 MODULE_LICENSE("GPL v2");
326                                                   329 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php