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

Commit 6ed3e57f authored by Linus Torvalds's avatar Linus Torvalds
Browse files

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

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

Pull platform driver update from Darren Hart:
 "This includes a significant update to the toshiba_acpi driver,
  bringing it to feature parity with the Windows driver, followed by
  some needed cleanups.

  The other changes are mostly minor updates, quirks, sparse fixes, or
  cleanups.

  Details:

   - toshiba_acpi:
       Add support for missing features from the Windows driver, bump the
       sysfs version, and clean up the driver.

   - thinkpad_acpi:
       BIOS string versions, unhandled hkey events.

   - msamsung-laptop:
       Add native backlight quirk, enable better lid handling.

   - intel_scu_ipc:
       Read resources from PCI configuration

   - other:
       Fix sparse warnings, general cleanups"

* tag 'platform-drivers-x86-v3.20-1' of git://git.infradead.org/users/dvhart/linux-platform-drivers-x86: (34 commits)
  toshiba_acpi: Cleanup GPL header
  toshiba_acpi: Cleanup comment blocks and capitalization
  toshiba_acpi: Make use of DEVICE_ATTR_{RO, RW} macros
  toshiba_acpi: Drop the toshiba_ prefix from sysfs function names
  toshiba_acpi: Move sysfs function and struct declarations further down
  Documentation/ABI: Add file describing the sysfs entries for toshiba_acpi
  toshiba_acpi: Clean file according to coding style
  toshiba_acpi: Bump version number to 0.21
  toshiba_acpi: Add support to enable/disable USB 3
  toshiba_acpi: Add support for Panel Power ON
  toshiba_acpi: Add support for Keyboard functions mode
  toshiba_acpi: Add fan entry to sysfs
  toshiba_acpi: Add version entry to sysfs
  thinkpad_acpi: support new BIOS version string pattern
  thinkpad_acpi: unhandled hkey event
  toshiba_acpi: Make toshiba_eco_mode_available more robust
  classmate-laptop: Fix sparse warning (0 as NULL)
  Sony-laptop: Fix sparse warning (make undeclared var static)
  thinkpad_acpi.c: Fix sparse warning (make undeclared var static)
  samsung-laptop.c: Prefer kstrtoint over single variable sscanf
  ...
parents b11a2783 c57c0fa4
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -35,3 +35,11 @@ Contact: Corentin Chary <corentin.chary@gmail.com>
Description:	Use your USB ports to charge devices, even
		when your laptop is powered off.
		1 means enabled, 0 means disabled.

What:		/sys/devices/platform/samsung/lid_handling
Date:		December 11, 2014
KernelVersion:	3.19
Contact:	Julijonas Kikutis <julijonas.kikutis@gmail.com>
Description:	Some Samsung laptops handle lid closing quicker and
		only handle lid opening with this mode enabled.
		1 means enabled, 0 means disabled.
+114 −0
Original line number Diff line number Diff line
What:		/sys/devices/LNXSYSTM:00/LNXSYBUS:00/TOS{1900,620{0,7,8}}:00/kbd_backlight_mode
Date:		June 8, 2014
KernelVersion:	3.15
Contact:	Azael Avalos <coproscefalo@gmail.com>
Description:	This file controls the keyboard backlight operation mode, valid
		values are:
			* 0x1  -> FN-Z
			* 0x2  -> AUTO (also called TIMER)
			* 0x8  -> ON
			* 0x10 -> OFF
		Note that the kernel 3.16 onwards this file accepts all listed
		parameters, kernel 3.15 only accepts the first two (FN-Z and
		AUTO).
Users:		KToshiba

What:		/sys/devices/LNXSYSTM:00/LNXSYBUS:00/TOS{1900,620{0,7,8}}:00/kbd_backlight_timeout
Date:		June 8, 2014
KernelVersion:	3.15
Contact:	Azael Avalos <coproscefalo@gmail.com>
Description:	This file controls the timeout of the keyboard backlight
		whenever the operation mode is set to AUTO (or TIMER),
		valid values range from 0-60.
		Note that the kernel 3.15 only had support for the first
		keyboard type, the kernel 3.16 added support for the second
		type and the range accepted for type 2 is 1-60.
		See the entry named "kbd_type"
Users:		KToshiba

What:		/sys/devices/LNXSYSTM:00/LNXSYBUS:00/TOS{1900,620{0,7,8}}:00/position
Date:		June 8, 2014
KernelVersion:	3.15
Contact:	Azael Avalos <coproscefalo@gmail.com>
Description:	This file shows the absolute position of the built-in
		accelereometer.

