Commit fee4efd7 authored by Mario Limonciello's avatar Mario Limonciello Committed by Matthew Garrett

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: default avatarMario Limonciello <mario_limonciello@dell.com>
Signed-off-by: default avatarMatthew Garrett <matthew.garrett@nebula.com>
parent 49458e83
...@@ -59,16 +59,24 @@ enum WMAX_CONTROL_STATES { ...@@ -59,16 +59,24 @@ enum WMAX_CONTROL_STATES {
struct quirk_entry { struct quirk_entry {
u8 num_zones; u8 num_zones;
u8 hdmi_mux;
}; };
static struct quirk_entry *quirks; static struct quirk_entry *quirks;
static struct quirk_entry quirk_unknown = { static struct quirk_entry quirk_unknown = {
.num_zones = 2, .num_zones = 2,
.hdmi_mux = 0,
}; };
static struct quirk_entry quirk_x51_family = { static struct quirk_entry quirk_x51_family = {
.num_zones = 3, .num_zones = 3,
.hdmi_mux = 0.
};
static struct quirk_entry quirk_asm100 = {
.num_zones = 2,
.hdmi_mux = 1,
}; };
static int __init dmi_matched(const struct dmi_system_id *dmi) 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,6 +104,15 @@ static const struct dmi_system_id alienware_quirks[] __initconst = {
}, },
.driver_data = &quirk_x51_family, .driver_data = &quirk_x51_family,
}, },
{
.callback = dmi_matched,
.ident = "Alienware ASM100",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Alienware"),
DMI_MATCH(DMI_PRODUCT_NAME, "ASM100"),
},
.driver_data = &quirk_asm100,
},
{} {}
}; };
...@@ -537,7 +554,8 @@ static struct attribute_group hdmi_attribute_group = { ...@@ -537,7 +554,8 @@ static struct attribute_group hdmi_attribute_group = {
static void remove_hdmi(struct platform_device *dev) static void remove_hdmi(struct platform_device *dev)
{ {
sysfs_remove_group(&dev->dev.kobj, &hdmi_attribute_group); if (quirks->hdmi_mux > 0)
sysfs_remove_group(&dev->dev.kobj, &hdmi_attribute_group);
} }
static int create_hdmi(struct platform_device *dev) static int create_hdmi(struct platform_device *dev)
...@@ -583,7 +601,7 @@ static int __init alienware_wmi_init(void) ...@@ -583,7 +601,7 @@ static int __init alienware_wmi_init(void)
if (ret) if (ret)
goto fail_platform_device2; goto fail_platform_device2;
if (interface == WMAX) { if (quirks->hdmi_mux > 0) {
ret = create_hdmi(platform_device); ret = create_hdmi(platform_device);
if (ret) if (ret)
goto fail_prep_hdmi; goto fail_prep_hdmi;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment