Add config entries to conditionally compile alienware-wmi-alienfx.c and alienware-wmi-awcc.c. Signed-off-by: Kurt Borja <kuurtb@xxxxxxxxx> --- drivers/platform/x86/dell/Kconfig | 25 ++++++++++++++++++----- drivers/platform/x86/dell/Makefile | 8 ++++---- drivers/platform/x86/dell/alienware-wmi.h | 22 ++++++++++++++++++++ 3 files changed, 46 insertions(+), 9 deletions(-) diff --git a/drivers/platform/x86/dell/Kconfig b/drivers/platform/x86/dell/Kconfig index 2dddafb3f7fa..fcc7f7d28ac1 100644 --- a/drivers/platform/x86/dell/Kconfig +++ b/drivers/platform/x86/dell/Kconfig @@ -18,16 +18,31 @@ config ALIENWARE_WMI tristate "Alienware Special feature control" default m depends on ACPI + depends on ACPI_WMI + help + This is a driver for controlling Alienware WMI driven + features. + +config ALIENWARE_ALIENFX + bool "Alienware AlienFX backend" + default y depends on LEDS_CLASS depends on NEW_LEDS - depends on ACPI_WMI - select ACPI_PLATFORM_PROFILE + depends on ALIENWARE_WMI help - This is a driver for controlling Alienware BIOS driven - features. It exposes an interface for controlling the AlienFX - zones on Alienware machines that don't contain a dedicated AlienFX + It exposes an interface for controlling the AlienFX zones on + Alienware machines that don't contain a dedicated AlienFX USB MCU such as the X51 and X51-R2. +config ALIENWARE_AWCC + bool "Alienware AWCC backend" + default y + depends on ALIENWARE_WMI + select ACPI_PLATFORM_PROFILE + help + Provides thermal control features on Alienware and Dell's + GSeries laptops with a WMI device with UID "AWCC". + config DCDBAS tristate "Dell Systems Management Base Driver" default m diff --git a/drivers/platform/x86/dell/Makefile b/drivers/platform/x86/dell/Makefile index 54a592fd6ae6..6153cff5538f 100644 --- a/drivers/platform/x86/dell/Makefile +++ b/drivers/platform/x86/dell/Makefile @@ -4,10 +4,10 @@ # Dell x86 Platform-Specific Drivers # -obj-$(CONFIG_ALIENWARE_WMI) += alienware-wmi.o -alienware-wmi-objs := alienware-wmi-base.o -alienware-wmi-y += alienware-wmi-alienfx.o -alienware-wmi-y += alienware-wmi-awcc.o +obj-$(CONFIG_ALIENWARE_WMI) += alienware-wmi.o +alienware-wmi-objs := alienware-wmi-base.o +alienware-wmi-$(CONFIG_ALIENWARE_ALIENFX) += alienware-wmi-alienfx.o +alienware-wmi-$(CONFIG_ALIENWARE_AWCC) += alienware-wmi-awcc.o obj-$(CONFIG_DCDBAS) += dcdbas.o obj-$(CONFIG_DELL_LAPTOP) += dell-laptop.o obj-$(CONFIG_DELL_RBTN) += dell-rbtn.o diff --git a/drivers/platform/x86/dell/alienware-wmi.h b/drivers/platform/x86/dell/alienware-wmi.h index 1c12b8e330e2..16624c824828 100644 --- a/drivers/platform/x86/dell/alienware-wmi.h +++ b/drivers/platform/x86/dell/alienware-wmi.h @@ -110,10 +110,32 @@ struct awcc_priv { acpi_status alienware_wmi_command(struct wmi_device *wdev, u32 method_id, void *in_args, size_t in_size, u32 *out_data); +#if IS_ENABLED(CONFIG_ALIENWARE_ALIENFX) int alienfx_wmi_init(struct alienfx_platdata *pdata); void alienfx_wmi_exit(struct wmi_device *wdev); +#else +int inline alienfx_wmi_init(struct alienfx_platdata *pdata) +{ + return 0; +} + +void inline alienfx_wmi_exit(struct wmi_device *wdev) +{ +} +#endif +#if IS_ENABLED(CONFIG_ALIENWARE_AWCC) int create_thermal_profile(struct wmi_device *wdev, bool has_gmode); void remove_thermal_profile(void); +#else +int inline create_thermal_profile(struct wmi_device *wdev, bool has_gmode) +{ + return 0; +} + +void inline remove_thermal_profile(void) +{ +} +#endif #endif -- 2.47.1