Merge branch 'fix/hda' into for-linus
[pandora-kernel.git] / sound / pci / hda / hda_eld.c
index 3f10961..fcad5ec 100644 (file)
@@ -32,14 +32,6 @@ enum eld_versions {
        ELD_VER_PARTIAL         = 31,
 };
 
-static char *eld_versoin_names[32] = {
-       "reserved",
-       "reserved",
-       "CEA-861D or below",
-       [3 ... 30] = "reserved",
-       [31] = "partial"
-};
-
 enum cea_edid_versions {
        CEA_EDID_VER_NONE       = 0,
        CEA_EDID_VER_CEA861     = 1,
@@ -48,14 +40,6 @@ enum cea_edid_versions {
        CEA_EDID_VER_RESERVED   = 4,
 };
 
-static char *cea_edid_version_names[8] = {
-       "no CEA EDID Timing Extension block present",
-       "CEA-861",
-       "CEA-861-A",
-       "CEA-861-B, C or D",
-       [4 ... 7] = "reserved"
-};
-
 static char *cea_speaker_allocation_names[] = {
        /*  0 */ "FL/FR",
        /*  1 */ "LFE",
@@ -72,7 +56,7 @@ static char *cea_speaker_allocation_names[] = {
 
 static char *eld_connection_type_names[4] = {
        "HDMI",
-       "Display Port",
+       "DisplayPort",
        "2-reserved",
        "3-reserved"
 };
@@ -478,6 +462,20 @@ static void hdmi_print_eld_info(struct snd_info_entry *entry,
        struct hdmi_eld *e = entry->private_data;
        char buf[SND_PRINT_CHANNEL_ALLOCATION_ADVISED_BUFSIZE];
        int i;
+       static char *eld_versoin_names[32] = {
+               "reserved",
+               "reserved",
+               "CEA-861D or below",
+               [3 ... 30] = "reserved",
+               [31] = "partial"
+       };
+       static char *cea_edid_version_names[8] = {
+               "no CEA EDID Timing Extension block present",
+               "CEA-861",
+               "CEA-861-A",
+               "CEA-861-B, C or D",
+               [4 ... 7] = "reserved"
+       };
 
        snd_iprintf(buffer, "monitor_name\t\t%s\n", e->monitor_name);
        snd_iprintf(buffer, "connection_type\t\t%s\n",
@@ -502,7 +500,7 @@ static void hdmi_print_eld_info(struct snd_info_entry *entry,
                hdmi_print_sad_info(i, e->sad + i, buffer);
 }
 
-static void hdmi_write_eld_item(struct snd_info_entry *entry,
+static void hdmi_write_eld_info(struct snd_info_entry *entry,
                                struct snd_info_buffer *buffer)
 {
        struct hdmi_eld *e = entry->private_data;
@@ -515,6 +513,11 @@ static void hdmi_write_eld_item(struct snd_info_entry *entry,
        while (!snd_info_get_line(buffer, line, sizeof(line))) {
                if (sscanf(line, "%s %llx", name, &val) != 2)
                        continue;
+               /*
+                * We don't allow modification to these fields:
+                *      monitor_name manufacture_id product_id
+                *      eld_version edid_version
+                */
                if (!strcmp(name, "connection_type"))
                        e->conn_type = val;
                else if (!strcmp(name, "port_id"))
@@ -548,6 +551,8 @@ static void hdmi_write_eld_item(struct snd_info_entry *entry,
                                e->sad[n].sample_bits = val;
                        else if (!strcmp(sname, "_max_bitrate"))
                                e->sad[n].max_bitrate = val;
+                       else if (!strcmp(sname, "_profile"))
+                               e->sad[n].profile = val;
                        if (n >= e->sad_count)
                                e->sad_count = n + 1;
                }
@@ -567,7 +572,7 @@ int snd_hda_eld_proc_new(struct hda_codec *codec, struct hdmi_eld *eld)
                return err;
 
        snd_info_set_text_ops(entry, eld, hdmi_print_eld_info);
-       entry->c.text.write = hdmi_write_eld_item;
+       entry->c.text.write = hdmi_write_eld_info;
        entry->mode |= S_IWUSR;
        eld->proc_entry = entry;