What:		/sys/devices/LNXSYSTM:00/LNXSYBUS:00/TOS{1900,620{0,7,8}}:00/touchpad
Date:		June 8, 2014
KernelVersion:	3.15
Contact:	Azael Avalos <coproscefalo@gmail.com>
Description:	This files controls the status of the touchpad and pointing
		stick (if available), valid values are:
			* 0 -> OFF
			* 1 -> ON
Users:		KToshiba

What:		/sys/devices/LNXSYSTM:00/LNXSYBUS:00/TOS{1900,620{0,7,8}}:00/available_kbd_modes
Date:		August 3, 2014
KernelVersion:	3.16
Contact:	Azael Avalos <coproscefalo@gmail.com>
Description:	This file shows the supported keyboard backlight modes
		the system supports, which can be:
			* 0x1  -> FN-Z
			* 0x2  -> AUTO (also called TIMER)
			* 0x8  -> ON
			* 0x10 -> OFF
		Note that not all keyboard types support the listed modes.
		See the entry named "available_kbd_modes"
Users:		KToshiba

What:		/sys/devices/LNXSYSTM:00/LNXSYBUS:00/TOS{1900,620{0,7,8}}:00/kbd_type
Date:		August 3, 2014
KernelVersion:	3.16
Contact:	Azael Avalos <coproscefalo@gmail.com>
Description:	This file shows the current keyboard backlight type,
		which can be:
			* 1 -> Type 1, supporting modes FN-Z and AUTO
			* 2 -> Type 2, supporting modes TIMER, ON and OFF
Users:		KToshiba

What:		/sys/devices/LNXSYSTM:00/LNXSYBUS:00/TOS{1900,620{0,7,8}}:00/version
Date:		February, 2015
KernelVersion:	3.20
Contact:	Azael Avalos <coproscefalo@gmail.com>
Description:	This file shows the current version of the driver

What:		/sys/devices/LNXSYSTM:00/LNXSYBUS:00/TOS{1900,620{0,7,8}}:00/fan
Date:		February, 2015
KernelVersion:	3.20
Contact:	Azael Avalos <coproscefalo@gmail.com>
Description:	This file controls the state of the internal fan, valid
		values are:
			* 0 -> OFF
			* 1 -> ON

What:		/sys/devices/LNXSYSTM:00/LNXSYBUS:00/TOS{1900,620{0,7,8}}:00/kbd_function_keys
Date:		February, 2015
KernelVersion:	3.20
Contact:	Azael Avalos <coproscefalo@gmail.com>
Description:	This file controls the Special Functions (hotkeys) operation
		mode, valid values are:
			* 0 -> Normal Operation
			* 1 -> Special Functions
		In the "Normal Operation" mode, the F{1-12} keys are as usual
		and the hotkeys are accessed via FN-F{1-12}.
		In the "Special Functions" mode, the F{1-12} keys trigger the
		hotkey and the F{1-12} keys are accessed via FN-F{1-12}.

What:		/sys/devices/LNXSYSTM:00/LNXSYBUS:00/TOS{1900,620{0,7,8}}:00/panel_power_on
Date:		February, 2015
KernelVersion:	3.20
Contact:	Azael Avalos <coproscefalo@gmail.com>
Description:	This file controls whether the laptop should turn ON whenever
		the LID is opened, valid values are:
			* 0 -> Disabled
			* 1 -> Enabled

What:		/sys/devices/LNXSYSTM:00/LNXSYBUS:00/TOS{1900,620{0,7,8}}:00/usb_three
Date:		February, 2015
KernelVersion:	3.20
Contact:	Azael Avalos <coproscefalo@gmail.com>
Description:	This file controls whether the USB 3 functionality, valid
		values are:
			* 0 -> Disabled (Acts as a regular USB 2)
			* 1 -> Enabled (Full USB 3 functionality)
+47 −50
Original line number Diff line number Diff line
@@ -856,8 +856,8 @@ static void asus_backlight_exit(struct asus_laptop *asus)
 * than count bytes. We set eof to 1 if we handle those 2 values. We return the
 * number of bytes written in page
 */
static ssize_t show_infos(struct device *dev,
			  struct device_attribute *attr, char *page)
