aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVinod Koul <vinod.koul@intel.com>2016-08-04 06:16:01 -0400
committerTakashi Iwai <tiwai@suse.de>2016-08-09 02:53:56 -0400
commitec8ae5703da1b8bd057b4e319567ddbcac295b3a (patch)
treebb38f97ce9d660521032d35d73caa72b7c3ebf5d
parent6720b38420a01d40dbeb8ee575eb601d612de691 (diff)
ALSA: convert users to core bus_parse_capabilities
Now that we have the bus parse capabilities moved to core, we need to convert users. The SKL driver and HDA extended lib needs to converted in single patch, otherwise we regress on the functionality. Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/hda/ext/hdac_ext_controller.c16
-rw-r--r--sound/hda/ext/hdac_ext_stream.c46
-rw-r--r--sound/soc/intel/skylake/skl-messages.c4
-rw-r--r--sound/soc/intel/skylake/skl-pcm.c8
-rw-r--r--sound/soc/intel/skylake/skl.c6
5 files changed, 40 insertions, 40 deletions
diff --git a/sound/hda/ext/hdac_ext_controller.c b/sound/hda/ext/hdac_ext_controller.c
index 860f8cad6602..cd65e007e864 100644
--- a/sound/hda/ext/hdac_ext_controller.c
+++ b/sound/hda/ext/hdac_ext_controller.c
@@ -118,15 +118,15 @@ void snd_hdac_ext_bus_ppcap_enable(struct hdac_ext_bus *ebus, bool enable)
118{ 118{
119 struct hdac_bus *bus = &ebus->bus; 119 struct hdac_bus *bus = &ebus->bus;
120 120
121 if (!ebus->ppcap) { 121 if (!bus->ppcap) {
122 dev_err(bus->dev, "Address of PP capability is NULL"); 122 dev_err(bus->dev, "Address of PP capability is NULL");
123 return; 123 return;
124 } 124 }
125 125
126 if (enable) 126 if (enable)
127 snd_hdac_updatel(ebus->ppcap, AZX_REG_PP_PPCTL, 0, AZX_PPCTL_GPROCEN); 127 snd_hdac_updatel(bus->ppcap, AZX_REG_PP_PPCTL, 0, AZX_PPCTL_GPROCEN);
128 else 128 else
129 snd_hdac_updatel(ebus->ppcap, AZX_REG_PP_PPCTL, AZX_PPCTL_GPROCEN, 0); 129 snd_hdac_updatel(bus->ppcap, AZX_REG_PP_PPCTL, AZX_PPCTL_GPROCEN, 0);
130} 130}
131EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_ppcap_enable); 131EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_ppcap_enable);
132 132
@@ -139,15 +139,15 @@ void snd_hdac_ext_bus_ppcap_int_enable(struct hdac_ext_bus *ebus, bool enable)
139{ 139{
140 struct hdac_bus *bus = &ebus->bus; 140 struct hdac_bus *bus = &ebus->bus;
141 141
142 if (!ebus->ppcap) { 142 if (!bus->ppcap) {
143 dev_err(bus->dev, "Address of PP capability is NULL\n"); 143 dev_err(bus->dev, "Address of PP capability is NULL\n");
144 return; 144 return;
145 } 145 }
146 146
147 if (enable) 147 if (enable)
148 snd_hdac_updatel(ebus->ppcap, AZX_REG_PP_PPCTL, 0, AZX_PPCTL_PIE); 148 snd_hdac_updatel(bus->ppcap, AZX_REG_PP_PPCTL, 0, AZX_PPCTL_PIE);
149 else 149 else
150 snd_hdac_updatel(ebus->ppcap, AZX_REG_PP_PPCTL, AZX_PPCTL_PIE, 0); 150 snd_hdac_updatel(bus->ppcap, AZX_REG_PP_PPCTL, AZX_PPCTL_PIE, 0);
151} 151}
152EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_ppcap_int_enable); 152EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_ppcap_int_enable);
153 153
@@ -171,7 +171,7 @@ int snd_hdac_ext_bus_get_ml_capabilities(struct hdac_ext_bus *ebus)
171 struct hdac_ext_link *hlink; 171 struct hdac_ext_link *hlink;
172 struct hdac_bus *bus = &ebus->bus; 172 struct hdac_bus *bus = &ebus->bus;
173 173
174 link_count = readl(ebus->mlcap + AZX_REG_ML_MLCD) + 1; 174 link_count = readl(bus->mlcap + AZX_REG_ML_MLCD) + 1;
175 175
176 dev_dbg(bus->dev, "In %s Link count: %d\n", __func__, link_count); 176 dev_dbg(bus->dev, "In %s Link count: %d\n", __func__, link_count);
177 177
@@ -181,7 +181,7 @@ int snd_hdac_ext_bus_get_ml_capabilities(struct hdac_ext_bus *ebus)
181 return -ENOMEM; 181 return -ENOMEM;
182 hlink->index = idx; 182 hlink->index = idx;
183 hlink->bus = bus; 183 hlink->bus = bus;
184 hlink->ml_addr = ebus->mlcap + AZX_ML_BASE + 184 hlink->ml_addr = bus->mlcap + AZX_ML_BASE +
185 (AZX_ML_INTERVAL * idx); 185 (AZX_ML_INTERVAL * idx);
186 hlink->lcaps = readl(hlink->ml_addr + AZX_REG_ML_LCAP); 186 hlink->lcaps = readl(hlink->ml_addr + AZX_REG_ML_LCAP);
187 hlink->lsdiid = readw(hlink->ml_addr + AZX_REG_ML_LSDIID); 187 hlink->lsdiid = readw(hlink->ml_addr + AZX_REG_ML_LSDIID);
diff --git a/sound/hda/ext/hdac_ext_stream.c b/sound/hda/ext/hdac_ext_stream.c
index 626f3bb24c55..2441273adcef 100644
--- a/sound/hda/ext/hdac_ext_stream.c
+++ b/sound/hda/ext/hdac_ext_stream.c
@@ -40,27 +40,27 @@ void snd_hdac_ext_stream_init(struct hdac_ext_bus *ebus,
40{ 40{
41 struct hdac_bus *bus = &ebus->bus; 41 struct hdac_bus *bus = &ebus->bus;
42 42
43 if (ebus->ppcap) { 43 if (bus->ppcap) {
44 stream->pphc_addr = ebus->ppcap + AZX_PPHC_BASE + 44 stream->pphc_addr = bus->ppcap + AZX_PPHC_BASE +
45 AZX_PPHC_INTERVAL * idx; 45 AZX_PPHC_INTERVAL * idx;
46 46
47 stream->pplc_addr = ebus->ppcap + AZX_PPLC_BASE + 47 stream->pplc_addr = bus->ppcap + AZX_PPLC_BASE +
48 AZX_PPLC_MULTI * ebus->num_streams + 48 AZX_PPLC_MULTI * ebus->num_streams +
49 AZX_PPLC_INTERVAL * idx; 49 AZX_PPLC_INTERVAL * idx;
50 } 50 }
51 51
52 if (ebus->spbcap) { 52 if (bus->spbcap) {
53 stream->spib_addr = ebus->spbcap + AZX_SPB_BASE + 53 stream->spib_addr = bus->spbcap + AZX_SPB_BASE +
54 AZX_SPB_INTERVAL * idx + 54 AZX_SPB_INTERVAL * idx +
55 AZX_SPB_SPIB; 55 AZX_SPB_SPIB;
56 56
57 stream->fifo_addr = ebus->spbcap + AZX_SPB_BASE + 57 stream->fifo_addr = bus->spbcap + AZX_SPB_BASE +
58 AZX_SPB_INTERVAL * idx + 58 AZX_SPB_INTERVAL * idx +
59 AZX_SPB_MAXFIFO; 59 AZX_SPB_MAXFIFO;
60 } 60 }
61 61
62 if (ebus->drsmcap) 62 if (bus->drsmcap)
63 stream->dpibr_addr = ebus->drsmcap + AZX_DRSM_BASE + 63 stream->dpibr_addr = bus->drsmcap + AZX_DRSM_BASE +
64 AZX_DRSM_INTERVAL * idx; 64 AZX_DRSM_INTERVAL * idx;
65 65
66 stream->decoupled = false; 66 stream->decoupled = false;
@@ -131,10 +131,10 @@ void snd_hdac_ext_stream_decouple(struct hdac_ext_bus *ebus,
131 131
132 spin_lock_irq(&bus->reg_lock); 132 spin_lock_irq(&bus->reg_lock);
133 if (decouple) 133 if (decouple)
134 snd_hdac_updatel(ebus->ppcap, AZX_REG_PP_PPCTL, 0, 134 snd_hdac_updatel(bus->ppcap, AZX_REG_PP_PPCTL, 0,
135 AZX_PPCTL_PROCEN(hstream->index)); 135 AZX_PPCTL_PROCEN(hstream->index));
136 else 136 else
137 snd_hdac_updatel(ebus->ppcap, AZX_REG_PP_PPCTL, 137 snd_hdac_updatel(bus->ppcap, AZX_REG_PP_PPCTL,
138 AZX_PPCTL_PROCEN(hstream->index), 0); 138 AZX_PPCTL_PROCEN(hstream->index), 0);
139 stream->decoupled = decouple; 139 stream->decoupled = decouple;
140 spin_unlock_irq(&bus->reg_lock); 140 spin_unlock_irq(&bus->reg_lock);
@@ -255,7 +255,7 @@ hdac_ext_link_stream_assign(struct hdac_ext_bus *ebus,
255 struct hdac_stream *stream = NULL; 255 struct hdac_stream *stream = NULL;
256 struct hdac_bus *hbus = &ebus->bus; 256 struct hdac_bus *hbus = &ebus->bus;
257 257
258 if (!ebus->ppcap) { 258 if (!hbus->ppcap) {
259 dev_err(hbus->dev, "stream type not supported\n"); 259 dev_err(hbus->dev, "stream type not supported\n");
260 return NULL; 260 return NULL;
261 } 261 }
@@ -296,7 +296,7 @@ hdac_ext_host_stream_assign(struct hdac_ext_bus *ebus,
296 struct hdac_stream *stream = NULL; 296 struct hdac_stream *stream = NULL;
297 struct hdac_bus *hbus = &ebus->bus; 297 struct hdac_bus *hbus = &ebus->bus;
298 298
299 if (!ebus->ppcap) { 299 if (!hbus->ppcap) {
300 dev_err(hbus->dev, "stream type not supported\n"); 300 dev_err(hbus->dev, "stream type not supported\n");
301 return NULL; 301 return NULL;
302 } 302 }
@@ -423,21 +423,21 @@ void snd_hdac_ext_stream_spbcap_enable(struct hdac_ext_bus *ebus,
423 u32 register_mask = 0; 423 u32 register_mask = 0;
424 struct hdac_bus *bus = &ebus->bus; 424 struct hdac_bus *bus = &ebus->bus;
425 425
426 if (!ebus->spbcap) { 426 if (!bus->spbcap) {
427 dev_err(bus->dev, "Address of SPB capability is NULL"); 427 dev_err(bus->dev, "Address of SPB capability is NULL");
428 return; 428 return;
429 } 429 }
430 430
431 mask |= (1 << index); 431 mask |= (1 << index);
432 432
433 register_mask = readl(ebus->spbcap + AZX_REG_SPB_SPBFCCTL); 433 register_mask = readl(bus->spbcap + AZX_REG_SPB_SPBFCCTL);
434 434
435 mask |= register_mask; 435 mask |= register_mask;
436 436
437 if (enable) 437 if (enable)
438 snd_hdac_updatel(ebus->spbcap, AZX_REG_SPB_SPBFCCTL, 0, mask); 438 snd_hdac_updatel(bus->spbcap, AZX_REG_SPB_SPBFCCTL, 0, mask);
439 else 439 else
440 snd_hdac_updatel(ebus->spbcap, AZX_REG_SPB_SPBFCCTL, mask, 0); 440 snd_hdac_updatel(bus->spbcap, AZX_REG_SPB_SPBFCCTL, mask, 0);
441} 441}
442EXPORT_SYMBOL_GPL(snd_hdac_ext_stream_spbcap_enable); 442EXPORT_SYMBOL_GPL(snd_hdac_ext_stream_spbcap_enable);
443 443
@@ -452,7 +452,7 @@ int snd_hdac_ext_stream_set_spib(struct hdac_ext_bus *ebus,
452{ 452{
453 struct hdac_bus *bus = &ebus->bus; 453 struct hdac_bus *bus = &ebus->bus;
454 454
455 if (!ebus->spbcap) { 455 if (!bus->spbcap) {
456 dev_err(bus->dev, "Address of SPB capability is NULL"); 456 dev_err(bus->dev, "Address of SPB capability is NULL");
457 return -EINVAL; 457 return -EINVAL;
458 } 458 }
@@ -475,7 +475,7 @@ int snd_hdac_ext_stream_get_spbmaxfifo(struct hdac_ext_bus *ebus,
475{ 475{
476 struct hdac_bus *bus = &ebus->bus; 476 struct hdac_bus *bus = &ebus->bus;
477 477
478 if (!ebus->spbcap) { 478 if (!bus->spbcap) {
479 dev_err(bus->dev, "Address of SPB capability is NULL"); 479 dev_err(bus->dev, "Address of SPB capability is NULL");
480 return -EINVAL; 480 return -EINVAL;
481 } 481 }
@@ -515,21 +515,21 @@ void snd_hdac_ext_stream_drsm_enable(struct hdac_ext_bus *ebus,
515 u32 register_mask = 0; 515 u32 register_mask = 0;
516 struct hdac_bus *bus = &ebus->bus; 516 struct hdac_bus *bus = &ebus->bus;
517 517
518 if (!ebus->drsmcap) { 518 if (!bus->drsmcap) {
519 dev_err(bus->dev, "Address of DRSM capability is NULL"); 519 dev_err(bus->dev, "Address of DRSM capability is NULL");
520 return; 520 return;
521 } 521 }
522 522
523 mask |= (1 << index); 523 mask |= (1 << index);
524 524
525 register_mask = readl(ebus->drsmcap + AZX_REG_SPB_SPBFCCTL); 525 register_mask = readl(bus->drsmcap + AZX_REG_SPB_SPBFCCTL);
526 526
527 mask |= register_mask; 527 mask |= register_mask;
528 528
529 if (enable) 529 if (enable)
530 snd_hdac_updatel(ebus->drsmcap, AZX_REG_DRSM_CTL, 0, mask); 530 snd_hdac_updatel(bus->drsmcap, AZX_REG_DRSM_CTL, 0, mask);
531 else 531 else
532 snd_hdac_updatel(ebus->drsmcap, AZX_REG_DRSM_CTL, mask, 0); 532 snd_hdac_updatel(bus->drsmcap, AZX_REG_DRSM_CTL, mask, 0);
533} 533}
534EXPORT_SYMBOL_GPL(snd_hdac_ext_stream_drsm_enable); 534EXPORT_SYMBOL_GPL(snd_hdac_ext_stream_drsm_enable);
535 535
@@ -544,7 +544,7 @@ int snd_hdac_ext_stream_set_dpibr(struct hdac_ext_bus *ebus,
544{ 544{
545 struct hdac_bus *bus = &ebus->bus; 545 struct hdac_bus *bus = &ebus->bus;
546 546
547 if (!ebus->drsmcap) { 547 if (!bus->drsmcap) {
548 dev_err(bus->dev, "Address of DRSM capability is NULL"); 548 dev_err(bus->dev, "Address of DRSM capability is NULL");
549 return -EINVAL; 549 return -EINVAL;
550 } 550 }
diff --git a/sound/soc/intel/skylake/skl-messages.c b/sound/soc/intel/skylake/skl-messages.c
index 44ab595ce21a..83a731fc884e 100644
--- a/sound/soc/intel/skylake/skl-messages.c
+++ b/sound/soc/intel/skylake/skl-messages.c
@@ -296,7 +296,7 @@ int skl_suspend_dsp(struct skl *skl)
296 int ret; 296 int ret;
297 297
298 /* if ppcap is not supported return 0 */ 298 /* if ppcap is not supported return 0 */
299 if (!skl->ebus.ppcap) 299 if (!skl->ebus.bus.ppcap)
300 return 0; 300 return 0;
301 301
302 ret = skl_dsp_sleep(ctx->dsp); 302 ret = skl_dsp_sleep(ctx->dsp);
@@ -316,7 +316,7 @@ int skl_resume_dsp(struct skl *skl)
316 int ret; 316 int ret;
317 317
318 /* if ppcap is not supported return 0 */ 318 /* if ppcap is not supported return 0 */
319 if (!skl->ebus.ppcap) 319 if (!skl->ebus.bus.ppcap)
320 return 0; 320 return 0;
321 321
322 /* enable ppcap interrupt */ 322 /* enable ppcap interrupt */
diff --git a/sound/soc/intel/skylake/skl-pcm.c b/sound/soc/intel/skylake/skl-pcm.c
index 6e05bf8622f7..5ae86c227d45 100644
--- a/sound/soc/intel/skylake/skl-pcm.c
+++ b/sound/soc/intel/skylake/skl-pcm.c
@@ -106,7 +106,7 @@ static void skl_set_pcm_constrains(struct hdac_ext_bus *ebus,
106 106
107static enum hdac_ext_stream_type skl_get_host_stream_type(struct hdac_ext_bus *ebus) 107static enum hdac_ext_stream_type skl_get_host_stream_type(struct hdac_ext_bus *ebus)
108{ 108{
109 if (ebus->ppcap) 109 if ((ebus_to_hbus(ebus))->ppcap)
110 return HDAC_EXT_STREAM_TYPE_HOST; 110 return HDAC_EXT_STREAM_TYPE_HOST;
111 else 111 else
112 return HDAC_EXT_STREAM_TYPE_COUPLED; 112 return HDAC_EXT_STREAM_TYPE_COUPLED;
@@ -188,7 +188,7 @@ static int skl_get_format(struct snd_pcm_substream *substream,
188 struct hdac_ext_bus *ebus = dev_get_drvdata(dai->dev); 188 struct hdac_ext_bus *ebus = dev_get_drvdata(dai->dev);
189 int format_val = 0; 189 int format_val = 0;
190 190
191 if (ebus->ppcap) { 191 if ((ebus_to_hbus(ebus))->ppcap) {
192 struct snd_pcm_runtime *runtime = substream->runtime; 192 struct snd_pcm_runtime *runtime = substream->runtime;
193 193
194 format_val = snd_hdac_calc_stream_format(runtime->rate, 194 format_val = snd_hdac_calc_stream_format(runtime->rate,
@@ -1020,7 +1020,7 @@ static int skl_platform_pcm_trigger(struct snd_pcm_substream *substream,
1020{ 1020{
1021 struct hdac_ext_bus *ebus = get_bus_ctx(substream); 1021 struct hdac_ext_bus *ebus = get_bus_ctx(substream);
1022 1022
1023 if (!ebus->ppcap) 1023 if ((ebus_to_hbus(ebus))->ppcap)
1024 return skl_coupled_trigger(substream, cmd); 1024 return skl_coupled_trigger(substream, cmd);
1025 1025
1026 return 0; 1026 return 0;
@@ -1144,7 +1144,7 @@ static int skl_platform_soc_probe(struct snd_soc_platform *platform)
1144 struct skl *skl = ebus_to_skl(ebus); 1144 struct skl *skl = ebus_to_skl(ebus);
1145 int ret; 1145 int ret;
1146 1146
1147 if (ebus->ppcap) { 1147 if ((ebus_to_hbus(ebus))->ppcap) {
1148 ret = skl_tplg_init(platform, ebus); 1148 ret = skl_tplg_init(platform, ebus);
1149 if (ret < 0) { 1149 if (ret < 0) {
1150 dev_err(platform->dev, "Failed to init topology!\n"); 1150 dev_err(platform->dev, "Failed to init topology!\n");
diff --git a/sound/soc/intel/skylake/skl.c b/sound/soc/intel/skylake/skl.c
index cd59536a761d..a893ca13be8e 100644
--- a/sound/soc/intel/skylake/skl.c
+++ b/sound/soc/intel/skylake/skl.c
@@ -587,7 +587,7 @@ static int skl_first_init(struct hdac_ext_bus *ebus)
587 return -ENXIO; 587 return -ENXIO;
588 } 588 }
589 589
590 snd_hdac_ext_bus_parse_capabilities(ebus); 590 snd_hdac_bus_parse_capabilities(bus);
591 591
592 if (skl_acquire_irq(ebus, 0) < 0) 592 if (skl_acquire_irq(ebus, 0) < 0)
593 return -EBUSY; 593 return -EBUSY;
@@ -682,7 +682,7 @@ static int skl_probe(struct pci_dev *pci,
682 skl_dmic_data.dmic_num = skl_get_dmic_geo(skl); 682 skl_dmic_data.dmic_num = skl_get_dmic_geo(skl);
683 683
684 /* check if dsp is there */ 684 /* check if dsp is there */
685 if (ebus->ppcap) { 685 if (bus->ppcap) {
686 err = skl_machine_device_register(skl, 686 err = skl_machine_device_register(skl,
687 (void *)pci_id->driver_data); 687 (void *)pci_id->driver_data);
688 if (err < 0) 688 if (err < 0)
@@ -696,7 +696,7 @@ static int skl_probe(struct pci_dev *pci,
696 skl->skl_sst->enable_miscbdcge = skl_enable_miscbdcge; 696 skl->skl_sst->enable_miscbdcge = skl_enable_miscbdcge;
697 697
698 } 698 }
699 if (ebus->mlcap) 699 if (bus->mlcap)
700 snd_hdac_ext_bus_get_ml_capabilities(ebus); 700 snd_hdac_ext_bus_get_ml_capabilities(ebus);
701 701
702 /* create device for soc dmic */ 702 /* create device for soc dmic */