diff options
author | Mario Limonciello <mario_limonciello@dell.com> | 2014-07-24 00:19:23 -0400 |
---|---|---|
committer | Matthew Garrett <matthew.garrett@nebula.com> | 2014-08-16 04:23:55 -0400 |
commit | fee4efd7d1372aa9ac2f6873167f02259cb143ef (patch) | |
tree | ba308ae0f34a8e677e9947bbeffe5efaf9079a31 | |
parent | 49458e83082d6c68c6b7b8905789dc4f35eca422 (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.c | 22 |
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 | ||
60 | struct quirk_entry { | 60 | struct quirk_entry { |
61 | u8 num_zones; | 61 | u8 num_zones; |
62 | u8 hdmi_mux; | ||
62 | }; | 63 | }; |
63 | 64 | ||
64 | static struct quirk_entry *quirks; | 65 | static struct quirk_entry *quirks; |
65 | 66 | ||
66 | static struct quirk_entry quirk_unknown = { | 67 | static struct quirk_entry quirk_unknown = { |
67 | .num_zones = 2, | 68 | .num_zones = 2, |
69 | .hdmi_mux = 0, | ||
68 | }; | 70 | }; |
69 | 71 | ||
70 | static struct quirk_entry quirk_x51_family = { | 72 | static struct quirk_entry quirk_x51_family = { |
71 | .num_zones = 3, | 73 | .num_zones = 3, |
74 | .hdmi_mux = 0. | ||
75 | }; | ||
76 | |||
77 | static struct quirk_entry quirk_asm100 = { | ||
78 | .num_zones = 2, | ||
79 | .hdmi_mux = 1, | ||
72 | }; | 80 | }; |
73 | 81 | ||
74 | static int __init dmi_matched(const struct dmi_system_id *dmi) | 82 | static 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 | ||
538 | static void remove_hdmi(struct platform_device *dev) | 555 | static 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 | ||
543 | static int create_hdmi(struct platform_device *dev) | 561 | static 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; |