diff options
Diffstat (limited to 'sound/drivers/vx/vx_mixer.c')
-rw-r--r-- | sound/drivers/vx/vx_mixer.c | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/sound/drivers/vx/vx_mixer.c b/sound/drivers/vx/vx_mixer.c index 8ec2c605d2f0..c1d7fcdd1973 100644 --- a/sound/drivers/vx/vx_mixer.c +++ b/sound/drivers/vx/vx_mixer.c | |||
@@ -427,10 +427,10 @@ static int vx_output_level_get(struct snd_kcontrol *kcontrol, struct snd_ctl_ele | |||
427 | { | 427 | { |
428 | struct vx_core *chip = snd_kcontrol_chip(kcontrol); | 428 | struct vx_core *chip = snd_kcontrol_chip(kcontrol); |
429 | int codec = kcontrol->id.index; | 429 | int codec = kcontrol->id.index; |
430 | down(&chip->mixer_mutex); | 430 | mutex_lock(&chip->mixer_mutex); |
431 | ucontrol->value.integer.value[0] = chip->output_level[codec][0]; | 431 | ucontrol->value.integer.value[0] = chip->output_level[codec][0]; |
432 | ucontrol->value.integer.value[1] = chip->output_level[codec][1]; | 432 | ucontrol->value.integer.value[1] = chip->output_level[codec][1]; |
433 | up(&chip->mixer_mutex); | 433 | mutex_unlock(&chip->mixer_mutex); |
434 | return 0; | 434 | return 0; |
435 | } | 435 | } |
436 | 436 | ||
@@ -438,7 +438,7 @@ static int vx_output_level_put(struct snd_kcontrol *kcontrol, struct snd_ctl_ele | |||
438 | { | 438 | { |
439 | struct vx_core *chip = snd_kcontrol_chip(kcontrol); | 439 | struct vx_core *chip = snd_kcontrol_chip(kcontrol); |
440 | int codec = kcontrol->id.index; | 440 | int codec = kcontrol->id.index; |
441 | down(&chip->mixer_mutex); | 441 | mutex_lock(&chip->mixer_mutex); |
442 | if (ucontrol->value.integer.value[0] != chip->output_level[codec][0] || | 442 | if (ucontrol->value.integer.value[0] != chip->output_level[codec][0] || |
443 | ucontrol->value.integer.value[1] != chip->output_level[codec][1]) { | 443 | ucontrol->value.integer.value[1] != chip->output_level[codec][1]) { |
444 | vx_set_analog_output_level(chip, codec, | 444 | vx_set_analog_output_level(chip, codec, |
@@ -446,10 +446,10 @@ static int vx_output_level_put(struct snd_kcontrol *kcontrol, struct snd_ctl_ele | |||
446 | ucontrol->value.integer.value[1]); | 446 | ucontrol->value.integer.value[1]); |
447 | chip->output_level[codec][0] = ucontrol->value.integer.value[0]; | 447 | chip->output_level[codec][0] = ucontrol->value.integer.value[0]; |
448 | chip->output_level[codec][1] = ucontrol->value.integer.value[1]; | 448 | chip->output_level[codec][1] = ucontrol->value.integer.value[1]; |
449 | up(&chip->mixer_mutex); | 449 | mutex_unlock(&chip->mixer_mutex); |
450 | return 1; | 450 | return 1; |
451 | } | 451 | } |
452 | up(&chip->mixer_mutex); | 452 | mutex_unlock(&chip->mixer_mutex); |
453 | return 0; | 453 | return 0; |
454 | } | 454 | } |
455 | 455 | ||
@@ -502,14 +502,14 @@ static int vx_audio_src_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_v | |||
502 | static int vx_audio_src_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) | 502 | static int vx_audio_src_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
503 | { | 503 | { |
504 | struct vx_core *chip = snd_kcontrol_chip(kcontrol); | 504 | struct vx_core *chip = snd_kcontrol_chip(kcontrol); |
505 | down(&chip->mixer_mutex); | 505 | mutex_lock(&chip->mixer_mutex); |
506 | if (chip->audio_source_target != ucontrol->value.enumerated.item[0]) { | 506 | if (chip->audio_source_target != ucontrol->value.enumerated.item[0]) { |
507 | chip->audio_source_target = ucontrol->value.enumerated.item[0]; | 507 | chip->audio_source_target = ucontrol->value.enumerated.item[0]; |
508 | vx_sync_audio_source(chip); | 508 | vx_sync_audio_source(chip); |
509 | up(&chip->mixer_mutex); | 509 | mutex_unlock(&chip->mixer_mutex); |
510 | return 1; | 510 | return 1; |
511 | } | 511 | } |
512 | up(&chip->mixer_mutex); | 512 | mutex_unlock(&chip->mixer_mutex); |
513 | return 0; | 513 | return 0; |
514 | } | 514 | } |
515 | 515 | ||
@@ -550,14 +550,14 @@ static int vx_clock_mode_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_ | |||
550 | static int vx_clock_mode_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) | 550 | static int vx_clock_mode_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) |
551 | { | 551 | { |
552 | struct vx_core *chip = snd_kcontrol_chip(kcontrol); | 552 | struct vx_core *chip = snd_kcontrol_chip(kcontrol); |
553 | down(&chip->mixer_mutex); | 553 | mutex_lock(&chip->mixer_mutex); |
554 | if (chip->clock_mode != ucontrol->value.enumerated.item[0]) { | 554 | if (chip->clock_mode != ucontrol->value.enumerated.item[0]) { |
555 | chip->clock_mode = ucontrol->value.enumerated.item[0]; | 555 | chip->clock_mode = ucontrol->value.enumerated.item[0]; |
556 | vx_set_clock(chip, chip->freq); | 556 | vx_set_clock(chip, chip->freq); |
557 | up(&chip->mixer_mutex); | 557 | mutex_unlock(&chip->mixer_mutex); |
558 | return 1; | 558 | return 1; |
559 | } | 559 | } |
560 | up(&chip->mixer_mutex); | 560 | mutex_unlock(&chip->mixer_mutex); |
561 | return 0; | 561 | return 0; |
562 | } | 562 | } |
563 | 563 | ||
@@ -587,10 +587,10 @@ static int vx_audio_gain_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_ | |||
587 | int audio = kcontrol->private_value & 0xff; | 587 | int audio = kcontrol->private_value & 0xff; |
588 | int capture = (kcontrol->private_value >> 8) & 1; | 588 | int capture = (kcontrol->private_value >> 8) & 1; |
589 | 589 | ||
590 | down(&chip->mixer_mutex); | 590 | mutex_lock(&chip->mixer_mutex); |
591 | ucontrol->value.integer.value[0] = chip->audio_gain[capture][audio]; | 591 | ucontrol->value.integer.value[0] = chip->audio_gain[capture][audio]; |
592 | ucontrol->value.integer.value[1] = chip->audio_gain[capture][audio+1]; | 592 | ucontrol->value.integer.value[1] = chip->audio_gain[capture][audio+1]; |
593 | up(&chip->mixer_mutex); | 593 | mutex_unlock(&chip->mixer_mutex); |
594 | return 0; | 594 | return 0; |
595 | } | 595 | } |
596 | 596 | ||
@@ -600,15 +600,15 @@ static int vx_audio_gain_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_ | |||
600 | int audio = kcontrol->private_value & 0xff; | 600 | int audio = kcontrol->private_value & 0xff; |
601 | int capture = (kcontrol->private_value >> 8) & 1; | 601 | int capture = (kcontrol->private_value >> 8) & 1; |
602 | 602 | ||
603 | down(&chip->mixer_mutex); | 603 | mutex_lock(&chip->mixer_mutex); |
604 | if (ucontrol->value.integer.value[0] != chip->audio_gain[capture][audio] || | 604 | if (ucontrol->value.integer.value[0] != chip->audio_gain[capture][audio] || |
605 | ucontrol->value.integer.value[1] != chip->audio_gain[capture][audio+1]) { | 605 | ucontrol->value.integer.value[1] != chip->audio_gain[capture][audio+1]) { |
606 | vx_set_audio_gain(chip, audio, capture, ucontrol->value.integer.value[0]); | 606 | vx_set_audio_gain(chip, audio, capture, ucontrol->value.integer.value[0]); |
607 | vx_set_audio_gain(chip, audio+1, capture, ucontrol->value.integer.value[1]); | 607 | vx_set_audio_gain(chip, audio+1, capture, ucontrol->value.integer.value[1]); |
608 | up(&chip->mixer_mutex); | 608 | mutex_unlock(&chip->mixer_mutex); |
609 | return 1; | 609 | return 1; |
610 | } | 610 | } |
611 | up(&chip->mixer_mutex); | 611 | mutex_unlock(&chip->mixer_mutex); |
612 | return 0; | 612 | return 0; |
613 | } | 613 | } |
614 | 614 | ||
@@ -617,10 +617,10 @@ static int vx_audio_monitor_get(struct snd_kcontrol *kcontrol, struct snd_ctl_el | |||
617 | struct vx_core *chip = snd_kcontrol_chip(kcontrol); | 617 | struct vx_core *chip = snd_kcontrol_chip(kcontrol); |
618 | int audio = kcontrol->private_value & 0xff; | 618 | int audio = kcontrol->private_value & 0xff; |
619 | 619 | ||
620 | down(&chip->mixer_mutex); | 620 | mutex_lock(&chip->mixer_mutex); |
621 | ucontrol->value.integer.value[0] = chip->audio_monitor[audio]; | 621 | ucontrol->value.integer.value[0] = chip->audio_monitor[audio]; |
622 | ucontrol->value.integer.value[1] = chip->audio_monitor[audio+1]; | 622 | ucontrol->value.integer.value[1] = chip->audio_monitor[audio+1]; |
623 | up(&chip->mixer_mutex); | 623 | mutex_unlock(&chip->mixer_mutex); |
624 | return 0; | 624 | return 0; |
625 | } | 625 | } |
626 | 626 | ||
@@ -629,17 +629,17 @@ static int vx_audio_monitor_put(struct snd_kcontrol *kcontrol, struct snd_ctl_el | |||
629 | struct vx_core *chip = snd_kcontrol_chip(kcontrol); | 629 | struct vx_core *chip = snd_kcontrol_chip(kcontrol); |
630 | int audio = kcontrol->private_value & 0xff; | 630 | int audio = kcontrol->private_value & 0xff; |
631 | 631 | ||
632 | down(&chip->mixer_mutex); | 632 | mutex_lock(&chip->mixer_mutex); |
633 | if (ucontrol->value.integer.value[0] != chip->audio_monitor[audio] || | 633 | if (ucontrol->value.integer.value[0] != chip->audio_monitor[audio] || |
634 | ucontrol->value.integer.value[1] != chip->audio_monitor[audio+1]) { | 634 | ucontrol->value.integer.value[1] != chip->audio_monitor[audio+1]) { |
635 | vx_set_monitor_level(chip, audio, ucontrol->value.integer.value[0], | 635 | vx_set_monitor_level(chip, audio, ucontrol->value.integer.value[0], |
636 | chip->audio_monitor_active[audio]); | 636 | chip->audio_monitor_active[audio]); |
637 | vx_set_monitor_level(chip, audio+1, ucontrol->value.integer.value[1], | 637 | vx_set_monitor_level(chip, audio+1, ucontrol->value.integer.value[1], |
638 | chip->audio_monitor_active[audio+1]); | 638 | chip->audio_monitor_active[audio+1]); |
639 | up(&chip->mixer_mutex); | 639 | mutex_unlock(&chip->mixer_mutex); |
640 | return 1; | 640 | return 1; |
641 | } | 641 | } |
642 | up(&chip->mixer_mutex); | 642 | mutex_unlock(&chip->mixer_mutex); |
643 | return 0; | 643 | return 0; |
644 | } | 644 | } |
645 | 645 | ||
@@ -657,10 +657,10 @@ static int vx_audio_sw_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_va | |||
657 | struct vx_core *chip = snd_kcontrol_chip(kcontrol); | 657 | struct vx_core *chip = snd_kcontrol_chip(kcontrol); |
658 | int audio = kcontrol->private_value & 0xff; | 658 | int audio = kcontrol->private_value & 0xff; |
659 | 659 | ||
660 | down(&chip->mixer_mutex); | 660 | mutex_lock(&chip->mixer_mutex); |
661 | ucontrol->value.integer.value[0] = chip->audio_active[audio]; | 661 | ucontrol->value.integer.value[0] = chip->audio_active[audio]; |
662 | ucontrol->value.integer.value[1] = chip->audio_active[audio+1]; | 662 | ucontrol->value.integer.value[1] = chip->audio_active[audio+1]; |
663 | up(&chip->mixer_mutex); | 663 | mutex_unlock(&chip->mixer_mutex); |
664 | return 0; | 664 | return 0; |
665 | } | 665 | } |
666 | 666 | ||
@@ -669,15 +669,15 @@ static int vx_audio_sw_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_va | |||
669 | struct vx_core *chip = snd_kcontrol_chip(kcontrol); | 669 | struct vx_core *chip = snd_kcontrol_chip(kcontrol); |
670 | int audio = kcontrol->private_value & 0xff; | 670 | int audio = kcontrol->private_value & 0xff; |
671 | 671 | ||
672 | down(&chip->mixer_mutex); | 672 | mutex_lock(&chip->mixer_mutex); |
673 | if (ucontrol->value.integer.value[0] != chip->audio_active[audio] || | 673 | if (ucontrol->value.integer.value[0] != chip->audio_active[audio] || |
674 | ucontrol->value.integer.value[1] != chip->audio_active[audio+1]) { | 674 | ucontrol->value.integer.value[1] != chip->audio_active[audio+1]) { |
675 | vx_set_audio_switch(chip, audio, ucontrol->value.integer.value[0]); | 675 | vx_set_audio_switch(chip, audio, ucontrol->value.integer.value[0]); |
676 | vx_set_audio_switch(chip, audio+1, ucontrol->value.integer.value[1]); | 676 | vx_set_audio_switch(chip, audio+1, ucontrol->value.integer.value[1]); |
677 | up(&chip->mixer_mutex); | 677 | mutex_unlock(&chip->mixer_mutex); |
678 | return 1; | 678 | return 1; |
679 | } | 679 | } |
680 | up(&chip->mixer_mutex); | 680 | mutex_unlock(&chip->mixer_mutex); |
681 | return 0; | 681 | return 0; |
682 | } | 682 | } |
683 | 683 | ||
@@ -686,10 +686,10 @@ static int vx_monitor_sw_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_ | |||
686 | struct vx_core *chip = snd_kcontrol_chip(kcontrol); | 686 | struct vx_core *chip = snd_kcontrol_chip(kcontrol); |
687 | int audio = kcontrol->private_value & 0xff; | 687 | int audio = kcontrol->private_value & 0xff; |
688 | 688 | ||
689 | down(&chip->mixer_mutex); | 689 | mutex_lock(&chip->mixer_mutex); |
690 | ucontrol->value.integer.value[0] = chip->audio_monitor_active[audio]; | 690 | ucontrol->value.integer.value[0] = chip->audio_monitor_active[audio]; |
691 | ucontrol->value.integer.value[1] = chip->audio_monitor_active[audio+1]; | 691 | ucontrol->value.integer.value[1] = chip->audio_monitor_active[audio+1]; |
692 | up(&chip->mixer_mutex); | 692 | mutex_unlock(&chip->mixer_mutex); |
693 | return 0; | 693 | return 0; |
694 | } | 694 | } |
695 | 695 | ||
@@ -698,17 +698,17 @@ static int vx_monitor_sw_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_ | |||
698 | struct vx_core *chip = snd_kcontrol_chip(kcontrol); | 698 | struct vx_core *chip = snd_kcontrol_chip(kcontrol); |
699 | int audio = kcontrol->private_value & 0xff; | 699 | int audio = kcontrol->private_value & 0xff; |
700 | 700 | ||
701 | down(&chip->mixer_mutex); | 701 | mutex_lock(&chip->mixer_mutex); |
702 | if (ucontrol->value.integer.value[0] != chip->audio_monitor_active[audio] || | 702 | if (ucontrol->value.integer.value[0] != chip->audio_monitor_active[audio] || |
703 | ucontrol->value.integer.value[1] != chip->audio_monitor_active[audio+1]) { | 703 | ucontrol->value.integer.value[1] != chip->audio_monitor_active[audio+1]) { |
704 | vx_set_monitor_level(chip, audio, chip->audio_monitor[audio], | 704 | vx_set_monitor_level(chip, audio, chip->audio_monitor[audio], |
705 | ucontrol->value.integer.value[0]); | 705 | ucontrol->value.integer.value[0]); |
706 | vx_set_monitor_level(chip, audio+1, chip->audio_monitor[audio+1], | 706 | vx_set_monitor_level(chip, audio+1, chip->audio_monitor[audio+1], |
707 | ucontrol->value.integer.value[1]); | 707 | ucontrol->value.integer.value[1]); |
708 | up(&chip->mixer_mutex); | 708 | mutex_unlock(&chip->mixer_mutex); |
709 | return 1; | 709 | return 1; |
710 | } | 710 | } |
711 | up(&chip->mixer_mutex); | 711 | mutex_unlock(&chip->mixer_mutex); |
712 | return 0; | 712 | return 0; |
713 | } | 713 | } |
714 | 714 | ||
@@ -756,12 +756,12 @@ static int vx_iec958_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_valu | |||
756 | { | 756 | { |
757 | struct vx_core *chip = snd_kcontrol_chip(kcontrol); | 757 | struct vx_core *chip = snd_kcontrol_chip(kcontrol); |
758 | 758 | ||
759 | down(&chip->mixer_mutex); | 759 | mutex_lock(&chip->mixer_mutex); |
760 | ucontrol->value.iec958.status[0] = (chip->uer_bits >> 0) & 0xff; | 760 | ucontrol->value.iec958.status[0] = (chip->uer_bits >> 0) & 0xff; |
761 | ucontrol->value.iec958.status[1] = (chip->uer_bits >> 8) & 0xff; | 761 | ucontrol->value.iec958.status[1] = (chip->uer_bits >> 8) & 0xff; |
762 | ucontrol->value.iec958.status[2] = (chip->uer_bits >> 16) & 0xff; | 762 | ucontrol->value.iec958.status[2] = (chip->uer_bits >> 16) & 0xff; |
763 | ucontrol->value.iec958.status[3] = (chip->uer_bits >> 24) & 0xff; | 763 | ucontrol->value.iec958.status[3] = (chip->uer_bits >> 24) & 0xff; |
764 | up(&chip->mixer_mutex); | 764 | mutex_unlock(&chip->mixer_mutex); |
765 | return 0; | 765 | return 0; |
766 | } | 766 | } |
767 | 767 | ||
@@ -783,14 +783,14 @@ static int vx_iec958_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_valu | |||
783 | (ucontrol->value.iec958.status[1] << 8) | | 783 | (ucontrol->value.iec958.status[1] << 8) | |
784 | (ucontrol->value.iec958.status[2] << 16) | | 784 | (ucontrol->value.iec958.status[2] << 16) | |
785 | (ucontrol->value.iec958.status[3] << 24); | 785 | (ucontrol->value.iec958.status[3] << 24); |
786 | down(&chip->mixer_mutex); | 786 | mutex_lock(&chip->mixer_mutex); |
787 | if (chip->uer_bits != val) { | 787 | if (chip->uer_bits != val) { |
788 | chip->uer_bits = val; | 788 | chip->uer_bits = val; |
789 | vx_set_iec958_status(chip, val); | 789 | vx_set_iec958_status(chip, val); |
790 | up(&chip->mixer_mutex); | 790 | mutex_unlock(&chip->mixer_mutex); |
791 | return 1; | 791 | return 1; |
792 | } | 792 | } |
793 | up(&chip->mixer_mutex); | 793 | mutex_unlock(&chip->mixer_mutex); |
794 | return 0; | 794 | return 0; |
795 | } | 795 | } |
796 | 796 | ||