| @@ -243,7 +243,7 @@ static int get_channel_allocation_order(int ca) · 242 unmodified lines |
| 243 | return i; | 243 | return i; |
| 244 | } | 244 | } |
| 245 | | 245 | |
| 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) |
| 247 | { | 247 | { |
| 248 | int i, j; | 248 | int i, j; |
| 249 | | 249 | |
| @@ -254,7 +254,7 @@ void snd_print_channel_allocation(int spk_alloc, char *buf, int buflen) · 4 unmodified lines |
| 254 | } | 254 | } |
| 255 | buf[j] = '\0'; /* necessary when j == 0 */ | 255 | buf[j] = '\0'; /* necessary when j == 0 */ |
| 256 | } | 256 | } |
| 257 | EXPORT_SYMBOL_GPL(snd_print_channel_allocation); | 257 | EXPORT_SYMBOL_GPL(snd_hdac_print_channel_allocation); |
| 258 | | 258 | |
| 259 | /* | 259 | /* |
| 260 | * The transformation takes two steps: | 260 | * The transformation takes two steps: |
| @@ -312,7 +312,7 @@ static int hdmi_channel_allocation_spk_alloc_blk(struct hdac_device *codec, · 51 unmodified lines |
| 312 | } | 312 | } |
| 313 | } | 313 | } |
| 314 | | 314 | |
| 315 | snd_print_channel_allocation(spk_alloc, buf, sizeof(buf)); | 315 | snd_hdac_print_channel_allocation(spk_alloc, buf, sizeof(buf)); |
| 316 | dev_dbg(&codec->dev, "HDMI: select CA 0x%x for %d-channel allocation: %s\n", | 316 | dev_dbg(&codec->dev, "HDMI: select CA 0x%x for %d-channel allocation: %s\n", |
| 317 | ca, channels, buf); | 317 | ca, channels, buf); |
| 318 | | 318 | |
| @@ -412,7 +412,7 @@ static struct channel_map_table map_tables[] = { · 93 unmodified lines |
| 412 | }; | 412 | }; |
| 413 | | 413 | |
| 414 | /* from ALSA API channel position to speaker bit mask */ | 414 | /* 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) |
| 416 | { | 416 | { |
| 417 | struct channel_map_table *t = map_tables; | 417 | struct channel_map_table *t = map_tables; |
| 418 | | 418 | |
| @@ -422,12 +422,12 @@ int to_spk_mask(unsigned char c) · 3 unmodified lines |
| 422 | } | 422 | } |
| 423 | return 0; | 423 | return 0; |
| 424 | } | 424 | } |
| 425 | EXPORT_SYMBOL_GPL(to_spk_mask); | 425 | EXPORT_SYMBOL_GPL(snd_hdac_chmap_to_spk_mask); |
| 426 | | 426 | |
| 427 | /* from ALSA API channel position to CEA slot */ | 427 | /* from ALSA API channel position to CEA slot */ |
| 428 | static int to_cea_slot(int ordered_ca, unsigned char pos) | 428 | static int to_cea_slot(int ordered_ca, unsigned char pos) |
| 429 | { | 429 | { |
| 430 | int mask = to_spk_mask(pos); | 430 | int mask = snd_hdac_chmap_to_spk_mask(pos); |
| 431 | int i; | 431 | int i; |
| 432 | | 432 | |
| 433 | if (mask) { | 433 | if (mask) { |
| @@ -441,7 +441,7 @@ static int to_cea_slot(int ordered_ca, unsigned char pos) · 7 unmodified lines |
| 441 | } | 441 | } |
| 442 | | 442 | |
| 443 | /* from speaker bit mask to ALSA API channel position */ | 443 | /* 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) |
| 445 | { | 445 | { |
| 446 | struct channel_map_table *t = map_tables; | 446 | struct channel_map_table *t = map_tables; |
| 447 | | 447 | |
| @@ -451,14 +451,14 @@ int spk_to_chmap(int spk) · 3 unmodified lines |
| 451 | } | 451 | } |
| 452 | return 0; | 452 | return 0; |
| 453 | } | 453 | } |
| 454 | EXPORT_SYMBOL_GPL(spk_to_chmap); | 454 | EXPORT_SYMBOL_GPL(snd_hdac_spk_to_chmap); |
| 455 | | 455 | |
| 456 | /* from CEA slot to ALSA API channel position */ | 456 | /* from CEA slot to ALSA API channel position */ |
| 457 | static int from_cea_slot(int ordered_ca, unsigned char slot) | 457 | static int from_cea_slot(int ordered_ca, unsigned char slot) |
| 458 | { | 458 | { |
| 459 | int mask = channel_allocations[ordered_ca].speakers[7 - slot]; | 459 | int mask = channel_allocations[ordered_ca].speakers[7 - slot]; |
| 460 | | 460 | |
| 461 | return spk_to_chmap(mask); | 461 | return snd_hdac_spk_to_chmap(mask); |
| 462 | } | 462 | } |
| 463 | | 463 | |
| 464 | /* get the CA index corresponding to the given ALSA API channel map */ | 464 | /* 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) · 2 unmodified lines |
| 467 | int i, spks = 0, spk_mask = 0; | 467 | int i, spks = 0, spk_mask = 0; |
| 468 | | 468 | |
| 469 | for (i = 0; i < chs; i++) { | 469 | 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]); |
| 471 | | 471 | |
| 472 | if (mask) { | 472 | if (mask) { |
| 473 | spk_mask |= mask; | 473 | spk_mask |= mask; |
| @@ -530,7 +530,7 @@ static void hdmi_setup_fake_chmap(unsigned char *map, int ca) · 56 unmodified lines |
| 530 | } | 530 | } |
| 531 | } | 531 | } |
| 532 | | 532 | |
| 533 | void hdmi_setup_channel_mapping(struct hdac_chmap *chmap, | 533 | void snd_hdac_setup_channel_mapping(struct hdac_chmap *chmap, |
| 534 | hda_nid_t pin_nid, bool non_pcm, int ca, | 534 | hda_nid_t pin_nid, bool non_pcm, int ca, |
| 535 | int channels, unsigned char *map, | 535 | int channels, unsigned char *map, |
| 536 | bool chmap_set) | 536 | bool chmap_set) |
| @@ -545,23 +545,23 @@ void hdmi_setup_channel_mapping(struct hdac_chmap *chmap, · 8 unmodified lines |
| 545 | | 545 | |
| 546 | hdmi_debug_channel_mapping(chmap, pin_nid); | 546 | hdmi_debug_channel_mapping(chmap, pin_nid); |
| 547 | } | 547 | } |
| 548 | EXPORT_SYMBOL_GPL(hdmi_setup_channel_mapping); | 548 | EXPORT_SYMBOL_GPL(snd_hdac_setup_channel_mapping); |
| 549 | | 549 | |
| 550 | int hdmi_get_active_channels(int ca) | 550 | int snd_hdac_get_active_channels(int ca) |
| 551 | { | 551 | { |
| 552 | int ordered_ca = get_channel_allocation_order(ca); | 552 | int ordered_ca = get_channel_allocation_order(ca); |
| 553 | | 553 | |
| 554 | return channel_allocations[ordered_ca].channels; | 554 | return channel_allocations[ordered_ca].channels; |
| 555 | } | 555 | } |
| 556 | EXPORT_SYMBOL_GPL(hdmi_get_active_channels); | 556 | EXPORT_SYMBOL_GPL(snd_hdac_get_active_channels); |
| 557 | | 557 | |
| 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) |
| 559 | { | 559 | { |
| 560 | return &channel_allocations[get_channel_allocation_order(ca)]; | 560 | return &channel_allocations[get_channel_allocation_order(ca)]; |
| 561 | } | 561 | } |
| 562 | EXPORT_SYMBOL_GPL(hdmi_get_ch_alloc_from_ca); | 562 | EXPORT_SYMBOL_GPL(snd_hdac_get_ch_alloc_from_ca); |
| 563 | | 563 | |
| 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, |
| 565 | int channels, bool chmap_set, bool non_pcm, unsigned char *map) | 565 | int channels, bool chmap_set, bool non_pcm, unsigned char *map) |
| 566 | { | 566 | { |
| 567 | int ca; | 567 | int ca; |
| @@ -577,7 +577,7 @@ int hdmi_channel_allocation(struct hdac_device *hdac, int spk_alloc, · 9 unmodified lines |
| 577 | | 577 | |
| 578 | return ca; | 578 | return ca; |
| 579 | } | 579 | } |
| 580 | EXPORT_SYMBOL_GPL(hdmi_channel_allocation); | 580 | EXPORT_SYMBOL_GPL(snd_hdac_channel_allocation); |
| 581 | | 581 | |
| 582 | /* | 582 | /* |
| 583 | * ALSA API channel-map control callbacks | 583 | * ALSA API channel-map control callbacks |
| @@ -619,7 +619,7 @@ static void hdmi_cea_alloc_to_tlv_chmap(struct hdac_chmap *hchmap, · 35 unmodified lines |
| 619 | if (!spk) | 619 | if (!spk) |
| 620 | continue; | 620 | continue; |
| 621 | | 621 | |
| 622 | chmap[count++] = spk_to_chmap(spk); | 622 | chmap[count++] = snd_hdac_spk_to_chmap(spk); |
| 623 | } | 623 | } |
| 624 | | 624 | |
| 625 | WARN_ON(count != channels); | 625 | WARN_ON(count != channels); |