Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

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