static ssize_t infos_show(struct device *dev, struct device_attribute *attr,
			  char *page)
{
	struct asus_laptop *asus = dev_get_drvdata(dev);
	int len = 0;
@@ -926,6 +926,7 @@ static ssize_t show_infos(struct device *dev,

	return len;
}
static DEVICE_ATTR_RO(infos);

static int parse_arg(const char *buf, unsigned long count, int *val)
{
@@ -957,15 +958,15 @@ static ssize_t sysfs_acpi_set(struct asus_laptop *asus,
/*
 * LEDD display
 */
static ssize_t show_ledd(struct device *dev,
			 struct device_attribute *attr, char *buf)
static ssize_t ledd_show(struct device *dev, struct device_attribute *attr,
			 char *buf)
{
	struct asus_laptop *asus = dev_get_drvdata(dev);

	return sprintf(buf, "0x%08x\n", asus->ledd_status);
}

static ssize_t store_ledd(struct device *dev, struct device_attribute *attr,
static ssize_t ledd_store(struct device *dev, struct device_attribute *attr,
			  const char *buf, size_t count)
{
	struct asus_laptop *asus = dev_get_drvdata(dev);
@@ -981,6 +982,7 @@ static ssize_t store_ledd(struct device *dev, struct device_attribute *attr,
	}
	return rv;
}
static DEVICE_ATTR_RW(ledd);

/*
 * Wireless
@@ -1014,21 +1016,22 @@ static int asus_wlan_set(struct asus_laptop *asus, int status)
	return 0;
}

static ssize_t show_wlan(struct device *dev,
			 struct device_attribute *attr, char *buf)
static ssize_t wlan_show(struct device *dev, struct device_attribute *attr,
			 char *buf)
{
	struct asus_laptop *asus = dev_get_drvdata(dev);

	return sprintf(buf, "%d\n", asus_wireless_status(asus, WL_RSTS));
}

static ssize_t store_wlan(struct device *dev, struct device_attribute *attr,
static ssize_t wlan_store(struct device *dev, struct device_attribute *attr,
			  const char *buf, size_t count)
{
	struct asus_laptop *asus = dev_get_drvdata(dev);

	return sysfs_acpi_set(asus, buf, count, METHOD_WLAN);
}
static DEVICE_ATTR_RW(wlan);

/*e
 * Bluetooth
@@ -1042,15 +1045,15 @@ static int asus_bluetooth_set(struct asus_laptop *asus, int status)
	return 0;
}

static ssize_t show_bluetooth(struct device *dev,
			      struct device_attribute *attr, char *buf)
static ssize_t bluetooth_show(struct device *dev, struct device_attribute *attr,
			      char *buf)
{
	struct asus_laptop *asus = dev_get_drvdata(dev);

	return sprintf(buf, "%d\n", asus_wireless_status(asus, BT_RSTS));
}

static ssize_t store_bluetooth(struct device *dev,
static ssize_t bluetooth_store(struct device *dev,
			       struct device_attribute *attr, const char *buf,
			       size_t count)
{
@@ -1058,6 +1061,7 @@ static ssize_t store_bluetooth(struct device *dev,

	return sysfs_acpi_set(asus, buf, count, METHOD_BLUETOOTH);
}
static DEVICE_ATTR_RW(bluetooth);

/*
 * Wimax
@@ -1071,22 +1075,22 @@ static int asus_wimax_set(struct asus_laptop *asus, int status)
	return 0;
}

static ssize_t show_wimax(struct device *dev,
			      struct device_attribute *attr, char *buf)
static ssize_t wimax_show(struct device *dev, struct device_attribute *attr,
			  char *buf)
{
	struct asus_laptop *asus = dev_get_drvdata(dev);

	return sprintf(buf, "%d\n", asus_wireless_status(asus, WM_RSTS));
}

static ssize_t store_wimax(struct device *dev,
			       struct device_attribute *attr, const char *buf,
			       size_t count)
static ssize_t wimax_store(struct device *dev, struct device_attribute *attr,
			   const char *buf, size_t count)
{
	struct asus_laptop *asus = dev_get_drvdata(dev);

	return sysfs_acpi_set(asus, buf, count, METHOD_WIMAX);
}
static DEVICE_ATTR_RW(wimax);

/*
 * Wwan
@@ -1100,22 +1104,22 @@ static int asus_wwan_set(struct asus_laptop *asus, int status)
	return 0;
}

static ssize_t show_wwan(struct device *dev,
			      struct device_attribute *attr, char *buf)
static ssize_t wwan_show(struct device *dev, struct device_attribute *attr,
			 char *buf)
{
	struct asus_laptop *asus = dev_get_drvdata(dev);

	return sprintf(buf, "%d\n", asus_wireless_status(asus, WW_RSTS));
}

static ssize_t store_wwan(struct device *dev,
			       struct device_attribute *attr, const char *buf,
			       size_t count)
static ssize_t wwan_store(struct device *dev, struct device_attribute *attr,
			  const char *buf, size_t count)
{
	struct asus_laptop *asus = dev_get_drvdata(dev);

	return sysfs_acpi_set(asus, buf, count, METHOD_WWAN);
}
static DEVICE_ATTR_RW(wwan);

/*
 * Display
@@ -1135,7 +1139,7 @@ static void asus_set_display(struct asus_laptop *asus, int value)
 * displays hooked up simultaneously, so be warned. See the acpi4asus README
 * for more info.
 */
static ssize_t store_disp(struct device *dev, struct device_attribute *attr,
static ssize_t display_store(struct device *dev, struct device_attribute *attr,
			     const char *buf, size_t count)
{
	struct asus_laptop *asus = dev_get_drvdata(dev);
@@ -1146,6 +1150,7 @@ static ssize_t store_disp(struct device *dev, struct device_attribute *attr,
		asus_set_display(asus, value);
	return rv;
}
static DEVICE_ATTR_WO(display);

/*
 * Light Sens
@@ -1167,16 +1172,17 @@ static void asus_als_switch(struct asus_laptop *asus, int value)
	asus->light_switch = value;
}

static ssize_t show_lssw(struct device *dev,
			 struct device_attribute *attr, char *buf)
static ssize_t ls_switch_show(struct device *dev, struct device_attribute *attr,
			      char *buf)
{
	struct asus_laptop *asus = dev_get_drvdata(dev);

	return sprintf(buf, "%d\n", asus->light_switch);
}

static ssize_t store_lssw(struct device *dev, struct device_attribute *attr,
			  const char *buf, size_t count)
static ssize_t ls_switch_store(struct device *dev,
			       struct device_attribute *attr, const char *buf,
			       size_t count)
{
	struct asus_laptop *asus = dev_get_drvdata(dev);
	int rv, value;
@@ -1187,6 +1193,7 @@ static ssize_t store_lssw(struct device *dev, struct device_attribute *attr,

	return rv;
}
static DEVICE_ATTR_RW(ls_switch);

static void asus_als_level(struct asus_laptop *asus, int value)
{
@@ -1195,15 +1202,15 @@ static void asus_als_level(struct asus_laptop *asus, int value)
	asus->light_level = value;
}

static ssize_t show_lslvl(struct device *dev,
			  struct device_attribute *attr, char *buf)
static ssize_t ls_level_show(struct device *dev, struct device_attribute *attr,
			     char *buf)
{
	struct asus_laptop *asus = dev_get_drvdata(dev);

	return sprintf(buf, "%d\n", asus->light_level);
}

static ssize_t store_lslvl(struct device *dev, struct device_attribute *attr,
static ssize_t ls_level_store(struct device *dev, struct device_attribute *attr,
			      const char *buf, size_t count)
{
	struct asus_laptop *asus = dev_get_drvdata(dev);
@@ -1218,6 +1225,7 @@ static ssize_t store_lslvl(struct device *dev, struct device_attribute *attr,

	return rv;
}
static DEVICE_ATTR_RW(ls_level);

static int pega_int_read(struct asus_laptop *asus, int arg, int *result)
{
@@ -1234,8 +1242,8 @@ static int pega_int_read(struct asus_laptop *asus, int arg, int *result)
	return err;
}

static ssize_t show_lsvalue(struct device *dev,
			    struct device_attribute *attr, char *buf)
static ssize_t ls_value_show(struct device *dev, struct device_attribute *attr,
			     char *buf)
{
	struct asus_laptop *asus = dev_get_drvdata(dev);
	int err, hi, lo;
@@ -1247,6 +1255,7 @@ static ssize_t show_lsvalue(struct device *dev,
		return sprintf(buf, "%d\n", 10 * hi + lo);
	return err;
}
static DEVICE_ATTR_RO(ls_value);

/*
 * GPS
@@ -1274,15 +1283,15 @@ static int asus_gps_switch(struct asus_laptop *asus, int status)
	return 0;
}

static ssize_t show_gps(struct device *dev,
			struct device_attribute *attr, char *buf)
static ssize_t gps_show(struct device *dev, struct device_attribute *attr,
			char *buf)
{
	struct asus_laptop *asus = dev_get_drvdata(dev);

	return sprintf(buf, "%d\n", asus_gps_status(asus));
}

static ssize_t store_gps(struct device *dev, struct device_attribute *attr,
static ssize_t gps_store(struct device *dev, struct device_attribute *attr,
			 const char *buf, size_t count)
{
	struct asus_laptop *asus = dev_get_drvdata(dev);
@@ -1298,6 +1307,7 @@ static ssize_t store_gps(struct device *dev, struct device_attribute *attr,
	rfkill_set_sw_state(asus->gps.rfkill, !value);
	return rv;
}
static DEVICE_ATTR_RW(gps);

/*
 * rfkill
@@ -1569,19 +1579,6 @@ static void asus_acpi_notify(struct acpi_device *device, u32 event)
	asus_input_notify(asus, event);
}

static DEVICE_ATTR(infos, S_IRUGO, show_infos, NULL);
static DEVICE_ATTR(wlan, S_IRUGO | S_IWUSR, show_wlan, store_wlan);
static DEVICE_ATTR(bluetooth, S_IRUGO | S_IWUSR,
		   show_bluetooth, store_bluetooth);
static DEVICE_ATTR(wimax, S_IRUGO | S_IWUSR, show_wimax, store_wimax);
static DEVICE_ATTR(wwan, S_IRUGO | S_IWUSR, show_wwan, store_wwan);
static DEVICE_ATTR(display, S_IWUSR, NULL, store_disp);
static DEVICE_ATTR(ledd, S_IRUGO | S_IWUSR, show_ledd, store_ledd);
static DEVICE_ATTR(ls_value, S_IRUGO, show_lsvalue, NULL);
static DEVICE_ATTR(ls_level, S_IRUGO | S_IWUSR, show_lslvl, store_lslvl);
static DEVICE_ATTR(ls_switch, S_IRUGO | S_IWUSR, show_lssw, store_lssw);
static DEVICE_ATTR(gps, S_IRUGO | S_IWUSR, show_gps, store_gps);

static struct attribute *asus_attributes[] = {
	&dev_attr_infos.attr,
	&dev_attr_wlan.attr,
@@ -1616,7 +1613,7 @@ static umode_t asus_sysfs_is_visible(struct kobject *kobj,
		else
			goto normal;

		return supported;
		return supported ? attr->mode : 0;
	}

normal:
+1 −1
Original line number Diff line number Diff line
@@ -520,7 +520,7 @@ static acpi_status cmpc_get_accel(acpi_handle handle,
{
	union acpi_object param[2];
	struct acpi_object_list input;
	struct acpi_buffer output = { ACPI_ALLOCATE_BUFFER, 0 };
	struct acpi_buffer output = { ACPI_ALLOCATE_BUFFER, NULL };
	unsigned char *locs;
	acpi_status status;

+4 −3
Original line number Diff line number Diff line
@@ -64,6 +64,7 @@
#include <linux/acpi.h>
#include <linux/dmi.h>
#include <linux/backlight.h>
#include <linux/fb.h>
#include <linux/input.h>
#include <linux/kfifo.h>
#include <linux/platform_device.h>
@@ -398,7 +399,7 @@ static int bl_get_brightness(struct backlight_device *b)
static int bl_update_status(struct backlight_device *b)
{
	int ret;
	if (b->props.power == 4)
	if (b->props.power == FB_BLANK_POWERDOWN)
		ret = call_fext_func(FUNC_BACKLIGHT, 0x1, 0x4, 0x3);
	else
		ret = call_fext_func(FUNC_BACKLIGHT, 0x1, 0x4, 0x0);
@@ -1139,9 +1140,9 @@ static int __init fujitsu_init(void)

	if (!acpi_video_backlight_support()) {
		if (call_fext_func(FUNC_BACKLIGHT, 0x2, 0x4, 0x0) == 3)
			fujitsu->bl_device->props.power = 4;
			fujitsu->bl_device->props.power = FB_BLANK_POWERDOWN;
		else
			fujitsu->bl_device->props.power = 0;
			fujitsu->bl_device->props.power = FB_BLANK_UNBLANK;
	}

	pr_info("driver " FUJITSU_DRIVER_VERSION " successfully loaded\n");
Loading