[PATCH 3/3][SRU][B][C][D] UBUNTU: SAUCE: platform/x86: dell-uart-backlight: add force parameter
AceLan Kao
acelan.kao at canonical.com
Wed Jan 30 09:10:26 UTC 2019
BugLink: https://bugs.launchpad.net/bugs/1813877
Add force parameter to force load the driver if the platform doesn't
provide a working scalar status command.
Signed-off-by: AceLan Kao <acelan.kao at canonical.com>
---
drivers/platform/x86/dell-uart-backlight.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/platform/x86/dell-uart-backlight.c b/drivers/platform/x86/dell-uart-backlight.c
index a1ec0067291f..f81fc01606d0 100644
--- a/drivers/platform/x86/dell-uart-backlight.c
+++ b/drivers/platform/x86/dell-uart-backlight.c
@@ -40,6 +40,10 @@ unsigned int (*io_serial_in)(struct uart_port *p, int offset);
int (*uart_write)(struct tty_struct *tty, const unsigned char *buf, int count);
int (*uart_chars_in_buffer)(struct tty_struct *tty);
+static bool force;
+module_param(force, bool, 0444);
+MODULE_PARM_DESC(force, "load the driver regardless of the scalar status");
+
static struct dell_uart_bl_cmd uart_cmd[] = {
/*
* Get Firmware Version: Tool uses this command to get firmware version.
@@ -381,7 +385,7 @@ static int dell_uart_bl_add(struct acpi_device *dev)
mutex_init(&dell_pdata->brightness_mutex);
- if (!dell_uart_get_scalar_status(dell_pdata)) {
+ if (!force && !dell_uart_get_scalar_status(dell_pdata)) {
pr_debug("Scalar is not in charge of brightness adjustment.\n");
kzfree(dell_pdata);
return -1;
--
2.17.1
More information about the kernel-team
mailing list