Skip to content

Commit ec8ae57

Browse files
Vinod Koultiwai
authored andcommitted
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 <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
1 parent 6720b38 commit ec8ae57

File tree

5 files changed

+40
-40
lines changed

5 files changed

+40
-40
lines changed

sound/hda/ext/hdac_ext_controller.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -118,15 +118,15 @@ void snd_hdac_ext_bus_ppcap_enable(struct hdac_ext_bus *ebus, bool enable)
118118
{
119119
struct hdac_bus *bus = &ebus->bus;
120120

121-
if (!ebus->ppcap) {
121+
if (!bus->ppcap) {
122122
dev_err(bus->dev, "Address of PP capability is NULL");
123123
return;
124124
}
125125

126126
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);
128128
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);
130130
}
131131
EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_ppcap_enable);
132132

@@ -139,15 +139,15 @@ void snd_hdac_ext_bus_ppcap_int_enable(struct hdac_ext_bus *ebus, bool enable)
139139
{
140140
struct hdac_bus *bus = &ebus->bus;
141141

142-
if (!ebus->ppcap) {
142+
if (!bus->ppcap) {
143143
dev_err(bus->dev, "Address of PP capability is NULL\n");
144144
return;
145145
}
146146

147147
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);
149149
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);
151151
}
152152
EXPORT_SYMBOL_GPL(snd_hdac_ext_bus_ppcap_int_enable);
153153

@@ -171,7 +171,7 @@ int snd_hdac_ext_bus_get_ml_capabilities(struct hdac_ext_bus *ebus)
171171
struct hdac_ext_link *hlink;
172172
struct hdac_bus *bus = &ebus->bus;
173173

174-
link_count = readl(ebus->mlcap + AZX_REG_ML_MLCD) + 1;
174+
link_count = readl(bus->mlcap + AZX_REG_ML_MLCD) + 1;
175175

176176
dev_dbg(bus->dev, "In %s Link count: %d\n", __func__, link_count);
177177

@@ -181,7 +181,7 @@ int snd_hdac_ext_bus_get_ml_capabilities(struct hdac_ext_bus *ebus)
181181
return -ENOMEM;
182182
hlink->index = idx;
183183
hlink->bus = bus;
184-
hlink->ml_addr = ebus->mlcap + AZX_ML_BASE +
184+
hlink->ml_addr = bus->mlcap + AZX_ML_BASE +
185185
(AZX_ML_INTERVAL * idx);
186186
hlink->lcaps = readl(hlink->ml_addr + AZX_REG_ML_LCAP);
187187
hlink->lsdiid = readw(hlink->ml_addr + AZX_REG_ML_LSDIID);

