Skip to content

Commit bb63f72

Browse files
Subhransu S. Prustytiwai
authored andcommitted
ALSA: hda - Use snd_hdac namespace prefix for chmap exported APIs
Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent 2f6e8a8 commit bb63f72

4 files changed

Lines changed: 35 additions & 35 deletions

File tree

‎include/sound/hda_chmap.h‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,18 +59,18 @@ struct hdac_chmap {
5959

6060
void snd_hdac_register_chmap_ops(struct hdac_device *hdac,
6161
struct hdac_chmap *chmap);
62-
int hdmi_channel_allocation(struct hdac_device *hdac, int spk_alloc,
62+
int snd_hdac_channel_allocation(struct hdac_device *hdac, int spk_alloc,
6363
int channels, bool chmap_set,
6464
bool non_pcm, unsigned char *map);
65-
int hdmi_get_active_channels(int ca);
66-
void hdmi_setup_channel_mapping(struct hdac_chmap *chmap,
65+
int snd_hdac_get_active_channels(int ca);
66+
void snd_hdac_setup_channel_mapping(struct hdac_chmap *chmap,
6767
hda_nid_t pin_nid, bool non_pcm, int ca,
6868
int channels, unsigned char *map,
6969
bool chmap_set);
70-
void snd_print_channel_allocation(int spk_alloc, char *buf, int buflen);
71-
struct hdac_cea_channel_speaker_allocation *hdmi_get_ch_alloc_from_ca(int ca);
72-
int to_spk_mask(unsigned char c);
73-
int spk_to_chmap(int spk);
70+
void snd_hdac_print_channel_allocation(int spk_alloc, char *buf, int buflen);
71+
struct hdac_cea_channel_speaker_allocation *snd_hdac_get_ch_alloc_from_ca(int ca);
72+
int snd_hdac_chmap_to_spk_mask(unsigned char c);
73+
int snd_hdac_spk_to_chmap(int spk);
7474
int snd_hdac_add_chmap_ctls(struct snd_pcm *pcm, int pcm_idx,
7575
struct hdac_chmap *chmap);
7676
#endif /* __SOUND_HDA_CHMAP_H */

‎sound/hda/hdmi_chmap.c‎

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ static int get_channel_allocation_order(int ca)
243243
return i;
244244
}
245245

246-
void snd_print_channel_allocation(int spk_alloc, char *buf, int buflen)
246+
void snd_hdac_print_channel_allocation(int spk_alloc, char *buf, int buflen)
247247
{
248248
int i, j;
249249

@@ -254,7 +254,7 @@ void snd_print_channel_allocation(int spk_alloc, char *buf, int buflen)
254254
}
255255
buf[j] = '\0'; /* necessary when j == 0 */
256256
}
257-
EXPORT_SYMBOL_GPL(snd_print_channel_allocation);
257+
EXPORT_SYMBOL_GPL(snd_hdac_print_channel_allocation);
258258

259259
/*
260260
* The transformation takes two steps:
@@ -312,7 +312,7 @@ static int hdmi_channel_allocation_spk_alloc_blk(struct hdac_device *codec,
312312
}
313313
}
314314

315-
snd_print_channel_allocation(spk_alloc, buf, sizeof(buf));
315+
snd_hdac_print_channel_allocation(spk_alloc, buf, sizeof(buf));
316316
dev_dbg(&codec->dev, "HDMI: select CA 0x%x for %d-channel allocation: %s\n",
317317
ca, channels, buf);
318318

@@ -412,7 +412,7 @@ static struct channel_map_table map_tables[] = {
412412
};
413413

414414
/* from ALSA API channel position to speaker bit mask */
415-
int to_spk_mask(unsigned char c)
415+
int snd_hdac_chmap_to_spk_mask(unsigned char c)
416416
{
417417
struct channel_map_table *t = map_tables;
418418

@@ -422,12 +422,12 @@ int to_spk_mask(unsigned char c)
422422
}
423423
return 0;
424424
}
425-
EXPORT_SYMBOL_GPL(to_spk_mask);
425+
EXPORT_SYMBOL_GPL(snd_hdac_chmap_to_spk_mask);
426426

