19e1cbedeSMauro Carvalho Chehab==================================== 29e1cbedeSMauro Carvalho ChehabToshiba HDD Active Protection Sensor 39e1cbedeSMauro Carvalho Chehab==================================== 49e1cbedeSMauro Carvalho Chehab 59e1cbedeSMauro Carvalho ChehabKernel driver: toshiba_haps 69e1cbedeSMauro Carvalho Chehab 79e1cbedeSMauro Carvalho ChehabAuthor: Azael Avalos <coproscefalo@gmail.com> 89e1cbedeSMauro Carvalho Chehab 99e1cbedeSMauro Carvalho Chehab 109e1cbedeSMauro Carvalho Chehab.. 0. Contents 119e1cbedeSMauro Carvalho Chehab 129e1cbedeSMauro Carvalho Chehab 1. Description 139e1cbedeSMauro Carvalho Chehab 2. Interface 149e1cbedeSMauro Carvalho Chehab 3. Accelerometer axes 159e1cbedeSMauro Carvalho Chehab 4. Supported devices 169e1cbedeSMauro Carvalho Chehab 5. Usage 179e1cbedeSMauro Carvalho Chehab 189e1cbedeSMauro Carvalho Chehab 199e1cbedeSMauro Carvalho Chehab1. Description 209e1cbedeSMauro Carvalho Chehab-------------- 219e1cbedeSMauro Carvalho Chehab 229e1cbedeSMauro Carvalho ChehabThis driver provides support for the accelerometer found in various Toshiba 239e1cbedeSMauro Carvalho Chehablaptops, being called "Toshiba HDD Protection - Shock Sensor" officially, 249e1cbedeSMauro Carvalho Chehaband detects laptops automatically with this device. 259e1cbedeSMauro Carvalho ChehabOn Windows, Toshiba provided software monitors this device and provides 269e1cbedeSMauro Carvalho Chehabautomatic HDD protection (head unload) on sudden moves or harsh vibrations, 279e1cbedeSMauro Carvalho Chehabhowever, this driver only provides a notification via a sysfs file to let 289e1cbedeSMauro Carvalho Chehabuserspace tools or daemons act accordingly, as well as providing a sysfs 299e1cbedeSMauro Carvalho Chehabfile to set the desired protection level or sensor sensibility. 309e1cbedeSMauro Carvalho Chehab 319e1cbedeSMauro Carvalho Chehab 329e1cbedeSMauro Carvalho Chehab2. Interface 339e1cbedeSMauro Carvalho Chehab------------ 349e1cbedeSMauro Carvalho Chehab 359e1cbedeSMauro Carvalho ChehabThis device comes with 3 methods: 369e1cbedeSMauro Carvalho Chehab 379e1cbedeSMauro Carvalho Chehab==== ===================================================================== 389e1cbedeSMauro Carvalho Chehab_STA Checks existence of the device, returning Zero if the device does not 399e1cbedeSMauro Carvalho Chehab exists or is not supported. 409e1cbedeSMauro Carvalho ChehabPTLV Sets the desired protection level. 419e1cbedeSMauro Carvalho ChehabRSSS Shuts down the HDD protection interface for a few seconds, 429e1cbedeSMauro Carvalho Chehab then restores normal operation. 439e1cbedeSMauro Carvalho Chehab==== ===================================================================== 449e1cbedeSMauro Carvalho Chehab 459e1cbedeSMauro Carvalho ChehabNote: 469e1cbedeSMauro Carvalho Chehab The presence of Solid State Drives (SSD) can make this driver to fail loading, 479e1cbedeSMauro Carvalho Chehab given the fact that such drives have no movable parts, and thus, not requiring 489e1cbedeSMauro Carvalho Chehab any "protection" as well as failing during the evaluation of the _STA method 499e1cbedeSMauro Carvalho Chehab found under this device. 509e1cbedeSMauro Carvalho Chehab 519e1cbedeSMauro Carvalho Chehab 529e1cbedeSMauro Carvalho Chehab3. Accelerometer axes 539e1cbedeSMauro Carvalho Chehab--------------------- 549e1cbedeSMauro Carvalho Chehab 559e1cbedeSMauro Carvalho ChehabThis device does not report any axes, however, to query the sensor position 569e1cbedeSMauro Carvalho Chehaba couple HCI (Hardware Configuration Interface) calls (0x6D and 0xA6) are 579e1cbedeSMauro Carvalho Chehabprovided to query such information, handled by the kernel module toshiba_acpi 589e1cbedeSMauro Carvalho Chehabsince kernel version 3.15. 599e1cbedeSMauro Carvalho Chehab 609e1cbedeSMauro Carvalho Chehab 619e1cbedeSMauro Carvalho Chehab4. Supported devices 629e1cbedeSMauro Carvalho Chehab-------------------- 639e1cbedeSMauro Carvalho Chehab 649e1cbedeSMauro Carvalho ChehabThis driver binds itself to the ACPI device TOS620A, and any Toshiba laptop 659e1cbedeSMauro Carvalho Chehabwith this device is supported, given the fact that they have the presence of 669e1cbedeSMauro Carvalho Chehabconventional HDD and not only SSD, or a combination of both HDD and SSD. 679e1cbedeSMauro Carvalho Chehab 689e1cbedeSMauro Carvalho Chehab 699e1cbedeSMauro Carvalho Chehab5. Usage 709e1cbedeSMauro Carvalho Chehab-------- 719e1cbedeSMauro Carvalho Chehab 729e1cbedeSMauro Carvalho ChehabThe sysfs files under /sys/devices/LNXSYSTM:00/LNXSYBUS:00/TOS620A:00/ are: 739e1cbedeSMauro Carvalho Chehab 749e1cbedeSMauro Carvalho Chehab================ ============================================================ 759e1cbedeSMauro Carvalho Chehabprotection_level The protection_level is readable and writeable, and 769e1cbedeSMauro Carvalho Chehab provides a way to let userspace query the current protection 779e1cbedeSMauro Carvalho Chehab level, as well as set the desired protection level, the 78*eddeed12SMauro Carvalho Chehab available protection levels are:: 799e1cbedeSMauro Carvalho Chehab 809e1cbedeSMauro Carvalho Chehab ============ ======= ========== ======== 819e1cbedeSMauro Carvalho Chehab 0 - Disabled 1 - Low 2 - Medium 3 - High 829e1cbedeSMauro Carvalho Chehab ============ ======= ========== ======== 839e1cbedeSMauro Carvalho Chehab 849e1cbedeSMauro Carvalho Chehabreset_protection The reset_protection entry is writeable only, being "1" 859e1cbedeSMauro Carvalho Chehab the only parameter it accepts, it is used to trigger 869e1cbedeSMauro Carvalho Chehab a reset of the protection interface. 879e1cbedeSMauro Carvalho Chehab================ ============================================================ 88