[2/3,SRU,B,C,D] UBUNTU: SAUCE: platform/x86: dell-uart-backlight: load driver by scalar status

Message ID 20190130091026.14290-3-acelan.kao@canonical.com
State New
Headers show
Series
  • Can't adjust brightness on DELL UHD dGPU AIO
Related show

Commit Message

AceLan Kao Jan. 30, 2019, 9:10 a.m.
BugLink: https://bugs.launchpad.net/bugs/1813877

Leverage the scalar status command to determinate whether the driver
should be loaded or not.

Signed-off-by: AceLan Kao <acelan.kao@canonical.com>
---
 drivers/platform/x86/dell-uart-backlight.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

Patch

diff --git a/drivers/platform/x86/dell-uart-backlight.c b/drivers/platform/x86/dell-uart-backlight.c
index f957da1a452a..a1ec0067291f 100644
--- a/drivers/platform/x86/dell-uart-backlight.c
+++ b/drivers/platform/x86/dell-uart-backlight.c
@@ -382,14 +382,11 @@  static int dell_uart_bl_add(struct acpi_device *dev)
 	mutex_init(&dell_pdata->brightness_mutex);
 
 	if (!dell_uart_get_scalar_status(dell_pdata)) {
-		udelay(50);
-		/* try another command to make sure there is no scalar IC */
-		if (dell_uart_show_firmware_ver(dell_pdata) <= 0) {
-			pr_debug("Scalar is not in charge of brightness adjustment.\n");
-			kzfree(dell_pdata);
-			return -1;
-		}
+		pr_debug("Scalar is not in charge of brightness adjustment.\n");
+		kzfree(dell_pdata);
+		return -1;
 	}
+	dell_uart_show_firmware_ver(dell_pdata);
 
 	memset(&props, 0, sizeof(struct backlight_properties));
 	props.type = BACKLIGHT_PLATFORM;