diff options
| author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2013-05-01 08:47:44 -0700 | 
|---|---|---|
| committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2013-05-01 08:47:44 -0700 | 
| commit | bf61c8840efe60fd8f91446860b63338fb424158 (patch) | |
| tree | 7a71832407a4f0d6346db773343f4c3ae2257b19 /drivers/platform/x86/thinkpad_acpi.c | |
| parent | 5846115b30f3a881e542c8bfde59a699c1c13740 (diff) | |
| parent | 0c6a61657da78098472fd0eb71cc01f2387fa1bb (diff) | |
| download | olio-linux-3.10-bf61c8840efe60fd8f91446860b63338fb424158.tar.xz olio-linux-3.10-bf61c8840efe60fd8f91446860b63338fb424158.zip  | |
Merge branch 'next' into for-linus
Prepare first set of updates for 3.10 merge window.
Diffstat (limited to 'drivers/platform/x86/thinkpad_acpi.c')
| -rw-r--r-- | drivers/platform/x86/thinkpad_acpi.c | 26 | 
1 files changed, 16 insertions, 10 deletions
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index 75dd651664a..9a907567f41 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c @@ -209,9 +209,8 @@ enum tpacpi_hkey_event_t {  	TP_HKEY_EV_ALARM_SENSOR_XHOT	= 0x6022, /* sensor critically hot */  	TP_HKEY_EV_THM_TABLE_CHANGED	= 0x6030, /* thermal table changed */ -	TP_HKEY_EV_UNK_6040		= 0x6040, /* Related to AC change? -						     some sort of APM hint, -						     W520 */ +	/* AC-related events */ +	TP_HKEY_EV_AC_CHANGED		= 0x6040, /* AC status changed */  	/* Misc */  	TP_HKEY_EV_RFKILL_CHANGED	= 0x7000, /* rfkill switch changed */ @@ -852,7 +851,7 @@ static ssize_t dispatch_proc_write(struct file *file,  			const char __user *userbuf,  			size_t count, loff_t *pos)  { -	struct ibm_struct *ibm = PDE(file->f_path.dentry->d_inode)->data; +	struct ibm_struct *ibm = PDE(file_inode(file))->data;  	char *kernbuf;  	int ret; @@ -3629,6 +3628,12 @@ static bool hotkey_notify_6xxx(const u32 hkey,  			 "a sensor reports something is extremely hot!\n");  		/* recommended action: immediate sleep/hibernate */  		break; +	case TP_HKEY_EV_AC_CHANGED: +		/* X120e, X121e, X220, X220i, X220t, X230, T420, T420s, W520: +		 * AC status changed; can be triggered by plugging or +		 * unplugging AC adapter, docking or undocking. */ + +		/* fallthrough */  	case TP_HKEY_EV_KEY_NUMLOCK:  	case TP_HKEY_EV_KEY_FN: @@ -4877,8 +4882,7 @@ static int __init light_init(struct ibm_init_struct *iibm)  static void light_exit(void)  {  	led_classdev_unregister(&tpacpi_led_thinklight.led_classdev); -	if (work_pending(&tpacpi_led_thinklight.work)) -		flush_workqueue(tpacpi_wq); +	flush_workqueue(tpacpi_wq);  }  static int light_read(struct seq_file *m) @@ -6732,7 +6736,7 @@ static int volume_alsa_mute_put(struct snd_kcontrol *kcontrol,  	return volume_alsa_set_mute(!ucontrol->value.integer.value[0]);  } -static struct snd_kcontrol_new volume_alsa_control_vol __devinitdata = { +static struct snd_kcontrol_new volume_alsa_control_vol = {  	.iface = SNDRV_CTL_ELEM_IFACE_MIXER,  	.name = "Console Playback Volume",  	.index = 0, @@ -6741,7 +6745,7 @@ static struct snd_kcontrol_new volume_alsa_control_vol __devinitdata = {  	.get = volume_alsa_vol_get,  }; -static struct snd_kcontrol_new volume_alsa_control_mute __devinitdata = { +static struct snd_kcontrol_new volume_alsa_control_mute = {  	.iface = SNDRV_CTL_ELEM_IFACE_MIXER,  	.name = "Console Playback Switch",  	.index = 0, @@ -8575,7 +8579,8 @@ static bool __pure __init tpacpi_is_valid_fw_id(const char* const s,  	return s && strlen(s) >= 8 &&  		tpacpi_is_fw_digit(s[0]) &&  		tpacpi_is_fw_digit(s[1]) && -		s[2] == t && s[3] == 'T' && +		s[2] == t && +		(s[3] == 'T' || s[3] == 'N') &&  		tpacpi_is_fw_digit(s[4]) &&  		tpacpi_is_fw_digit(s[5]);  } @@ -8608,7 +8613,8 @@ static int __must_check __init get_thinkpad_model_data(  		return -ENOMEM;  	/* Really ancient ThinkPad 240X will fail this, which is fine */ -	if (!tpacpi_is_valid_fw_id(tp->bios_version_str, 'E')) +	if (!(tpacpi_is_valid_fw_id(tp->bios_version_str, 'E') || +	      tpacpi_is_valid_fw_id(tp->bios_version_str, 'C')))  		return 0;  	tp->bios_model = tp->bios_version_str[0]  |