aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario Limonciello <mario_limonciello@dell.com>2014-07-24 00:19:23 -0400
committerMatthew Garrett <matthew.garrett@nebula.com>2014-08-16 04:23:55 -0400
commitfee4efd7d1372aa9ac2f6873167f02259cb143ef (patch)
treeba308ae0f34a8e677e9947bbeffe5efaf9079a31
parent49458e83082d6c68c6b7b8905789dc4f35eca422 (diff)
alienware-wmi: make hdmi_mux enabled on case-by-case basis
Not all HW supporting WMAX method will support the HDMI mux feature. Explicitly quirk the HW that does support it. Signed-off-by: Mario Limonciello <mario_limonciello@dell.com> Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
-rw-r--r--drivers/platform/x86/alienware-wmi.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/drivers/platform/x86/alienware-wmi.c b/drivers/platform/x86/alienware-wmi.c
index cdbaf3c5328a..c5af23b64438 100644
--- a/drivers/platform/x86/alienware-wmi.c
+++ b/drivers/platform/x86/alienware-wmi.c
@@ -59,16 +59,24 @@ enum WMAX_CONTROL_STATES {
59 59
60struct quirk_entry { 60struct quirk_entry {
61 u8 num_zones; 61 u8 num_zones;
62 u8 hdmi_mux;
62}; 63};
63 64
64static struct quirk_entry *quirks; 65static struct quirk_entry *quirks;
65 66
66static struct quirk_entry quirk_unknown = { 67static struct quirk_entry quirk_unknown = {
67 .num_zones = 2, 68 .num_zones = 2,
69 .hdmi_mux = 0,
68}; 70};
69 71
70static struct quirk_entry quirk_x51_family = { 72static struct quirk_entry quirk_x51_family = {
71 .num_zones = 3, 73 .num_zones = 3,
74 .hdmi_mux = 0.
75};
76
77static struct quirk_entry quirk_asm100 = {
78 .num_zones = 2,
79 .hdmi_mux = 1,
72}; 80};
73 81
74static int __init dmi_matched(const struct dmi_system_id *dmi) 82static int __init dmi_matched(const struct dmi_system_id *dmi)
@@ -96,6 +104,15 @@ static const struct dmi_system_id alienware_quirks[] __initconst = {
96 }, 104 },
97 .driver_data = &quirk_x51_family, 105 .driver_data = &quirk_x51_family,
98 }, 106 },
107 {
108 .callback = dmi_matched,
109 .ident = "Alienware ASM100",
110 .matches = {
111 DMI_MATCH(DMI_SYS_VENDOR, "Alienware"),
112 DMI_MATCH(DMI_PRODUCT_NAME, "ASM100"),
113 },
114 .driver_data = &quirk_asm100,
115 },
99 {} 116 {}
100}; 117};
101 118
@@ -537,7 +554,8 @@ static struct attribute_group hdmi_attribute_group = {
537 554
538static void remove_hdmi(struct platform_device *dev) 555static void remove_hdmi(struct platform_device *dev)
539{ 556{
540 sysfs_remove_group(&dev->dev.kobj, &hdmi_attribute_group); 557 if (quirks->hdmi_mux > 0)
558 sysfs_remove_group(&dev->dev.kobj, &hdmi_attribute_group);
541} 559}
542 560
543static int create_hdmi(struct platform_device *dev) 561static int create_hdmi(struct platform_device *dev)
@@ -583,7 +601,7 @@ static int __init alienware_wmi_init(void)
583 if (ret) 601 if (ret)
584 goto fail_platform_device2; 602 goto fail_platform_device2;
585 603
586 if (interface == WMAX) { 604 if (quirks->hdmi_mux > 0) {
587 ret = create_hdmi(platform_device); 605 ret = create_hdmi(platform_device);
588 if (ret) 606 if (ret)
589 goto fail_prep_hdmi; 607 goto fail_prep_hdmi;