diff options
Diffstat (limited to 'drivers/platform/x86/alienware-wmi.c')
-rw-r--r-- | drivers/platform/x86/alienware-wmi.c | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/drivers/platform/x86/alienware-wmi.c b/drivers/platform/x86/alienware-wmi.c index 297b6640213f..c5af23b64438 100644 --- a/drivers/platform/x86/alienware-wmi.c +++ b/drivers/platform/x86/alienware-wmi.c | |||
@@ -59,25 +59,33 @@ 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. | ||
72 | }; | 75 | }; |
73 | 76 | ||
74 | static int dmi_matched(const struct dmi_system_id *dmi) | 77 | static struct quirk_entry quirk_asm100 = { |
78 | .num_zones = 2, | ||
79 | .hdmi_mux = 1, | ||
80 | }; | ||
81 | |||
82 | static int __init dmi_matched(const struct dmi_system_id *dmi) | ||
75 | { | 83 | { |
76 | quirks = dmi->driver_data; | 84 | quirks = dmi->driver_data; |
77 | return 1; | 85 | return 1; |
78 | } | 86 | } |
79 | 87 | ||
80 | static struct dmi_system_id alienware_quirks[] = { | 88 | static const struct dmi_system_id alienware_quirks[] __initconst = { |
81 | { | 89 | { |
82 | .callback = dmi_matched, | 90 | .callback = dmi_matched, |
83 | .ident = "Alienware X51 R1", | 91 | .ident = "Alienware X51 R1", |
@@ -96,6 +104,15 @@ static struct dmi_system_id alienware_quirks[] = { | |||
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; |