Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 385336e3 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'platform-drivers-x86-v3.19-1' of...

Merge tag 'platform-drivers-x86-v3.19-1' of git://git.infradead.org/users/dvhart/linux-platform-drivers-x86

Pull x86 platform driver update from Darren Hart:
 - thinkpad-acpi: Switch to software mute, cleanups
 - acerhdf: Bang-bang thermal governor, new models, cleanups
 - dell-laptop: New keyboard backlight support and documentation
 - toshiba_acpi: Keyboard backlight updates, hotkey handling
 - dell-wmi: Keypress filtering, WMI event processing
 - eeepc-laptop: Multiple cleanups, improved error handling, documentation
 - hp_wireless: Inform the user if hp_wireless_input_setup()/add() fails
 - misc: Code cleanups, quirks, various new IDs

* tag 'platform-drivers-x86-v3.19-1' of git://git.infradead.org/users/dvhart/linux-platform-drivers-x86: (33 commits)
  platform/x86/acerhdf: Still depends on THERMAL
  Documentation: Add entry for dell-laptop sysfs interface
  acpi: Remove _OSI(Linux) for ThinkPads
  thinkpad-acpi: Try to use full software mute control
  acerhdf: minor clean up
  acerhdf: added critical trip point
  acerhdf: Use bang-bang thermal governor
  acerhdf: Adding support for new models
  acerhdf: Adding support for "manual mode"
  dell-smo8800: Add more ACPI ids and change description of driver
  platform: x86: dell-laptop: Add support for keyboard backlight
  toshiba_acpi: Add keyboard backlight mode change event
  toshiba_acpi: Change notify funtion to handle more events
  toshiba_acpi: Move hotkey enabling code to its own function
  dell-wmi: Don't report keypresses on keybord illumination change
  dell-wmi: Don't report keypresses for radio state changes
  hp_wireless: Inform the user if hp_wireless_input_setup()/add() fails
  toshiba-acpi: Add missing ID (TOS6207)
  Sony-laptop: Deletion of an unnecessary check before the function call "pci_dev_put"
  platform: x86: Deletion of checks before backlight_device_unregister()
  ...
parents ebcffcda 200db647
Loading
Loading
Loading
Loading
+60 −0
Original line number Diff line number Diff line
What:		/sys/class/leds/dell::kbd_backlight/als_setting
Date:		December 2014
KernelVersion:	3.19
Contact:	Gabriele Mazzotta <gabriele.mzt@gmail.com>,
		Pali Rohár <pali.rohar@gmail.com>
Description:
		This file allows to control the automatic keyboard
		illumination mode on some systems that have an ambient
		light sensor. Write 1 to this file to enable the auto
		mode, 0 to disable it.

What:		/sys/class/leds/dell::kbd_backlight/start_triggers
Date:		December 2014
KernelVersion:	3.19
Contact:	Gabriele Mazzotta <gabriele.mzt@gmail.com>,
		Pali Rohár <pali.rohar@gmail.com>
Description:
		This file allows to control the input triggers that
		turn on the keyboard backlight illumination that is
		disabled because of inactivity.
		Read the file to see the triggers available. The ones
		enabled are preceded by '+', those disabled by '-'.

		To enable a trigger, write its name preceded by '+' to
		this file. To disable a trigger, write its name preceded
		by '-' instead.

		For example, to enable the keyboard as trigger run:
		    echo +keyboard > /sys/class/leds/dell::kbd_backlight/start_triggers
		To disable it:
		    echo -keyboard > /sys/class/leds/dell::kbd_backlight/start_triggers

		Note that not all the available triggers can be configured.

What:		/sys/class/leds/dell::kbd_backlight/stop_timeout
Date:		December 2014
KernelVersion:	3.19
Contact:	Gabriele Mazzotta <gabriele.mzt@gmail.com>,
		Pali Rohár <pali.rohar@gmail.com>
Description:
		This file allows to specify the interval after which the
		keyboard illumination is disabled because of inactivity.
		The timeouts are expressed in seconds, minutes, hours and
		days, for which the symbols are 's', 'm', 'h' and 'd'
		respectively.

		To configure the timeout, write to this file a value along
		with any the above units. If no unit is specified, the value
		is assumed to be expressed in seconds.

		For example, to set the timeout to 10 minutes run:
		    echo 10m > /sys/class/leds/dell::kbd_backlight/stop_timeout

		Note that when this file is read, the returned value might be
		expressed in a different unit than the one used when the timeout
		was set.

		Also note that only some timeouts are supported and that
		some systems might fall back to a specific timeout in case
		an invalid timeout is written to this file.