427427
/* from ALSA API channel position to CEA slot */
428428
static int to_cea_slot(int ordered_ca, unsigned char pos)
429429
{
430-
int mask = to_spk_mask(pos);
430+
int mask = snd_hdac_chmap_to_spk_mask(pos);
431431
int i;
432432

433433
if (mask) {
@@ -441,7 +441,7 @@ static int to_cea_slot(int ordered_ca, unsigned char pos)
441441
}
442442

443443
/* from speaker bit mask to ALSA API channel position */
444-
int spk_to_chmap(int spk)
444+
int snd_hdac_spk_to_chmap(int spk)
445445
{
446446
struct channel_map_table *t = map_tables;
447447

@@ -451,14 +451,14 @@ int spk_to_chmap(int spk)
451451
}
452452
return 0;
453453
}
454-
EXPORT_SYMBOL_GPL(spk_to_chmap);
454+
EXPORT_SYMBOL_GPL(snd_hdac_spk_to_chmap);
455455

456456
/* from CEA slot to ALSA API channel position */
457457
static int from_cea_slot(int ordered_ca, unsigned char slot)
458458
{
459459
int mask = channel_allocations[ordered_ca].speakers[7 - slot];
460460

461-
return spk_to_chmap(mask);
461+
return snd_hdac_spk_to_chmap(mask);
462462
}
463463

464464
/* get the CA index corresponding to the given ALSA API channel map */
@@ -467,7 +467,7 @@ static int hdmi_manual_channel_allocation(int chs, unsigned char *map)
467467
int i, spks = 0, spk_mask = 0;
468468

469469
for (i = 0; i < chs; i++) {
470-
int mask = to_spk_mask(map[i]);
470+
int mask = snd_hdac_chmap_to_spk_mask(map[i]);
471471

472472
if (mask) {
473473
spk_mask |= mask;
@@ -530,7 +530,7 @@ static void hdmi_setup_fake_chmap(unsigned char *map, int ca)
530530
}
531531
}
532532