sound/hda/ext/hdac_ext_stream.c

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -40,27 +40,27 @@ void snd_hdac_ext_stream_init(struct hdac_ext_bus *ebus,
4040
{
4141
struct hdac_bus *bus = &ebus->bus;
4242

43-
if (ebus->ppcap) {
44-
stream->pphc_addr = ebus->ppcap + AZX_PPHC_BASE +
43+
if (bus->ppcap) {
44+
stream->pphc_addr = bus->ppcap + AZX_PPHC_BASE +
4545
AZX_PPHC_INTERVAL * idx;
4646

47-
stream->pplc_addr = ebus->ppcap + AZX_PPLC_BASE +
47+
stream->pplc_addr = bus->ppcap + AZX_PPLC_BASE +
4848
AZX_PPLC_MULTI * ebus->num_streams +
4949
AZX_PPLC_INTERVAL * idx;
5050
}
5151

52-
if (ebus->spbcap) {
53-
stream->spib_addr = ebus->spbcap + AZX_SPB_BASE +
52+
if (bus->spbcap) {
53+
stream->spib_addr = bus->spbcap + AZX_SPB_BASE +
5454
AZX_SPB_INTERVAL * idx +
5555
AZX_SPB_SPIB;
5656

57-
stream->fifo_addr = ebus->spbcap + AZX_SPB_BASE +
57+
stream->fifo_addr = bus->spbcap + AZX_SPB_BASE +
5858
AZX_SPB_INTERVAL * idx +
5959
AZX_SPB_MAXFIFO;
6060
}
6161

62-
if (ebus->drsmcap)
63-
stream->dpibr_addr = ebus->drsmcap + AZX_DRSM_BASE +
62+
if (bus->drsmcap)
63+
stream->dpibr_addr = bus->drsmcap + AZX_DRSM_BASE +
6464
AZX_DRSM_INTERVAL * idx;
6565

6666
stream->decoupled = false;
@@ -131,10 +131,10 @@ void snd_hdac_ext_stream_decouple(struct hdac_ext_bus *ebus,
131131

132132
spin_lock_irq(&bus->reg_lock);
133133
if (decouple)
134-
snd_hdac_updatel(ebus->ppcap, AZX_REG_PP_PPCTL, 0,
134+
snd_hdac_updatel(bus->ppcap, AZX_REG_PP_PPCTL, 0,
135135
AZX_PPCTL_PROCEN(hstream->index));
136136
else
137-
snd_hdac_updatel(ebus->ppcap, AZX_REG_PP_PPCTL,
137+
snd_hdac_updatel(bus->ppcap, AZX_REG_PP_PPCTL,
138138
AZX_PPCTL_PROCEN(hstream->index), 0);
139139
stream->decoupled = decouple;
140140
spin_unlock_irq(&bus->reg_lock);
@@ -255,7 +255,7 @@ hdac_ext_link_stream_assign(struct hdac_ext_bus *ebus,
255255
struct hdac_stream *stream = NULL;
256256
struct hdac_bus *hbus = &ebus->bus;
257257

258-
if (!ebus->ppcap) {
258+
if (!hbus->ppcap) {
259259
dev_err(hbus->dev, "stream type not supported\n");
260260
return NULL;
261261
}
@@ -296,7 +296,7 @@ hdac_ext_host_stream_assign(struct hdac_ext_bus *ebus,
296296
struct hdac_stream *stream = NULL;
297297
struct hdac_bus *hbus = &ebus->bus;
298298

299-
if (!ebus->ppcap) {
299+
if (!hbus->ppcap) {
300300
dev_err(hbus->dev, "stream type not supported\n");
301301
return NULL;
302302
}
@@ -423,21 +423,21 @@ void snd_hdac_ext_stream_spbcap_enable(struct hdac_ext_bus *ebus,
423423
u32 register_mask = 0;
424424
struct hdac_bus *bus = &ebus->bus;
425425

426-
if (!ebus->spbcap) {
426+
if (!bus->spbcap) {
427427
dev_err(bus->dev, "Address of SPB capability is NULL");
428428
return;
429429
}
430430

431431
mask |= (1 << index);
432432

433-
register_mask = readl(ebus->spbcap + AZX_REG_SPB_SPBFCCTL);
433+
register_mask = readl(bus->spbcap + AZX_REG_SPB_SPBFCCTL);
434434

435435
mask |= register_mask;
436436

437437
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);
439439
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);
441441
}
442442
EXPORT_SYMBOL_GPL(snd_hdac_ext_stream_spbcap_enable);
443443

@@ -452,7 +452,7 @@ int snd_hdac_ext_stream_set_spib(struct hdac_ext_bus *ebus,
452452
{
453453
struct hdac_bus *bus = &ebus->bus;
454454

455-
if (!ebus->spbcap) {
455+
if (!bus->spbcap) {
456456
dev_err(bus->dev, "Address of SPB capability is NULL");
457457
return -EINVAL;
458458
}
@@ -475,7 +475,7 @@ int snd_hdac_ext_stream_get_spbmaxfifo(struct hdac_ext_bus *ebus,
475475
{
476476
struct hdac_bus *bus = &ebus->bus;
477477

478-
if (!ebus->spbcap) {
478+
if (!bus->spbcap) {
479479
dev_err(bus->dev, "Address of SPB capability is NULL");
480480
return -EINVAL;
481481
}
@@ -515,21 +515,21 @@ void snd_hdac_ext_stream_drsm_enable(struct hdac_ext_bus *ebus,
515515
u32 register_mask = 0;
516516
struct hdac_bus *bus = &ebus->bus;
517517

518-
if (!ebus->drsmcap) {
518+
if (!bus->drsmcap) {
519519
dev_err(bus->dev, "Address of DRSM capability is NULL");
520520
return;
521521
}
522522

523523
mask |= (1 << index);
524524

525-
register_mask = readl(ebus->drsmcap + AZX_REG_SPB_SPBFCCTL);
525+
register_mask = readl(bus->drsmcap + AZX_REG_SPB_SPBFCCTL);
526526

527527
mask |= register_mask;
528528

529529
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);
531531
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);
533533
}
534534
EXPORT_SYMBOL_GPL(snd_hdac_ext_stream_drsm_enable);
535535

@@ -544,7 +544,7 @@ int snd_hdac_ext_stream_set_dpibr(struct hdac_ext_bus *ebus,
544544
{
545545
struct hdac_bus *bus = &ebus->bus;
546546

547-
if (!ebus->drsmcap) {
547+
if (!bus->drsmcap) {
548548
dev_err(bus->dev, "Address of DRSM capability is NULL");
549549
return -EINVAL;
550550
}

sound/soc/intel/skylake/skl-messages.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ int skl_suspend_dsp(struct skl *skl)
296296
int ret;
297297

298298
/* if ppcap is not supported return 0 */
299-
if (!skl->ebus.ppcap)
299+
if (!skl->ebus.bus.ppcap)
300300
return 0;
301301

302302
ret = skl_dsp_sleep(ctx->dsp);
@@ -316,7 +316,7 @@ int skl_resume_dsp(struct skl *skl)
316316
int ret;
317317

318318
/* if ppcap is not supported return 0 */
319-
if (!skl->ebus.ppcap)
319+
if (!skl->ebus.bus.ppcap)
320320
return 0;
321321

322322
/* enable ppcap interrupt */

sound/soc/intel/skylake/skl-pcm.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ static void skl_set_pcm_constrains(struct hdac_ext_bus *ebus,
106106

107107
static enum hdac_ext_stream_type skl_get_host_stream_type(struct hdac_ext_bus *ebus)
108108
{
109-
if (ebus->ppcap)
109+
if ((ebus_to_hbus(ebus))->ppcap)
110110
return HDAC_EXT_STREAM_TYPE_HOST;
111111
else
112112
return HDAC_EXT_STREAM_TYPE_COUPLED;
@@ -188,7 +188,7 @@ static int skl_get_format(struct snd_pcm_substream *substream,
188188
struct hdac_ext_bus *ebus = dev_get_drvdata(dai->dev);
189189
int format_val = 0;
190190

191-
if (ebus->ppcap) {
191+
if ((ebus_to_hbus(ebus))->ppcap) {
192192
struct snd_pcm_runtime *runtime = substream->runtime;
193193

194194
format_val = snd_hdac_calc_stream_format(runtime->rate,
@@ -1020,7 +1020,7 @@ static int skl_platform_pcm_trigger(struct snd_pcm_substream *substream,
10201020
{
10211021
struct hdac_ext_bus *ebus = get_bus_ctx(substream);
10221022

1023-
if (!ebus->ppcap)
1023+
if ((ebus_to_hbus(ebus))->ppcap)
10241024
return skl_coupled_trigger(substream, cmd);
10251025

10261026
return 0;
@@ -1144,7 +1144,7 @@ static int skl_platform_soc_probe(struct snd_soc_platform *platform)
11441144
struct skl *skl = ebus_to_skl(ebus);
11451145
int ret;
11461146

1147-
if (ebus->ppcap) {
1147+
if ((ebus_to_hbus(ebus))->ppcap) {
11481148
ret = skl_tplg_init(platform, ebus);
11491149
if (ret < 0) {
11501150
dev_err(platform->dev, "Failed to init topology!\n");

sound/soc/intel/skylake/skl.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ static int skl_first_init(struct hdac_ext_bus *ebus)
587587
return -ENXIO;
588588
}
589589

590-
snd_hdac_ext_bus_parse_capabilities(ebus);
590+
snd_hdac_bus_parse_capabilities(bus);
591591

592592
if (skl_acquire_irq(ebus, 0) < 0)
593593
return -EBUSY;
@@ -682,7 +682,7 @@ static int skl_probe(struct pci_dev *pci,
682682
skl_dmic_data.dmic_num = skl_get_dmic_geo(skl);
683683

684684
/* check if dsp is there */
685-
if (ebus->ppcap) {
685+
if (bus->ppcap) {
686686
err = skl_machine_device_register(skl,
687687
(void *)pci_id->driver_data);
688688
if (err < 0)
@@ -696,7 +696,7 @@ static int skl_probe(struct pci_dev *pci,
696696
skl->skl_sst->enable_miscbdcge = skl_enable_miscbdcge;
697697

698698
}
699-
if (ebus->mlcap)
699+
if (bus->mlcap)
700700
snd_hdac_ext_bus_get_ml_capabilities(ebus);
701701

702702
/* create device for soc dmic */

0 commit comments

Comments
 (0)