xref: /OK3568_Linux_fs/kernel/Documentation/admin-guide/laptops/toshiba_haps.rst (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun====================================
2*4882a593SmuzhiyunToshiba HDD Active Protection Sensor
3*4882a593Smuzhiyun====================================
4*4882a593Smuzhiyun
5*4882a593SmuzhiyunKernel driver: toshiba_haps
6*4882a593Smuzhiyun
7*4882a593SmuzhiyunAuthor: Azael Avalos <coproscefalo@gmail.com>
8*4882a593Smuzhiyun
9*4882a593Smuzhiyun
10*4882a593Smuzhiyun.. 0. Contents
11*4882a593Smuzhiyun
12*4882a593Smuzhiyun   1. Description
13*4882a593Smuzhiyun   2. Interface
14*4882a593Smuzhiyun   3. Accelerometer axes
15*4882a593Smuzhiyun   4. Supported devices
16*4882a593Smuzhiyun   5. Usage
17*4882a593Smuzhiyun
18*4882a593Smuzhiyun
19*4882a593Smuzhiyun1. Description
20*4882a593Smuzhiyun--------------
21*4882a593Smuzhiyun
22*4882a593SmuzhiyunThis driver provides support for the accelerometer found in various Toshiba
23*4882a593Smuzhiyunlaptops, being called "Toshiba HDD Protection - Shock Sensor" officially,
24*4882a593Smuzhiyunand detects laptops automatically with this device.
25*4882a593SmuzhiyunOn Windows, Toshiba provided software monitors this device and provides
26*4882a593Smuzhiyunautomatic HDD protection (head unload) on sudden moves or harsh vibrations,
27*4882a593Smuzhiyunhowever, this driver only provides a notification via a sysfs file to let
28*4882a593Smuzhiyunuserspace tools or daemons act accordingly, as well as providing a sysfs
29*4882a593Smuzhiyunfile to set the desired protection level or sensor sensibility.
30*4882a593Smuzhiyun
31*4882a593Smuzhiyun
32*4882a593Smuzhiyun2. Interface
33*4882a593Smuzhiyun------------
34*4882a593Smuzhiyun
35*4882a593SmuzhiyunThis device comes with 3 methods:
36*4882a593Smuzhiyun
37*4882a593Smuzhiyun====	=====================================================================
38*4882a593Smuzhiyun_STA    Checks existence of the device, returning Zero if the device does not
39*4882a593Smuzhiyun	exists or is not supported.
40*4882a593SmuzhiyunPTLV    Sets the desired protection level.
41*4882a593SmuzhiyunRSSS    Shuts down the HDD protection interface for a few seconds,
42*4882a593Smuzhiyun	then restores normal operation.
43*4882a593Smuzhiyun====	=====================================================================
44*4882a593Smuzhiyun
45*4882a593SmuzhiyunNote:
46*4882a593Smuzhiyun  The presence of Solid State Drives (SSD) can make this driver to fail loading,
47*4882a593Smuzhiyun  given the fact that such drives have no movable parts, and thus, not requiring
48*4882a593Smuzhiyun  any "protection" as well as failing during the evaluation of the _STA method
49*4882a593Smuzhiyun  found under this device.
50*4882a593Smuzhiyun
51*4882a593Smuzhiyun
52*4882a593Smuzhiyun3. Accelerometer axes
53*4882a593Smuzhiyun---------------------
54*4882a593Smuzhiyun
55*4882a593SmuzhiyunThis device does not report any axes, however, to query the sensor position
56*4882a593Smuzhiyuna couple HCI (Hardware Configuration Interface) calls (0x6D and 0xA6) are
57*4882a593Smuzhiyunprovided to query such information, handled by the kernel module toshiba_acpi
58*4882a593Smuzhiyunsince kernel version 3.15.
59*4882a593Smuzhiyun
60*4882a593Smuzhiyun
61*4882a593Smuzhiyun4. Supported devices
62*4882a593Smuzhiyun--------------------
63*4882a593Smuzhiyun
64*4882a593SmuzhiyunThis driver binds itself to the ACPI device TOS620A, and any Toshiba laptop
65*4882a593Smuzhiyunwith this device is supported, given the fact that they have the presence of
66*4882a593Smuzhiyunconventional HDD and not only SSD, or a combination of both HDD and SSD.
67*4882a593Smuzhiyun
68*4882a593Smuzhiyun
69*4882a593Smuzhiyun5. Usage
70*4882a593Smuzhiyun--------
71*4882a593Smuzhiyun
72*4882a593SmuzhiyunThe sysfs files under /sys/devices/LNXSYSTM:00/LNXSYBUS:00/TOS620A:00/ are:
73*4882a593Smuzhiyun
74*4882a593Smuzhiyun================   ============================================================
75*4882a593Smuzhiyunprotection_level   The protection_level is readable and writeable, and
76*4882a593Smuzhiyun		   provides a way to let userspace query the current protection
77*4882a593Smuzhiyun		   level, as well as set the desired protection level, the
78*4882a593Smuzhiyun		   available protection levels are::
79*4882a593Smuzhiyun
80*4882a593Smuzhiyun		     ============   =======   ==========   ========
81*4882a593Smuzhiyun		     0 - Disabled   1 - Low   2 - Medium   3 - High
82*4882a593Smuzhiyun		     ============   =======   ==========   ========
83*4882a593Smuzhiyun
84*4882a593Smuzhiyunreset_protection   The reset_protection entry is writeable only, being "1"
85*4882a593Smuzhiyun		   the only parameter it accepts, it is used to trigger
86*4882a593Smuzhiyun		   a reset of the protection interface.
87*4882a593Smuzhiyun================   ============================================================
88