533-
void hdmi_setup_channel_mapping(struct hdac_chmap *chmap,
533+
void snd_hdac_setup_channel_mapping(struct hdac_chmap *chmap,
534534
hda_nid_t pin_nid, bool non_pcm, int ca,
535535
int channels, unsigned char *map,
536536
bool chmap_set)
@@ -545,23 +545,23 @@ void hdmi_setup_channel_mapping(struct hdac_chmap *chmap,
545545

546546
hdmi_debug_channel_mapping(chmap, pin_nid);
547547
}
548-
EXPORT_SYMBOL_GPL(hdmi_setup_channel_mapping);
548+
EXPORT_SYMBOL_GPL(snd_hdac_setup_channel_mapping);
549549

550-
int hdmi_get_active_channels(int ca)
550+
int snd_hdac_get_active_channels(int ca)
551551
{
552552
int ordered_ca = get_channel_allocation_order(ca);
553553

554554
return channel_allocations[ordered_ca].channels;
555555
}
556-
EXPORT_SYMBOL_GPL(hdmi_get_active_channels);
556+
EXPORT_SYMBOL_GPL(snd_hdac_get_active_channels);
557557

558-
struct hdac_cea_channel_speaker_allocation *hdmi_get_ch_alloc_from_ca(int ca)
558+
struct hdac_cea_channel_speaker_allocation *snd_hdac_get_ch_alloc_from_ca(int ca)
559559
{
560560
return &channel_allocations[get_channel_allocation_order(ca)];
561561
}
562-
EXPORT_SYMBOL_GPL(hdmi_get_ch_alloc_from_ca);
562+
EXPORT_SYMBOL_GPL(snd_hdac_get_ch_alloc_from_ca);
563563

564-
int hdmi_channel_allocation(struct hdac_device *hdac, int spk_alloc,
564+
int snd_hdac_channel_allocation(struct hdac_device *hdac, int spk_alloc,
565565
int channels, bool chmap_set, bool non_pcm, unsigned char *map)
566566
{
567567
int ca;
@@ -577,7 +577,7 @@ int hdmi_channel_allocation(struct hdac_device *hdac, int spk_alloc,
577577

578578
return ca;
579579
}
580-
EXPORT_SYMBOL_GPL(hdmi_channel_allocation);
580+
EXPORT_SYMBOL_GPL(snd_hdac_channel_allocation);
581581

582582
/*
583583
* ALSA API channel-map control callbacks
@@ -619,7 +619,7 @@ static void hdmi_cea_alloc_to_tlv_chmap(struct hdac_chmap *hchmap,
619619
if (!spk)
620620
continue;
621621

622-
chmap[count++] = spk_to_chmap(spk);
622+
chmap[count++] = snd_hdac_spk_to_chmap(spk);
623623
}
624624

625625
WARN_ON(count != channels);

‎sound/pci/hda/hda_eld.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ void snd_hdmi_show_eld(struct hda_codec *codec, struct parsed_hdmi_eld *e)
416416

417417
if (e->spk_alloc) {
418418
char buf[SND_PRINT_CHANNEL_ALLOCATION_ADVISED_BUFSIZE];
419-
snd_print_channel_allocation(e->spk_alloc, buf, sizeof(buf));
419+
snd_hdac_print_channel_allocation(e->spk_alloc, buf, sizeof(buf));
420420
codec_dbg(codec, "HDMI: available speakers:%s\n", buf);
421421
}
422422

@@ -491,7 +491,7 @@ void snd_hdmi_print_eld_info(struct hdmi_eld *eld,
491491
snd_iprintf(buffer, "support_ai\t\t%d\n", e->support_ai);
492492
snd_iprintf(buffer, "audio_sync_delay\t%d\n", e->aud_synch_delay);
493493

494-
snd_print_channel_allocation(e->spk_alloc, buf, sizeof(buf));
494+
snd_hdac_print_channel_allocation(e->spk_alloc, buf, sizeof(buf));
495495
snd_iprintf(buffer, "speakers\t\t[0x%x]%s\n", e->spk_alloc, buf);
496496

497497
snd_iprintf(buffer, "sad_count\t\t%d\n", e->sad_count);

‎sound/pci/hda/patch_hdmi.c‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -687,11 +687,11 @@ static void hdmi_setup_audio_infoframe(struct hda_codec *codec,
687687

688688
eld = &per_pin->sink_eld;
689689

690-
ca = hdmi_channel_allocation(&codec->core,
690+
ca = snd_hdac_channel_allocation(&codec->core,
691691
eld->info.spk_alloc, channels,
692692
per_pin->chmap_set, non_pcm, per_pin->chmap);
693693

694-
active_channels = hdmi_get_active_channels(ca);
694+
active_channels = snd_hdac_get_active_channels(ca);
695695

696696
chmap->ops.set_channel_count(&codec->core, per_pin->cvt_nid,
697697
active_channels);
@@ -700,7 +700,7 @@ static void hdmi_setup_audio_infoframe(struct hda_codec *codec,
700700
* always configure channel mapping, it may have been changed by the
701701
* user in the meantime
702702
*/
703-
hdmi_setup_channel_mapping(&spec->chmap,
703+
snd_hdac_setup_channel_mapping(&spec->chmap,
704704
pin_nid, non_pcm, ca, channels,
705705
per_pin->chmap, per_pin->chmap_set);
706706

@@ -3115,9 +3115,9 @@ static int atihdmi_paired_chmap_validate(struct hdac_chmap *chmap,
31153115

31163116
/* check that only channel pairs need to be remapped on old pre-rev3 ATI/AMD */
31173117

3118-
cap = hdmi_get_ch_alloc_from_ca(ca);
3118+
cap = snd_hdac_get_ch_alloc_from_ca(ca);
31193119
for (i = 0; i < chs; ++i) {
3120-
int mask = to_spk_mask(map[i]);
3120+
int mask = snd_hdac_chmap_to_spk_mask(map[i]);
31213121
bool ok = false;
31223122
bool companion_ok = false;
31233123

@@ -3133,7 +3133,7 @@ static int atihdmi_paired_chmap_validate(struct hdac_chmap *chmap,
31333133
if (i % 2 == 0 && i + 1 < chs) {
31343134
/* even channel, check the odd companion */
31353135
int comp_chan_idx = 7 - atihdmi_paired_swap_fc_lfe(j + 1);
3136-
int comp_mask_req = to_spk_mask(map[i+1]);
3136+
int comp_mask_req = snd_hdac_chmap_to_spk_mask(map[i+1]);
31373137
int comp_mask_act = cap->speakers[comp_chan_idx];
31383138

31393139
if (comp_mask_req == comp_mask_act)
@@ -3270,7 +3270,7 @@ static void atihdmi_paired_cea_alloc_to_tlv_chmap(struct hdac_chmap *hchmap,
32703270
continue;
32713271
}
32723272

3273-
chmap[count++] = spk_to_chmap(spk);
3273+
chmap[count++] = snd_hdac_spk_to_chmap(spk);
32743274
}
32753275

32763276
WARN_ON(count != channels);

0 commit comments

Comments
 (0)