Skip to contentSkip to conversation

Add support for the generic backlight device to the TOSHIBA ACPI driver

PATCH In review Holger Macht 2 participants 2 messages Oct 13, 2006 ACPI

lore
Share & tools
lore
#0 lore raw

PATCH 3/3 Add support for the generic backlight device to the TOSHIBA ACPI driver

Add support for the generic backlight interface below /sys/class/backlight. The patch keeps the procfs brightness handling for backward compatibility.

For this to archive, the patch adds two generic functions get_lcd and set_lcd to be used both by the procfs related and the sysfs related methods.

---

drivers/acpi/Kconfig +1 -0
index f0bd84a..d9bb370 100644
@@ -227,6 +227,7 @@ config ACPI_IBM_DOCK
 config ACPI_TOSHIBA
 	tristate "Toshiba Laptop Extras"
 	depends on X86
+	select BACKLIGHT_DEVICE
 	---help---
 	  This driver adds support for access to certain system settings
 	  on "legacy free" Toshiba laptops.  These laptops can be recognized by
drivers/acpi/toshiba_acpi.c +65 -23

136 lines not on this page · raw message

#1 lore raw

drivers/acpi/toshiba_acpi.c static char *read_lcd(char *p) · line 313

Quoted 10 lines · On Fri, 13 Oct 2006 12:24:19 +0200 Holger Macht <[email protected]> wrote:
drivers/acpi/toshiba_acpi.c +10 -0
+static int set_lcd(int value)
+{
+	u32 hci_result;
+
+	value = value << HCI_LCD_BRIGHTNESS_SHIFT;
+	hci_write1(HCI_LCD_BRIGHTNESS, value, &hci_result);
+	if (hci_result != HCI_SUCCESS)
+		return -EFAULT;
+
+	return 0;

-EFAULT seems a bit random. Would -EIO be more appropriate?