Skip to content

Commit fee4efd

Browse files
Mario LimoncielloMatthew Garrett
authored andcommitted
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 <[email protected]> Signed-off-by: Matthew Garrett <[email protected]>
1 parent 49458e8 commit fee4efd

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

drivers/platform/x86/alienware-wmi.c

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,24 @@ enum WMAX_CONTROL_STATES {
5959

6060
struct quirk_entry {
6161
u8 num_zones;
62+
u8 hdmi_mux;
6263
};
6364

6465
static struct quirk_entry *quirks;
6566

6667
static struct quirk_entry quirk_unknown = {
6768
.num_zones = 2,
69+
.hdmi_mux = 0,
6870
};
6971

7072
static struct quirk_entry quirk_x51_family = {
7173
.num_zones = 3,
74+
.hdmi_mux = 0.
75+
};
76+
77+
static struct quirk_entry quirk_asm100 = {
78+
.num_zones = 2,
79+
.hdmi_mux = 1,
7280
};
7381

7482
static int __init dmi_matched(const struct dmi_system_id *dmi)
@@ -96,6 +104,15 @@ static const struct dmi_system_id alienware_quirks[] __initconst = {
96104
},
97105
.driver_data = &quirk_x51_family,
98106
},
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+
},
99116
{}
100117
};
101118

@@ -537,7 +554,8 @@ static struct attribute_group hdmi_attribute_group = {
537554

538555
static void remove_hdmi(struct platform_device *dev)
539556
{
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);
541559
}
542560

543561
static int create_hdmi(struct platform_device *dev)
@@ -583,7 +601,7 @@ static int __init alienware_wmi_init(void)
583601
if (ret)
584602
goto fail_platform_device2;
585603

586-
if (interface == WMAX) {
604+
if (quirks->hdmi_mux > 0) {
587605
ret = create_hdmi(platform_device);
588606
if (ret)
589607
goto fail_prep_hdmi;

0 commit comments

Comments
 (0)