+0 −54
Original line number Diff line number Diff line
@@ -304,60 +304,6 @@ static struct dmi_system_id acpi_osi_dmi_table[] __initdata = {
	 * Linux ignores it, except for the machines enumerated below.
	 */

	/*
	 * Lenovo has a mix of systems OSI(Linux) situations
	 * and thus we can not wildcard the vendor.
	 *
	 * _OSI(Linux) helps sound
	 * DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad R61"),
	 * DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T61"),
	 * T400, T500
	 * _OSI(Linux) has Linux specific hooks
	 * DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X61"),
	 * _OSI(Linux) is a NOP:
	 * DMI_MATCH(DMI_PRODUCT_VERSION, "3000 N100"),
	 * DMI_MATCH(DMI_PRODUCT_VERSION, "LENOVO3000 V100"),
	 */
	{
	.callback = dmi_enable_osi_linux,
	.ident = "Lenovo ThinkPad R61",
	.matches = {
		     DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
		     DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad R61"),
		},
	},
	{
	.callback = dmi_enable_osi_linux,
	.ident = "Lenovo ThinkPad T61",
	.matches = {
		     DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
		     DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T61"),
		},
	},
	{
	.callback = dmi_enable_osi_linux,
	.ident = "Lenovo ThinkPad X61",
	.matches = {
		     DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
		     DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X61"),
		},
	},
	{
	.callback = dmi_enable_osi_linux,
	.ident = "Lenovo ThinkPad T400",
	.matches = {
		     DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
		     DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T400"),
		},
	},
	{
	.callback = dmi_enable_osi_linux,
	.ident = "Lenovo ThinkPad T500",
	.matches = {
		     DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
		     DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T500"),
		},
	},
	/*
	 * Without this this EEEpc exports a non working WMI interface, with
	 * this it exports a working "good old" eeepc_laptop interface, fixing
+4 −3
Original line number Diff line number Diff line
@@ -38,7 +38,8 @@ config ACER_WMI

config ACERHDF
	tristate "Acer Aspire One temperature and fan driver"
	depends on THERMAL && ACPI
	depends on ACPI && THERMAL
	select THERMAL_GOV_BANG_BANG
	---help---
	  This is a driver for Acer Aspire One netbooks. It allows to access
	  the temperature sensor and to control the fan.
@@ -128,10 +129,10 @@ config DELL_WMI_AIO
	  be called dell-wmi-aio.

config DELL_SMO8800
	tristate "Dell Latitude freefall driver (ACPI SMO8800/SMO8810)"
	tristate "Dell Latitude freefall driver (ACPI SMO88XX)"
	depends on ACPI
	---help---
	  Say Y here if you want to support SMO8800/SMO8810 freefall device
	  Say Y here if you want to support SMO88XX freefall devices
	  on Dell Latitude laptops.

	  To compile this driver as a module, choose M here: the module will
+170 −95
Original line number Diff line number Diff line
@@ -50,7 +50,7 @@
 */
#undef START_IN_KERNEL_MODE

#define DRV_VER "0.5.26"
#define DRV_VER "0.7.0"

/*
 * According to the Atom N270 datasheet,
@@ -119,116 +119,152 @@ struct fancmd {
	u8 cmd_auto;
};

struct manualcmd {
	u8 mreg;
	u8 moff;
};

/* default register and command to disable fan in manual mode */
static const struct manualcmd mcmd = {
	.mreg = 0x94,
	.moff = 0xff,
};

/* BIOS settings */
struct bios_settings_t {
struct bios_settings {
	const char *vendor;
	const char *product;
	const char *version;
	unsigned char fanreg;
	unsigned char tempreg;
	u8 fanreg;
	u8 tempreg;
	struct fancmd cmd;
	int mcmd_enable;
};

/* Register addresses and values for different BIOS versions */
static const struct bios_settings_t bios_tbl[] = {
static const struct bios_settings bios_tbl[] = {
	/* AOA110 */
	{"Acer", "AOA110", "v0.3109", 0x55, 0x58, {0x1f, 0x00} },
	{"Acer", "AOA110", "v0.3114", 0x55, 0x58, {0x1f, 0x00} },
	{"Acer", "AOA110", "v0.3301", 0x55, 0x58, {0xaf, 0x00} },
	{"Acer", "AOA110", "v0.3304", 0x55, 0x58, {0xaf, 0x00} },
	{"Acer", "AOA110", "v0.3305", 0x55, 0x58, {0xaf, 0x00} },
	{"Acer", "AOA110", "v0.3307", 0x55, 0x58, {0xaf, 0x00} },
	{"Acer", "AOA110", "v0.3308", 0x55, 0x58, {0x21, 0x00} },
	{"Acer", "AOA110", "v0.3309", 0x55, 0x58, {0x21, 0x00} },
	{"Acer", "AOA110", "v0.3310", 0x55, 0x58, {0x21, 0x00} },
	{"Acer", "AOA110", "v0.3109", 0x55, 0x58, {0x1f, 0x00}, 0},
	{"Acer", "AOA110", "v0.3114", 0x55, 0x58, {0x1f, 0x00}, 0},
	{"Acer", "AOA110", "v0.3301", 0x55, 0x58, {0xaf, 0x00}, 0},
	{"Acer", "AOA110", "v0.3304", 0x55, 0x58, {0xaf, 0x00}, 0},
	{"Acer", "AOA110", "v0.3305", 0x55, 0x58, {0xaf, 0x00}, 0},
	{"Acer", "AOA110", "v0.3307", 0x55, 0x58, {0xaf, 0x00}, 0},
	{"Acer", "AOA110", "v0.3308", 0x55, 0x58, {0x21, 0x00}, 0},
	{"Acer", "AOA110", "v0.3309", 0x55, 0x58, {0x21, 0x00}, 0},
	{"Acer", "AOA110", "v0.3310", 0x55, 0x58, {0x21, 0x00}, 0},
	/* AOA150 */
	{"Acer", "AOA150", "v0.3114", 0x55, 0x58, {0x1f, 0x00} },
	{"Acer", "AOA150", "v0.3301", 0x55, 0x58, {0x20, 0x00} },
	{"Acer", "AOA150", "v0.3304", 0x55, 0x58, {0x20, 0x00} },
	{"Acer", "AOA150", "v0.3305", 0x55, 0x58, {0x20, 0x00} },
	{"Acer", "AOA150", "v0.3307", 0x55, 0x58, {0x20, 0x00} },
	{"Acer", "AOA150", "v0.3308", 0x55, 0x58, {0x20, 0x00} },
	{"Acer", "AOA150", "v0.3309", 0x55, 0x58, {0x20, 0x00} },
	{"Acer", "AOA150", "v0.3310", 0x55, 0x58, {0x20, 0x00} },
	{"Acer", "AOA150", "v0.3114", 0x55, 0x58, {0x1f, 0x00}, 0},
	{"Acer", "AOA150", "v0.3301", 0x55, 0x58, {0x20, 0x00}, 0},
	{"Acer", "AOA150", "v0.3304", 0x55, 0x58, {0x20, 0x00}, 0},
	{"Acer", "AOA150", "v0.3305", 0x55, 0x58, {0x20, 0x00}, 0},
	{"Acer", "AOA150", "v0.3307", 0x55, 0x58, {0x20, 0x00}, 0},
	{"Acer", "AOA150", "v0.3308", 0x55, 0x58, {0x20, 0x00}, 0},
	{"Acer", "AOA150", "v0.3309", 0x55, 0x58, {0x20, 0x00}, 0},
	{"Acer", "AOA150", "v0.3310", 0x55, 0x58, {0x20, 0x00}, 0},
	/* LT1005u */
	{"Acer", "LT-10Q", "v0.3310", 0x55, 0x58, {0x20, 0x00} },
	{"Acer", "LT-10Q", "v0.3310", 0x55, 0x58, {0x20, 0x00}, 0},
	/* Acer 1410 */
	{"Acer", "Aspire 1410", "v0.3108", 0x55, 0x58, {0x9e, 0x00} },
	{"Acer", "Aspire 1410", "v0.3113", 0x55, 0x58, {0x9e, 0x00} },
	{"Acer", "Aspire 1410", "v0.3115", 0x55, 0x58, {0x9e, 0x00} },
	{"Acer", "Aspire 1410", "v0.3117", 0x55, 0x58, {0x9e, 0x00} },
	{"Acer", "Aspire 1410", "v0.3119", 0x55, 0x58, {0x9e, 0x00} },
	{"Acer", "Aspire 1410", "v0.3120", 0x55, 0x58, {0x9e, 0x00} },
	{"Acer", "Aspire 1410", "v1.3204", 0x55, 0x58, {0x9e, 0x00} },
	{"Acer", "Aspire 1410", "v1.3303", 0x55, 0x58, {0x9e, 0x00} },
	{"Acer", "Aspire 1410", "v1.3308", 0x55, 0x58, {0x9e, 0x00} },
	{"Acer", "Aspire 1410", "v1.3310", 0x55, 0x58, {0x9e, 0x00} },
	{"Acer", "Aspire 1410", "v1.3314", 0x55, 0x58, {0x9e, 0x00} },
	{"Acer", "Aspire 1410", "v0.3108", 0x55, 0x58, {0x9e, 0x00}, 0},
	{"Acer", "Aspire 1410", "v0.3113", 0x55, 0x58, {0x9e, 0x00}, 0},
	{"Acer", "Aspire 1410", "v0.3115", 0x55, 0x58, {0x9e, 0x00}, 0},
	{"Acer", "Aspire 1410", "v0.3117", 0x55, 0x58, {0x9e, 0x00}, 0},
	{"Acer", "Aspire 1410", "v0.3119", 0x55, 0x58, {0x9e, 0x00}, 0},
	{"Acer", "Aspire 1410", "v0.3120", 0x55, 0x58, {0x9e, 0x00}, 0},
	{"Acer", "Aspire 1410", "v1.3204", 0x55, 0x58, {0x9e, 0x00}, 0},
	{"Acer", "Aspire 1410", "v1.3303", 0x55, 0x58, {0x9e, 0x00}, 0},
	{"Acer", "Aspire 1410", "v1.3308", 0x55, 0x58, {0x9e, 0x00}, 0},
	{"Acer", "Aspire 1410", "v1.3310", 0x55, 0x58, {0x9e, 0x00}, 0},
	{"Acer", "Aspire 1410", "v1.3314", 0x55, 0x58, {0x9e, 0x00}, 0},
	/* Acer 1810xx */
	{"Acer", "Aspire 1810TZ", "v0.3108", 0x55, 0x58, {0x9e, 0x00} },
	{"Acer", "Aspire 1810T",  "v0.3108", 0x55, 0x58, {0x9e, 0x00} },
	{"Acer", "Aspire 1810TZ", "v0.3113", 0x55, 0x58, {0x9e, 0x00} },
	{"Acer", "Aspire 1810T",  "v0.3113", 0x55, 0x58, {0x9e, 0x00} },
	{"Acer", "Aspire 1810TZ", "v0.3115", 0x55, 0x58, {0x9e, 0x00} },
	{"Acer", "Aspire 1810T",  "v0.3115", 0x55, 0x58, {0x9e, 0x00} },
	{"Acer", "Aspire 1810TZ", "v0.3117", 0x55, 0x58, {0x9e, 0x00} },
	{"Acer", "Aspire 1810T",  "v0.3117", 0x55, 0x58, {0x9e, 0x00} },
	{"Acer", "Aspire 1810TZ", "v0.3119", 0x55, 0x58, {0x9e, 0x00} },
	{"Acer", "Aspire 1810T",  "v0.3119", 0x55, 0x58, {0x9e, 0x00} },
	{"Acer", "Aspire 1810TZ", "v0.3120", 0x55, 0x58, {0x9e, 0x00} },
	{"Acer", "Aspire 1810T",  "v0.3120", 0x55, 0x58, {0x9e, 0x00} },
	{"Acer", "Aspire 1810TZ", "v1.3204", 0x55, 0x58, {0x9e, 0x00} },
	{"Acer", "Aspire 1810T",  "v1.3204", 0x55, 0x58, {0x9e, 0x00} },
	{"Acer", "Aspire 1810TZ", "v1.3303", 0x55, 0x58, {0x9e, 0x00} },
	{"Acer", "Aspire 1810T",  "v1.3303", 0x55, 0x58, {0x9e, 0x00} },
	{"Acer", "Aspire 1810TZ", "v1.3308", 0x55, 0x58, {0x9e, 0x00} },
	{"Acer", "Aspire 1810T",  "v1.3308", 0x55, 0x58, {0x9e, 0x00} },
	{"Acer", "Aspire 1810TZ", "v1.3310", 0x55, 0x58, {0x9e, 0x00} },
	{"Acer", "Aspire 1810T",  "v1.3310", 0x55, 0x58, {0x9e, 0x00} },
	{"Acer", "Aspire 1810TZ", "v1.3314", 0x55, 0x58, {0x9e, 0x00} },
	{"Acer", "Aspire 1810T",  "v1.3314", 0x55, 0x58, {0x9e, 0x00} },
	{"Acer", "Aspire 1810TZ", "v0.3108", 0x55, 0x58, {0x9e, 0x00}, 0},
	{"Acer", "Aspire 1810T",  "v0.3108", 0x55, 0x58, {0x9e, 0x00}, 0},
	{"Acer", "Aspire 1810TZ", "v0.3113", 0x55, 0x58, {0x9e, 0x00}, 0},
	{"Acer", "Aspire 1810T",  "v0.3113", 0x55, 0x58, {0x9e, 0x00}, 0},
	{"Acer", "Aspire 1810TZ", "v0.3115", 0x55, 0x58, {0x9e, 0x00}, 0},
	{"Acer", "Aspire 1810T",  "v0.3115", 0x55, 0x58, {0x9e, 0x00}, 0},
	{"Acer", "Aspire 1810TZ", "v0.3117", 0x55, 0x58, {0x9e, 0x00}, 0},
	{"Acer", "Aspire 1810T",  "v0.3117", 0x55, 0x58, {0x9e, 0x00}, 0},
	{"Acer", "Aspire 1810TZ", "v0.3119", 0x55, 0x58, {0x9e, 0x00}, 0},
	{"Acer", "Aspire 1810T",  "v0.3119", 0x55, 0x58, {0x9e, 0x00}, 0},
	{"Acer", "Aspire 1810TZ", "v0.3120", 0x55, 0x58, {0x9e, 0x00}, 0},
	{"Acer", "Aspire 1810T",  "v0.3120", 0x55, 0x58, {0x9e, 0x00}, 0},
	{"Acer", "Aspire 1810TZ", "v1.3204", 0x55, 0x58, {0x9e, 0x00}, 0},
	{"Acer", "Aspire 1810T",  "v1.3204", 0x55, 0x58, {0x9e, 0x00}, 0},
	{"Acer", "Aspire 1810TZ", "v1.3303", 0x55, 0x58, {0x9e, 0x00}, 0},
	{"Acer", "Aspire 1810T",  "v1.3303", 0x55, 0x58, {0x9e, 0x00}, 0},
	{"Acer", "Aspire 1810TZ", "v1.3308", 0x55, 0x58, {0x9e, 0x00}, 0},
	{"Acer", "Aspire 1810T",  "v1.3308", 0x55, 0x58, {0x9e, 0x00}, 0},
	{"Acer", "Aspire 1810TZ", "v1.3310", 0x55, 0x58, {0x9e, 0x00}, 0},
	{"Acer", "Aspire 1810T",  "v1.3310", 0x55, 0x58, {0x9e, 0x00}, 0},
	{"Acer", "Aspire 1810TZ", "v1.3314", 0x55, 0x58, {0x9e, 0x00}, 0},
	{"Acer", "Aspire 1810T",  "v1.3314", 0x55, 0x58, {0x9e, 0x00}, 0},
	/* Acer 5755G */
	{"Acer", "Aspire 5755G",  "V1.20",   0xab, 0xb4, {0x00, 0x08}, 0},
	{"Acer", "Aspire 5755G",  "V1.21",   0xab, 0xb3, {0x00, 0x08}, 0},
	/* Acer 521 */
	{"Acer", "AO521", "V1.11", 0x55, 0x58, {0x1f, 0x00}, 0},
	/* Acer 531 */
	{"Acer", "AO531h", "v0.3104", 0x55, 0x58, {0x20, 0x00} },
	{"Acer", "AO531h", "v0.3201", 0x55, 0x58, {0x20, 0x00} },
	{"Acer", "AO531h", "v0.3304", 0x55, 0x58, {0x20, 0x00} },
	{"Acer", "AO531h", "v0.3104", 0x55, 0x58, {0x20, 0x00}, 0},
	{"Acer", "AO531h", "v0.3201", 0x55, 0x58, {0x20, 0x00}, 0},
	{"Acer", "AO531h", "v0.3304", 0x55, 0x58, {0x20, 0x00}, 0},
	/* Acer 751 */
	{"Acer", "AO751h", "V0.3212", 0x55, 0x58, {0x21, 0x00} },
	{"Acer", "AO751h", "V0.3206", 0x55, 0x58, {0x21, 0x00}, 0},
	{"Acer", "AO751h", "V0.3212", 0x55, 0x58, {0x21, 0x00}, 0},
	/* Acer 753 */
	{"Acer", "Aspire One 753", "V1.24", 0x93, 0xac, {0x14, 0x04}, 1},
	/* Acer 1825 */
	{"Acer", "Aspire 1825PTZ", "V1.3118", 0x55, 0x58, {0x9e, 0x00} },
	{"Acer", "Aspire 1825PTZ", "V1.3127", 0x55, 0x58, {0x9e, 0x00} },
	{"Acer", "Aspire 1825PTZ", "V1.3118", 0x55, 0x58, {0x9e, 0x00}, 0},
	{"Acer", "Aspire 1825PTZ", "V1.3127", 0x55, 0x58, {0x9e, 0x00}, 0},
	/* Acer Extensa 5420 */
	{"Acer", "Extensa 5420", "V1.17", 0x93, 0xac, {0x14, 0x04}, 1},
	/* Acer Aspire 5315 */
	{"Acer", "Aspire 5315", "V1.19", 0x93, 0xac, {0x14, 0x04}, 1},
	/* Acer Aspire 5739 */
	{"Acer", "Aspire 5739G", "V1.3311", 0x55, 0x58, {0x20, 0x00}, 0},
	/* Acer TravelMate 7730 */
	{"Acer", "TravelMate 7730G", "v0.3509", 0x55, 0x58, {0xaf, 0x00} },
	{"Acer", "TravelMate 7730G", "v0.3509", 0x55, 0x58, {0xaf, 0x00}, 0},
	/* Acer TravelMate TM8573T */
	{"Acer", "TM8573T", "V1.13", 0x93, 0xa8, {0x14, 0x04}, 1},
	/* Gateway */
	{"Gateway", "AOA110", "v0.3103",  0x55, 0x58, {0x21, 0x00} },
	{"Gateway", "AOA150", "v0.3103",  0x55, 0x58, {0x20, 0x00} },
	{"Gateway", "LT31",   "v1.3103",  0x55, 0x58, {0x9e, 0x00} },
	{"Gateway", "LT31",   "v1.3201",  0x55, 0x58, {0x9e, 0x00} },
	{"Gateway", "LT31",   "v1.3302",  0x55, 0x58, {0x9e, 0x00} },
	{"Gateway", "LT31",   "v1.3303t", 0x55, 0x58, {0x9e, 0x00} },
	{"Gateway", "AOA110", "v0.3103",  0x55, 0x58, {0x21, 0x00}, 0},
	{"Gateway", "AOA150", "v0.3103",  0x55, 0x58, {0x20, 0x00}, 0},
	{"Gateway", "LT31",   "v1.3103",  0x55, 0x58, {0x9e, 0x00}, 0},
	{"Gateway", "LT31",   "v1.3201",  0x55, 0x58, {0x9e, 0x00}, 0},
	{"Gateway", "LT31",   "v1.3302",  0x55, 0x58, {0x9e, 0x00}, 0},
	{"Gateway", "LT31",   "v1.3303t", 0x55, 0x58, {0x9e, 0x00}, 0},
	/* Packard Bell */
	{"Packard Bell", "DOA150",  "v0.3104",  0x55, 0x58, {0x21, 0x00} },
	{"Packard Bell", "DOA150",  "v0.3105",  0x55, 0x58, {0x20, 0x00} },
	{"Packard Bell", "AOA110",  "v0.3105",  0x55, 0x58, {0x21, 0x00} },
	{"Packard Bell", "AOA150",  "v0.3105",  0x55, 0x58, {0x20, 0x00} },
	{"Packard Bell", "ENBFT",   "V1.3118",  0x55, 0x58, {0x9e, 0x00} },
	{"Packard Bell", "ENBFT",   "V1.3127",  0x55, 0x58, {0x9e, 0x00} },
	{"Packard Bell", "DOTMU",   "v1.3303",  0x55, 0x58, {0x9e, 0x00} },
	{"Packard Bell", "DOTMU",   "v0.3120",  0x55, 0x58, {0x9e, 0x00} },
	{"Packard Bell", "DOTMU",   "v0.3108",  0x55, 0x58, {0x9e, 0x00} },
	{"Packard Bell", "DOTMU",   "v0.3113",  0x55, 0x58, {0x9e, 0x00} },
	{"Packard Bell", "DOTMU",   "v0.3115",  0x55, 0x58, {0x9e, 0x00} },
	{"Packard Bell", "DOTMU",   "v0.3117",  0x55, 0x58, {0x9e, 0x00} },
	{"Packard Bell", "DOTMU",   "v0.3119",  0x55, 0x58, {0x9e, 0x00} },
	{"Packard Bell", "DOTMU",   "v1.3204",  0x55, 0x58, {0x9e, 0x00} },
	{"Packard Bell", "DOTMA",   "v1.3201",  0x55, 0x58, {0x9e, 0x00} },
	{"Packard Bell", "DOTMA",   "v1.3302",  0x55, 0x58, {0x9e, 0x00} },
	{"Packard Bell", "DOTMA",   "v1.3303t", 0x55, 0x58, {0x9e, 0x00} },
	{"Packard Bell", "DOTVR46", "v1.3308",  0x55, 0x58, {0x9e, 0x00} },
	{"Packard Bell", "DOA150",  "v0.3104",  0x55, 0x58, {0x21, 0x00}, 0},
	{"Packard Bell", "DOA150",  "v0.3105",  0x55, 0x58, {0x20, 0x00}, 0},
	{"Packard Bell", "AOA110",  "v0.3105",  0x55, 0x58, {0x21, 0x00}, 0},
	{"Packard Bell", "AOA150",  "v0.3105",  0x55, 0x58, {0x20, 0x00}, 0},
	{"Packard Bell", "ENBFT",   "V1.3118",  0x55, 0x58, {0x9e, 0x00}, 0},
	{"Packard Bell", "ENBFT",   "V1.3127",  0x55, 0x58, {0x9e, 0x00}, 0},
	{"Packard Bell", "DOTMU",   "v1.3303",  0x55, 0x58, {0x9e, 0x00}, 0},
	{"Packard Bell", "DOTMU",   "v0.3120",  0x55, 0x58, {0x9e, 0x00}, 0},
	{"Packard Bell", "DOTMU",   "v0.3108",  0x55, 0x58, {0x9e, 0x00}, 0},
	{"Packard Bell", "DOTMU",   "v0.3113",  0x55, 0x58, {0x9e, 0x00}, 0},
	{"Packard Bell", "DOTMU",   "v0.3115",  0x55, 0x58, {0x9e, 0x00}, 0},
	{"Packard Bell", "DOTMU",   "v0.3117",  0x55, 0x58, {0x9e, 0x00}, 0},
	{"Packard Bell", "DOTMU",   "v0.3119",  0x55, 0x58, {0x9e, 0x00}, 0},
	{"Packard Bell", "DOTMU",   "v1.3204",  0x55, 0x58, {0x9e, 0x00}, 0},
	{"Packard Bell", "DOTMA",   "v1.3201",  0x55, 0x58, {0x9e, 0x00}, 0},
	{"Packard Bell", "DOTMA",   "v1.3302",  0x55, 0x58, {0x9e, 0x00}, 0},
	{"Packard Bell", "DOTMA",   "v1.3303t", 0x55, 0x58, {0x9e, 0x00}, 0},
	{"Packard Bell", "DOTVR46", "v1.3308",  0x55, 0x58, {0x9e, 0x00}, 0},
	/* pewpew-terminator */
	{"", "", "", 0, 0, {0, 0} }
	{"", "", "", 0, 0, {0, 0}, 0}
};

static const struct bios_settings_t *bios_cfg __read_mostly;
static const struct bios_settings *bios_cfg __read_mostly;

/*
 * this struct is used to instruct thermal layer to use bang_bang instead of
 * default governor for acerhdf
 */
static struct thermal_zone_params acerhdf_zone_params = {
	.governor_name = "bang_bang",
};

static int acerhdf_get_temp(int *temp)
{
@@ -275,6 +311,12 @@ static void acerhdf_change_fanstate(int state)
	fanstate = state;

	ec_write(bios_cfg->fanreg, cmd);

	if (bios_cfg->mcmd_enable && state == ACERHDF_FAN_OFF) {
		if (verbose)
			pr_notice("turning off fan manually\n");
		ec_write(mcmd.mreg, mcmd.moff);
	}
}

static void acerhdf_check_param(struct thermal_zone_device *thermal)
@@ -401,6 +443,21 @@ static int acerhdf_get_trip_type(struct thermal_zone_device *thermal, int trip,
{
	if (trip == 0)
		*type = THERMAL_TRIP_ACTIVE;
	else if (trip == 1)
		*type = THERMAL_TRIP_CRITICAL;
	else
		return -EINVAL;

	return 0;
}

static int acerhdf_get_trip_hyst(struct thermal_zone_device *thermal, int trip,
				 unsigned long *temp)
{
	if (trip != 0)
		return -EINVAL;

	*temp = fanon - fanoff;

	return 0;
}
@@ -410,6 +467,10 @@ static int acerhdf_get_trip_temp(struct thermal_zone_device *thermal, int trip,
{
	if (trip == 0)
		*temp = fanon;
	else if (trip == 1)
		*temp = ACERHDF_TEMP_CRIT;
	else
		return -EINVAL;

	return 0;
}
@@ -429,6 +490,7 @@ static struct thermal_zone_device_ops acerhdf_dev_ops = {
	.get_mode = acerhdf_get_mode,
	.set_mode = acerhdf_set_mode,
	.get_trip_type = acerhdf_get_trip_type,
	.get_trip_hyst = acerhdf_get_trip_hyst,
	.get_trip_temp = acerhdf_get_trip_temp,
	.get_crit_temp = acerhdf_get_crit_temp,
};
@@ -481,9 +543,7 @@ static int acerhdf_set_cur_state(struct thermal_cooling_device *cdev,
	}

	if (state == 0) {
		/* turn fan off only if below fanoff temperature */
		if ((cur_state == ACERHDF_FAN_AUTO) &&
		    (cur_temp < fanoff))
		if (cur_state == ACERHDF_FAN_AUTO)
			acerhdf_change_fanstate(ACERHDF_FAN_OFF);
	} else {
		if (cur_state == ACERHDF_FAN_OFF)
@@ -558,7 +618,7 @@ static int str_starts_with(const char *str, const char *start)
static int acerhdf_check_hardware(void)
{
	char const *vendor, *version, *product;
	const struct bios_settings_t *bt = NULL;
	const struct bios_settings *bt = NULL;

	/* get BIOS data */
	vendor  = dmi_get_system_info(DMI_SYS_VENDOR);
@@ -660,12 +720,20 @@ static int acerhdf_register_thermal(void)
	if (IS_ERR(cl_dev))
		return -EINVAL;

	thz_dev = thermal_zone_device_register("acerhdf", 1, 0, NULL,
					      &acerhdf_dev_ops, NULL, 0,
	thz_dev = thermal_zone_device_register("acerhdf", 2, 0, NULL,
					      &acerhdf_dev_ops,
					      &acerhdf_zone_params, 0,
					      (kernelmode) ? interval*1000 : 0);
	if (IS_ERR(thz_dev))
		return -EINVAL;

	if (strcmp(thz_dev->governor->name,
				acerhdf_zone_params.governor_name)) {
		pr_err("Didn't get thermal governor %s, perhaps not compiled into thermal subsystem.\n",
				acerhdf_zone_params.governor_name);
		return -EINVAL;
	}

	return 0;
}

@@ -722,9 +790,15 @@ MODULE_ALIAS("dmi:*:*Acer*:pnAOA*:");
MODULE_ALIAS("dmi:*:*Acer*:pnAO751h*:");
MODULE_ALIAS("dmi:*:*Acer*:pnAspire*1410*:");
MODULE_ALIAS("dmi:*:*Acer*:pnAspire*1810*:");
MODULE_ALIAS("dmi:*:*Acer*:pnAspire*5755G:");
MODULE_ALIAS("dmi:*:*Acer*:pnAspire*1825PTZ:");
MODULE_ALIAS("dmi:*:*Acer*:pnAO521*:");
MODULE_ALIAS("dmi:*:*Acer*:pnAO531*:");
MODULE_ALIAS("dmi:*:*Acer*:pnAspire*5739G:");
MODULE_ALIAS("dmi:*:*Acer*:pnAspire*One*753:");
MODULE_ALIAS("dmi:*:*Acer*:pnAspire*5315:");
MODULE_ALIAS("dmi:*:*Acer*:TravelMate*7730G:");
MODULE_ALIAS("dmi:*:*Acer*:TM8573T:");
MODULE_ALIAS("dmi:*:*Gateway*:pnAOA*:");
MODULE_ALIAS("dmi:*:*Gateway*:pnLT31*:");
MODULE_ALIAS("dmi:*:*Packard*Bell*:pnAOA*:");
@@ -733,6 +807,7 @@ MODULE_ALIAS("dmi:*:*Packard*Bell*:pnDOTMU*:");
MODULE_ALIAS("dmi:*:*Packard*Bell*:pnENBFT*:");
MODULE_ALIAS("dmi:*:*Packard*Bell*:pnDOTMA*:");
MODULE_ALIAS("dmi:*:*Packard*Bell*:pnDOTVR46*:");
MODULE_ALIAS("dmi:*:*Acer*:pnExtensa 5420*:");

module_init(acerhdf_init);
module_exit(acerhdf_exit);
+1 −2
Original line number Diff line number Diff line
@@ -843,7 +843,6 @@ static int asus_backlight_init(struct asus_laptop *asus)

static void asus_backlight_exit(struct asus_laptop *asus)
{
	if (asus->backlight_device)
	backlight_device_unregister(asus->backlight_device);
	asus->backlight_device = NULL;
}
Loading