diff options
Diffstat (limited to 'sound/pci/hda/patch_hdmi.c')
-rw-r--r-- | sound/pci/hda/patch_hdmi.c | 39 |
1 files changed, 26 insertions, 13 deletions
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c index 715615a88a8d..322901873222 100644 --- a/sound/pci/hda/patch_hdmi.c +++ b/sound/pci/hda/patch_hdmi.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <linux/slab.h> | 33 | #include <linux/slab.h> |
34 | #include <linux/moduleparam.h> | 34 | #include <linux/moduleparam.h> |
35 | #include <sound/core.h> | 35 | #include <sound/core.h> |
36 | #include <sound/jack.h> | ||
36 | #include "hda_codec.h" | 37 | #include "hda_codec.h" |
37 | #include "hda_local.h" | 38 | #include "hda_local.h" |
38 | 39 | ||
@@ -76,7 +77,7 @@ struct hdmi_spec { | |||
76 | * ati/nvhdmi specific | 77 | * ati/nvhdmi specific |
77 | */ | 78 | */ |
78 | struct hda_multi_out multiout; | 79 | struct hda_multi_out multiout; |
79 | struct hda_pcm_stream *pcm_playback; | 80 | const struct hda_pcm_stream *pcm_playback; |
80 | 81 | ||
81 | /* misc flags */ | 82 | /* misc flags */ |
82 | /* PD bit indicates only the update, not the current state */ | 83 | /* PD bit indicates only the update, not the current state */ |
@@ -720,6 +721,8 @@ static void hdmi_intrinsic_event(struct hda_codec *codec, unsigned int res) | |||
720 | &spec->sink_eld[index]); | 721 | &spec->sink_eld[index]); |
721 | /* TODO: do real things about ELD */ | 722 | /* TODO: do real things about ELD */ |
722 | } | 723 | } |
724 | |||
725 | snd_hda_input_jack_report(codec, tag); | ||
723 | } | 726 | } |
724 | 727 | ||
725 | static void hdmi_non_intrinsic_event(struct hda_codec *codec, unsigned int res) | 728 | static void hdmi_non_intrinsic_event(struct hda_codec *codec, unsigned int res) |
@@ -912,6 +915,7 @@ static void hdmi_present_sense(struct hda_codec *codec, hda_nid_t pin_nid, | |||
912 | static int hdmi_add_pin(struct hda_codec *codec, hda_nid_t pin_nid) | 915 | static int hdmi_add_pin(struct hda_codec *codec, hda_nid_t pin_nid) |
913 | { | 916 | { |
914 | struct hdmi_spec *spec = codec->spec; | 917 | struct hdmi_spec *spec = codec->spec; |
918 | int err; | ||
915 | 919 | ||
916 | if (spec->num_pins >= MAX_HDMI_PINS) { | 920 | if (spec->num_pins >= MAX_HDMI_PINS) { |
917 | snd_printk(KERN_WARNING | 921 | snd_printk(KERN_WARNING |
@@ -919,6 +923,12 @@ static int hdmi_add_pin(struct hda_codec *codec, hda_nid_t pin_nid) | |||
919 | return -E2BIG; | 923 | return -E2BIG; |
920 | } | 924 | } |
921 | 925 | ||
926 | err = snd_hda_input_jack_add(codec, pin_nid, | ||
927 | SND_JACK_VIDEOOUT, NULL); | ||
928 | if (err < 0) | ||
929 | return err; | ||
930 | snd_hda_input_jack_report(codec, pin_nid); | ||
931 | |||
922 | hdmi_present_sense(codec, pin_nid, &spec->sink_eld[spec->num_pins]); | 932 | hdmi_present_sense(codec, pin_nid, &spec->sink_eld[spec->num_pins]); |
923 | 933 | ||
924 | spec->pin[spec->num_pins] = pin_nid; | 934 | spec->pin[spec->num_pins] = pin_nid; |
@@ -1044,7 +1054,7 @@ static int generic_hdmi_playback_pcm_prepare(struct hda_pcm_stream *hinfo, | |||
1044 | return hdmi_setup_stream(codec, hinfo->nid, stream_tag, format); | 1054 | return hdmi_setup_stream(codec, hinfo->nid, stream_tag, format); |
1045 | } | 1055 | } |
1046 | 1056 | ||
1047 | static struct hda_pcm_stream generic_hdmi_pcm_playback = { | 1057 | static const struct hda_pcm_stream generic_hdmi_pcm_playback = { |
1048 | .substreams = 1, | 1058 | .substreams = 1, |
1049 | .channels_min = 2, | 1059 | .channels_min = 2, |
1050 | .ops = { | 1060 | .ops = { |
@@ -1120,11 +1130,12 @@ static void generic_hdmi_free(struct hda_codec *codec) | |||
1120 | 1130 | ||
1121 | for (i = 0; i < spec->num_pins; i++) | 1131 | for (i = 0; i < spec->num_pins; i++) |
1122 | snd_hda_eld_proc_free(codec, &spec->sink_eld[i]); | 1132 | snd_hda_eld_proc_free(codec, &spec->sink_eld[i]); |
1133 | snd_hda_input_jack_free(codec); | ||
1123 | 1134 | ||
1124 | kfree(spec); | 1135 | kfree(spec); |
1125 | } | 1136 | } |
1126 | 1137 | ||
1127 | static struct hda_codec_ops generic_hdmi_patch_ops = { | 1138 | static const struct hda_codec_ops generic_hdmi_patch_ops = { |
1128 | .init = generic_hdmi_init, | 1139 | .init = generic_hdmi_init, |
1129 | .free = generic_hdmi_free, | 1140 | .free = generic_hdmi_free, |
1130 | .build_pcms = generic_hdmi_build_pcms, | 1141 | .build_pcms = generic_hdmi_build_pcms, |
@@ -1169,12 +1180,12 @@ static int patch_generic_hdmi(struct hda_codec *codec) | |||
1169 | #define nvhdmi_master_con_nid_7x 0x04 | 1180 | #define nvhdmi_master_con_nid_7x 0x04 |
1170 | #define nvhdmi_master_pin_nid_7x 0x05 | 1181 | #define nvhdmi_master_pin_nid_7x 0x05 |
1171 | 1182 | ||
1172 | static hda_nid_t nvhdmi_con_nids_7x[4] = { | 1183 | static const hda_nid_t nvhdmi_con_nids_7x[4] = { |
1173 | /*front, rear, clfe, rear_surr */ | 1184 | /*front, rear, clfe, rear_surr */ |
1174 | 0x6, 0x8, 0xa, 0xc, | 1185 | 0x6, 0x8, 0xa, 0xc, |
1175 | }; | 1186 | }; |
1176 | 1187 | ||
1177 | static struct hda_verb nvhdmi_basic_init_7x[] = { | 1188 | static const struct hda_verb nvhdmi_basic_init_7x[] = { |
1178 | /* set audio protect on */ | 1189 | /* set audio protect on */ |
1179 | { 0x1, Nv_VERB_SET_Audio_Protection_On, 0x1}, | 1190 | { 0x1, Nv_VERB_SET_Audio_Protection_On, 0x1}, |
1180 | /* enable digital output on pin widget */ | 1191 | /* enable digital output on pin widget */ |
@@ -1435,7 +1446,7 @@ static int nvhdmi_8ch_7x_pcm_prepare(struct hda_pcm_stream *hinfo, | |||
1435 | return 0; | 1446 | return 0; |
1436 | } | 1447 | } |
1437 | 1448 | ||
1438 | static struct hda_pcm_stream nvhdmi_pcm_playback_8ch_7x = { | 1449 | static const struct hda_pcm_stream nvhdmi_pcm_playback_8ch_7x = { |
1439 | .substreams = 1, | 1450 | .substreams = 1, |
1440 | .channels_min = 2, | 1451 | .channels_min = 2, |
1441 | .channels_max = 8, | 1452 | .channels_max = 8, |
@@ -1450,7 +1461,7 @@ static struct hda_pcm_stream nvhdmi_pcm_playback_8ch_7x = { | |||
1450 | }, | 1461 | }, |
1451 | }; | 1462 | }; |
1452 | 1463 | ||
1453 | static struct hda_pcm_stream nvhdmi_pcm_playback_2ch = { | 1464 | static const struct hda_pcm_stream nvhdmi_pcm_playback_2ch = { |
1454 | .substreams = 1, | 1465 | .substreams = 1, |
1455 | .channels_min = 2, | 1466 | .channels_min = 2, |
1456 | .channels_max = 2, | 1467 | .channels_max = 2, |
@@ -1465,14 +1476,14 @@ static struct hda_pcm_stream nvhdmi_pcm_playback_2ch = { | |||
1465 | }, | 1476 | }, |
1466 | }; | 1477 | }; |
1467 | 1478 | ||
1468 | static struct hda_codec_ops nvhdmi_patch_ops_8ch_7x = { | 1479 | static const struct hda_codec_ops nvhdmi_patch_ops_8ch_7x = { |
1469 | .build_controls = generic_hdmi_build_controls, | 1480 | .build_controls = generic_hdmi_build_controls, |
1470 | .build_pcms = generic_hdmi_build_pcms, | 1481 | .build_pcms = generic_hdmi_build_pcms, |
1471 | .init = nvhdmi_7x_init, | 1482 | .init = nvhdmi_7x_init, |
1472 | .free = generic_hdmi_free, | 1483 | .free = generic_hdmi_free, |
1473 | }; | 1484 | }; |
1474 | 1485 | ||
1475 | static struct hda_codec_ops nvhdmi_patch_ops_2ch = { | 1486 | static const struct hda_codec_ops nvhdmi_patch_ops_2ch = { |
1476 | .build_controls = generic_hdmi_build_controls, | 1487 | .build_controls = generic_hdmi_build_controls, |
1477 | .build_pcms = generic_hdmi_build_pcms, | 1488 | .build_pcms = generic_hdmi_build_pcms, |
1478 | .init = nvhdmi_7x_init, | 1489 | .init = nvhdmi_7x_init, |
@@ -1568,7 +1579,7 @@ static int atihdmi_playback_pcm_prepare(struct hda_pcm_stream *hinfo, | |||
1568 | return 0; | 1579 | return 0; |
1569 | } | 1580 | } |
1570 | 1581 | ||
1571 | static struct hda_pcm_stream atihdmi_pcm_digital_playback = { | 1582 | static const struct hda_pcm_stream atihdmi_pcm_digital_playback = { |
1572 | .substreams = 1, | 1583 | .substreams = 1, |
1573 | .channels_min = 2, | 1584 | .channels_min = 2, |
1574 | .channels_max = 2, | 1585 | .channels_max = 2, |
@@ -1580,7 +1591,7 @@ static struct hda_pcm_stream atihdmi_pcm_digital_playback = { | |||
1580 | }, | 1591 | }, |
1581 | }; | 1592 | }; |
1582 | 1593 | ||
1583 | static struct hda_verb atihdmi_basic_init[] = { | 1594 | static const struct hda_verb atihdmi_basic_init[] = { |
1584 | /* enable digital output on pin widget */ | 1595 | /* enable digital output on pin widget */ |
1585 | { 0x03, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT }, | 1596 | { 0x03, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT }, |
1586 | {} /* terminator */ | 1597 | {} /* terminator */ |
@@ -1599,7 +1610,7 @@ static int atihdmi_init(struct hda_codec *codec) | |||
1599 | return 0; | 1610 | return 0; |
1600 | } | 1611 | } |
1601 | 1612 | ||
1602 | static struct hda_codec_ops atihdmi_patch_ops = { | 1613 | static const struct hda_codec_ops atihdmi_patch_ops = { |
1603 | .build_controls = generic_hdmi_build_controls, | 1614 | .build_controls = generic_hdmi_build_controls, |
1604 | .build_pcms = generic_hdmi_build_pcms, | 1615 | .build_pcms = generic_hdmi_build_pcms, |
1605 | .init = atihdmi_init, | 1616 | .init = atihdmi_init, |
@@ -1634,7 +1645,7 @@ static int patch_atihdmi(struct hda_codec *codec) | |||
1634 | /* | 1645 | /* |
1635 | * patch entries | 1646 | * patch entries |
1636 | */ | 1647 | */ |
1637 | static struct hda_codec_preset snd_hda_preset_hdmi[] = { | 1648 | static const struct hda_codec_preset snd_hda_preset_hdmi[] = { |
1638 | { .id = 0x1002793c, .name = "RS600 HDMI", .patch = patch_atihdmi }, | 1649 | { .id = 0x1002793c, .name = "RS600 HDMI", .patch = patch_atihdmi }, |
1639 | { .id = 0x10027919, .name = "RS600 HDMI", .patch = patch_atihdmi }, | 1650 | { .id = 0x10027919, .name = "RS600 HDMI", .patch = patch_atihdmi }, |
1640 | { .id = 0x1002791a, .name = "RS690/780 HDMI", .patch = patch_atihdmi }, | 1651 | { .id = 0x1002791a, .name = "RS690/780 HDMI", .patch = patch_atihdmi }, |
@@ -1677,6 +1688,7 @@ static struct hda_codec_preset snd_hda_preset_hdmi[] = { | |||
1677 | { .id = 0x80862803, .name = "Eaglelake HDMI", .patch = patch_generic_hdmi }, | 1688 | { .id = 0x80862803, .name = "Eaglelake HDMI", .patch = patch_generic_hdmi }, |
1678 | { .id = 0x80862804, .name = "IbexPeak HDMI", .patch = patch_generic_hdmi }, | 1689 | { .id = 0x80862804, .name = "IbexPeak HDMI", .patch = patch_generic_hdmi }, |
1679 | { .id = 0x80862805, .name = "CougarPoint HDMI", .patch = patch_generic_hdmi }, | 1690 | { .id = 0x80862805, .name = "CougarPoint HDMI", .patch = patch_generic_hdmi }, |
1691 | { .id = 0x80862806, .name = "PantherPoint HDMI", .patch = patch_generic_hdmi }, | ||
1680 | { .id = 0x808629fb, .name = "Crestline HDMI", .patch = patch_generic_hdmi }, | 1692 | { .id = 0x808629fb, .name = "Crestline HDMI", .patch = patch_generic_hdmi }, |
1681 | {} /* terminator */ | 1693 | {} /* terminator */ |
1682 | }; | 1694 | }; |
@@ -1722,6 +1734,7 @@ MODULE_ALIAS("snd-hda-codec-id:80862802"); | |||
1722 | MODULE_ALIAS("snd-hda-codec-id:80862803"); | 1734 | MODULE_ALIAS("snd-hda-codec-id:80862803"); |
1723 | MODULE_ALIAS("snd-hda-codec-id:80862804"); | 1735 | MODULE_ALIAS("snd-hda-codec-id:80862804"); |
1724 | MODULE_ALIAS("snd-hda-codec-id:80862805"); | 1736 | MODULE_ALIAS("snd-hda-codec-id:80862805"); |
1737 | MODULE_ALIAS("snd-hda-codec-id:80862806"); | ||
1725 | MODULE_ALIAS("snd-hda-codec-id:808629fb"); | 1738 | MODULE_ALIAS("snd-hda-codec-id:808629fb"); |
1726 | 1739 | ||
1727 | MODULE_LICENSE("GPL"); | 1740 | MODULE_LICENSE("GPL"); |