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) Kernel driver max197
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  2) ====================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  3) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  4) Author:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  5) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  6)   * Vivien Didelot <vivien.didelot@savoirfairelinux.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  7) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  8) Supported chips:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  9) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)   * Maxim MAX197
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)     Prefix: 'max197'
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)     Datasheet: http://datasheets.maxim-ic.com/en/ds/MAX197.pdf
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16)   * Maxim MAX199
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18)     Prefix: 'max199'
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20)     Datasheet: http://datasheets.maxim-ic.com/en/ds/MAX199.pdf
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) Description
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) -----------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) The A/D converters MAX197, and MAX199 are both 8-Channel, Multi-Range, 5V,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) 12-Bit DAS with 8+4 Bus Interface and Fault Protection.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) The available ranges for the MAX197 are {0,-5V} to 5V, and {0,-10V} to 10V,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) while they are {0,-2V} to 2V, and {0,-4V} to 4V on the MAX199.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) Platform data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) -------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) The MAX197 platform data (defined in linux/platform_data/max197.h) should be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) filled with a pointer to a conversion function, defined like::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37)     int convert(u8 ctrl);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) ctrl is the control byte to write to start a new conversion.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) On success, the function must return the 12-bit raw value read from the chip,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) or a negative error code otherwise.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) Control byte format:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) ======= ========== ============================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) Bit     Name       Description
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) 7,6     PD1,PD0    Clock and Power-Down modes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) 5       ACQMOD     Internal or External Controlled Acquisition
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) 4       RNG        Full-scale voltage magnitude at the input
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) 3       BIP        Unipolar or Bipolar conversion mode
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) 2,1,0   A2,A1,A0   Channel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) ======= ========== ============================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) Sysfs interface
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) ---------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57)   ============== ==============================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58)   in[0-7]_input  The conversion value for the corresponding channel.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) 		 RO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61)   in[0-7]_min    The lower limit (in mV) for the corresponding channel.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) 		 For the MAX197, it will be adjusted to -10000, -5000, or 0.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) 		 For the MAX199, it will be adjusted to -4000, -2000, or 0.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) 		 RW
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66)   in[0-7]_max    The higher limit (in mV) for the corresponding channel.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) 		 For the MAX197, it will be adjusted to 0, 5000, or 10000.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) 		 For the MAX199, it will be adjusted to 0, 2000, or 4000.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) 		 RW
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70)   ============== ==============================================================