1*d9bab776SHans de GoedeEmulator for DELL0501 UART attached backlight controller 2*d9bab776SHans de Goede-------------------------------------------------------- 3*d9bab776SHans de Goede 4*d9bab776SHans de GoedeDell All In One (AIO) models released after 2017 use a backlight controller 5*d9bab776SHans de Goedeboard connected to an UART. 6*d9bab776SHans de Goede 7*d9bab776SHans de GoedeIn DSDT this uart port will be defined as: 8*d9bab776SHans de Goede 9*d9bab776SHans de Goede Name (_HID, "DELL0501") 10*d9bab776SHans de Goede Name (_CID, EisaId ("PNP0501") 11*d9bab776SHans de Goede 12*d9bab776SHans de GoedeWith the DELL0501 indicating that we are dealing with an UART with 13*d9bab776SHans de Goedethe backlight controller board attached. 14*d9bab776SHans de Goede 15*d9bab776SHans de GoedeThis small emulator allows testing 16*d9bab776SHans de Goedethe drivers/platform/x86/dell/dell-uart-backlight.c driver without access 17*d9bab776SHans de Goedeto an actual Dell All In One. 18*d9bab776SHans de Goede 19*d9bab776SHans de GoedeThis requires: 20*d9bab776SHans de Goede1. A (desktop) PC with a 16550 UART on the motherboard and a standard DB9 21*d9bab776SHans de Goede connector connected to this UART. 22*d9bab776SHans de Goede2. A DB9 NULL modem cable. 23*d9bab776SHans de Goede3. A second DB9 serial port, this can e.g. be a USB to serial converter 24*d9bab776SHans de Goede with a DB9 connector plugged into the same desktop PC. 25*d9bab776SHans de Goede4. A DSDT overlay for the desktop PC replacing the _HID of the 16550 UART 26*d9bab776SHans de Goede ACPI Device() with "DELL0501" and adding a _CID of "PNP0501", see 27*d9bab776SHans de Goede DSDT.patch for an example of the necessary DSDT changes. 28*d9bab776SHans de Goede 29*d9bab776SHans de GoedeWith everything setup and the NULL modem cable connected between 30*d9bab776SHans de Goedethe 2 serial ports run: 31*d9bab776SHans de Goede 32*d9bab776SHans de Goede./dell-uart-backlight-emulator <path-to-/dev/tty*S#-for-second-port> 33*d9bab776SHans de Goede 34*d9bab776SHans de GoedeFor example when using an USB to serial converter for the second port: 35*d9bab776SHans de Goede 36*d9bab776SHans de Goede./dell-uart-backlight-emulator /dev/ttyUSB0 37*d9bab776SHans de Goede 38*d9bab776SHans de GoedeAnd then (re)load the dell-uart-backlight driver: 39*d9bab776SHans de Goede 40*d9bab776SHans de Goedesudo rmmod dell-uart-backlight; sudo modprobe dell-uart-backlight dyndbg 41*d9bab776SHans de Goede 42*d9bab776SHans de GoedeAfter this check "dmesg" to see if the driver correctly received 43*d9bab776SHans de Goedethe firmware version string from the emulator. If this works there 44*d9bab776SHans de Goedeshould be a /sys/class/backlight/dell_uart_backlight/ directory now 45*d9bab776SHans de Goedeand writes to the brightness or bl_power files should be reflected 46*d9bab776SHans de Goedeby matching output from the emulator. 47