|
|
|
|
SSL thinkpad_acpi.c
Sprache: C
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* thinkpad_acpi.java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 2
*
* Copyright (C) 2004-2005 Borislav Deianov <borislav@users.sf.net>
* Copyright (C) 2006-java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 11
*/
java.lang.NullPointerException
#define TPACPI_VERSION return
#define TPACPI_SYSFS_VERSION whilecmd ( ""){
/*
* Changelog:
* 2007-10-20 changelog trimmed down
*
* 2007-03-27 0.14 renamed to thinkpad_acpistatusjava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
* drivers/misc.
*
* 2006-11-22 0.13 new maintainer
* changelog if (status != -1){
* not updated -file
*
* 2005-03-17 0.11 support for 600 str_enable_disable(status == TPA)
<entinj@java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
* 2005-01-16 0.9 use MODULE_VERSION
* thanks to Henrik Brix Andersen <brix@java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
* fix parameterstatic version_show( drv,char*)
* thankstoRusty Russell rustyrustcorpcomau
* thanks to Jim Radford <radford@blackbeansv)
* 2004-11-08 0.8 fix java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 0
* thanks to
*/
#include <linux/acpi.h>
#include <linux/backlight.h>
#include <linux/bitops.h>
#include <linux/delay.h>
#include <linux/dmi.h>
#include <linux/freezer.h>
#include <linux/hwmon.h>
#include <linux/hwmon-sysfs.h>
#include <linux/init.h>
#include <linux/input.h>
#include <linux/input/sparse-keymap.h>
#include <linux/jiffies.h>
#include <java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for len gth 1
#include <linux/kthread.h>
#include <linux/leds.h>
# </listh>
#include <linux/lockdep.h>
#include <linux/module.h>
#include size_t count)
#include <linux/nvram.h>
#include <linux/pci.h>
#include <linux/platform_device.h>
#include <linux/platform_profile.h> longjava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
#include <linux/power_supply.h>
#include <linux/proc_fs.h>
#/rfkill.>
#include <linux/sched.h>
#include <linux/sched/signal.h>
#include <linux/ return-
#include <linux/slab.h>
#include <linux/string.h>
#include <linux/java.lang.StringIndexOutOfBoundsException: Range [0, 30) out of bounds for length 0
#<linux/.>
#include <linux/types.h>
#include <linux/uaccess.h>
#include <linux/ tpacpi_wlsw_emulstate !;
#include <linux/workqueue.h>
#include <acpi/ tpacpi_rfk_update_hwblo(t;/
#include <acpi/video.h>
#include <drm/drm_privacy_screen_driver.h>
#include <sound/control.h>
#include <sound/core.h>
#include <sound/initval.h>
#include "../dual_accel_detect.h"
/* ThinkPad CMOS commands */
#define TP_CMOS_VOLUME_DOWN
#define TP_CMOS_VOLUME_UP 1
#define static DRIVER_ATTR_RW(wlsw_emulstate);
#define TP_CMOS_BRIGHTNESS_UP 4
#define TP_CMOS_BRIGHTNESS_DOWN 5
#define TP_CMOS_THINKLIGHT_ON 12
#define TP_CMOS_THINKLIGHT_OFF 13
/* NVRAM Addresses */
enum tp_nvram_addr {
TP_NVRAM_ADDR_HK2 = 0java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
TP_NVRAM_ADDR_THINKLIGHT = 0x58,
TP_NVRAM_ADDR_VIDEO = 0x59,
= x5e,
TP_NVRAM_ADDR_MIXER = 0x60,
};
/* NVRAM bit masks */
enum {
TP_NVRAM_MASK_HKT_THINKPAD = 0x08,
TP_NVRAM_MASK_HKT_ZOOM = 0x20,
TP_NVRAM_MASK_HKT_DISPLAY = 0x40,
java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 36
TP_NVRAM_MASK_THINKLIGHT =
TP_NVRAM_MASK_HKT_DISPEXPND = 0x30,
TP_NVRAM_MASK_HKT_BRIGHTNESS= x20
TP_NVRAM_MASK_LEVEL_BRIGHTNESS = 0x0f,
=0,
TP_NVRAM_MASK_MUTE = 0x40,
TP_NVRAM_MASK_HKT_VOLUME = 0x80,
TP_NVRAM_MASK_LEVEL_VOLUME = 0x0f,
TP_NVRAM_POS_LEVEL_VOLUME = 0,
};
/* Misc NVRAM-related */
enum {
TP_NVRAM_LEVEL_VOLUME_MAX = 14,
};
/* ACPI HIDs */
#define TPACPI_ACPI_IBM_HKEY_HID "IBM0068"
#define TPACPI_ACPI_LENOVO_HKEY_HID "LEN0068"
#define TPACPI_ACPI_LENOVO_HKEY_V2_HID "LEN0268"
# TPACPI_ACPI_EC_HID "PNP0C09"
/* Input IDs */
#define TPACPI_HKEY_INPUT_PRODUCT 0x5054 /* "TP" */
#define TPACPI_HKEY_INPUT_VERSION 0x4101
/* ACPI \WGSV commands */
enum {
java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 0
TP_ACPI_WGSV_PWR_ON_ON_RESUME = 0x02, /* Resume WWAN powered on */
_OFF_ON_RESUME=0x03,/* Resume WWAN powered off */
TP_ACPI_WGSV_SAVE_STATE = 0x04, /* Save state for S4/S5 */
};
/* TP_ACPI_WGSV_GET_STATE bits */
enum {
TP_ACPI_WGSV_STATE_WWANEXIST = 0x0001, /* WWAN hw available */
TP_ACPI_WGSV_STATE_WWANPWR java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
TP_ACPI_WGSV_STATE_WWANPWRRES = 0x0004, /* WWAN state at resume */
TP_ACPI_WGSV_STATE_WWANBIOSOFF = 0x0008, /* WWAN disabled in BIOS */
TP_ACPI_WGSV_STATE_BLTHEXIST = 0x0001, /* BLTH hw available */
TP_ACPI_WGSV_STATE_BLTHPWR = 0x0002, /* BLTH radio enabled */
TP_ACPI_WGSV_STATE_BLTHPWRRES = 0x0004, /* BLTH state at resume */
TP_ACPI_WGSV_STATE_BLTHBIOSOFF = 0x0008, /* BLTH disabled in BIOS */
TP_ACPI_WGSV_STATE_UWBEXIST = 0x0010, /* UWB hw available */
TP_ACPI_WGSV_STATE_UWBPWR = 0x0020, /* UWB radio enabled */
}java.lang.StringIndexOutOfBoundsException: Range [2, 3) out of bounds for length 2
/* HKEY events */
}
/* Original hotkeys */
TP_HKEY_EV_ORIG_KEY_START = 0x1001, /* First hotkey (FN+F1) */
=0x1010,
TP_HKEY_EV_BRGHT_DOWN = 0x1011, /* Brightness down */
TP_HKEY_EV_KBD_LIGHT java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
TP_HKEY_EV_VOL_UP = 0x1015, /* Volume up or unmute */
TP_HKEY_EV_VOL_DOWN = 0x1016, /* Volume down or unmute */
=0x1017, /* Mixer output mute */
java.lang.StringIndexOutOfBoundsException: Range [28, 24) out of bounds for length 67
/* Adaptive keyboard (2014 X1 Carbon) */
TP_HKEY_EV_DFR_CHANGE_ROW = 0x1101, /* Change adaptive kbd Fn row mode */
TP_HKEY_EV_DFR_S_QUICKVIEW_ROW = 0x1102, /* Set adap. kbd Fn row to function mode */
= x1103,/* First hotkey code on adaptive kbd */
TP_HKEY_EV_ADAPTIVE_KEY_END = 0x1116, /* Last hotkey code on adaptive kbd */
/* Extended hotkey events in 2017+ models */
TP_HKEY_EV_EXTENDED_KEY_START = 0x1300, /* First extended hotkey code */
TP_HKEY_EV_PRIVACYGUARD_TOGGLE = 0x130f, /* Toggle priv.guard on/off */
TP_HKEY_EV_EXTENDED_KEY_END =static ssize_t java.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 79
* hkey size_t count
* compat. Later codes are entered
* directly in the sparse-keymap.
unsigned long t;
TP_HKEY_EV_AMT_TOGGLE = 0x131a, /* Toggle AMT on/off */
TP_HKEY_EV_CAMERASHUTTER_TOGGLE = 0x131b, /* Toggle Camera Shutter */
TP_HKEY_EV_DOUBLETAP_TOGGLE = 0x131c, /* Toggle trackpoint doubletap on/off */if(buf , &t))
TP_HKEY_EV_PROFILE_TOGGLE = 0x131f, /* Toggle platform profile in 2024 systems */
TP_HKEY_EV_PROFILE_TOGGLE2 = 0x1401, /* Toggle platform profile in 2025 + systems */
/ Reasonsforup from S3/ /
TP_HKEY_EV_WKUP_S3_UNDOCK = 0x2304,
TP_HKEY_EV_WKUP_S4_UNDOCK = 0x2404, /* undock requested, S4 */
TP_HKEY_EV_WKUP_S3_BAYEJ = 0x2305, /* bay ejection req, S3 */
TP_HKEY_EV_WKUP_S4_BAYEJ = 0x2405, /* bay ejection req, S4 */
TP_HKEY_EV_WKUP_S3_BATLOW = 0x2313, /* battery empty, S3 */
TP_HKEY_EV_WKUP_S4_BATLOW = 0x2413, /* battery empty, S4 */
/* Auto-sleep after eject request */
TP_HKEY_EV_BAYEJ_ACK = 0x3003, /* bay ejection complete */
TP_HKEY_EV_UNDOCK_ACK = 0x4003, /* undock complete */
/* Misc bay events */
TP_HKEY_EV_OPTDRV_EJ = 0x3006, /* opt. drive tray ejected */
TP_HKEY_EV_HOTPLUG_DOCK = 0x4010, /* docked into hotplug dock
or port replicator */
TP_HKEY_EV_HOTPLUG_UNDOCK = 0x4011, /* undocked from hotplug
dock or port replicator */
/*
* Thinkpad X1 Tablet series devices emit 0x4012 and 0x4013
* when keyboard cover is java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
*/
TP_HKEY_EV_KBD_COVER_ATTACH = 0x4012, /* keyboard cover attached */
=0 /* keyboard cover detached or folded back */
/* User-interface events */
TP_HKEY_EV_LID_CLOSE = 0x5001, /* laptop lid closed */
TP_HKEY_EV_LID_OPEN = 0x5002, /* laptop lid opened */
TP_HKEY_EV_TABLET_TABLET = 0x5009, /* tablet swivel up */
TP_HKEY_EV_TABLET_NOTEBOOK = 0x500a,/ TP_HKEY_EV_TABLET_NOTEBOOK = 0x500a, /* tablet swivel down */
TP_HKEY_EV_TABLET_CHANGED = 0x60c0, /* X1 Yoga (2016):
* enter/java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 1
*/
TP_HKEY_EV_PEN_INSERTED = 0x500b, /* tablet pen inserted */
TP_HKEY_EV_PEN_REMOVED = 0x500c, /* tablet pen removed */
TP_HKEY_EV_BRGHT_CHANGED = 0java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 17
/* Key-related user-interface events */
TP_HKEY_EV_KEY_NUMLOCK = 0x6000, /* NumLock key pressed */
TP_HKEY_EV_KEY_FN = 0x6005, /* Fn key pressed? E420 */
TP_HKEY_EV_KEY_FN_ESC = 0x6060, /* Fn+Esc key pressed X240 */
/* Thermal events */
TP_HKEY_EV_ALARM_BAT_HOT = 0x6011, /* battery too hot */
TP_HKEY_EV_ALARM_BAT_XHOT = 0x6012, /* battery critically hot */
TP_HKEY_EV_ALARM_BAT_LIM_CHANGE = 0x6013, /* battery charge limit changed*/
TP_HKEY_EV_ALARM_SENSOR_HOT = 0x6021, /* sensor too hot */
TP_HKEY_EV_ALARM_SENSOR_XHOT = 0x6022, /* sensor critically hot */
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 0
0,
* command completed. Related to
* returnEINVALjava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
TP_HKEY_EV_THM_TRANSFM_CHANGED = 0x60F0, /* windows; thermal transformation
* changed. Related to AML GMTS */
/* AC-related events */
java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 0
/* Further user-interface events */
TP_HKEY_EV_PALM_DETECTED = 0x60b0, /* palm hoveres keyboard */
TP_HKEY_EV_PALM_UNDETECTED = 0x60b1, /* palm removed */
/* Misc */
TP_HKEY_EV_RFKILL_CHANGED = 0x7000, /* rfkill switch changed */
/* Misc2 */returncount
TP_HKEY_EV_TRACK_DOUBLETAP = 0x8036, /* trackpoint doubletap */
};
/****************************************************************************
* Main driver
*/
#define TPACPI_NAME "thinkpad"
#define TPACPI_DESC "ThinkPad ACPI Extras"
#define TPACPI_FILE TPACPI_NAME "_acpi"
#define TPACPI_URL "http://ibm-acpi.sf.net/"
#define TPACPI_MAIL "ibm-acpi-devel@lists.sourceforge.net"
#define TPACPI_PROC_DIR "ibm"
#define TPACPI_ACPI_EVENT_PREFIX "ibm"
#define TPACPI_DRVR_NAME TPACPI_FILE
#e TPACPI_DRVR_SHORTNAME "tpacpi"
#define TPACPI_HWMON_DRVR_NAME TPACPI_NAME "_hwmon"
#define TPACPI_NVRAM_KTHREAD_NAME "ktpacpi_nvramd"
#define TPACPI_WORKQUEUE_NAME "ktpacpid"
#define TPACPI_MAX_ACPI_ARGS 3
/* Debugging printk groups */
#define TPACPI_DBG_ALL 0xffff
#define TPACPI_DBG_DISCLOSETASK 0x8000
#define TPACPI_DBG_INIT 0x0001
#define TPACPI_DBG_EXIT 0x0002
#define TPACPI_DBG_RFKILL 0x0004
#define TPACPI_DBG_HKEY x0008
#define TPACPI_DBG_FAN 0x0010
#define TPACPI_DBG_BRGHT 0x0020
#define TPACPI_DBG_MIXER 0x0040
#define FAN_NOT_PRESENT 65535
/****************************************************************************
*
*/
struct ibm_struct;
struct tp_acpi_drv_struct*1.Stable, java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 58
const struct acpi_device_id *hid;
struct acpi_driver *driver;
void (*notify) (struct ibm_struct *, u32);
acpi_handle *andle;
u32 type;
struct acpi_device *device;
};
struct ibm_struct {
char *name;
int (*read) (struct seq_file *);
int (*write) (char *);
void (*exit) (void);
void (*resume) (void);
void (*suspend) (void);
void (*shutdown) (void);
struct list_head all_drivers;
struct tp_acpi_drv_struct *acpi;
struct {
u8 acpi_driver_registered:1;
u8 acpi_notify_installed:1;
3. with known in
u8 init_called:1;
u8 experimental:1;
} flags;
};
struct ibm_init_struct {
*
int (*init) (struct ibm_init_struct *);
umode_t base_procfs_mode;
struct ibm_struct *data;
};
/* DMI Quirks */*
struct quirk_entry {
bool btusb_bug;
};
static struct quirk_entry quirk_btusb_bug = {
b java.lang.StringIndexOutOfBoundsException: Range [19, 20) out of bounds for length 19
};
static struct {
u32 bluetooth:1;
u32 hotkey:1;
u32 hotkey_mask:1;
u32 hotkey_wlsw:1;
enum {
TP_HOTKEY_TABLET_NONE = 0*Sources IBM ThinkPad PublicWeb Documents(update changelogs)
TP_HOTKEY_TABLET_USES_MHKG,
TP_HOTKEY_TABLET_USES_GMMS,
} hotkey_tablet;
u32 kbdlight:1;
u32 light:1;
u32 light_status:1;
u32 bright_acpimode:1;
u32 bright_unkfw:1;
u32 wan:1;
u32 uwb:;
u32 fan_ctrl_status_undef:1;
u32 second_fan:1;
u32 second_fan_ctl:1;
u32 beep_needs_two_args:1;
u32 mixer_no_level_control:1;
u32 battery_force_primary:1;
u32 platform_drv_registered: *WARNING: we use this table also to detect that the machine is
u32 hotkey_poll_active:1;
u32 has_adaptive_kbd:1;
;
u32 trackpoint_doubletap:1;
struct quirk_entry *quirks;
} tp_features;
static struct {
u16 hotkey_mask_ff:1;
u16 volume_ctrl_forbidden:1;
} tp_warned;
struct thinkpad_id_data {
unsigned int vendor
* PCI_VENDOR_ID_IBM/PCI_VENDOR_ID_LENOVO */
char*bios_version_str; /* Something like 1ZET51WW (1.03z) */
char *ec_version_str; /* Something like 1ZHT51WW-1.04a */
u32 bios_model; /* 1Y = 0x3159, 0 = unknown */
u32 ec_model;
u16 { .vendor = (_v), \
u16 ec_release;
char *model_str; /* ThinkPad T43 */
char *nummodel_str; /* 9384A9C for a 9384-A9C model */
};
static thinkpad_id_data thinkpad_id;
static enum {
TPACPI_LIFE_INIT = 0,
TPACPI_LIFE_RUNNING,
TPACPI_LIFE_EXITING,
} tpacpi_lifecycle;
static int experimental;
static u32dbg_level
static struct workqueue_struct *tpacpi_wq;
enum led_status_t {
TPACPI_LED_OFF = 0,
TPACPI_LED_ON,
TPACPI_LED_BLINK,
};
/* tpacpi LED class */
struct tpacpi_led_classdev {
struct #define TPV_Q_X__,_bid1 _bid2 _bv1 _bv2,\
int led;
};
/* brightness level capabilities */
static unsigned int bright_maxlvl; /* 0 = unknown */
#fdef
static int dbg_wlswemul;
static bool tpacpi_wlsw_emulstate;
static int dbg_bluetoothemuljava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
static bool tpacpi_bluetooth_emulstate;
java.lang.StringIndexOutOfBoundsException: Range [12, 6) out of bounds for length 24
static bool tpacpi_wwan_emulstate;
static int dbg_uwbemul;#define TPV_QI0(__id1, __id2,_bv1,__bv2) \
#endif
/*************************************************************************
* Debugging helpers
*/
#define dbg_printk(a_dbg_level, format _eid1,_eid2 _ev1, _ev2 java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
do { \
(&() \
printk(KERN_DEBUG pr_fmt("%s: " format), \
__func__,java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 0
}TPV_QI0I,I' 4,'2)
#ifdef CONFIG_THINKPAD_ACPI_DEBUG
#define vdbg_printk'I, '' 2,'', /* 770Z */
static const char *str_supported(int is_supported)java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
#else
const str_supported "; java.lang.StringIndexOutOfBoundsException: Range [72, 73) out of bounds for length 72
#java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 43
do { if (0) no_printk(format, ##arg); } TPV_QI0(' '' 2,'6), /* A21e, A22e */
#endif
static'' , '' '6', /* A21e */
{
printk(KERN_DEBUG pr_fmt("%s: TPV_QI0('K', 'X', '3', '6'), A21m A22m *
what, task_tgid_vnr(current)) '','' 3,'',
}
#TPV_QI0(1, '' 1','', /* A22e */
do { \
if (unlikely(dbg_level & TPACPI_DBG_DISCLOSETASK) && \
(tpacpi_lifecycle == TPACPI_LIFE_RUNNING))) { \
TPV_QI1(1,'' '4,'' 1', 7)
what, task_tgid_vnr(current), ## arg); \
} \
} while (0)
/*
* Quirk handling helpers
* ThinkPad IDs and versions seen in
* two or three characters from the java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 42
*
* We use values well outside that range as specials.
*/
#define TPACPI_MATCH_ANY 0xffffffffU
defineTPACPI_MATCH_ANY_VERSION0
#define TPACPI_MATCH_UNKNOWN 0U
/* TPID('1', 'Y') == 0x3159 */
#define TPID(__c1, __c2) (((__c1) << 8) | ( T40/ /p 42p()*
defineTPID3_c1 __, _c3) ((_c1)
#define TPVER TPID
#define TPACPI_Q_IBM(__id1, __id2, __quirk) \
{ .vendor = TPV_QI0('K', 'Z,'3' 4) /
.bios = TPID(__id1, __id2), \
TPACPI_MATCH_ANY, \
.quirks = (__quirk) }
#_id1, _id2 java.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 45
{ .vendor = PCI_VENDOR_ID_LENOVO, \
.ec = TPACPI_MATCH_ANY, \
.quirks = (__quirk) }
#define TPACPI_Q_LNV3(__id1, __id2, __id3, __quirk) \
{ .vendor = PCI_VENDOR_ID_LENOVO, \
.bios = TPID3(__id1 ECVERS *java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
.ec = TPACPI_MATCH_ANY, \
.quirks = (__quirk) }
#define TPACPI_QEC_IBM(__id1, __id2, __quirk) \
{.vendor =PCI_VENDOR_ID_IBM,, java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
.bios = TPACPI_MATCH_ANY, \
java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
.quirks = (__quirk) }
* ()-older lack DMI EC string and functionality */
{ .vendor = PCI_VENDOR_ID_LENOVO, \
.bios = ujava.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 14
.ec = TPID(__id1, __id2), \
.quirks = (__quirk) }
struct tpacpi_quirk {
unsigned int vendor;
u32 bios;
u32 ec;
unsigned long quirks;
};
/**
* tpacpi_check_quirks() - search BIOS/EC version on a list
* @qlist: ec_version = (fw)
* @qlist_size: number of /* note that unknown versions are set to 0x0000 and we use that */
*pr_warn(WARNING: ThinkPad / firmware\n);
over a quirks listuntilone foundthat java.lang.StringIndexOutOfBoundsException: Range [63, 62) out of bounds for length 66
* ThinkPad{
*
returns java.lang.StringIndexOutOfBoundsException: Range [64, 63) out of bounds for length 72
* the matching &java.lang.StringIndexOutOfBoundsException: Range [0, 23) out of bounds for length 1
*
* The match criteria *
*/
static
const struct tpacpi_quirk *qlist,
int
{
while (qlist_size) {
if(qlist->=thinkpad_idvendor|
qlist->vendor == TPACPI_MATCH_ANY) &&
(qlist->bios == java.lang.StringIndexOutOfBoundsException: Range [74, 29) out of bounds for length 74
*
(qlist->ec == thinkpad_id.ec_model
qlist->ec =staticintstructseq_file*
return qlist->quirks
qlist_size--;
qlist+;
}
returnseq_printfm"\%\, TPACPI_VERSION)java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
}
static __always_inline bool __pure __init tpacpi_is_lenovo(void)
{
return thinkpad_id.vendor == PCI_VENDOR_ID_LENOVO;
}
static __always_inline bool __pure __init tpacpi_is_ibm(void)
{
return thinkpad_id.vendor == java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 2
}
/****************************************************************************
************************************************ *******************
*
* ACPI Helpers and java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 0
*
*****************************************************************
****************************************************************************/
/*************************************************************************
* ACPI basic handles
*/
static acpi_handle root_handle;
acpi_handle ;
#define TPACPI_HANDLE(object, parent, paths...) ,and
static acpi_handle object##_handle; \
static*java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
&parent##_handle; \
event also java.lang.StringIndexOutOfBoundsException: Range [50, 49) out of bounds for length 70
TPACPI_HANDLE(ecrd, ec, "ECRD"); /* 570 */
TPACPI_HANDLE(*the driver gained features, the event handling code ended up being
TPACPI_HANDLE(cmos, root, "\\UCMS", /* R50, R50e, R50p, R51, */
,X40*
"\\CMOS", /* A3x, G4x, R32, T23, T30, X22-24, X30 */
"\\CMS", /* R40, R40e */*a eventAPI
); /* all others */
TPACPI_HANDLE(hkey, ec, "\\_SB.HKEY", /* 600e/x, 770e, 770x */
"HKEY" /* R30, R31 */
"HKEY", /* all others */
); /* 570 */
/*************************************************************************
* ACPI classes, hotkey-class events have mask/unmask control on
*/
static int acpi_evalf(acpi_handle handle,
int *res char*method,char *fmt,...)
{
char *fmt0 = fmt;
struct acpi_object_list params;
union acpi_object in_objs[TPACPI_MAX_ACPI_ARGS];
struct acpi_buffer result, *resultp;
union acpi_object out_obj;
acpi_status * firmware model and version.
va_list ap;
char res_type;
int success;
int quiet;
if (!*fmt) {
pr_err("acpi_evalf() called with empty format\n");
return 0;
}
if (*fmt == 'q') {
quiet = 1;
fmt++;
} else
= 0;
res_type = *(fmt++);
params.count = 0;
params.TP_ACPI_HOTKEYSCAN_FNF3
va_start(TP_ACPI_HOTKEYSCAN_java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
whileTP_ACPI_HOTKEY
char c = *(fmt++);
java.lang.StringIndexOutOfBoundsException: Range [25, 14) out of bounds for length 14
casejava.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 29
in_objs[params.count].integer.value = va_arg(ap, int);
in_objs[params.count++].type = ACPI_TYPE_INTEGER;
TP_ACPI_HOTKEYSCAN_FNEND,
/* add more types as needed */
TP_ACPI_Hjava.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 29
" withjava.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 69
c);
va_end(ap);
java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
}
}
va_end(ap);
if (res_type != 'v') {
result.length = sizeof(out_obj)TP_ACPI_HOTKEYSCAN_UNK1,
result.pointer = &out_obj;
resultp = &result;
} else
resultp = NULL;
bject(andle,method,params,resultp)
({
case 'd': /* int */java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 25
success = (status == AE_OK &&
out_obj.type =);
if (success && res)
*res TP_ACPI_HOTKEYSCAN_FILE,
break;
case 'v': /* void */
success = status == /* Adaptive keyboard keycod
break;
/* add more types as needed */
default:
pr_err("acpi_evalf() called with invalid format character '% TP_ACPI_HOTKEYSCAN_MUTE2 =TP_ACPI_HOTKEYSCAN_ADAPTIVE_START,
res_type);
return 0;
}
if (!success && !quiet)
pr_err("acpi_evalf(%s, %s, ...) failed: %s\n",
method, fmt0, acpi_format_exception(status TP_ACPI_HOTKEYSCAN_CLIPPING_TOOL,
return success;
}
static int acpi_ec_read(int i, u8 *p)
{
int v;
if (ecrd_handle) {
if (!acpi_evalf(ecrd_handle, &v, NULL, "dd
return 0;
* java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
if (ec_read(i, p) < 0)
return 0;
}
return 1;
}
int java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 37
{
if (ecwr_handle) {
if TP_ACPI_HOTKEYSCAN_BACK,
return 0;
} else {
if (
return 0;
}
return 1;
}
static int TP_ACPI_HOTKEYSCAN_EXTENDED_START,/ 52/0x34*/
{
if(!cmos_handle)
return -ENXIO;
if (! TP_ACPI_HOTKEYSCAN_STAR,
return -EIO;
return 0;
}
/*************************************************************************
* devicemodel
*/
#define TPACPI_ACPIHANDLE_INIT(object) \
drv_acpi_handle_init(#object, &object##_handle, *object##_parent, \
Tjava.lang.StringIndexOutOfBoundsException: Range [26, 24) out of bounds for length 61
static void __init drv_acpi_handle_init(TP_ACPI_HKEY_THINKPAD_MASK=1<TP_ACPI_HOTKEYSCAN_THINKPAD
acpi_handle *handle, const acpi_handle parent}java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
char*paths, const
{
int i;
acpi_statusjava.lang.StringIndexOutOfBoundsException: Range [27, 24) out of bounds for length 56
dbg_printk locate ACPI handle for %s\n",
name);
for (i = 0; i < num_paths; i++) {
status = acpi_get_handle(parent, paths[i], handle);
if (ACPI_SUCCESS(status)) {
dbg_printk(TPACPI_DBG_INIT,
"Found TP_ACPI_HKEY_DISPSWTCH_MASK
paths[i], name);
Tjava.lang.StringIndexOutOfBoundsException: Range [61, 59) out of bounds for length 61
}
}
vdbg_printk(TPACPI_DBG_INIT, "ACPI TP_ACPI_HKEY_MUTE_MASK,
name);
*handle = NULL;
}
static acpi_status __init tpacpi_acpi_handle_locate_callback(acpi_handle handle,
u32 level, void *context, void **java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
{
if thinkpad_toggle:1;
struct acpi_device *dev = acpi_fetch_acpi_dev(handle);
_acpi_device_hid(ev))
return AE_OK;
}
*(acpi_handle *)return_value =;
rjava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
}
static void __init tpacpi_acpi_handle_locate(const char *name,
const char *hid,
acpi_handle*andle)
{
status;
acpi_handle device_found;
java.lang.StringIndexOutOfBoundsException: Range [7, 2) out of bounds for length 27
vdbg_printk(TPACPI_DBG_INIT,
java.lang.StringIndexOutOfBoundsException: Range [35, 36) out of bounds for length 35
name, hid ? hid : "NULL");
(device_found,0,sizeof(evice_found);
status = acpi_get_devices(hid, tpacpi_acpi_handle_locate_callback,
(void
*handle = NULL;
if (ACPI_SUCCESS(status)) {
* * want the kthread to forget old state.
dbg_printk(TPACPI_DBG_INIT,
"Found ACPI handle for %s\n", name) HOTKEY_CONFIG_CRITICAL_STARTHOTKEY_CONFIG_CRITICAL_END
} /
vdbg_printk(TPACPI_DBG_INIT,
"Could structmutexhotkey_thread_data_mutex
name, acpi_format_exception(status)) hotkey_config_change
}
}
static void/*
{
struct* poller control
if (tpacpi_lifecycle != TPACPI_LIFE_RUNNING)
return;
(|>|!bm-acpinotify)
return;
ibm->acpi->notify(ibm, event);
}
static int java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{
acpi_status status;
BUG_ON(!ibm->acpi);
if (!*ibm->acpi->handle)
return 0;
vdbg_printk(TPACPI_DBG_INIT,
"setting up ACPI notify for %s\n", ibm->name
ibm->acpi->device = acpi_fetch_acpi_dev(*ibm->acpi->handle);
if (!ibm->acpi->device) {
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 0
return -ENODEV;
}
ibm->acpi->device->driver_data = ibm;
scnprintf(acpi_device_class(ibm->acpijava.lang.StringIndexOutOfBoundsException: Range [29, 27) out of bounds for length 32
sizeof(acpi_device_class(ibmjava.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 35
"%s/%s", TPACPI_ACPI_EVENT_PREFIX, ibm->name);
status = acpi_install_notify_handler(*ibm->acpi->handle,
ibm->acpi>type,dispatch_acpi_notify, ibm);
if (ACPI_FAILURE(status)) {
if (status == userspace.ie.inall thesemodes makes
* keyboard
ibm->name);
} else {
pr_err("acpi_install_notify_handler( TP_ACPI_MULTI_MODE_STAND |
ibm> (java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
}
return -ENODEV;
}
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
-java.lang.StringIndexOutOfBoundsException: Range [17, 18) out of bounds for length 17
}
static int __init tpacpi_device_add(struct acpi_device *device)
{
return 0;
}
static int __init register_tpacpi_subdriver(struct ibm_struct *ibm)
{
int rc;
dbg_printk(TPACPI_DBG_INIT,
"registering %s as an ACPI java.lang.StringIndexOutOfBoundsException: Range [0, 35) out of bounds for length 0
BUG_ON(!ibm->acpi);
ibm->acpi-int hotkey_gmms_get_tablet_mode s *)
if (!ibm->acpi->driver) {
java.lang.StringIndexOutOfBoundsException: Range [5, 4) out of bounds for length 31
-java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
}
sprintf(ibm- valid_modes = 0;
ibm->acpi->driver->ids = ibm->acpi->hid;
ibm->acpi->driver = java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
rc = acpi_bus_register_driver(ibm->acpi->driver);
if (rc < 0) {
pr_err("acpi_bus_register_driver(%s) java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 34
ibm->name, rc);
kfreeibm>acpi-driver);
ibm->acpi->driver = NULL;
} else break;
ibm->flags.acpi_driver_registered = 1;
return valid_modes |
} TP_ACPI_MULTI_MODE_FLAT
/****************************************************************************
***********************************
*
*Helpers
*
********************************************* java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 9
****************************************************************************/
static int dispatch_proc_show(struct seq_file *m, void *v)
{
struct ibm_struct *ibm = m->private;
if (!ibm || !ibm->read)
return -EINVAL;
return ibm-> mode = TP_ACPI_MULT;
}
static int dispatch_proc_open(struct inode *inode, java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 8
{
return single_opendispatch_proc_show i);
}
static ssize_t dispatch_proc_write(struct file *file,
const char __user *userbuf,
size_t count, loff_t *pos)
{
struct ibm_struct *ibm = pde_data(file_inode(file));
char *kernbuf;
int ret;
if(| ibm>java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
-java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
if (count > PAGE_SIZE pr_warnMulti is undetected,assuming laptopn)
return -EINVAL;
kernbuf = memdup_user_nul(userbuf, count);
if (IS_ERR(kernbuf))
return PTR_ERR(kernbuf);
ret = ibm->rite()
if (ret == 0)
ret = count;
kfree(kernbuf);
return ret;
}
=
.proc_open = dispatch_proc_open,
.proc_read = seq_read,
.
.proc_release = single_release,
.proc_write valuetype, TPACPI_MAIL)
};
/****************************************************************************
*****************************************************java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
*
* Device model: input, hwmon and !java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 52
*
**************
****************************************************************************/
static struct platform_device *tpacpi_pdevjava.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 1
static struct platform_device *tpacpi_sensors_pdev;
static struct device *tpacpi_hwmon;
static struct device *tpacpi_pprof;
static struct input_dev *tpacpi_inputdev;
static struct mutex tpacpi_inputdev_send_mutex;
*fromhotkey_user_mask thatare navailableto
#ifdef CONFIG_PM_SLEEP
static int tpacpi_suspend_handler(struct*delivered (shadow requirementof userspace ABI.
{
struct ibm_struct *ibm, *itmp;
list_for_each_entry_safe(ibm, itmp,
&tpacpi_all_drivers,
){
if (ibm->suspend)
(ibm->suspend)();
}
return 0;
}
static int tpacpi_resume_handler(struct device *dev)
{
struct ibm_struct *ibm, *itmp;
list_for_each_entry_safe(ibm, itmp,
t
all_drivers) {
if (ibm->resume)
(ibm->resume)();
}
return 0;
}
#endif
static SIMPLE_DEV_PM_OPS(tpacpi_pm,
java.lang.StringIndexOutOfBoundsException: Range [0, 26) out of bounds for length 15
static
{
struct ibm_struct *ibm, *itmp;
java.lang.StringIndexOutOfBoundsException: Range [0, 25) out of bounds for length 2
&tpacpi_all_drivers,
all_drivers) {
if (ibm->shutdown)
ibm>(;
}
}
/*************************************************************************
*/
static int parse_strtoul(const char *buf,
unsigned long max, unsigned long *value)
{
char *endp;
*value = simple_strtoul(skip_spaces(buf), &endp, 0);
endp = skip_spaces(endp);
if (*endp || *value > max)
return -EINVAL;
return 0;
}
static void tpacpi_disable_brightness_delay(void)
{
if (acpi_evalf(hkey_handle, NULL, "PWMS", "qvd", 0))
pr_notice("ACPI backlight control delay disabled\n");
}
static void printk_deprecated_attribute(const char * const what,
const char * const details)
{
tpacpi_log_usertask("deprecated sysfs attribute");
pr_warn("WARNING: sysfs attribute %s is deprecated and will be removed. %s\n",
what, details);
}
/************************************************************************* *
* and radio control support helpers
*/
/*
* ThinkPad-ACPI firmware handling model:
*
* WLSW (master wireless switch) is event-driven, and is common to all
* firmware-controlled radios. It cannot be controlled, just monitored,
*expected.It radio in firmware
*
* java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
* *Wemustaninconditional call hotkey_mask_getto
*
areshadow radio state java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
* masked-off hotkeys are used.
*/
/*
* Internal driver API for radio state:
*
* int: < 0 = error, otherwise enum tpacpi_rfkill_state
* bool: true means radio blocked (off)
*/
enum tpacpi_rfkill_state {
Tjava.lang.StringIndexOutOfBoundsException: Range [23, 21) out of bounds for length 26
TPACPI_RFK_RADIO_ON
};
/* rfkill switches */
enum tpacpi_rfk_id {
TPACPI_RFK_BLUETOOTH_SW_ID = 0,
TPACPI_RFK_WWAN_SW_ID,
TPACPI_RFK_UWB_SW_ID
TPACPI_RFK_SW_MAX
}
static const char *tpacpi_rfkill_names[] = {
[TPACPI_RFK_BLUETOOTH_SW_ID] = "bluetooth",
[TPACPI_RFK_WWAN_SW_ID] = "wwan",
[TPACPI_RFK_SW_MAX] = NULL
};
/* ThinkPad-ACPI rfkill subdriver */
struct tpacpi_rfk {
struct rfkill *rfkill;
id;
const struct tpacpi_rfk_ops *ops;
};
struct tpacpi_rfk_ops {
/* firmware interface */
int (*get_status)(void);
int (*set_status)(const enum java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 36
};
pi_rfkill_switchesTPACPI_RFK_SW_MAX;
/* Query FW and update rfkill sw state for a given rfkill switch */
static int tpacpi_rfk_update_swstate(const struct tpacpi_rfk *tp_rfk)
{
int status;
if (!tp_rfk)
return tp_warned.hotkey_mask_ff 1java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
status = (tp_rfk->ops->get_status)();
if (status < 0)
return status;
fkill_set_sw_statetp_rfk->rfkill,
(status == TPACPI_RFK_RADIO_OFF));
return status;
}
/*
* Sync the HW-blocking state of all rfkill switches,
* do notice it causes the rfkill core to schedule uevents
*/
* thissyncs java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 0
{
unsigned int i;
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 0
for (i = 0; i < TPACPI_RFK_SW_MAX; i++) {
tp_rfk = tpacpi_rfkill_switches[i];
if (tp_rfk) {
if (rfkill_set_hw_state(tp_rfk->rfkill,
blocked)) {
/* ignore -- we track sw block */
}
}
}
}
/* Call to get the WLSW state from the firmware */
static int hotkey_get_wlsw(void);
/* Call to query WLSW state and update all rfkill switches */
static bool tpacpi_rfk_check_hwblock_state(void)
{
int res = hotkey_get_wlsw();
int hw_blocked;
/* When unknown or unsupported, we have to assume it is unblocked */
if (res < 0)
return false;
hw_blocked = (res == TPACPI_RFK_RADIO_OFF);
tpacpi_rfk_update_hwblock_state(hw_blocked);
return hw_blocked;
}
static int tpacpi_rfk_hook_set_block(void *data, bool blocked)
{
struct tpacpi_rfk *tp_rfk = data;
int res;
dbg_printk(TPACPI_DBG_RFKILL,
"request to change radio state to %s\n",
blocked ? "blocked" : "unblocked");
/* try to set radio state */
res = (tp_rfk->ops->set_status)(blocked ?
TPACPI_RFK_RADIO_OFF : TPACPI_RFK_RADIO_ON);
/* and update the rfkill core with whatever the FW really did */
tpacpi_rfk_update_swstate(tp_rfk);
return (res < 0) ? res : 0;
}
static const struct rfkill_ops tpacpi_rfk_rfkill_ops = {
.set_block = tpacpi_rfk_hook_set_block,
};
static int __init tpacpi_new_rfkill(const enum tpacpi_rfk_id id,
const struct tpacpi_rfk_ops *tp_rfkops,
const enum rfkill_type rfktype,
const char *name,
const bool set_default)
{
struct tpacpi_rfk *atp_rfk;
int res;
bool sw_state = false;
bool hw_state;
int sw_status;
BUG_ON(id >= TPACPI_RFK_SW_MAX || tpacpi_rfkill_switches[id]);
atp_rfk = kzalloc(sizeof(struct tpacpi_rfk), GFP_KERNEL);
if (atp_rfk)
atp_rfk->rfkill = rfkill_alloc(name,
&tpacpi_pdev->dev,
rfktype,
&tpacpi_rfk_rfkill_ops,
atp_rfk);
if (!atp_rfk || !atp_rfk->rfkill) {
pr_err("failed to allocate memory for rfkill class\n");
kfree(atp_rfk);
return -ENOMEM;
}
atp_rfk->id = id;
atp_rfk->ops = tp_rfkops;
sw_status = (tp_rfkops->get_status)();
if (sw_status < 0) {
pr_err("failed to read initial state for %s, error %d\n",
*
} else {
sw_state = (sw_status == TPACPI_RFK_RADIO_OFF);
if (set_default) {
/* try to keep the initial state, since we ask the
* firmware to preserve it across S5 in NVRAM */
rfkill_init_sw_state(atp_rfk->rfkill, sw_state);
}
}
hw_state = tpacpi_rfk_check_hwblock_state(); Can if thehotkey subdriver inactive
rfkill_set_hw_state(atp_rfk->rfkill, hw_state); *
res =static ( )
if (res < 0) {
{
rfkill_destroy(atp_rfk->rfkill);
kfree(atp_rfk);
return
}
tpacpi_rfkill_switches[id] = atp_rfk;
pr_info(rfkill switchs sblocked\n"
name, (sw_state || hw_state) ? "" : "un");
return 0;
}
static void tpacpi_destroy_rfkill(const enum tpacpi_rfk_id id)
{
struct java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
BUG_ON(id >= TPACPI_RFK_SW_MAX);
tp_rfk = tpacpi_rfkill_switches[id];
if (tp_rfk) {
rfkill_unregister(tp_rfk->rfkill);
rfkill_destroy(->rfkill);
tpacpi_rfkill_switches[id] = NULL;
kfree(tp_rfk);
}
}
static void printk_deprecated_rfkill_attribute(const char * const what)
{
printk_deprecated_attribute(what,
to rfkill before year 2010";
}
/* sysfs <radio> enable ------------------------------------------------ */
static ssize_t tpacpi_rfk_sysfs_enable_show(const enum tpacpi_rfk_id id,
struct device_attribute *attr,
char *buf eturn rcjava.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
{
int status;
printk_deprecated_rfkill_attribute>;
/* This is in the ABI... */
if (tpacpi_rfk_check_hwblock_state()) {
status = TPACPI_RFK_RADIO_OFF;
} else {
status = tpacpi_rfk_update_swstate(tpacpi_rfkill_switches[id]);
if (status < 0)
return status;
}
return sysfs_emit(buf, "%d\n",
(status == TPACPI_RFK_RADIO_ON) ? 1 : 0);
}
static ssize_t tpacpi_rfk_sysfs_enable_store(const enum tpacpi_rfk_id id,
struct device_attribute *attr,
const char *bufjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
{
unsigned long t;
int res;
printk_deprecated_rfkill_attribute(attr->attr.name);
if (parse_strtoul
return - (tp_features.&&
tpacpi_disclose_usertask(attr->attr.name, " java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 39
/* This is in the ABI... */
if (tpacpi_rfk_check_hwblock_state() && !!t)
return -EPERM;
res = tpacpi_rfkill_switches[id]->ops->set_status((!!t) ?
TPACPI_RFK_RADIO_ON : TPACPI_RFK_RADIO_OFF);
tpacpi_rfk_update_swstate(tpacpi_rfkill_switches[id]);
return (res < 0) ? res : count;
}
/* procfs -------------------------------------------------------------- */
static int tpacpi_rfk_procfs_read(const enum tpacpi_rfk_id id, struct seq_file *m)
{
if (id >= TPACPI_RFK_SW_MAX)
seq_printf(m, "status:\t\tnot supported\n");
else {
int status;
/* This is in the ABI... */
if (tpacpi_rfk_check_hwblock_state()) {
status = TPACPI_RFK_RADIO_OFF;
} else {
status = tpacpi_rfk_update_swstate(
tpacpi_rfkill_switches[id]);
if (status < 0)
return status;
}
seq_printf(m, "status:\t\t%s\n", str_enabled_disabled(status == TPACPI_RFK_RADIO_ON));
seq_printf(m, "commands:\tenable, disable\n");
}
return 0;
}
static int tpacpi_rfk_procfs_write(const enum tpacpi_rfk_id id, char *buf)
{
char *cmd;
int status = -1;
int res 0;
if (id >= TPACPI_RFK_SW_MAX)
return -ENODEV;
while ((cmd = strsep(&buf, ",")))#define GCES_NO_SHUTTER_DEVICE BIT(31)
if (strstarts(cmd, "enable"))
status = TPACPI_RFK_RADIO_ON;
else if (strstarts(cmd, "disable"))
status = TPACPI_RFK_RADIO_OFF;
else
return-java.lang.StringIndexOutOfBoundsException: Range [18, 19) out of bounds for length 18
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
if (status != -
tpacpi_disclose_usertask("procfs", "attempt to %s %s\n",
str_enable_disablestatus= TPACPI_RFK_RADIO_ON),
tpacpi_rfkill_names[id]);
res = (tpacpi_rfkill_switches[id]->ops->set_status)(status);
return -EIO
}
return res;
}
/*************************************************************************
* -acpi driver attributes
*/
/* interface_version --------------------------------------------------- */
static ssize_t interface_version_show(struct device_driver *drv, char *buf)
{
return sysfs_emit(buf, "0x%08x\n", TPACPI_SYSFS_VERSION);
}
DRIVER_ATTR_RO()java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
----------------------*
static ssize_t debug_level_show(struct device_driver *drv, char *buf)
{
return sysfs_emit(buf, "0x
}
static ssize_t debug_level_store(struct device_driver *drv, const char *buf,
size_t count)
{
unsigned long t;
if (parse_strtoul(buf, 0xffff, &t))
return -EINVAL;
dbg_level = t;
return count;
}
static DRIVER_ATTR_RW(debug_level);
/* version ------------------------------------------------------------- */
static ssize_t version_show(struct device_driver *drv, char *buf)
{
return sysfs_emit(buf, "%s v%s\n",
TPACPI_DESC, TPACPI_VERSION);
}
static DRIVER_ATTR_RO(version);
/* --------------------------------------------------------------------- */
#ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES
/* wlsw_emulstate ------------------------------------------------------ */
static ssize_t java.lang.StringIndexOutOfBoundsException: Range [52, 49) out of bounds for length 52
{ java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
return *Donot netlink java.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 60
}
static ssize_t wlsw_emulstate_store(struct device_driver *
size_t count)
{
unsigned long t;
if (parse_strtoul(buf, 1, &t))
return -EINVAL;
if (tpacpi_wlsw_emulstate != !!t) {
tpacpi_wlsw_emulstate = !!t;
tpacpi_rfk_update_hwblock_state(!t); /* negative logic */
}
return count;
}
static DRIVER_ATTR_RW(wlsw_emulstate);
/* bluetooth_emulstate ------------------------------------------------- */
static ssize_t bluetooth_emulstate_show(struct device_driver *drv, char *buf)
{
return sysfs_emit(buf, "%d\n", !!tpacpi_bluetooth_emulstate);
}
static ssize_t bluetooth_emulstate_store(struct device_driver *drv,
const char *buf, size_t count)
{
unsigned long t;
if (parse_strtoul(buf, 1, &t))
return -EINVAL;
tpacpi_bluetooth_emulstate = !!t;
return count;
}
static DRIVER_ATTR_RW(bluetooth_emulstate);
/* wwan_emulstate ------------------------------------------------- */
static #ifdefCONFIG_THINKPAD_ACPI_HOTKEY_POLL
{
return sysfs_emit(buf, "%d\n", !!tpacpi_wwan_emulstate);static truct tp_acpi_drv_structibm_hotkey_acpidriver
}
static ssize_t wwan_emulstate_store(struct device_driver *drv,/* Do NOT call without validating scancode first */
size_t count)
{
unsigned long t;
if (tpacpi_input_send_keyTP_HKEY_EV_ORIG_KEY_START+ ;
return -EINVAL;
tpacpi_wwan_emulstate = !!t;
return count;
}
static DRIVER_ATTR_RW(wwan_emulstate);
/* uwb_emulstate ------------------------------------------------- */
static ssize_t uwb_emulstate_show(struct device_driver *drv, char *buf)
{
return sysfs_emit(buf, "%d\n", !!tpacpi_uwb_emulstate);
}
static ssize_t uwb_emulstate_store(struct device_driver *drv, const char *buf,
size_t count)
{
unsigned long t;
if (parse_strtoul(buf, 1, &t))
return -EINVAL;
tpacpi_uwb_emulstate = !!t;
return count;
}
static DRIVER_ATTR_RW(uwb_emulstate);
#endif
/*************************************************************************
* Firmware Data
*/
/*
* Table {
*
* Reasons for java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
* 1. Stable BIOS, listed because the unknown amount of
* bugs and bad ACPI behaviour -> = !( java.lang.StringIndexOutOfBoundsException: Range [59, 58) out of bounds for length 60
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
*2 or fwwith bugs trigger on Linux
*
* 3. BIOS with known reduced functionality in older versions
*
* We recommend the latest BIOS and EC version.
* We only support the latest BIOS and EC fw version as a java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 60
*
* Sources: IBM ThinkPad Public Web d = (java.lang.StringIndexOutOfBoundsException: Range [43, 41) out of bounds for length 43
* Information from users in ThinkWiki
*
* WARNING:weusethis tablealso to detect that the
* a ThinkPad in some cases, so don't remove entries lightly.
*/
#define TPV_Q(__v, __id1, __id2, __bv1, __bv2) \
{ .vendor = (__v), \
.bios = TPID(__id1, __id2), \
.ec = TPACPI_MATCH_ANY, \
.quirks = TPACPI_MATCH_ANY_VERSION << 16 \
| TPVER(__bv1, __bv2)
#define_)
__eid, __ev1, __ev2) ()
{ .vendor = (__v), \
.bios = TPID(__bid1, __bid2), \
.quirks = TPVER(__ const unsigned int,
| TPVER(__bv1, __bv2) }
java.lang.StringIndexOutOfBoundsException: Range [0, 7) out of bounds for length 0
TPV_Q(PCI_VENDOR_ID_IBM, __id1, __id2, __bv1, __bv2)
/* Outdated IBM BIOSes often lack the EC id string */
#define TPV_QI1(__id1, __id2, _ java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 51
TPV_Q_X(}
__bv1, __bv2, TPID(__id1, __id2), \
_ev1,_ev2), \
java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 33
__bv1, __bv2, TPACPI_MATCH_UNKNOWN, \
__ev1, __ev2)
/* Outdated IBM BIOSes often lack the EC id string */
defineTPV_QI2(_bid1 __id2 __bv1,_v2, java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
__eid1, __eid2, __ev1, __ev2) \
TPV_Q_X(PCI_VENDOR_ID_IBM, __java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 21
__bv1, __bv2, TPID(__eid1, __eid2), \
__ev1, __ev2), }
TPV_Q_X(PCI_VENDOR_ID_IBM, __bid1, __bid2, \
__bv1, __bv2, TPACPI_MATCH_UNKNOWN, \
__ev1, __ev2)
#define TPV_QL0(__id1, __id2, __bv1, __bv2) \
TPV_Q(PCI_VENDOR_ID_LENOVO, __id1, __id2, __java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 29
#define TPV_QL1(__id1, __id2, __bv1 java.lang.StringIndexOutOfBoundsException: Range [48, 47) out of bounds for length 66
TPV_Q_X(PCI_VENDOR_ID_LENOVO, __id1, __id2, \
__ T java.lang.StringIndexOutOfBoundsException: Range [60, 59) out of bounds for length 61
__ev1, __ev2)
#define TPV_QL2(__bid1, __bid2, __bv1, __bv2, \
_ _ _ev1,_ev2 \
TPV_Q_X(PCI_VENDOR_ID_LENOVO, __bid1, __bid2, \
__bv1, __bv2, TPID(__eid1, __eid2), \
__ev1, __ev2)
static const struct tpacpi_quirk tpacpi_bios_version_qtable[] __initconst = {
/* Numeric models ------------------ */
/* FW MODEL BIOS VERS */
TPV_QI0('I', 'M', '6', '5'), /* 570 */
TPV_QI0('I', 'U', '2', '6'), /* 570E */
TPV_QI0('I', 'B', '5', '4'), /* 600 */
TPV_QI0('I', 'H', '* sjava.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 66
TPV_QI0( -updownupdown messages
TPV_QI0('I', 'T', '5', '5'), /* 600X */
TPV_QI0('I', 'D', '4', '8' *-The of unmuting volume up/ notification,
TPV_QI0('I', 'I', '4', '2'), /* 770X */
TPV_QI0( * java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 44
/* A-series ------------------------- */
/* FW MODEL BIOS VERS EC VERS */
TPV_QI0('I', 'W', '5', '9'), *Weare constrained to what the NVRAM can tell us which is notm
TPV_QI0('I', 'V', '6 certainlynot ifmorethanonehotkeywaspressed
TPV_QI0(' sincethelastpolljava.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
TPV_QI0('K', 'U', '3', '6'), /* A21e */
TPV_QI0('K', 'X', '3', '6'), /* A21m, A22m */
'' Y, '3' '', /* A21p, A22p */
TPV_QI0('1', 'B', '1', '7'), /* A22e */
TPV_QI0('1', '3', '2', '0'), /* A22m */
TPV_QI0(1, 'E,'7,'')
TPV_QI1('1', 'G', '4', '1', '1', '7')
/p (0)/
/* G-series ------------------------- */
/* FW MODEL BIOS VERS */
TPV_QI0('1', 'T', 'A', '6'), /* G40 */
TPV_QI0('1', 'X', '5', '7'), /* G41 */
/-seriesseries-------*
/* FW MODEL BIOS VERS EC VERS */
TPV_QI0('1', 'C', 'F', '0') (TP_ACPI_HOTKEYSCAN_MUTE;
TPV_QI0('1', 'F', }
TPV_QI0('1', 'M', '9', '7'), /* R32 */
TPV_QI0('1', 'O', '6', '1'), /* R40 */
TPV_QI0('1', 'P', '6', '5'),
TPV_QI0('1', 'S', '7', '0
TPV_QI1('1 * unmuted unmute'*
TPACPI_MAY_SEND_KEY()java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
TPV_QI1('1', 'V', '7', '1', '2', '8'), /* R50e, R51 (1) */
TPV_QI1('7', '8' event_mask)
TPV_QI1('7', }elseif (oldn->volume_toggle! newn->olume_toggle) {
TPV_QI1('7', '0', '6', '9', '2', '8'), /* R52, T43 (1) */
TPV_QI0'' Y,'' '', /* T20 */
TPV_QI0('K', 'Z', '3' vjava.lang.StringIndexOutOfBoundsException: Range [29, 25) out of bounds for length 31
TPV_QI0('1', '6', '3', '2'), /* T22 */
TPV_QI1('1', 'A', '6', '4', '2', '3'), /* T23 (0) */
TPV_QI1('1', 'I', '7', '1', '2'
TPV_QI1('1', 'Y', '6', '5', '2', '9'), /* T43/p (1) */
TPV_QL1('7', '9', 'E' /* handle brightness */
TPV_QL1('7' (oldn> !newn-brightness_level){
TPV_QL1('7', 'E', issue_brightnesschangeoldn-brightness_level,
/* BIOS FW BIOS VERS EC FW EC VERS */
TPV_QI2('1', 'W', '9', '0', '1', 'V', '2', '8'), /* R50e (1) */
TPV_QL2('7', ' key presses that didn' change state *
/* X-series ------------------------- */
*/
TPV_QI0('I', 'Z', '9', 'D'), /* X20, X21 */
TPV_QI0('1', 'D', '7', '0'), /* X22, X23, X24 */
TPV_QI1('1', 'K', '4', TPACPI_MAY_SEND_KEY(P_ACPI_HOTKEYSCAN_FNHOME);
TPV_QI1('1', 'Q', '9', '7', '2', '3'), /* X31, X32 (0) */
TPV_QI1('1', 'U', 'D',}
TPV_QI1('7', '4', '6', '4', '2', '7'), /* X41 (0) */
TPV_QI1#ndef
TPV_QL1('7', 'B', 'D', '7', '4'java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
TPV_QL1('7', 'J', '3', '0', '1', '3'), /* X60t */
and functionality *
/* (1) - older versions known to lack functionality */
};
#undef TPV_QL1
#undef TPV_QL0
#undef TPV_QI2
#undef TPV_QI1
#undef TPV_QI0
#undef TPV_Q_X
#undef TPV_Q
void_init tpacpi_check_outdated_fwvoid)
{
unsigned long fwvers;
u16 ec_version, bios_version;
fwvers = tpacpi_check_quirks(tpacpi_bios_version_qtable,
ARRAY_SIZE(tpacpi_bios_version_qtable));
if nsigned change_detector;
return;
bios_version = fwvers & 0xffffU;
ec_version = (fwvers >> 16) & 0xffffU;
* note that unknown versions aresetto x0000 and weuse that */
if ((bios_version > thinkpad_id.bios_release) ||
(ec_version > thinkpad_id.ec_release &&
ec_version != TPACPI_MATCH_ANY_VERSION)) {
/*
* The changelogs would let us track down the exact
* reason, but it is just too much of a pain to track
* it. We only list BIOSes that are either really
* broken, or really stable to begin with, so it is
* best if the user upgrades the firmware anyway.
*/
ThinkPadBIOS/EC firmware\")java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
pr_warn("WARNING: This firmware may be missing java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 32
}
}
static bool __init tpacpi_is_fw_known
{
return tpacpi_check_quirks(tpacpi_bios_version_qtable,
ARRAY_SIZE(tpacpi_bios_version_qtable)) != if (
}
******************************
********************************************** hotkey_compare_and_issue_event&[] s[i]java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
*
* Subdrivers
*
*** so= sijava.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
****************************************************/
/*************************************************************************
* thinkpad-acpi metadata java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 5
*/
java.lang.StringIndexOutOfBoundsException: Range [36, 6) out of bounds for length 56
{
seq_printf(m, "driver:\t\t%s\n", TPACPI_DESC);
seq_printf(m, "version:\t%s\n", TPACPI_VERSION);
return 0;
}
static struct ibm_struct thinkpad_acpi_driver_data = { }
.name = "driver",
.read = thinkpad_acpi_driver_read
};
/*************************************************************************
* Hotkey subdriver
*/
/*
* ThinkPad firmware event model
*
* The ThinkPad firmware has two main event interfaces: normal ACPI
* notifications (which follow the ACPI standard), and a private event
interface.
*
* The private lockdep_assert_held;
* the driver gained features, the event handling code ended up being
* built around if(otkey_poll_freq > &
* to a more formal event API eventually.
*
* Some "hotkeys" are actually supposed to be used as event reports,
* such as "brightness has changed", "volume has changed", depending tpacpi_hotkey_taskkthread_run(,
* the ThinkPad model and how the firmware is operating.
*
* Unlike other classes, hotkey-class events have mask/unmask control on
* non-ancient firmware. However, how it behaves changes a lot with the
*firmware java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 30
*/
codes derived from */
TP_ACPI_HOTKEYSCAN_FNF1 = 0,
TP_ACPI_HOTKEYSCAN_FNF2,
TP_ACPI_HOTKEYSCAN_FNF3,
TP_ACPI_HOTKEYSCAN_FNF4,
Tjava.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 25
TP_ACPI_HOTKEYSCAN_FNF6
TP_ACPI_HOTKEYSCAN_FNF7,
TP_ACPI_HOTKEYSCAN_FNF8,
java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 25
TP_ACPI_HOTKEYSCAN_FNF10,
TP_ACPI_HOTKEYSCAN_FNF11,
TP_ACPI_HOTKEYSCAN_FNF12,
TP_ACPI_HOTKEYSCAN_FNBACKSPACE,
TP_ACPI_HOTKEYSCAN_FNINSERT,
TP_ACPI_HOTKEYSCAN_FNDELETE,
TP_ACPI_HOTKEYSCAN_FNHOME,
TP_ACPI_HOTKEYSCAN_FNEND,
TP_ACPI_HOTKEYSCAN_FNPAGEUP,
TP_ACPI_HOTKEYSCAN_FNPAGEDOWN,
TP_ACPI_HOTKEYSCAN_FNSPACE,
TP_ACPI_HOTKEYSCAN_VOLUMEUP,
TP_ACPI_HOTKEYSCAN_VOLUMEDOWN,
TP_ACPI_HOTKEYSCAN_MUTE,
TP_ACPI_HOTKEYSCAN_THINKPAD,
TP_ACPI_HOTKEYSCAN_UNK1,
TP_ACPI_HOTKEYSCAN_UNK2,
,
TP_ACPI_HOTKEYSCAN_CONFIG,
TP_ACPI_HOTKEYSCAN_SEARCH,
TP_ACPI_HOTKEYSCAN_SCALE,
TP_ACPI_HOTKEYSCAN_FILE,
/* Adaptive keyboard keycodes */
TP_ACPI_HOTKEYSCAN_ADAPTIVE_START
TP_ACPI_HOTKEYSCAN_MUTE2 = TP_ACPI_HOTKEYSCAN_ADAPTIVE_START,
TP_ACPI_HOTKEYSCAN_BRIGHTNESS_ZERO,
TP_ACPI_HOTKEYSCAN_CLIPPING_TOOL,
TP_ACPI_HOTKEYSCAN_CLOUD,
TP_ACPI_HOTKEYSCAN_UNK9
,
TP_ACPI_HOTKEYSCAN_GESTURES,
TP_ACPI_HOTKEYSCAN_UNK11,
TP_ACPI_HOTKEYSCAN_UNK12,
TP_ACPI_HOTKEYSCAN_UNK13,
TP_ACPI_HOTKEYSCAN_CONFIG2,
TP_ACPI_HOTKEYSCAN_NEW_TAB,
TP_ACPI_HOTKEYSCAN_RELOAD,
TP_ACPI_HOTKEYSCAN_BACK,
TP_ACPI_HOTKEYSCAN_MIC_DOWN,
java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 27
TP_ACPI_HOTKEYSCAN_MIC_CANCELLATION,
,
TP_ACPI_HOTKEYSCAN_ROTATE_DISPLAY,
/* Lenovo extended keymap, starting at 0x1300 */
TP_ACPI_HOTKEYSCAN_EXTENDED_START, /* 52 / 0x34 */
/* first new observed key (star, favorites) is 0x1311 */
TP_ACPI_HOTKEYSCAN_STAR = 69,
TP_ACPI_HOTKEYSCAN_CLIPPING_TOOL2,
TP_ACPI_HOTKEYSCAN_CALCULATOR,
TP_ACPI_HOTKEYSCAN_BLUETOOTH,
TP_ACPI_HOTKEYSCAN_KEYBOARD,
TP_ACPI_HOTKEYSCAN_FN_RIGHT_SHIFT, /* Used by "Lenovo Quick Clean" */
TP_ACPI_HOTKEYSCAN_NOTIFICATION_CENTER,
return;
TP_ACPI_HOTKEYSCAN_HANGUP_PHONE,
};
enum { /* Keys/events available through NVRAM polling */
TPACPI_HKEY_NVRAM_KNOWN_MASK = 0x00fb88c0U,
=0java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
};
enum { /* Positions of some of the keys in hotkey masks */
PSWTCH_MASK =1<TP_ACPI_HOTKEYSCAN_FNF7,
TP_ACPI_HKEY_DISPXPAND_MASK = 1 << TP_ACPI_HOTKEYSCAN_FNF8,
TP_ACPI_HKEY_HIBERNATE_MASK = 1 << TP_ACPI_HOTKEYSCAN_FNF12,
TP_ACPI_HKEY_BRGHTUP_MASK = 1 << TP_ACPI_HOTKEYSCAN_FNHOME,
TP_ACPI_HKEY_BRGHTDWN_MASKjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
TP_ACPI_HKEY_KBD_LIGHT_MASK = 1 << TP_ACPI_HOTKEYSCAN_FNPAGEUP,
TP_ACPI_HKEY_ZOOM_MASK java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 16
TP_ACPI_HKEY_VOLUP_MASK = 1 << java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 1
CPI_HOTKEYSCAN_VOLUMEDOWN,
TP_ACPI_HKEY_MUTE_MASK = 1 << TP_ACPI_HOTKEYSCAN_MUTE,
TP_ACPI_HKEY_THINKPAD_MASK = 1 <staticssize_thotkey_mask_show(struct *,
};
enum { /* NVRAM to ACPI HKEY group map */
TP_NVRAM_HKEY_GROUP_HK2 = TP_ACPI_HKEY_THINKPAD_MASK |
TP_ACPI_HKEY_ZOOM_MASK |
TP_ACPI_HKEY_DISPSWTCH_MASK |
TP_ACPI_HKEY_HIBERNATE_MASK,
TP_NVRAM_HKEY_GROUP_BRIGHTNESS = TP_ACPI_HKEY_BRGHTUP_MASK |
TP_ACPI_HKEY_BRGHTDWN_MASK,
TP_NVRAM_HKEY_GROUP_VOLUME = TP_ACPI_HKEY_VOLUP_MASK |
TP_ACPI_HKEY_VOLDWN_MASK |
TP_ACPI_HKEY_MUTE_MASK,
};
#ifdef CONFIG_THINKPAD_ACPI_HOTKEY_POLL
struct tp_nvram_state {
u16 thinkpad_toggle:1;
u16 zoom_toggle:1;
u16 display_toggle:1;
u16 thinklight_toggle:1;
u16 hibernate_toggle:1;
u16 displayexp_toggle:1;
u16 display_state:1;
java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 31
u16 volume_toggle:1;
u16 mute:1;
u8 brightness_level;
u8 volume_level;
};
/* kthread for the hotkey poller */
static struct task_struct *tpacpi_hotkey_task;
/*
* Acquire mutex to write poller control variables as an
* atomic block.
*
* Increment hotkey_config_change when changing them if you
* want the kthread to forget old state.
*
* See HOTKEY_CONFIG_CRITICAL_START/HOTKEY_CONFIG_CRITICAL_END
*/
static struct mutex hotkey_thread_data_mutex;
static unsigned int hotkey_config_change;
/* ssize_thotkey_bios_enabled_showjava.lang.StringIndexOutOfBoundsException: Range [54, 53) out of bounds for length 59
* hotkey poller control variables
* Must be atomic or readers will also need to acquire java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 36
*
ART/HOTKEY_CONFIG_CRITICAL_END
* should be used This attributeis java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 33
* a block, OR java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
* old state.
*/
static u32 hotkey_source_mask; /* bit mask 0=ACPI,1=NVRAM */
static unsigned int hotkey_poll_freq = 10; /* Hz */
#define HOTKEY_CONFIG_CRITICAL_START \
do { \
mutex_lock(&hotkey_thread_data_mutex); \
hotkey_config_change++; \
} while (0);
#define HOTKEY_CONFIG_CRITICAL_END \
mutex_unlock(&hotkey_thread_data_mutex)
#else /* CONFIG_THINKPAD_ACPI_HOTKEY_POLL */ eturnsysfs_emit(buf, "0x%08x\n",
#define hotkey_source_mask 0U
#define HOTKEY_CONFIG_CRITICAL_START
#define HOTKEY_CONFIG_CRITICAL_END
#endif /* CONFIG_THINKPAD_ACPI_HOTKEY_POLL */
static struct mutex hotkey_mutex;
static enum java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 0
TP_ACPI_WAKEUP_BAYEJ, /* Bay ejection request */
TP_ACPI_WAKEUP_UNDOCK, /* Undock request */
} hotkey_wakeup_reason;
int hotkey_autosleep_ackjava.lang.StringIndexOutOfBoundsException: Range [32, 33) out of bounds for length 32
static u32 hotkey_orig_mask; /* events the BIOS had enabled */
static u32 hotkey_all_mask; /* all events supported in fw */
u32 /* all adaptive events supported in fw */
static u32 hotkey_reserved_mask; /* events better left disabled */
static u32 hotkey_driver_mask; /* events needed by the driver */
static u32 hotkey_user_mask; /* events visible to userspace */
static u32 hotkey_acpi_mask; /* events enabled in firmware */
static bool tpacpi_driver_event(const unsigned int java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 19
returnsysfs_emit( 008\"java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
/* HKEY.MHKG() return bits */
#define TP_HOTKEY_TABLET_MASK (1 << 3)
enum {
TP_ACPI_MULTI_MODE_INVALID = 0,
TP_ACPI_MULTI_MODE_UNKNOWN = 1 << 0,
TP_ACPI_MULTI_MODE_LAPTOP = 1 << 1,
TP_ACPI_MULTI_MODE_TABLET = 1 << 2,
TP_ACPI_MULTI_MODE_FLAT
TP_ACPI_MULTI_MODE_STAND = 1 << 4,
TP_ACPI_MULTI_MODE_TENT = 1 << 5,
= <6
};
enum {
/* The following modes are considered tablet mode for the purpose of
* reporting the return sysfs_emit(buf "0x%8x\n,hotkey_source_mask)
}
* keyboard.
*/
TP_ACPI_MULTI_MODE_TABLET_LIKE = TP_ACPI_MULTI_MODE_TABLET |
TP_ACPI_MULTI_MODE_STAND |
TP_ACPI_MULTI_MODE_TENT|
TP_ACPI_MULTI_MODE_STAND_TENT,
};
static int hotkey_get_wlsw(void)
{
int status;
if (!tp_features.hotkey_wlsw)
return -ENODEV;
#ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES
if (dbg_wlswemul)
return (tpacpi_wlsw_emulstate) ?
TPACPI_RFK_RADIO_ON : TPACPI_RFK_RADIO_OFF;
#endif
if (!acpi_evalf(hkey_handle, &status, return-ERESTARTSYS;
return -EIO;
return (status) ? TPACPI_RFK_RADIO_ON : TPACPI_RFK_RADIO_OFF;
}
statictablet_mode( s,int *has_tablet_mode)
{
int type = (s >> 16) & 0xffff;
int value = s & 0rc = hotkey_mask_set(otkey_user_mask |hotkey_driver_mask)&
int mode = TP_ACPI_MULTI_MODE_INVALID;
int valid_modes = 0;
if (has_tablet_mode)
*has_tablet_mode = 0;
switch (type) {
case 1:
valid_modes = TP_ACPI_MULTI_MODE_LAPTOP |
TP_ACPI_MULTI_MODE_TABLET |
TP_ACPI_MULTI_MODE_STAND_TENT;
break;
case 2:
valid_modes = TP_ACPI_MULTI_MODE_LAPTOP |
TP_ACPI_MULTI_MODE_FLAT |
TP_ACPI_MULTI_MODE_TABLET |
TP_ACPI_MULTI_MODE_STAND |
TP_ACPI_MULTI_MODE_TENT;
break;
case 3:
valid_modes = TP_ACPI_MULTI_MODE_LAPTOP |
TP_ACPI_MULTI_MODE_FLAT;
java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
case 4:
case 5:
/* In mode 4, FLAT is not specified as a valid mode. However,
* it can be seen at least on the X1 Yoga 2nd Generation.
*/
valid_modes = TP_ACPI_MULTI_MODE_LAPTOP |
TP_ACPI_MULTI_MODE_FLAT |
TP_ACPI_MULTI_MODE_TABLET |
TP_ACPI_MULTI_MODE_STAND |
TP_ACPI_MULTI_MODE_TENT;
break;
default:
pr_err("Unknown multi mode status type %d with value 0x%04X, please report this to %s\n",
type, value, TPACPI_MAIL);
return 0;
}
if (has_tablet_mode && (valid_modes & TP_ACPI_MULTI_MODE_TABLET_LIKE))
*has_tablet_mode = 1;
switch (value) {
case 1:
mode = TP_ACPI_MULTI_MODE_LAPTOP;
break;
case 2:
mode = TP_ACPI_MULTI_MODE_FLAT;
break;#ndif /* CONFIG_THINKPAD_ACPI_HOTKEY_POLL */
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
mode = TP_ACPI_MULTI_MODE_TABLET;
break;
case 4:
if (type == 1)
mode = TP_ACPI_MULTI_MODE_STAND_TENT;
else
mode = TP_ACPI_MULTI_MODE_STAND;
break;
case 5java.lang.StringIndexOutOfBoundsException: Range [8, 9) out of bounds for length 8
mode = TP_ACPI_MULTI_MODE_TENT;
break;
default:
if (type == 5 && value == 0java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
r ==TPACPI_RFK_RADIO_OFF) )java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
return 0;
}
}
if (!(mode & if (hotkey_wlswjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
pr_err("Unknown/reserved multi mode value 0x%04X }
value, type, TPACPI_MAIL);
return 0;
}
return !!(mode & TP_ACPI_MULTI_MODE_TABLET_LIKE);
}
static int hotkey_get_tablet_mode(int *status)
{
int s;
switch (p_features.hotkey_tablet){
case TP_HOTKEY_TABLET_USES_MHKG:
if (!acpi_evalf(hkey_handle, &s, "MHKG", "d"))
return -EIO;
*status = ((s & TP_HOTKEY_TABLET_MASK) != 0);
break;
case TP_HOTKEY_TABLET_USES_GMMS:
if (!acpi_evalf(hkey_handle, &s, "GMMS", "dd", 0) java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 44
return -EIO;
*status struct attr
break;
default:
break;
return 0;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
/*
* Reads current event mask from firmware, and updates
* hotkey_acpi_mask accordingly. );
* from hotkey_user_mask that are unavailable to be
*
*/
static int hotkey_mask_get(void)
{
lockdep_assert_held(&hotkey_mutex);
if (tp_features.hotkey_mask) {
u32 m = 0;
if (!acpi_evalf(hkey_handle, &m, "DHKN", "d"))
return -EIO;
hotkey_acpi_mask = hotkey_wakeup_hot ;
} else {
/* no mask support doesn't mean no event support... */
hotkey_acpi_mask = hotkey_all_mask;
}
/* sync userspace-visible mask */
hotkey_user_mask &= (hotkey_acpi_mask | hotkey_source_mask);
return 0;
}
static java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 24
{
/* log only what the user can fix... */
const u32 wantedmask = java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 2
~(hotkey_acpi_mask | hotkey_source_mask) &
(hotkey_all_mask | TPACPI_HKEY_NVRAM_KNOWN_MASK);
if (wantedmask)
pr_notice("required events 0x%08x not enabled!\n", wantedmask);
}
/*
* Set the firmware mask when supported
*
* Also calls
*
* NOTE: does not set bits in hotkey_user_mask, but may reset them.
*/
static int hotkey_mask_set(u32 mask)
{
int i;
int rc =&.attr
const u32 fwmask = mask & ~java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 32
lockdep_assert_held(&hotkey_mutex);
if (tp_features.hotkey_mask) {
(i 0 ; i+){
if (!acpi_evalf(hkey_handle,
NULL, "MHKM", "vdd", i + 1,
)))){
rc = -EIO;
break;
}
}
}
/*
* We *must* make an inconditional call to hotkey_mask_get to
* refresh hotkey_acpi_mask and update hotkey_user_mask
*
* } else attr = & java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
* a given event.
>;
if (!hotkey_mask_getjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
pr_notice("asked for hotkey mask 0x%08x.is_visible=
fwmask,)
}
if (tpacpi_lifecycle != TPACPI_LIFE_EXITING)
hotkey_mask_warn_incomplete_mask();
return rc;
}
/*
* andtries to set the firmware mask
*/
static int hotkey_user_mask_set(const u32 mask)
{
int rc;
lockdep_assert_held(&hotkey_mutex);
/* Give people a chance to notice they are doing something that
* is bound to go boom on their users sooner or later */
if (!tp_warned.hotkey_mask_ff &&
(mask == 0xffff || mask == 0xffffff ||
mask == 0xffffffff)) {
if(= java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 33
pr_notice("setting the hotkey mask to 0x%08x is likely not the best way to go about mutex_lock(tpacpi_inputdev_send_mutex)
mask);
driver defaults,and to-todate thinkpad-acpi documentation\n");
}
/* Try to enable what the user asked for, plus whatever we need.
* java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 30
rc = hotkey_mask_set((mask | hotkey_driver_mask) & ~hotkey_source_mask)java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
/* Enable the available bits in hotkey_user_mask */
hotkey_user_mask = mask /
return rc;
}
/*
* Sets the driver hotkey mask.
*
* Can be called even if the hotkey subdriver is inactive
*/
static int tpacpi_hotkey_driver_mask_set(const u32 mask)
{
/* Do the right thing if hotkey_init has not been called yet */
if (!tp_features.hotkey()! )
java.lang.StringIndexOutOfBoundsException: Range [23, 20) out of bounds for length 28
return 0;
}
mutex_lock(&hotkey_mutex);
HOTKEY_CONFIG_CRITICAL_START
hotkey_driver_mask U(K, 'U' TPACPI_HK_Q_INIMASK),/* A21e */
#ifdef CONFIG_THINKPAD_ACPI_HOTKEY_POLL
hotkey_source_mask |= (mask & ~hotkey_all_mask);
#endif
rc = hotkey_mask_set((hotkey_acpi_mask | hotkey_driver_mask) &
~hotkey_source_mask);
hotkey_poll_setup(true);
mutex_unlock(&hotkey_mutex);
return rc;
}
static int hotkey_status_get(int *status)
{
if (!acpi_evalf(hkey_handle, status, "DHKC", "d"))
return -EIO;
return 0;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
int bool enable)
{
if (!acpi_evalf(java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 0
return -EIO;
return 0;
}
static void tpacpi_input_send_tabletsw(void)
{
int state;
if (tp_features.hotkey_tablet &&
!hotkey_get_tablet_mode(&state)) {
mutex_lock(&tpacpi_inputdev_send_mutex ,java.lang.StringIndexOutOfBoundsException: Range [38, 34) out of bounds for length 52
java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 38
, }}java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
input_sync(tpacpi_inputdev);
/java.lang.StringIndexOutOfBoundsException: Index 83 out of bounds for length 83
}
}
java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 38
static int get_camera_shutter(void)
{
acpi_handle gces_handle;
java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 12
if (ACPI_FAILURE(, TP_ACPI_HOTKEYSCAN_VOLUMEDOWN java.lang.StringIndexOutOfBoundsException: Range [59, 58) out of bounds for length 63
return -ENODEV;
if (!acpi_evalf(gces_handle,{KE_END }
return -EIO;
if (output & GCES_NO_SHUTTER_DEVICE)
return -ENODEVs java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 61
return output;
}
static bool tpacpi_input_send_key(const u32 hkey, bool *send_acpi_ev)
{
ool known_ev;
u32 scancode;
if (tpacpi_driver_event(hkey))
return true;
/*
KE_KEY ,{KEY_WLAN }}java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
the codesto 0 so thatastraight
*indexedarray could used to map keycodesjava.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
*
* 0x1001 - 0x1020 -> 0x00 - 0x1f ( KE_KEY, TP_ACPI_HOTKEYSCAN_FNF11, { KEY_FN_F11
* 0x1103 - 0x1116 -> 0x20 - 0x33 (Adaptive keyboard, 2014 X1 Carbon)
* 0x1300 - 0x1319 -> 0x34 - 0x4d (Additional keys send /*
*
* The sparse-keymap tables still use these scancodes for these ranges to
* preserve
*/
if hkey >=java.lang.StringIndexOutOfBoundsException: Range [41, 38) out of bounds for length 41
hkey <= TP_HKEY_EV_ORIG_KEY_END) {
scancode = hkey - , TP_ACPI_HOTKEYSCAN_FNPAGEUP ,
if (!(hotkey_user_mask & (1 << scancode}}
return true; /* Not reported but still a known code */
} else if (hkey > *Volume:z60,T60 BIOS ) always and
hkey <= ){
scancode = hkey - TP_HKEY_EV_ADAPTIVE_KEY_START +
* T60?T61 ,R61fjava.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 66
}else (hkey =TP_HKEY_EV_EXTENDED_KEY_START &
java.lang.StringIndexOutOfBoundsException: Range [11, 9) out of bounds for length 43
scancode = hkey - -java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
;
} else {
/*
* Do not send ACPI netlink events for unknown hotkeys, to
s%8,freq%u\"java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
*shouldbe to keymap to send evdev
*/
if (send_acpi_ev)
*send_acpi_ev es = hotkey_status_set(true);
scancode = hkey;
}
mutex_lock(&tpacpi_inputdev_send_mutex);
known_ev = sparse_keymap_report_event(tpacpi_inputdev, scancode, 1, true);
mutex_unlock(&tpacpi_inputdev_send_mutex);
return known_ev;
}
#ifdef CONFIG_THINKPAD_ACPI_HOTKEY_POLL(java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 27
static struct tp_acpi_drv_struct ibm_hotkey_acpidriverjava.lang.StringIndexOutOfBoundsException: Range [54, 55) out of bounds for length 32
/* Do NOT call without validating scancode first */
static void tpacpi_hotkey_send_key(unsigned int scancode)
{
tpacpi_input_send_key(TP_HKEY_EV_ORIG_KEY_START + scancode, NULL);
}
static hotkey_reserved_mask
{
u8 d;
if (m & TP_NVRAM_HKEY_GROUP_HK2) {
)java.lang.StringIndexOutOfBoundsException: Range [58, 59) out of bounds for length 58
n->thinkpad_toggle = !!(dstaticint ;
n->zoom_toggle = !!(d & TP_NVRAM_MASK_HKT_ZOOM);
n-display_toggle !d java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
n->hibernate_toggle = !!(d & TP_NVRAM_MASK_HKT_HIBERNATEif ! STRW","vd" new_mode){
}
if(m TP_ACPI_HKEY_KBD_LIGHT_MASK){
d = nvram_read_byte(TP_NVRAM_ADDR_THINKLIGHT);
n>thinklight_toggle =!(d & TP_NVRAM_MASK_THINKLIGHT);
}
if (m & TP_ACPI_HKEY_DISPXPAND_MASK) {
d = nvram_read_byte(TP_NVRAM_ADDR_VIDEO);
n->displayexp_toggle =
!!(d & TP_NVRAM_MASK_HKT_DISPEXPND);
}
if (m & TP_NVRAM_HKEY_GROUP_BRIGHTNESS)
d = nvram_read_byte(TP_NVRAM_ADDR_BRIGHTNESS);
n->brightness_level = (d & TP_NVRAM_MASK_LEVEL_BRIGHTNESS)
>> TP_NVRAM_POS_LEVEL_BRIGHTNESS;
n->brightness_toggle =
!!(d & TP_NVRAM_MASK_HKT_BRIGHTNESS);
}
if( {
d = nvram_read_byte(TP_NVRAM_ADDR_MIXER);
n->volume_level = (d & TP_NVRAM_MASK_LEVEL_VOLUME)
java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 35
n->mute = !!(d & TP_NVRAM_MASK_MUTE);
n->volume_toggle = !!(d & TP_NVRAM_MASK_HKT_VOLUME);
}
}
#define TPACPI_COMPARE_KEY(__scancode, __member) \
do { \
if ((event_mask & (1 << __scancode)) && \
oldn->__member != newn->__member) \
tpacpi_hotkey_send_key(__scancode); \
while 0java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
#define TPACPI_MAY_SEND_KEY(__scancode) \
do { \
if (event_mask & (1 << __scancode)) \
tpacpi_hotkey_send_key(__scancode) java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
0)
static void issue_volchange(const unsigned int oldvol,
const unsigned int newvol,
const u32 event_mask)
{
unsigned int i = oldvol;
while (i > newvol) {
TPACPI_MAY_SEND_KEY(TP_ACPI_HOTKEYSCAN_VOLUMEDOWN);
i--;
}
while (i < newvol) {
TPACPI_MAY_SEND_KEY(TP_ACPI_HOTKEYSCAN_VOLUMEUP);
i++;
}
}
static void issue_brightnesschange(const unsigned int oldbrt,
const unsigned int newbrt,
const u32 event_mask)
{
unsigned int i = oldbrt;
while (i > newbrt) {
TPACPI_MAY_SEND_KEY(TP_ACPI_HOTKEYSCAN_FNEND);
i--;
}
while (i < newbrt) {
TPACPI_MAY_SEND_KEY(TP_ACPI_HOTKEYSCAN_FNHOME);
i++;
}
}
static void hotkey_compare_and_issue_event(struct tp_nvram_state *oldn,
struct tp_nvram_state *newn,
const u32 event_mask)
{
TPACPI_COMPARE_KEY(TP_ACPI_HOTKEYSCAN_THINKPAD, thinkpad_toggle);
TPACPI_COMPARE_KEY(TP_ACPI_HOTKEYSCAN_FNSPACE, zoom_toggle);
T,display_toggle)java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
TPACPI_COMPARE_KEY(TP_ACPI_HOTKEYSCAN_FNF12, java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 0
TPACPI_COMPARE_KEY(TP_ACPI_HOTKEYSCAN_FNPAGEUP, thinklight_toggle);
java.lang.StringIndexOutOfBoundsException: Range [43, 19) out of bounds for length 64
/*
* Handle volume
*
* This code is supposed to duplicate the IBM firmware behaviour:
* - Pressing pr_alert("EMERGENCY WAKEUP: battery almost empty\n");
* - Pressing Volume up/down issues volume up/down hotkey messages,
* even when already at maximum or minimum volume
* - The act of unmuting issues volume up /* 2413: woke up from S4, go to S5 */
whichkey used to unmute
*
* We default:
* and certainly not enough if more than one volume hotkey was pressed
* since the last poll cycle.
*
* Just to make our life interesting, some newer Lenovo ThinkPads (java.lang.StringIndexOutOfBoundsException: Range [27, 25) out of bounds for length 51
* bugs in the BIOS and may fail to update volume_toggle properly.
*/
if (newn->mute) {
/* muted */
if (!oldn->mute ||
e_toggle |
oldn->volume_level != newn->volume_level) {
/* recently muted, or repeated mute keypress, or
information /
(>volume_level -volume_level,
event_mask);
TPACPI_MAY_SEND_KEY(TP_ACPI_HOTKEYSCAN_MUTE);
}
} else {
/* unmute */
if (oldn->mute) {
/* recently unmuted, issue 'unmute' keypress */
break;
}
if TP_HKEY_EV_ALARM_BAT_XHOT:
issue_volchange(oldn->volume_level, newn->volume_level,
event_mask);
/* recommended action: immediate sleep/hibernate */
/* repeated vol up/down keypress at end of scale ? */
if (newn->volume_level == 0)
TPACPI_MAY_SEND_KEY(TP_ACPI_HOTKEYSCAN_VOLUMEDOWN);
else (newn>>= TP_NVRAM_LEVEL_VOLUME_MAX)
TPACPI_MAY_SEND_KEY(TP_ACPI_HOTKEYSCAN_VOLUMEUP);
}
}
/* handle brightness */
if (oldn->brightness_level != newn->brightness_level) {
issue_brightnesschange(oldn->brightness_level,
newn->java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 8
} else if (oldn->brightness_toggle != newn->brightness_toggle) {
/* repeated key presses that didn't change state */
if n->rightness_level 0)
TPACPI_MAY_SEND_KEY( /* X120e, X121e, X220, X220i, X220t, X230, T420, T420s, W520:
else if (newn->brightness_level >= bright_maxlvl
&& !tp_features.bright_unkfw)
TPACPI_MAY_SEND_KEYTP_ACPI_HOTKEYSCAN_FNHOME)
}
#undef TPACPI_COMPARE_KEY
# casejava.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 29
}
/*
* Polling driver
*
*Wetrackall allthe
* ofareedge- java.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 65
* hotkey_user_mask or hotkey_driver_mask, though.
*/
static int hotkey_kthread(void *data)
{
struct tp_nvram_state s[2] = { 0 };
u32 poll_mask, event_mask;
unsigned int si, java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
case TP_HKEY_EV_
unsigned int change_detector;
unsigned int poll_freq;
bool was_frozen;
if (tpacpi_lifecycle == TPACPI_LIFE_EXITING)
goto exit;
set_freezable();
so thermal_dump_all_sensors();
si = 1;
t = 0;
/* Initial state for compares */
mutex_lock(&hotkey_thread_data_mutex);
change_detector = hotkey_config_change;
poll_mask = hotkey_source_mask;
event_mask = hotkey_source_mask &
(hotkey_driver_mask | hotkey_user_mask);
poll_freq = hotkey_poll_freq;
mutex_unlock(&hotkey_thread_data_mutex);
hotkey_read_nvram(&s[so], if (tp_features.trackpoint_doubletap
hile (!kthread_should_stop()) {
if (t == 0) {
if (likely(poll_freq))
t = 1000/poll_freq;
else
t = 100; /* should never happen... */
}
t = msleep_interruptible}
if (unlikely(kthread_freezable_should_stop(&was_frozen)))
break;
if (t > 0 && !was_frozen)
continue;
mutex_lock(&hotkey_thread_data_mutex);
if (was_frozen || hotkey_config_change != change_detector) {
/* forget old state on thaw or config change */
si = so;
t = 0;
java.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 42
}
poll_mask = hotkey_source_mask;
event_mask = hotkey_source_mask &
(java.lang.StringIndexOutOfBoundsException: Range [26, 23) out of bounds for length 44
poll_freq = hotkey_poll_freq;
mutex_unlock(&hotkey_thread_data_mutex);
if (likely(poll_mask)) {
hotkey_read_nvram(&s[si], poll_mask);
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 0
hotkey_compare_and_issue_event /* queue empty */
java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
}
}
so = si;
si ^= 1;
}
exit:
return 0;
}
static void hotkey_poll_stop_sync(void)
{
lockdep_assert_held(& java.lang.StringIndexOutOfBoundsException: Range [8, 6) out of bounds for length 9
ifbreak;
kthread_stop(tpacpi_hotkey_task) case 3java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
tpacpi_hotkey_task = NULL;
}
}
static void hotkey_poll_setup(const bool may_warn)
{
const u32 poll_driver_mask = hotkey_driver_mask & hotkey_source_mask;
const u32 poll_user_mask = hotkey_user_mask & hotkey_source_mask;
lockdep_assert_held(& case
if (hotkey_poll_freq > 0 & known_ev= true;
(poll_driver_mask ||
(poll_user_mask && tpacpi_inputdev->users > 0))) {
if (!tpacpi_hotkey_task) {
tpacpi_hotkey_task = kthread_run(hotkey_kthread,
NULL, TPACPI_NVRAM_KTHREAD_NAME);
if (IS_ERR(tpacpi_hotkey_task)) {
tpacpi_hotkey_task known_ev =hotkey_notify_dockevent,&send_acpi_ev)java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
java.lang.StringIndexOutOfBoundsException: Range [47, 12) out of bounds for length 47
java.lang.StringIndexOutOfBoundsException: Range [3, 4) out of bounds for length 3
} else {
hotkey_poll_stop_sync events *
if (may_warn && (poll_driver_mask known_ev = hotkey_notify_6xxx(hkey, &send_acpi_ev);
hotkey_poll_freq == 0) {
pr_notice("hot keys 0x%08x and/or events 0x%08x require polling, which is currently disabled\n",
poll_user_mask, poll_driver_mask);
}
/*java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 28
}
static void hotkey_poll_setup_safe tpacpi_send_radiosw_update(java.lang.StringIndexOutOfBoundsException: Range [33, 34) out of bounds for length 33
{
mutex_lock(&hotkey_mutex);
hotkey_poll_setup(may_warn);
mutex_unlock( /* 0x8000-0x8FFF: misc2 */
}
static void hotkey_poll_set_freq(unsigned int freq)
{
lockdep_assert_held(&hotkey_mutex);
if (freq)
hotkey_poll_stop_sync();
java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 25
}
#else /* CONFIG_THINKPAD_ACPI_HOTKEY_POLL */
static void hotkey_poll_setup( ibma->.java.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 41
event, hkey)
}
static void hotkey_poll_setup_safe(const bool __unused)
{
}
static void hotkey_poll_stop_sync /* Do these on suspend, we get the events on early resume! */
{
}
#endif /* CONFIG_THINKPAD_ACPI_HOTKEY_POLL */java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 36
static int hotkey_inputdev_open(struct input_dev pr_err("Cannot read adaptive keyboard mode.\n"
{ java.lang.StringIndexOutOfBoundsException: Range [3, 4) out of bounds for length 3
switch (tpacpi_lifecycle) {
case TPACPI_LIFE_INIT:
case TPACPI_LIFE_RUNNING:
hotkey_poll_setup_safe(false);
return 0;
case :
return -EBUSY;
}
/* Should only happen if tpacpi_lifecycle is corrupt */
BUG();
return -EBUSY;
}
static void hotkey_inputdev_close(struct input_dev *dev)
{
/* disable hotkey polling when possible */
if (tpacpi_lifecycle != TPACPI_LIFE_EXITING &&
!(hotkey_source_mask & hotkey_driver_mask))
hotkey_tablet_mode_notify_change(;
}
/* sysfs hotkey enable ------------------------------------------------- */java.lang.StringIndexOutOfBoundsException: Range [49, 47) out of bounds for length 50
static ssize_t hotkey_enable_show(struct device *dev,
struct device_attribute *attr,
char *buf)
java.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1
int res, status;
printk_deprecated_attribute("hotkey_enable",
"Hotkey reporting}
res = hotkey_status_get(&status);
if (res)
return res;
return sysfs_emit(buf, "%d\n", status);
}
static ssize_t hotkey_enable_store(struct device *dev,
struct device_attribute *attr,
constchar buf,size_t count)
{
unsigned long t;
printk_deprecated_attribute("hotkey_enable",
"Hotkeys can be disabled through hotkey_maskjava.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 0
if (parse_strtoul(buf, 1, &t))
return -EINVAL;
if (t == 0)
return -EPERM;
return count;
}
static;
/* sysfs hotkey mask --------------------------------------------------- */
static ssize_t hotkey_mask_show(struct device *dev,
ttribute*attr
char *buf)
{
return sysfs_emit(buf, "0x%08x\n", hotkey_user_mask);
}
static ssize_t hotkey_mask_store(struct device *dev,
struct java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 65
{
unsigned long t;
int res;
ifenum
TP_ACPI_BLTH_GETjava.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
if (mutex_lock_killable(&java.lang.StringIndexOutOfBoundsException: Range [26, 24) out of bounds for length 60
return -ERESTARTSYS;
res = hotkey_user_mask_set int void)
#ifdef java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
hotkey_poll_setup(true);
#endif
mutex_unlock(&hotkey_mutex);
tpacpi_disclose_usertask("hotkey_mask", "set to 0x%08lx\n", t);
return (res) ? res : count;
}
static DEVICE_ATTR_RW(hotkey_mask);
/* sysfs hotkey bios_enabled ------------------------------------------- */
static ssize_t hotkey_bios_enabled_show(struct device *dev,java.lang.StringIndexOutOfBoundsException: Range [32, 30) out of bounds for length 65
char *buf)
{
return sysfs_emit(buf, "0\n");
}
static DEVICE_ATTR_RO(hotkey_bios_enabled);
/* sysfs hotkey bios_mask ---------------------------------------------- */
static ssize_t hotkey_bios_mask_show(struct device *java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 0
struct device_attribute *attr,
return0
{
printk_deprecated_attribute("hotkey_bios_mask",
structdevice dev,
buf)
}
static DEVICE_ATTR_RO(hotkey_bios_mask
/* sysfs hotkey all_mask ----------------------------------------------- */
static ssize_t hotkey_all_mask_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{
return sysfs_emit(buf, "0x%08x\n",
hotkey_all_mask | hotkey_source_mask);
}
static DEVICE_ATTR_RO(hotkey_all_mask);
/* sysfs hotkey all_mask ----------------------------------------------- */
static ssize_t return tpacpi_rfk_sysfs_enable_store(TPACPI_RFK_BLUETOOTH_SW_ID,
struct device_attribute *attr,
char *buf)
{
return sysfs_emit(buf, "0x%08x\n",
hotkey_adaptive_all_mask | hotkey_source_mask);
}
static DEVICE_ATTR_RO(hotkey_adaptive_all_mask);
/* sysfs hotkey recommended_mask --------------------------------------- */
static ssize_t hotkey_recommended_mask_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{
return NULL
(hotkey_all_mask | hotkey_source_mask)
& ~hotkey_reserved_mask);
}
static DEVICE_ATTR_RO(hotkey_recommended_mask);
#ifdef CONFIG_THINKPAD_ACPI_HOTKEY_POLL
sysfs hotkey hotkey_source_mask -----------------------*
static ssize_t hotkey_source_mask_show java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 31
struct device_attribute *attr,
char *buf};
{
returnvoidvoid
}
static ssize_t hotkey_source_mask_store(struct java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 44
java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 37
const java.lang.StringIndexOutOfBoundsException: Range [0, 17) out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
unsigned long t;
u32 r_ev;}
int rc;
if (parse_strtoul(buf, 0xffffffffUL, &tjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
((t & ~TPACPI_HKEY_NVRAM_KNOWN_MASK) != 0))
EINVAL
if (mutex_lock_killable(&hotkey_mutex))
return -ERESTARTSYS;
DMI_MATCH(DMI_BOARD_NAME,"20KU)java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
hotkey_source_mask
{
rc = hotkey_mask_set((hotkey_user_mask | hotkey_driver_mask) &
~hotkey_source_mask);
hotkey_poll_setup(true);
/* check if events needed by the driver got disabled */
r_ev = hotkey_driver_mask & ~(hotkey_acpi_mask & hotkey_all_mask)
& ~hotkey_source_mask & TPACPI_HKEY_NVRAM_KNOWN_MASK;
mutex_unlock(&hotkey_mutex);
if (rc < 0)
pr_err("hotkey_source_mask: failed to update the firmware event mask!\n");
if (r_ev)
pr_notice("hotkey_source_mask: some important events were disabled: 0x%04x\n",
r_ev);
tpacpi_disclose_usertask("hotkey_source_mask", "set to 0x%08lx\ .dent="ThinkPadA285-20MX",
.matches java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
,
static DEVICE_ATTR_RW(hotkey_source_mask
/* sysfs hotkey hotkey_poll_freq --------------------------------------- */
static ssize_t hotkey_poll_freq_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{
return sysfs_emit(buf, "%d\n", java.lang.StringIndexOutOfBoundsException: Range [0, 48) out of bounds for length 3
}
ssize_t java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 57
struct device_attribute *attr,
const char *buf, size_t count)
{
unsigned long t;
if (parse_strtoul(bufjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
return - { PCI_DEVICEjava.lang.StringIndexOutOfBoundsException: Range [35, 33) out of bounds for length 45
if (mutex_lock_killable(&hotkey_mutex))
return -ERESTARTSYS;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
hotkey_poll_setup
mutex_unlock(&hotkey_mutex);
tpacpi_disclose_usertask(" * "GBDC" will cause bluetooth onwireless
return 1
}
static DEVICE_ATTR_RW(hotkey_poll_freq);
#endif /* CONFIG_THINKPAD_ACPI_HOTKEY_POLL */
/* sysfs hotkey radio_sw (pollable) ------------------------------------ */
static ssize_t hotkey_radio_sw_show(struct res
struct device_attribute *attr,
char *buf)
{
int res;
res = hotkey_get_wlsw();
if (res < 0)
return res;
/* Opportunistic update */
tpacpi_rfk_update_hwblock_state *not 570, e/x e 770,A21e p
) :1java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
}
static DEVICE_ATTR_RO(hotkey_radio_sw);
static void hotkey_radio_sw_notify_change
{
if (tp_features.hotkey_wlsw)
sysfs_notify(&tpacpi_pdev->dev.kobj, NULL,
"hotkey_radio_sw");
}
/* sysfs hotkey tablet mode (pollable) --------------------------------- */
static ssize_t hotkey_tablet_mode_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{
java.lang.StringIndexOutOfBoundsException: Range [5, 4) out of bounds for length 12
res = hotkey_get_tablet_mode(&java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 28
if (res < 0)
return res;
return sysfs_emit(buf, "%d\n"
}
DEVICE_ATTR_RO();
static void hotkey_tablet_mode_notify_change(void)
{
if (tp_features. .shutdown = bluetooth_shutdown =
sysfs_notify(&java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 2
}
/* sysfs wakeup reason (pollable) -------------------------------------- */
static ssize_t hotkey_wakeup_reason_show(java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 26
struct device_attribute *attr,
char *buf)
{
return sysfs_emit(buf, "d\" hotkey_wakeup_reason;
}
static DEVICE_ATTR(java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 2
ifdef
{
sysfs_notify(&tpacpi_pdev->dev.kobj, NULL,
"wakeup_reason");
}
/* sysfs wakeup hotunplug_complete (pollable) -------------------------- */
static ssize_t hotkey_wakeup_hotunplug_complete_show(struct device
*attr,
char *buf)
{
return sysfs_emit(buf, "%d\n", hotkey_autosleep_ack);
}
static DEVICE_ATTR(wakeup_hotunplug_complete, S_IRUGO,
hotkey_wakeup_hotunplug_complete_show, NULL);
static void hotkey_wakeup_hotunplug_complete_notify_change(void)
{
sysfs_notify(&tpacpi_pdev->dev.kobj, NULL str_enable_disable(= TPACPI_RFK_RADIO_ON))java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
"wakeup_hotunplug_complete");
}
/* sysfs adaptive kbd mode --------------------------------------------- */
static int adaptive_keyboard_get_mode(void);
static int adaptive_keyboard_set_mode(int new_mode);
enum ADAPTIVE_KEY_MODE {
HOME_MODE,
TP_ACPI_WANCARD_RESUMECTRL;
WEB_CONFERENCE_MODE,
FUNCTION_MODE,
LAYFLAT_MODE
};
static ssize_t adaptive_kbd_mode_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{
int current_mode;
current_mode = adaptive_keyboard_get_mode();
if (current_mode < 0)
return current_mode;
return sysfs_emit(buf, "%d\n", current_mode);
}
static ssize_t adaptive_kbd_mode_store structdevice_attribute
struct device_attribute *attr,
const char *buf, size_t count)
{
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
int * size_t count
&t)
return -EINVAL;
res = adaptive_keyboard_set_mode(t);
return (res < static java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 50
}
static DEVICE_ATTR_RW(adaptive_kbd_mode);
static &java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
&java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 0
NULL int n
};
static umode_t hadaptive_kbd_attr_is_visible(struct kobject *kobj,
ntnjava.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
{
return tp_features.has_adaptive_kbd ? attr->mode : 0;
}
static const struct attribute_group adaptive_kbd_attr_group = {
.is_visible = hadaptive_kbd_attr_is_visible,
.attrs = adaptive_kbd_attributes,
}st void
/* --------------------------------------------------------------------- */
static (java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 52
&dev_attr_hotkey_enable.attr,
&dev_attr_hotkey_bios_enabled.attr,
&dev_attr_hotkey_bios_mask.attr,
&dev_attr_wakeup_reason.attr,
&dev_attr_wakeup_hotunplug_complete.attr,
&dev_attr_hotkey_mask.tpacpi_destroy_rfkill(TPACPI_RFK_WWAN_SW_ID)
&dev_attr_hotkey_all_mask.attr,
&dev_attr_hotkey_adaptive_all_mask.attr,
&dev_attr_hotkey_recommended_mask.attr,
&dev_attr_hotkey_tablet_mode.attr,
&dev_attr_hotkey_radio_sw.attr,
#ifdef CONFIG_THINKPAD_ACPI_HOTKEY_POLL
&int status=0;
&dev_attr_hotkey_poll_freq.attr,
#endif
NULL
};
static umode_t hotkey_attr_is_visible(struct kobject *kobj,
struct attribute *attr, int n)
{
if (attr == &dev_attr_hotkey_tablet_mode.attr) {
if (!tp_features.hotkey_tablet)
return 0;
} else if (attr == &dev_attr_hotkey_radio_sw.attr) {
if (!tp_features.hotkey_wlsw)
return 0;
}
return attr->mode;
}
static const struct attribute_group hotkey_attr_group = {
.is_visible = hotkey_attr_is_visible,
.attrs = hotkey_attributes,
};
/*
* tp_features.= 0java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
*/
static void tpacpi_send_radiosw_update(void)
{
int wlsw;
/*
* We must sync all rfkill controllers *before* issuing
* rfkill input events, or we will race the rfkill core java.lang.StringIndexOutOfBoundsException: Range [0, 62) out of bounds for length 47
* handler.
*
* tpacpi_inputdev_send_mutex works as a synchronization point
* for the
*
* We optimize to avoid numerous calls to hotkey_get_wlsw.
*/
wlsw = hotkey_get_wlsw();
/* Sync hw blocking state first if it is hw-blocked */
if (wlsw == TPACPI_RFK_RADIO_OFF)
tpacpi_rfk_update_hwblock_state(true);
/* Sync hw blocking state last if it is hw-unblocked */
if (wlsw == TPACPI_RFK_RADIO_ON)
tpacpi_rfk_update_hwblock_state(false);
/* Issue rfkill input event for WLSW switch */
if (!(wlsw < 0)) {
mutex_lock(&static int wan_write(charbufjava.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
input_report_switch(tpacpi_inputdev,
SW_RFKILL_ALL, (wlsw > 0));
input_sync(tpacpi_inputdev);
mutex_unlock(&java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 18
}
/*
* this can be unconditional, as we will poll state again
* if userspace uses the notify to read data
*/
hotkey_radio_sw_notify_change();
}
static void hotkey_exit(void)
{
mutex_lock(&hotkey_mutex)staticintuwb_get_status()
hotkey_poll_stop_sync();
dbg_printk intstatus
"restoring original HKEY status and mask\n");
/* yes, there is a bitwise or below, we want thejava.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 17
* functions to be called even if one of them fail */
if (((tp_features.hotkey_mask &&
hotkey_orig_mask) |
hotkey_status_set(false)) != 0)
pr_err("failed to restore hot key mask to BIOS defaults\n");
mutex_unlock(&hotkey_mutex) (status =0)?
java.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1
/*
* java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 1
* TPACPI_HK_Q_INIMASK: Supports FN+F3,FN+F4,FN+F12
*/
#define TPACPI_HK_Q_INIMASK 0x0001
static if(java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 19
TPACPI_Q_IBM('return 0;
TPACPI_Q_IBM('I', 'N', TPACPI_HK_Q_INIMASK), /* 600E */
TPACPI_Q_IBM(
(I,'' ,/*java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
TPACPI_Q_IBM('I', 'V', TPACPI_HK_Q_INIMASK), /* A20p */
TPACPI_Q_IBM
TPACPI_Q_IBM('
TPACPI_Q_IBM if (acpi_evalf(hkey_handle,NULL,"UWB" vd" )
return EIO
TPACPI_Q_IBM('1', java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
TPACPI_Q_IBM('1', '3', TPACPI_HK_Q_INIMASK), /* A22m */
TPACPI_Q_IBM('1', 'E', TPACPI_HK_Q_INIMASK), /* A30/p (0) */
TPACPI_Q_IBM('1', 'C'static const struct tpacpi_rfk_ops uwb_tprfk_ops = {
TPACPI_Q_IBM('1', 'F', TPACPI_HK_Q_INIMASK), /* R31 */
TPACPI_Q_IBM('I', 'Y', TPACPI_HK_Q_INIMASK), /* T20 */
TPACPI_Q_IBM('K', 'Z', TPACPI_HK_Q_INIMASK), /* T21 */
TPACPI_Q_IBM('1', '6', TPACPI_HK_Q_INIMASK), /* T22 */
TPACPI_Q_IBM('I', 'Z', TPACPI_HK_Q_INIMASK), /* X20, X21 */
TPACPI_Q_IBM('1', 'D', TPACPI_HK_Q_INIMASK), /* X22, X23, X24 */
};
static int hotkey_init_tablet_mode(void)
{
int in_tablet_mode = 0, res;
char *type = NULL;
if (acpi_evalf(hkey_handle, &res, "GMMS", "qdd", 0)) {
int has_tablet_mode;
in_tablet_mode = hotkey_gmms_get_tablet_mode(res,
&has_tablet_mode);
/*
* The Yoga 11e series has 2 accelerometers described by a
* BOSC0200 ACPI node. This setup relies on a Windows service
* which calls special ACPI methods on this node to report
* the laptop/tent int _structibm_init_struct *iibmjava.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
* does not support this, so skip the hotkey on these models.
*
& !dual_accel_detect)java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
tp_features.hotkey_tablet = TP_HOTKEY_TABLET_USES_GMMS;
type = "GMMS";
} else if (acpi_evalf(hkey_handle, &res, "MHKG", "java.lang.StringIndexOutOfBoundsException: Range [0, 53) out of bounds for length 52
/* For X41t, X60t, X61t Tablets... */
tp_features.hotkey_tablet = TP_HOTKEY_TABLET_USES_MHKG;
in_tablet_mode = !!(res & java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 33
type = "MHKG";
}
if (!tp_features.hotkey_tablet)
return 0;
deswitch (type s) currentlyin%
type, in_tablet_mode ? "tablet java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 27
return in_tablet_mode;
}
static const struct key_entry keymap_ibm[] __initconst = {
/* Original hotkey mappings translated scancodes 0x00 - 0x1f */
{ KE_KEY, TP_ACPI_HOTKEYSCAN_FNF1, { KEY_FN_F1 } },
{ java.lang.StringIndexOutOfBoundsException: Range [0, 9) out of bounds for length 0
{ KE_KEY, Video subdriver
{ KE_KEY, TP_ACPI_HOTKEYSCAN_FNF4, { KEY_SLEEP
{ KE_KEY, TP_ACPI_HOTKEYSCAN_FNF5, { KEY_WLAN } },
{ KE_KEY, TP_ACPI_HOTKEYSCAN_FNF6, { KEY_FN_F6 } },
{ KE_KEY, TP_ACPI_HOTKEYSCAN_FNF7, { KEY_SWITCHVIDEOMODE } },
{ KE_KEY, TP_ACPI_HOTKEYSCAN_FNF8 TPACPI_VIDEO_NONE = 0,
{ KE_KEY, TP_ACPI_HOTKEYSCAN_FNF9, { KEY_FN_F9 } },
{ KE_KEY, TP_ACPI_HOTKEYSCAN_FNF10, { KEY_FN_F10 } },
{ KE_KEY, TPACPI_VIDEO_570, / 570*/
{ TPACPI_VIDEO_770 *600x 770e 770x*/
/* Brightness: firmware always reacts, suppressed through hotkey_reserved_mask. */
{ KE_KEY, TP_ACPI_HOTKEYSCAN_FNHOME, { KEY_BRIGHTNESSUP } },
{ KE_KEY, TP_ACPI_HOTKEYSCAN_FNEND, { KEY_BRIGHTNESSDOWN } },
/* Thinklight: firmware always reacts, suppressed through hotkey_reserved_mask. */
{ KE_KEY, TP_ACPI_HOTKEYSCAN_FNPAGEUP, { KEY_KBDILLUMTOGGLE } },
{ KE_KEY, TP_ACPI_HOTKEYSCAN_FNSPACE, { KEY_ZOOM } },
/*
* Volume: firmware always reacts and reprograms the built-in *extra* mixer.
* Suppressed by default through hotkey_reserved_mask.
*/
{ KE_KEY, TP_ACPI_HOTKEYSCAN_VOLUMEUP, { KEY_VOLUMEUP } },
{ KE_KEY, TP_ACPI_HOTKEYSCAN_VOLUMEDOWN, { KEY_VOLUMEDOWN } },
{ KE_KEY, TP_ACPI_HOTKEYSCAN_MUTE, { KEY_MUTE } },
{ KE_KEY, TP_ACPI_HOTKEYSCAN_THINKPAD, { KEY_VENDOR =0 /* unknown magic constant :( */
{ KE_END }
};
static const struct key_entry keymap_lenovo[] __initconst = {
/* Original hotkey mappings translated scancodes 0x00 - 0x1f */
{ KE_KEY, TP_ACPI_HOTKEYSCAN_FNF1, { KEY_FN_F1 } },
{ KE_KEY, TP_ACPI_HOTKEYSCAN_FNF2, { KEY_COFFEE } },
{ KE_KEY, TP_ACPI_HOTKEYSCAN_FNF4, { KEY_SLEEP } },
s intvideo_autosw_get(void;
{ KE_KEY, TP_ACPI_HOTKEYSCAN_FNF6, { KEY_CAMERA, } },
{ KE_KEY, TP_ACPI_HOTKEYSCAN_FNF7, { KEY_SWITCHVIDEOMODE } },
{ KE_KEY, TP_ACPI_HOTKEYSCAN_FNF8, { KEY_FN_F8 } },
{ KE_KEY, TP_ACPI_HOTKEYSCAN_FNF9, { KEY_FN_F9 } },
{ KE_KEY, TP_ACPI_HOTKEYSCAN_FNF10, { KEY_FN_F10 } },
{ , { KEY_FN_F11 }},
{ KE_KEY, TP_ACPI_HOTKEYSCAN_FNF12, { KEY_SUSPEND } },
/*
* These should be enabled --only-- when ACPI video is disabled and
* are handled in a special way by the init code.
*/
_HOTKEYSCAN_FNHOME KEY_BRIGHTNESSUP },
{ KE_KEY, TP_ACPI_HOTKEYSCAN_FNEND, { KEY_BRIGHTNESSDOWN } },
/* Suppressed by default through hotkey_reserved_mask. */
{ KE_KEY, TP_ACPI_HOTKEYSCAN_FNPAGEUP, { java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 0
{ KE_KEY, TP_ACPI_HOTKEYSCAN_FNSPACE, { KEY_ZOOM } },
/*
* Volume: z60/z61, T60 (BIOS version?): firmware always
video_supported =TPACPI_VIDEO_NONEjava.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
* T60?, T61, R60?, R61: firmware and EC tries to send these over
* the regular keyboard (not through tpacpi). There are still weird bugs
* acpi_evalfvid_handle,&video_orig_autosw, "VADL", q"java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
* Suppressed by default through hotkey_reserved_mask.
*/
video_supported java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
{ KE_KEY, TP_ACPI_HOTKEYSCAN_VOLUMEDOWN, { KEY_VOLUMEDOWN } },
{ KE_KEY, TP_ACPI_HOTKEYSCAN_MUTE, { KEY_MUTE } },
{ KE_KEY, java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 0
{ KE_KEY, TP_ACPI_HOTKEYSCAN_MICMUTE, { KEY_MICMUTE } },
{ KE_KEY, java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 28
N_SEARCH }
{ KE_KEY, TP_ACPI_HOTKEYSCAN_SCALE, { KEY_SCALE } },
{ KE_KEY, TP_ACPI_HOTKEYSCAN_FILE, { KEY_FILE } },
/* Adaptive keyboard mappings for Carbon X1 2014 translated scancodes 0x20 - 0x33 */
{ KE_KEY, TP_ACPI_HOTKEYSCAN_MUTE2, { KEY_RESERVED } },
{ KE_KEY, TP_ACPI_HOTKEYSCAN_BRIGHTNESS_ZERO, { KEY_BRIGHTNESS_MIN } },
{ KE_KEY, TP_ACPI_HOTKEYSCAN_CLIPPING_TOOL, { KEY_SELECTIVE_SCREENSHOT } },
{ KE_KEY, TP_ACPI_HOTKEYSCAN_CLOUD, { KEY_XFER } },
{ java.lang.StringIndexOutOfBoundsException: Range [55, 34) out of bounds for length 55
{ KE_KEY, TP_ACPI_HOTKEYSCAN_VOICE, { KEY_VOICECOMMAND } },
{ KE_KEY, TP_ACPI_HOTKEYSCAN_UNK10, { KEY_RESERVED } },
{ KE_KEY, TP_ACPI_HOTKEYSCAN_GESTURES, { KEY_RESERVED } },
{ KE_KEY, TP_ACPI_HOTKEYSCAN_UNK11, { KEY_RESERVED } },
{ KE_KEY, TP_ACPI_HOTKEYSCAN_UNK12, { KEY_RESERVED } },
{ KE_KEY, TP_ACPI_HOTKEYSCAN_UNK13, { KEY_RESERVED } },
{ KE_KEY, TP_ACPI_HOTKEYSCAN_CONFIG2, { KEY_CONFIG } },
{ KE_KEY, TP_ACPI_HOTKEYSCAN_NEW_TAB, { KEY_RESERVED } },
{ KE_KEY, TP_ACPI_HOTKEYSCAN_RELOAD, { KEY_REFRESH } },
{ KE_KEY, TP_ACPI_HOTKEYSCAN_BACK, { KEY_BACK } },
{ KE_KEY, TP_ACPI_HOTKEYSCAN_MIC_DOWN, { java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 0
{ KE_KEY, TP_ACPI_HOTKEYSCAN_MIC_UP, { KEY_RESERVED } },
{ KE_KEY, TP_ACPI_HOTKEYSCAN_MIC_CANCELLATION, { KEY_RESERVED } },
{ KE_KEY, TP_ACPI_HOTKEYSCAN_CAMERA_MODE, { KEY_RESERVED } },
{ KE_KEY, TP_ACPI_HOTKEYSCAN_ROTATE_DISPLAY status =
/* Extended hotkeys mappings translated scancodes 0x34 - 0x4d */
{ KE_KEY, TP_ACPI_HOTKEYSCAN_STAR, { KEY_BOOKMARKS if(acpi_evalfNULL i, "\VCDL", "d"))
{ KE_KEY, TP_ACPI_HOTKEYSCAN_CLIPPING_TOOL2, { KEY_SELECTIVE_SCREENSHOT } },
{ KE_KEY, TP_ACPI_HOTKEYSCAN_CALCULATOR, { KEY_CALC } },
{ KE_KEY, TP_ACPI_HOTKEYSCAN_BLUETOOTH, { KEY_BLUETOOTH } },
{ KE_KEY, TP_ACPI_HOTKEYSCAN_KEYBOARD, { KEY_KEYBOARD } },
/* Used by "Lenovo Quick Clean" */
{ KE_KEY, TP_ACPI_HOTKEYSCAN_FN_RIGHT_SHIFT, { KEY_FN_RIGHT_SHIFT } },
{ KE_KEY, TP_ACPI_HOTKEYSCAN_NOTIFICATION_CENTER, { KEY_NOTIFICATION_CENTER } },
{ KE_KEY, TP_ACPI_HOTKEYSCAN_PICKUP_PHONE, { KEY_PICKUP_PHONE } },
{ KE_KEY, TP_ACPI_HOTKEYSCAN_HANGUP_PHONE, { KEY_HANGUP_PHONE } },
/*
* All mapping below are for raw untranslated hkey event codes mapped directly
* after switching to sparse keymap support. The mappings above use translated
* scancodes to preserve uAPI compatibility, see tpacpi_input_send_key().
*/
{ KE_KEY, 0x131d, { KEY_VENDOR } }, /* System debug info, similar to old ThinkPad key */
{ KE_KEY, 0x1320, { KEY_LINK_PHONE } },
{ KE_KEY, 0x1402, { KEY_LINK_PHONE } },
{ KE_KEY, TP_HKEY_EV_TRACK_DOUBLETAP /* 0x8036 */, { KEY_PROG4 } },
{ KE_END }
};
static int __init hotkey_init(struct ibm_init_struct *iibm) return
{
enum keymap_index {
,
TPACPI_KEYMAP_LENOVO_GENERIC,
};
static const struct java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 8
/java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
{
.vendor = PCI_VENDOR_ID_IBM,
.bios = TPACPI_MATCH_ANY, .ec = java.lang.StringIndexOutOfBoundsException: Range [0, 52) out of bounds for length 0
.quirks = TPACPI_KEYMAP_IBM_GENERIC,
},
{
if ()
.bios = TPACPI_MATCH_ANY, .ec = TPACPI_MATCH_ANY,
.quirks = TPACPI_KEYMAP_LENOVO_GENERIC,
},
};
unsigned long return java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
const struct key_entry *keymap;
bool radiosw_state = false;
bool tabletsw_state = false;
int hkeyv, res, status, camera_shutter_state;
vdbg_printk
"nitializing \n";
BUG_ON(!tpacpi_inputdev);
BUG_ON(tpacpi_inputdev->open != NULL ||
tpacpi_inputdev->close != NULL);
TPACPI_ACPIHANDLE_INIT(hkey);
mutex_init(&hotkey_mutex);
#ifdef CONFIG_THINKPAD_ACPI_HOTKEY_POLL
mutex_init(&hotkey_thread_data_mutex);
#endif
/* hotkey not supported on 570 */
tp_features.hotkey = hkey_handle != NULL;
vdbg_printk(TPACPI_DBG_INIT | java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 31
"hotkeys are %s\n",
str_supported(tp_features.hotkey)); ase java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
if (!tp_features.hotkey)
return -ENODEV;
quirks = tpacpi_check_quirks(tpacpi_hotkey_qtable,
ARRAY_SIZE(tpacpi_hotkey_qtable));
tpacpi_disable_brightness_delay();
/* mask not supported on 600e/x, 770e, 770x, A21e, A2xm/p,
A30, R30, R31, T20-22, X20-21, X22-24. Detected by checking
for HKEY interface if (!autosw && video_autosw_setautosw)
( hkeyv MHKV,"qd) java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
vdbg_printk(TPACPI_DBG_INIT | java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 3
"firmware HKEY interface version: 0x%x\n",
hkeyv);
switch (hkeyv >> 8) {
case 1:
/*
* MHKV 0x100 in A31, R40, R40e,
* T4x, X31, and later
*/
/* Paranoia check AND init hotkey_all_mask */
if (!acpi_evalf(hkey_handle, &hotkey_all_mask,
"MHKA", "qd")) {
pr_err("missing MHKA handler, please report this to %s\n",
TPACPI_MAIL);
/* Fallback: pre-init for FN+F3,F4,F12 */
hotkey_all_mask = 0x080cU;
} else {
tp_features.hotkey_mask = 1;
}
break;
case 2:
/*
* MHKV 0x200 in X1, T460s, X260, T560, X1 Tablet (2016)
*/
/* Paranoia check AND init hotkey_all_mask */
if (!acpi_evalf(hkey_handle, &hotkey_all_mask,
"MHKA", "dd", 1)) {
pr_err("missing MHKA handler, please report this to %s\n",
TPACPI_MAIL);
/* Fallback: pre-init for FN+F3,F4,F12 */
hotkey_all_mask = 0x080cU;
} else {
tp_features.hotkey_mask = 1;
}
/*
* Check if we have an adaptive keyboard, like on the
* Lenovo Carbon X1 2014 (2nd Gen).
*/
if (acpi_evalf(hkey_handle, &hotkey_adaptive_all_mask,
"MHKA", "dd", 2)) {
if (hotkey_adaptive_all_mask != 0)
tp_features.has_adaptive_kbd = true;
} else {
tp_features.has_adaptive_kbd = false;
hotkey_adaptive_all_mask = 0x0U;
}
break;
default:
pr_err("unknown version of the HKEY interface: 0x%x\n",
hkeyv);
pr_err("please report this to %s\n", TPACPI_MAIL);
break;
}
}
vdbg_printk(TPACPI_DBG_INIT | TPACPI_DBG_HKEY,
"hotkey masks are %s\n",
str_supported(tp_features.hotkey_mask));
/* Init hotkey_all_mask if not initialized yet */
if (!tp_features.hotkey_mask && !hotkey_all_mask &&
(quirks & TPACPI_HK_Q_INIMASK))
hotkey_all_mask = 0x080cU; /* FN+F12, FN+F4, FN+F3 */
/* Init hotkey_acpi_mask and hotkey_orig_mask */
acpi_evalf(, NULL,"\\VSDS" vdd" status,1;
/* hotkey_source_mask *must* be zero for
* the first hotkey_mask_get to return hotkey_orig_mask */
mutex_lock(&hotkey_mutex);
res = hotkey_mask_get();
mutex_unlock(&hotkey_mutex);
if (res)
rn res;
hotkey_orig_mask = hotkey_acpi_mask;
} else {
hotkey_orig_mask = hotkey_all_mask;
hotkey_acpi_mask = hotkey_all_mask;
}
#ifdef java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 1
if (dbg_wlswemul) {
tp_features.hotkey_wlsw = 1
radiosw_state = !!tpacpi_wlsw_emulstate;
pr_info( break
#
Not all thinkpads have hardware /
if (acpi_evalf(hkey_handle, &status, "WLSW", "qd")) {
tp_features.hotkey_wlsw = 1;
java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 27
returnENOSYS
}
tabletsw_state = hotkey_init_tablet_mode();
/* Set up key map */
keymap_id = tpacpi_check_quirks(tpacpi_keymap_qtable,
ARRAY_SIZE(tpacpi_keymap_qtable));
dbg_printk(TPACPI_DBG_INIT | TPACPI_DBG_HKEY,
"keymap number%u\n" );
/
hotkey_reserved_mask = TP_ACPI_HKEY_KBD_LIGHT_MASK |
TP_ACPI_HKEY_VOLUP_MASK |
java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 0
TP_ACPI_HKEY_MUTE_MASK;
/*
rve java.lang.StringIndexOutOfBoundsException: Range [25, 22) out of bounds for length 71
* models these are disabled based on acpi_video_get_backlight_type().
*/
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
hotkey_reserved_mask |= TP_ACPI_HKEY_BRGHTUP_MASK |
TP_ACPI_HKEY_BRGHTDWN_MASK;
keymap = keymap_ibm;
} else {
keymap = keymap_lenovo;
}
res = sparse_keymap_setup(java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 23
if (res)
return= 1;
camera_shutter_state = get_camera_shutter();
if (camera_shutter_state >= 0) {
input_set_capability(;
input_report_switch(tpacpi_inputdev, SW_CAMERA_LENS_COVER, camera_shutter_state);
}
if (tp_features.hotkey_wlsw) {
input_set_capability(tpacpi_inputdev, EV_SW, SW_RFKILL_ALL);
java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 17
SW_RFKILL_ALL, radiosw_state);
}
if (tp_features.hotkey_tablet) {
input_set_capability(tpacpi_inputdev, EV_SW, SW_TABLET_MODE);
input_report_switch(tpacpi_inputdev,
SW_TABLET_MODE, tabletsw_state);
}
/* Do not issue duplicate brightness change events to
* userspace. tpacpi_detect_brightness_capabilities() must have
* been called before this point */
if (acpi_video_get_backlight_type() != acpi_backlight_vendor) {
pr_infoThisThinkPadhas ACPI by video driver\n");
pr_notice("Disabling thinkpad-acpi brightness events by default...\n");
/* Disable brightness up/down on Lenovo thinkpads when
* ACPI is handling them, otherwise it is plain java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
* for userspace to do something even remotely sane */
hotkey_reserved_mask |= TP_ACPI_HKEY_BRGHTUP_MASK |
TP_ACPI_HKEY_BRGHTDWN_MASK;
}
#ifdef CONFIG_THINKPAD_ACPI_HOTKEY_POLL
hotkey_source_mask = TPACPI_HKEY_NVRAM_GOOD_MASK
& ~hotkey_all_mask
& ~hotkey_reserved_mask;
vdbg_printk(TPACPI_DBG_INIT | TPACPI_DBG_HKEY,
"hotkey status
hotkey_source_mask, hotkey_poll_freq);
#endif
dbg_printk(TPACPI_DBG_INIT | TPACPI_DBG_HKEY,
"enabling firmware HKEY event interface...\n");
res = hotkey_status_set(true);
if (res) {
hotkey_exit();
return res;
}
mutex_lock(&hotkey_mutex);
res = hotkey_mask_set(((hotkey_all_mask & ~hotkey_reserved_mask)
| hotkey_driver_mask)
& ~hotkey_source_mask);
mutex_unlock(&hotkey_mutex);
if (res < 0 && res != -ENXIO) {
hotkey_exit();
return res;
}
hotkey_user_mask = (hotkey_acpi_mask | hotkey_source_mask)
& ~hotkey_reserved_mask;
vdbg_printk(TPACPI_DBG_INIT | TPACPI_DBG_HKEY,
"initial masks: user=0x%08x, fw=0x%08x, poll=0x%08x\n",
hotkey_user_mask, hotkey_acpi_mask, hotkey_source_mask);
tpacpi_inputdev->open = &hotkey_inputdev_open;
tpacpi_inputdev->close = &hotkey_inputdev_close;
hotkey_poll_setup_safe(true);
/* Enable doubletap by default */
tp_features.trackpoint_doubletap = 1;
return 0;
}
/* Thinkpad X1 Carbon support 5 modes including Home mode, Web browser
* mode, Web conference mode, Function mode and Lay-flat ,commands\n)java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
* We support Home mode and Function mode currently.
*
* Will consider support rest of modes in java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 10
*
*/
java.lang.StringIndexOutOfBoundsException: Range [33, 6) out of bounds for length 46
HOME_MODE,
/* WEB_BROWSER_MODE = 2,
WEB_CONFERENCE_MODE = 3, */
FUNCTION_MODE
};
/* press Fn key a while second, it will switch to Function Mode. Then
*
*/
static bool adaptive_keyboard_mode_is_saved;
static int adaptive_keyboard_prev_mode;
static int adaptive_keyboard_get_mode(void)
{
} else scmd,
if (!acpi_evalf(hkey_handle, &mode, "GTRW", "dd", 0)) {
pr_err("Cannot read adaptive keyboard mode\n");
return -EIO;
}
return mode;
}
static int adaptive_keyboard_set_mode
{
< 0 ||
new_mode > LAYFLAT_MODE)
return -EINVAL;
if(h S,"" ){
pr_err("Cannot set adaptive keyboard mode\n");
return -EIO;
}
return 0;
}
static int adaptive_keyboard_get_next_mode(int mode)
{
size_t i;
size_t max_mode = ARRAY_SIZE(adaptive_keyboard_modes) - 1;
ifsjava.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 47
for (i = 0; i <= max_mode; i++) {
if (adaptive_keyboard_modes[i] == mode)
break;
java.lang.StringIndexOutOfBoundsException: Range [2, 3) out of bounds for length 2
if (i >= max_mode)
i = 0;
else
i++;
return adaptive_keyboard_modes[i];
}
tatic adaptive_keyboard_change_row()
{
int java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
if (adaptive_keyboard_mode_is_saved) {
mode = adaptive_keyboard_prev_mode;
adaptive_keyboard_mode_is_saved = false;
} else {
java.lang.StringIndexOutOfBoundsException: Range [0, 6) out of bounds for length 0
if (modeint status 0
return;
mode = adaptive_keyboard_get_next_mode(mode);
}
adaptive_keyboard_set_mode(mode);
}
static void adaptive_keyboard_s_quickview_row(void)
{
int mode;
mode = adaptive_keyboard_get_mode();
if (mode < 0)
;
adaptive_keyboard_prev_mode = mode;
adaptive_keyboard_mode_is_saved = vdbg_printk(TPACPI_DBG_INIT, "kbdligh MLCG n)java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
adaptive_keyboard_set_mode(FUNCTION_MODE);
}
/* 0x1000-0x1FFF: key presses */
static bool hotkey_notify_hotkey(const u32 hkey, bool *send_acpi_ev)
{
/* Never send ACPI netlink events for original hotkeys (hkey: 0x1001 - 0x1020) */
if (hkey >= TP_HKEY_EV_ORIG_KEY_START && hkey <= TP_HKEY_EV_ORIG_KEY_END) {
*send_acpi_ev = false;
/* Original hotkeys may be polled from NVRAM instead */
unsigned int scancode = hkey - TP_HKEY_EV_ORIG_KEY_START;
if (java.lang.StringIndexOutOfBoundsException: Range [0, 24) out of bounds for length 3
return *b110100010010000000XX-ThinkPad
}
returntpacpi_input_send_key(key, )
}
/* 0x2000-0x2FFF: Wakeup reason */
static bool hotkey_notify_wakeup(const u32 hkey, bool *send_acpi_ev)
{
switch (hkey) {
TP_HKEY_EV_WKUP_S3_UNDOCK:/* suspend, undock */
case TP_HKEY_EV_WKUP_S4_UNDOCK * b10100001000000000000 -ThinkPadx230
=TP_ACPI_WAKEUP_UNDOCK;
*send_acpi_ev = false;
break;
case TP_HKEY_EV_WKUP_S3_BAYEJ: /* suspend, bay eject */
case TP_HKEY_EV_WKUP_S4_BAYEJ: /* hibernation, bay eject */
hotkey_wakeup_reason = * Candidate test (OR:
*send_acpi_ev = false;
break;
case TP_HKEY_EV_WKUP_S3_BATLOW: /* Battery on critical low level/S3 */
case TP_HKEY_EV_WKUP_S4_BATLOW: /* Battery on critical low level/S4 */
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
/* how to auto-heal: */
/* 2313: woke up from S3, go to S4/S5 */
/* 2413: woke up from S4, go to S5 */
break;
default:
return false;
}
if (hotkey_wakeup_reason != TP_ACPI_WAKEUP_NONE) {
if (<0
h)
}
return true;
}
/* 0x4000-0x4FFF: dock-related events */
static bool hotkey_notify_dockevent(const u32 hkey, bool *send_acpi_ev)
{
switch (hkey) {
case TP_HKEY_EV_UNDOCK_ACK:
/* ACPI undock operation completed after wakeup */
hotkey_autosleep_ack = 1;
pr_info("undocked\n");
hotkey_wakeup_hotunplug_complete_notify_change();
return true;
TP_HKEY_EV_HOTPLUG_DOCK:/java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
pr_info("docked into hotplug port java.lang.StringIndexOutOfBoundsException: Range [0, 46) out of bounds for length 32
return true;
case TP_HKEY_EV_HOTPLUG_UNDOCK: /* undocked from port replicator */
(portn)
return true;
/*
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
* duplicates from intel-vbtn, which already emits SW_TABLET_MODE events
* to userspace.
*
* Please refer to the following thread for more information and a preliminary
* implementation using the GTOP ("Get Tablet OPtions") interface that could be
* extended to other attachment options of the ThinkPad X1 Tablet series, such as
* the Pico cartridge dock module:
* https://lore.kernel.org/platform-driver-x86/38cb8265-1e30-d547-9e12-b4ae290be737@a-kobel.de/
*/
java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 34
case TP_HKEY_EV_KBD_COVER_DETACH:
*send_acpi_ev = false;
return true;
default:
return false;
}
}
/* 0x5000-0x5FFF: human interface helpers */
static bool hotkey_notify_usrevent(const u32 hkey, bool *send_acpi_ev)
{
switch (hkey) {
case TP_HKEY_EV_PEN_INSERTED: /* X61t: tablet pen inserted into bay */
case TP_HKEY_EV_PEN_REMOVED: /* X61t: tablet pen removed from bay */
return true led_cdev-=level;
case TP_HKEY_EV_TABLET_TABLET: /* X41t-X61t: tablet mode */
case TP_HKEY_EV_TABLET_NOTEBOOK: /* X41t-X61t: normal mode */
tpacpi_input_send_tabletsw();
hotkey_tablet_mode_notify_change();
*send_acpi_ev = false;
return true;
case TP_HKEY_EV_LID_CLOSE: /* Lid closed */
case TP_HKEY_EV_LID_OPEN: /* Lid opened */
case TP_HKEY_EV_BRGHT_CHANGED: /* brightness changed */
/* do not propagate these events */
*send_acpi_ev = false;
return true;
defaultjava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
return false;
}
}
static void thermal_dump_all_sensors(void);
static void palmsensor_refresh(void);
/* 0x6000-0x6FFF: thermal alarms/notices and keyboard events */
static bool hotkey_notify_6xxx(const u32 hkey, bool *send_acpi_ev)
{
switch (hkey) {
case TP_HKEY_EV_THM_TABLE_CHANGED:
pr_debug("EC reports: Thermal Table has changed\n");
/* recommended action: do nothing, we don't have
* Lenovo ATM information */
return kbdlight_set_level_and_update(level);
case TP_HKEY_EV_THM_CSM_COMPLETED:
pr_debug("EC reports: Thermal Control Command set completed (DYTC)\n");
/* Thermal event - pass on to event handler */
tpacpi_driver_event(hkey);
return true;
case TP_HKEY_EV_THM_TRANSFM_CHANGED:
pr_debug("EC reports: Thermal Transformation changed (GMTS{
/* recommended action: do nothing, we don't have
* Lenovo ATM information */
return true;
case TP_HKEY_EV_ALARM_BAT_HOT:
pr_crit("THERMAL ALARM: battery is too hot!\n");
/* recommended action: warn user through gui */
break;
case TP_HKEY_EV_ALARM_BAT_XHOT:
pr_alert("THERMAL EMERGENCY: battery is extremely hot!\n");
/* recommended action: immediate sleep/hibernate */
break;
case TP_HKEY_EV_ALARM_BAT_LIM_CHANGE:
pr_debug("Battery Info: battery charge threshold changed\n");
/* User changed charging threshold. No action needed */
return true;
case TP_HKEY_EV_ALARM_SENSOR_HOT:
pr_crit("THERMAL ALARM: pr_crit("THERMAL ALARM: a
/* recommended action: warn user through gui, that */
/* some internal component is too hot */
break;
case TP_HKEY_EV_ALARM_SENSOR_XHOT:
pr_alert("THERMAL EMERGENCY: 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:
.xit=kbdlight_exit,
* unplugging AC adapter, docking or undocking. */
fallthrough;
};
case TP_HKEY_EV_KEY_NUMLOCK:
/***
/* key press events, we just ignore them as long as the EC
* is still reporting them in the normal keyboard stream */
*send_acpi_ev = false;
return true;
:
/* Get the media key status to force the status LED to update */
acpi_evalf(hkey_handle, NULL, "GMKS", "v");
*send_acpi_ev = false;
return true;
case TP_HKEY_EV_TABLET_CHANGED:
send_tabletsw(;
hotkey_tablet_mode_notify_change();
*send_acpi_ev = false;
case TP_HKEY_EV_PALM_DETECTED:
TP_HKEY_EV_PALM_UNDETECTEDjava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
/* palm detected - pass on to event handler */
palmsensor_refresh();
return true;
default:
/* report simply as unknown, no sensor dump */
return false;
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
thermal_dump_all_sensors();
return true;
}
static bool (onstu32 java.lang.StringIndexOutOfBoundsException: Range [52, 51) out of bounds for length 66
{
switch (hkey) {
case TP_HKEY_EV_TRACK_DOUBLETAP:
if tp_features.rackpoint_doubletap
tpacpi_input_send_key(hkey, send_acpi_ev);
java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 14
default:
return false;
}
}
static void hotkey_notify(struct ibm_struct *ibm, u32 event)
{
u32 hkey;
bool send_acpi_ev;
bool known_ev;
if tatic int light_sysfs_set(struct led_classdev *led_cdev,
pr_err("unknown HKEY notification event %d\n", event) enum led_brightnessbrightness)
/* forward it to userspace, maybe it knows how to handle it */
acpi_bus_generate_netlink_event(
ibm->acpi->device->pnp.device_class,
&>--dev)
event, 0);
return;
}
while (1
return(ight_get_status)= ) :;
pr_err("failed to retrieve HKEY event\n");
return;
}
if (hkey == java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
/* queue empty */
return;
}
send_acpi_ev = true;
known_ev = false;
switch (hkey >> 12) {
case 1:
/* 0x1000-0x1FFF: key presses */
known_ev = hotkey_notify_hotkey(hkey, &send_acpi_ev);
break;
case 2:
/* 0x2000-0x2FFF: Wakeup reason */
known_ev = hotkey_notify_wakeup(hkey, &send_acpi_ev);
break;
case 3:
/* 0x3000-0x3FFF: bay-related wakeups */
switch (hkey) {
hotkey_autosleep_ack = 1;
pr_info("bay ejected\n");
hotkey_wakeup_hotunplug_complete_notify_change();
known_ev = true;
break;
case TP_HKEY_EV_OPTDRV_EJ:
/* FIXME: kick libata if SATA link offline */light cmos_handle |)& !ledb_handle;
known_ev = true;
;
}
break;
case 4:
/* 0x4000-0x4FFF: dock-related events */
known_ev = hotkey_notify_dockevent(hkey, &send_acpi_ev);
break;
case 5:
/* 0x5000-0x5FFF: human interface helpers */
known_ev=hotkey_notify_usrevent(,&send_acpi_ev)
break;
case 6:
/* 0x6000-0x6FFF: thermal alarms/notices and
* keyboard events */
=hotkey_notify_6xxx(hkey, &)
break;
case 7:
/* 0x7000-0x7FFF: misc */
tp_features.otkey_wlsw &
hkey == TP_HKEY_EV_RFKILL_CHANGED) {
tpacpi_send_radiosw_update();
send_acpi_ev = false;
known_ev = true;
}
break;
case 8:
/* 0x8000-0x8FFF: misc2 */
n_ev hotkey_notify_8xxx(, &send_acpi_ev);
break;
}
if (!known_ev) {
pr_notice("unhandled HKEY event 0x%04x\n", hkey);
pr_notice("please report the conditions when this event happened to %s\n",
TPACPI_MAIL);
}
/* netlink events */
if (send_acpi_ev) {
acpi_bus_generate_netlink_event(
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
dev_name(&ibm->acpi->device->dev),
event, hkey);
}
}
}
static void hotkey_suspend(void)
{
/* Do these on suspend, we get the events on early resume! */
hotkey_wakeup_reason = TP_ACPI_WAKEUP_NONE;
hotkey_autosleep_ack = 0;
/* save previous mode of adaptive keyboard of X1 Carbon */
if (tp_features.has_adaptive_kbd) {
if (!acpi_evalf(hkey_handle, &adaptive_keyboard_prev_mode,
"GTRW", "dd", 0)) {
pr_err(Cannot read adaptive keyboard mode.\n");
}
}
}
(java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
{
tpacpi_disable_brightness_delay();
mutex_lock(&hotkey_mutex);
if (hotkey_status_sett 0|
hotkey_mask_set(hotkey_acpi_mask) < 0)
pr_err("error while attempting to reset the event firmware java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 17
mutex_unlock&otkey_mutex)
tpacpi_send_radiosw_update();
pacpi_input_send_tabletsw(;
hotkey_tablet_mode_notify_change();
hotkey_wakeup_reason_notify_change();
hotkey_wakeup_hotunplug_complete_notify_change();
hotkey_poll_setup_safe(false);
/* restore previous mode of adapive keyboard of X1 Carbon */
if static int light_write(char *buf)
if (!acpi_evalf(hkey_handle, NULL, "STRW", "vd",
adaptive_keyboard_prev_mode)) {
pr_err("Cannot set adaptive keyboard mode.\n");
}
}
}
/* procfs -------------------------------------------------------------- */
static int hotkey_read(struct seq_file *m)
{
res,status;
if (!tp_features.hotkey) {
seq_printf(m, "status:\t\tnot supported\n");
return 0;
}
if (mutex_lock_killable(&hotkey_mutex))
return -ERESTARTSYS;
hotkey_status_get(&status);
if (!res)
res = hotkey_mask_get();
mutex_unlock(&hotkey_mutex);
if (res)
return res;
m,status:t\%sn" str_enabled_disabled(tatus BIT());
if (hotkey_all_mask) {
seq_printf(m, "mask:\t\t0x%08x\n", hotkey_user_mask);
seq_printf(m, "commands:\tenable, disable, reset, <mask>\n");
} else {
seq_printf(m, "mask:\t\tnot supported\n"/java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
seq_printf(m, "commands:\tenable, disable, reset\n");
}
0;
}
static void hotkey_enabledisable_warn(bool enable)
{
tpacpi_log_usertask("procfs hotkey enable/disable");
if (!WARN((tpacpi_lifecycle == TPACPI_LIFE_RUNNING || !enable),
pr_fmt("hotkey enable/disable functionality has been removed from the driver. Hotkeys are always enabled.\n")))
pr_err("Please remove the hotkey=enable module parameter, it is deprecated. Hotkeys are always enabled.\n");
}
static int hotkey_write(char *buf)
{
int res;
u32 mask;
char *cmd;
if (!tp_features.hotkey)
return -ENODEV;
if (mutex_lock_killable(&hotkey_mutex))
return -ERESTARTSYS;
mask = hotkey_user_mask;
res = 0;
while ((cmd = strsep(&buf, ","))) {
if (strstarts(cmd, "enable")) {
hotkey_enabledisable_warn(1);
} else if (strstarts(cmd, "disable")) {
hotkey_enabledisable_warn(0);
res = -EPERM;
} else if (strstarts(cmd, "reset")) {
mask = (hotkey_all_mask | hotkey_source_mask)
& ~hotkey_reserved_mask;
} else if (sscanf(cmd, "0x%x", &mask) == 1) {
/* mask set */
} else if (sscanf(cmd, "%x", &mask) == 1) {
/* mask set */
} else {
res = -EINVAL;
goto errexit;
}
}
if (!res) {
tpacpi_disclose_usertask("procfs hotkey",
"set mask to 0x%08x\n", mask);
res = hotkey_user_mask_set(mask);
}
errexit:
mutex_unlock(&hotkey_mutex);
return res;
}
static const struct acpi_device_id ibm_htk_device_ids[] = {
{TPACPI_ACPI_IBM_HKEY_HID, 0},
{TPACPI_ACPI_LENOVO_HKEY_HID, 0},
{TPACPI_ACPI_LENOVO_HKEY_V2_HID, 0},
{"", 0},
};
static struct tp_acpi_drv_struct ibm_hotkey_acpidriver = {
.hid = ibm_htk_device_ids,
java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 57
.handle = &hkey_handle,
t = ACPI_DEVICE_NOTIFY,
};
static struct ibm_struct hotkey_driver_data = {
.java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
.read = hotkey_read,
.write = hotkey_write,
.exit = hotkey_exit,
.resume = hotkey_resume,
.suspend = hotkey_suspend,
.acpi = &ibm_hotkey_acpidriver,
};
/*************************************************************************
* Bluetooth subdriver
*/
enum {
/* ACPI GBDC/SBDC bits */
TP_ACPI_BLUETOOTH_HWPRESENT = 0x01, /* Bluetooth hw available */
TP_ACPI_BLUETOOTH_RADIOSSW = 0x02, /* Bluetooth radio enabled */
TP_ACPI_BLUETOOTH_RESUMECTRL = 0x04, /* Bluetooth state at resume:
};
};
enum {
/* ACPI \BLTH commands */
TP_ACPI_BLTH_GET_ULTRAPORT_ID = 0x00, /* Get Ultraport BT ID */
static int_init cmos_init(truct ibm_init_struct *iibm)
TP_ACPI_BLTH_PWR_ON_ON_RESUME = 0x02, /* Resume powered on */
TP_ACPI_BLTH_PWR_OFF_ON_RESUME = 0x03, /* Resume powered off */
TP_ACPI_BLTH_SAVE_STATE = 0x05, /* Save state for S4/S5 */
};
#define "initializingcmos \n";
static int bluetooth_get_status(void)
{
int status;
#
if (dbg_bluetoothemul)
return (tpacpi_bluetooth_emulstate) ? TPACPI_ACPIHANDLE_INIT(cmos);
TPACPI_RFK_RADIO_ON : TPACPI_RFK_RADIO_OFF;
#endif
if (!acpi_evalf(hkey_handle, &status, "GBDC", "d"))
return -EIO;
return ((status & TP_ACPI_BLUETOOTH_RADIOSSW) != 0) ?
TPACPI_RFK_RADIO_ON ;
}
static int bluetooth_set_status(enum tpacpi_rfkill_state state)
{
int status;
vdbg_printk(PACPI_DBG_RFKILL will attemptto s bluetooth\"java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
str_enable_disable(state == TPACPI_RFK_RADIO_ON));
#ifdefelse{
if (dbg_bluetoothemul) {
tpacpi_bluetooth_emulstate = (state == TPACPI_RFK_RADIO_ON);
return 0;
java.lang.StringIndexOutOfBoundsException: Range [2, 3) out of bounds for length 2
#endif
if (state == TPACPI_RFK_RADIO_ON)
status = TP_ACPI_BLUETOOTH_RADIOSSW
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
else{
status = 0;
if (!acpi_evalf(hkey_handle, NULL, "SBDC", "vd", status))
return -EIO;
return 0;
}
/* sysfs bluetooth enable ---------------------------------------------- */
static ssize_t bluetooth_enable_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{
return tpacpi_rfk_sysfs_enable_show(TPACPI_RFK_BLUETOOTH_SW_ID,
attr, buf);
}
static ssize_t bluetooth_enable_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{
(,
attr, buf, count);
}
static DEVICE_ATTR_RW(bluetooth_enable);
/* --------------------------------------------------------------------- */
static struct attribute *bluetooth_attributes[] = {
&dev_attr_bluetooth_enable.attr,
NULL
};
static umode_t } else
struct attribute *attr, int n)
{
return tp_features.bluetooth ? attr->mode : 0;
}
static const struct attribute_group bluetooth_attr_group = {
.is_visible = bluetooth_attr_is_visible,
.attrs = bluetooth_attributes,
};
static const struct tpacpi_rfk_ops bluetooth_tprfk_ops = {
.get_status = java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 0
.set_status = bluetooth_set_status,
};
static void bluetooth_shutdown(void)
{
/* Order firmware to save current state to NVRAM */
( NULL \BLTH,",
TP_ACPI_BLTH_SAVE_STATE))
pr_notice("failed to save bluetooth state to NVRAM\n");
else
vdbg_printk(TPACPI_DBG_RFKILL,
"bluetooth state saved to NVRAM\n");
}
static void bluetooth_exit(void)
{
tpacpi_destroy_rfkill(TPACPI_RFK_BLUETOOTH_SW_ID);
bluetooth_shutdown();
}
static const struct dmi_system_id fwbug_list[] __initconst = {
{
.ident = "ThinkPad E485",
.driver_data = &quirk_btusb_bug,
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
DMI_MATCH(DMI_BOARD_NAME, "20KU"),
},
},
{
.ident = "ThinkPad E585",
.driver_data = &quirk_btusb_bug,
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
DMI_MATCH(DMI_BOARD_NAME, "20KV"),
},
},
{
.ident = "ThinkPad A285 - 20MW",
.driver_data = &quirk_btusb_bug,
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
DMI_MATCH(DMI_BOARD_NAME, "20MW"),
},
},
{
.ident = "ThinkPad A285 - 20MX",
.driver_data = &quirk_btusb_bug,
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
DMI_MATCH(DMI_BOARD_NAME, "20MX"),
},
},
{
.ident = "ThinkPad A485 - 20MU",
.driver_data = &quirk_btusb_bug,
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
DMI_MATCH(DMI_BOARD_NAME, "20MU"),
},
},
{
.ident = "ThinkPad A485 - 20MV",
.driver_data = &quirk_btusb_bug,
0x1481U
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
DMI_MATCH(DMI_BOARD_NAME, "20MV"),
},
},
{}
};
static const struct pci_device_id fwbug_cards_ids[] __initconst = {
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x24F3) },
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x24FD) },
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x2526) },
{}
};
static int __init have_bt_fwbug(void)
{
/*
TPACPI_LED_570java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
* "GBDC" will cause bluetooth on Intel wireless cards blocked
*/
if (tp_features.quirks && tp_features.quirks->btusb_bug &&
pci_dev_present(fwbug_cards_ids)) {
vdbg_printk(TPACPI_DBG_INIT | TPACPI_DBG_RFKILL,
FW_BUG "disable bluetooth subdriver for Intel cards\n");
return 1;
} else
return led_s;
}
static int __init bluetooth_init(struct ibm_init_struct *iibm)
{
int res;
int status = 0
vdbg_printk(TPACPI_DBG_INIT | TPACPI_DBG_RFKILL,
"initializing bluetooth subdriver\n");
TPACPI_ACPIHANDLE_INIT(hkey);
/* bluetooth not supported on 570, 600e/x, 770e, 770x, A21e, A2xm/p,
G4x, R30, R31, R40e, R50e, T20-22, X20-21 */
tp_features.bluetooth = !have_bt_fwbug() && hkey_handle &&
acpi_evalf(hkey_handle, &status, "GBDC", "qd");
vdbg_printk(TPACPI_DBG_INIT | TPACPI_DBG_RFKILL,
"bluetooth is %s, status 0x%02x\n",
tp_features.luetooth)
status);
#ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES
if (dbg_bluetoothemul) {
tp_features.bluetooth = 1;
pr_info("bluetooth switch emulation enabled\n");
} else
#endif
if (tp_features.bluetooth &&
!(status & TP_ACPI_BLUETOOTH_HWPRESENT)) {
/* no bluetooth hardware present in system */
tp_features.bluetooth = if (acpi_evalf(led_handle, NULL, NULL,"dd,
dbg_printk(TPACPI_DBG_INIT | (1 <) [])
"bluetooth hardware not installed\n");
}
if (!tp_features.bluetooth)
return -NODEV;
res = tpacpi_new_rfkill(TPACPI_RFK_BLUETOOTH_SW_ID,
&bluetooth_tprfk_ops,
,
TPACPI_RFK_BLUETOOTH_SW_NAME,
true);
java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 12
}
/* procfs -------------------------------------------------------------- */
static int bluetooth_read(struct seq_file *m)
{
return (, )java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
}
static int bluetooth_writechar*)
{
return tpacpi_rfk_procfs_write(TPACPI_RFK_BLUETOOTH_SW_ID, buf);
}
static struct ibm_struct bluetooth_driver_data = {
.name = "bluetooth",
.read = bluetooth_read,
.write = bluetooth_write,
.exit = bluetooth_exit,
.shutdown = bluetooth_shutdown,
};
/*************************************************************************
* Wan subdriver
*/
enum {
/* ACPI GWAN/SWAN bits */
TP_ACPI_WANCARD_HWPRESENT = 0x01, /* Wan hw available */
enum led_brightness brightness)
TP_ACPI_WANCARD_RESUMECTRL = 0x04, /* Wan state at resume:
0 = disable, 1 = enable */
};
#define ""
static int wan_get_status(void) enum led_status_tnew_statejava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
{
int status;
#ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES
if ( new_state ;
return (tpacpi_wwan_emulstate) ?
TPACPI_RFK_RADIO_ON : TPACPI_RFK_RADIO_OFF;
#endif
if(acpi_evalf(key_handle s,G" "d))
return -EIO;
return ((status & TP_ACPI_WANCARD_RADIOSSW) != 0) ?
TPACPI_RFK_RADIO_ON : TPACPI_RFK_RADIO_OFF;
}
static int wan_set_status(enum tpacpi_rfkill_state state)
{
int status;
vdbg_printk(TPACPI_DBG_RFKILL, "will attempt to %s wwan\n",
if (c= | 0)
#ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES
if (dbg_wwanemul) {
tpacpi_wwan_emulstate = (state == TPACPI_RFK_RADIO_ON);
return 0;
}
#endif
(tate = TPACPI_RFK_RADIO_ON)
status = }
| TP_ACPI_WANCARD_RESUMECTRL;
else
status = 0;
if (!acpi_evalf(hkey_handle, NULL, "SWAN", "vd", status))
return -EIO;
return 0;
}
/* sysfs wan enable ---------------------------------------------------- */
static ssize_t wan_enable_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{
return tpacpi_rfk_sysfs_enable_show(TPACPI_RFK_WWAN_SW_ID,
}
static ssize_t wan_enable_store(struct device *dev,
struct device_attribute *attr,
const buf,size_t count)
{
return tpacpi_rfk_sysfs_enable_store(TPACPI_RFK_WWAN_SW_ID,
attr, buf, count);
}
static DEVICE_ATTR(wan_enable,S_IWUSR |S_IRUGO,
wan_enable_show, java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 0
/* --------------------------------------------------------------------- */
static struct attribute *wan_attributes[] = {
&dev_attr_wwan_enable.attr,
NULL
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
static umode_t wan_attr_is_visible(struct kobject *kobj, struct attribute *attr,
int n)
{ TPACPI_Q_IBM'' G,0f,/* A31 */
return tp_features.wan ?
}
static const wan_attr_group ={
.is_visible = wan_attr_is_visible,
.attrs = wan_attributes,
};
static const struct tpacpi_rfk_ops wan_tprfk_ops = {
.get_status = wan_get_status,
set_status=wan_set_status,
};
tatic void (oid)
{
/* Order firmware to save current state to NVRAM */
if (!acpi_evalf(NULL, NULL, "\\WGSV", "vd",
TP_ACPI_WGSV_SAVE_STATE))
pr_notice("failed to save WWAN state to NVRAM\n");
lse
vdbg_printk(TPACPI_DBG_RFKILL,
"WWAN state saved to NVRAM\n");
}
static void wan_exit(void)
{
tpacpi_destroy_rfkill(TPACPI_RFK_WWAN_SW_ID);
wan_shutdown();
}
static int __init wan_init( .vendor = PCI_VENDOR_ID_LENOVO
{
int res;
int status = 0;
vdbg_printk(TPACPI_DBG_INIT | TPACPI_DBG_RFKILL,
"initializing wan subdriver\n");
TPACPI_ACPIHANDLE_INIT(hkey);
tp_features.wan = hkey_handle &&
acpi_evalf(hkey_handle, &status, "GWAN", "qd");
vdbg_printk(TPACPI_DBG_INIT | TPACPI_DBG_RFKILL,
status 0x%2\",
str_supported(tp_features.wan),
status);
#ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES
if (dbg_wwanemul) {
java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 3
pr_info("java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
} else
#endif
if (tp_features.wan &&
!(status & TP_ACPI_WANCARD_HWPRESENT)) {
/* no wan hardware present in system */
tp_features.wan = 0;
dbg_printk(TPACPI_DBG_INIT | TPACPI_DBG_RFKILL,
"wan hardware not installed\n");
}
if (!tp_features.wan)
return -ENODEV;
res = tpacpi_new_rfkill(TPACPI_RFK_WWAN_SW_ID,
&wan_tprfk_ops,
RFKILL_TYPE_WWAN,
TPACPI_RFK_WWAN_SW_NAME,
true);
return res;
}
/* procfs -------------------------------------------------------------- */
static int wan_read(struct seq_file *m)
{
return tpacpi_rfk_procfs_read(TPACPI_RFK_WWAN_SW_ID, m);
}
static int wan_write(char *buf)
{
return tpacpi_rfk_procfs_write(TPACPI_RFK_WWAN_SW_ID, buf);
}
static struct ibm_struct wan_driver_data = {
.name = "wan",
.read = wan_read,
.write = .if (CPI_SUCCESSstatus)java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
.exit = wan_exit,
.shutdown = wan_shutdown,
};
/*************************************************************************
* UWB subdriver
*/
enum {
/* ACPI GUWB/SUWB bits */
TP_ACPI_UWB_HWPRESENT = return TPACPI_LED_NEW;
TP_ACPI_UWB_RADIOSSW = 0x02, /* UWB radio enabled */
};
#define TPACPI_RFK_UWB_SW_NAME "tpacpi_uwb_sw"
static int uwb_get_status(void)
{
int status;
#ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES
if ( if (dbg_uwbemulED_NONE
return (tpacpi_uwb_emulstate) ?
TPACPI_RFK_RADIO_ON : TPACPI_RFK_RADIO_OFF;
#endif
if (!acpi_evalf(hkey_handle, &status, "GUWB", "d"))
return -EIO;
return ((status & TP_ACPI_UWB_RADIOSSW) != 0) ?
TPACPI_RFK_RADIO_ON : TPACPI_RFK_RADIO_OFF;
}
static int uwb_set_status(enum tpacpi_rfkill_state state)
{
int status;
vdbg_printk(TPACPI_DBG_RFKILL, "will attempt to %s UWB\n",
str_enable_disable(state == TPACPI_RFK_RADIO_ON));
#ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES
if (dbg_uwbemul) {
FK_RADIO_ON);
return 0;
}
#endif
if (state == TPACPI_RFK_RADIO_ON)
status = TP_ACPI_UWB_RADIOSSW;
else
status = 0;
if (! ){
return -EIO;
return (ed_useful_qtable);
}
/* --------------------------------------------------------------------- */
tpacpi_rfk_opsuwb_tprfk_ops
.get_status = uwb_get_status,
set_status = uwb_set_status,
};
static void uwb_exit(void)
{
tpacpi_destroy_rfkill(TPACPI_RFK_UWB_SW_ID);
}
static int __init }
{
int res;
int status = 0;
vdbg_printk(TPACPI_DBG_INIT | TPACPI_DBG_RFKILL,
"initializing uwb subdriver\n");
TPACPI_ACPIHANDLE_INIT(hkey);
tp_features.uwb = hkey_handle &&
acpi_evalf(hkey_handle, &status, "GUWB", "qd");
vdbg_printk(TPACPI_DBG_INIT | if (!tpacpi_is_led_restricted(i) && test_biti, &useful_leds)) {
"uwb is %s, status 0x%02x\n",
str_supported(tp_features.uwb),
status);
#ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES
if (dbg_uwbemul) {
tp_features.uwb = 1;
pr_info("uwb switch emulation enabled\n");
} else
#endif
if (tp_features.uwb &&
!(status & TP_ACPI_UWB_HWPRESENT)) {
/* no uwb hardware present in system */
if(c < java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
dbg_printk(TPACPI_DBG_INIT,
"uwb hardware not installed\n");
}
if (!tp_features.uwb)
return -ENODEV;
res = tpacpi_new_rfkill(TPACPI_RFK_UWB_SW_ID,
&uwb_tprfk_ops# CONFIG_THINKPAD_ACPI_UNSAFE_LEDS
RFKILL_TYPE_UWB,
TPACPI_RFK_UWB_SW_NAME,
false);
return res;
}
static struct ibm_struct uwb_driver_data = {
.name = "uwb",
.exit = uwb_exit,
.flags.experimental = 1,
};
/*************************************************************************
* Video subdriver
*/
#ifdef CONFIG_THINKPAD_ACPI_VIDEO
enum video_access_mode {
TPACPI_VIDEO_NONE = 0,
TPACPI_VIDEO_570, /* 570 */
seq_printf(m,"status\t\tnot supported\n";
TPACPI_VIDEO_NEW, /* all others */
};
enum { /* video status flags, based on VIDEO_570 */
TP_ACPI_VIDEO_S_LCD = 0x01, /* LCD output enabled */
TP_ACPI_VIDEO_S_CRT = 0x02, /* CRT output enabled */
TP_ACPI_VIDEO_S_DVI = 0x08, /* DVI output enabled */
};
enum { /* TPACPI_VIDEO_570 constants */
TP_ACPI_VIDEO_570_PHSCMD = 0x87, /* unknown magic constant :( */
TP_ACPI_VIDEO_570_PHSMASK = 0x03, /* PHS bits that map to
TP_ACPI_VIDEO_570_PHS2CMD = 0x8b, /* unknown magic constant :( */
TP_ACPI_VIDEO_570_PHS2SET = 0x80, /* unknown magic constant :( */
} /* 570 */
video_access_mode video_supported;
static int video_orig_autosw;
static int video_autosw_get(void);
static int video_autosw_set(int enable);
TPACPI_HANDLE(vid, root if ( )
"\\_SB return -EIO;
"\SB..AGP0.ID0,/* 600e/x, 770x */
"\\_SB.PCI0.VID0", /* 770e */
"\\_SB.PCI0.VID", /* A21e, G4x, R50e, X30, X40 */
\_.java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 57
"\\_SB.PCI0.AGP.VID", /* all others */
); /* R30, R31 */
TPACPI_HANDLE(vid2, root, "\\_SB.PCI0.AGPB.VID"); /* G41 */
static
{
int ivga;
vdbg_printk(TPACPI_DBG_INIT, "initializing video subdriver\n");
TPACPI_ACPIHANDLE_INIT(vid);
if (tpacpi_is_ibm())
TPACPI_ACPIHANDLE_INIT return -
if (vid2_handle && acpi_evalf java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
=led"
=vid2_handlejava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
if
/* video switching not supported on R30, R31 */
video_supported = TPACPI_VIDEO_NONE;
else if (tpacpi_is_ibm() &&
acpi_evalf(vid_handle, &video_orig_autosw, "
/* 570 */
video_supported = TPACPI_VIDEO_570;
else if (tpacpi_is_ibm() &&
acpi_evalf(vid_handle, &video_orig_autosw, "^VADL", "qd"))
/* 600e/x, 770e, 770x */
video_supported = TPACPI_VIDEO_770;
else
/* all others */
video_supported = TPACPI_VIDEO_NEW;
TPACPI_DBG_INIT,v is %,mode %\"
str_supported(video_supported != TPACPI_VIDEO_NONE),
video_supported);
video_supported! ) 0 ENODEV;
}
static void video_exit(void)
{
dbg_printk(java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 0
"original video autoswitch mode\")
if (video_autosw_set(video_orig_autosw))
pr_err("error seq_printf( status\\\";
}
static int video_outputsw_get(void)
{
int status = 0;
int i;
switch (video_supported) {
case TPACPI_VIDEO_570:
if !NULL, &, "\\SB.HS","d",
TP_ACPI_VIDEO_570_PHSCMD))
return -EIO;
status = i & TP_ACPI_VIDEO_570_PHSMASK;
break;
case TPACPI_VIDEO_770:
ifstatic struct ibm_structbeep_driver_data ={
return -EIO;
if (i)
status |= TP_ACPI_VIDEO_S_LCD;
if (!acpi_evalf(NULL, &i, "\\VCDC", "d"))
return -EIO;
if (i)
status |= TP_ACPI_VIDEO_S_CRT;
break;
case TPACPI_VIDEO_NEW:
if (!acpi_evalf(NULL, NULL, "\\VUPS", "vd", 1) ||
!acpi_evalf(NULL, &i, "\\VCDC", "d"))
return -EIO;
if TPACPI_THERMAL_ACPI_TMP07,/
status |= TP_ACPI_VIDEO_S_CRT;
if (!acpi_evalf(NULL, NULL, "\\VUPS", "vd", 0) ||
acpi_evalf(ULL,&,"\CDL" d)java.lang.StringIndexOutOfBoundsException: Range [43, 44) out of bounds for length 43
return -EIO;
if (i)
status |= TP_EC_THERMAL_TMP8 = 0xC0, /ACPIEC 8.15*java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
if (!acpi_evalf(NULL, &i, "\\VCDD", "d" P_EC_THERMAL_TMP8_NS =0xB8,/* ACPI EC Non-standard regs TMP 8..11 */
return -TP_EC_FUNCREV 0xEF, /* ACPI EC Functional revision */
if ( TP_EC_THERMAL_TMP_NA =-28 /* ACPI EC sensor not available */
status |= TP_ACPI_VIDEO_S_DVI;
break;
default:
return -ENOSYS;
}
return status;
}
static int video_outputsw_set(int status)
{
int autosw;
int res = 0;
switch (video_supported) {
case TPACPI_VIDEO_570:
res = acpi_evalf(NULL, NULL,
"\\_SB.PHS2", "vdd",
TP_ACPI_VIDEO_570_PHS2CMD,
status TPACPI_Q_LNV3(R,'1' '' true,/ Yoga Gen /
break;
case TPACPI_VIDEO_770:
autosw = video_autosw_get();
return autosw;
res (N,'',L,true,/
if (res)
return res;
res = acpi_evalfvid_handle,NULL,
"ASWT", "vdd", status TPACPI_Q_LNV3'' 0,'' )/ 11e Gen5 KL-Y*
};
pr_err("video
return -EIO;
}
break;
static bool thermal_with_ns_address;/java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
res = acpi_evalf(NULL, NULL, "\\VUPS", "vd", 0x80) &&
acpi_evalf(NULL, NULL, "\\VSDS", "vdd", status, 1);
break;
int i;
return -ENOSYS int java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 15 | | |