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) /* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 */
^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)  * Name: acbuffer.h - Support for buffers returned by ACPI predefined names
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  * Copyright (C) 2000 - 2020, Intel Corp.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7)  *
^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) #ifndef __ACBUFFER_H__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) #define __ACBUFFER_H__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14)  * Contains buffer structures for these predefined names:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15)  * _FDE, _GRT, _GTM, _PLD, _SRT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16)  */
^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)  * Note: C bitfields are not used for this reason:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21)  * "Bitfields are great and easy to read, but unfortunately the C language
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22)  * does not specify the layout of bitfields in memory, which means they are
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23)  * essentially useless for dealing with packed data in on-disk formats or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24)  * binary wire protocols." (Or ACPI tables and buffers.) "If you ask me,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25)  * this decision was a design error in C. Ritchie could have picked an order
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26)  * and stuck with it." Norman Ramsey.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27)  * See http://stackoverflow.com/a/1053662/41661
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) /* _FDE return value */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) struct acpi_fde_info {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) 	u32 floppy0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) 	u32 floppy1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) 	u32 floppy2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) 	u32 floppy3;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) 	u32 tape;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41)  * _GRT return value
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42)  * _SRT input value
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) struct acpi_grt_info {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) 	u16 year;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) 	u8 month;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) 	u8 day;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) 	u8 hour;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 	u8 minute;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 	u8 second;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 	u8 valid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 	u16 milliseconds;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53) 	u16 timezone;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54) 	u8 daylight;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 	u8 reserved[3];
^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) /* _GTM return value */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) struct acpi_gtm_info {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 	u32 pio_speed0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 	u32 dma_speed0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) 	u32 pio_speed1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) 	u32 dma_speed1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 	u32 flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) };
^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)  * Formatted _PLD return value. The minimum size is a package containing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70)  * one buffer.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71)  * Revision 1: Buffer is 16 bytes (128 bits)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72)  * Revision 2: Buffer is 20 bytes (160 bits)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74)  * Note: This structure is returned from the acpi_decode_pld_buffer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75)  * interface.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) struct acpi_pld_info {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 	u8 revision;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 	u8 ignore_color;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 	u8 red;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 	u8 green;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 	u8 blue;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 	u16 width;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 	u16 height;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 	u8 user_visible;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 	u8 dock;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 	u8 lid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 	u8 panel;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 	u8 vertical_position;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 	u8 horizontal_position;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 	u8 shape;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 	u8 group_orientation;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 	u8 group_token;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 	u8 group_position;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 	u8 bay;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 	u8 ejectable;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 	u8 ospm_eject_required;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 	u8 cabinet_number;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 	u8 card_cage_number;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 	u8 reference;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 	u8 rotation;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 	u8 order;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 	u8 reserved;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 	u16 vertical_offset;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 	u16 horizontal_offset;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109)  * Macros to:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110)  *     1) Convert a _PLD buffer to internal struct acpi_pld_info format - ACPI_PLD_GET*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111)  *        (Used by acpi_decode_pld_buffer)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112)  *     2) Construct a _PLD buffer - ACPI_PLD_SET*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113)  *        (Intended for BIOS use only)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) #define ACPI_PLD_REV1_BUFFER_SIZE               16	/* For Revision 1 of the buffer (From ACPI spec) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) #define ACPI_PLD_REV2_BUFFER_SIZE               20	/* For Revision 2 of the buffer (From ACPI spec) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) #define ACPI_PLD_BUFFER_SIZE                    20	/* For Revision 2 of the buffer (From ACPI spec) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) /* First 32-bit dword, bits 0:32 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) #define ACPI_PLD_GET_REVISION(dword)            ACPI_GET_BITS (dword, 0, ACPI_7BIT_MASK)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) #define ACPI_PLD_SET_REVISION(dword,value)      ACPI_SET_BITS (dword, 0, ACPI_7BIT_MASK, value)	/* Offset 0, Len 7 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) #define ACPI_PLD_GET_IGNORE_COLOR(dword)        ACPI_GET_BITS (dword, 7, ACPI_1BIT_MASK)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) #define ACPI_PLD_SET_IGNORE_COLOR(dword,value)  ACPI_SET_BITS (dword, 7, ACPI_1BIT_MASK, value)	/* Offset 7, Len 1 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) #define ACPI_PLD_GET_RED(dword)                 ACPI_GET_BITS (dword, 8, ACPI_8BIT_MASK)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) #define ACPI_PLD_SET_RED(dword,value)           ACPI_SET_BITS (dword, 8, ACPI_8BIT_MASK, value)	/* Offset 8, Len 8 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) #define ACPI_PLD_GET_GREEN(dword)               ACPI_GET_BITS (dword, 16, ACPI_8BIT_MASK)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) #define ACPI_PLD_SET_GREEN(dword,value)         ACPI_SET_BITS (dword, 16, ACPI_8BIT_MASK, value)	/* Offset 16, Len 8 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) #define ACPI_PLD_GET_BLUE(dword)                ACPI_GET_BITS (dword, 24, ACPI_8BIT_MASK)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) #define ACPI_PLD_SET_BLUE(dword,value)          ACPI_SET_BITS (dword, 24, ACPI_8BIT_MASK, value)	/* Offset 24, Len 8 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) /* Second 32-bit dword, bits 33:63 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) #define ACPI_PLD_GET_WIDTH(dword)               ACPI_GET_BITS (dword, 0, ACPI_16BIT_MASK)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) #define ACPI_PLD_SET_WIDTH(dword,value)         ACPI_SET_BITS (dword, 0, ACPI_16BIT_MASK, value)	/* Offset 32+0=32, Len 16 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) #define ACPI_PLD_GET_HEIGHT(dword)              ACPI_GET_BITS (dword, 16, ACPI_16BIT_MASK)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) #define ACPI_PLD_SET_HEIGHT(dword,value)        ACPI_SET_BITS (dword, 16, ACPI_16BIT_MASK, value)	/* Offset 32+16=48, Len 16 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) /* Third 32-bit dword, bits 64:95 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) #define ACPI_PLD_GET_USER_VISIBLE(dword)        ACPI_GET_BITS (dword, 0, ACPI_1BIT_MASK)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) #define ACPI_PLD_SET_USER_VISIBLE(dword,value)  ACPI_SET_BITS (dword, 0, ACPI_1BIT_MASK, value)	/* Offset 64+0=64, Len 1 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) #define ACPI_PLD_GET_DOCK(dword)                ACPI_GET_BITS (dword, 1, ACPI_1BIT_MASK)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) #define ACPI_PLD_SET_DOCK(dword,value)          ACPI_SET_BITS (dword, 1, ACPI_1BIT_MASK, value)	/* Offset 64+1=65, Len 1 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) #define ACPI_PLD_GET_LID(dword)                 ACPI_GET_BITS (dword, 2, ACPI_1BIT_MASK)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) #define ACPI_PLD_SET_LID(dword,value)           ACPI_SET_BITS (dword, 2, ACPI_1BIT_MASK, value)	/* Offset 64+2=66, Len 1 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) #define ACPI_PLD_GET_PANEL(dword)               ACPI_GET_BITS (dword, 3, ACPI_3BIT_MASK)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) #define ACPI_PLD_SET_PANEL(dword,value)         ACPI_SET_BITS (dword, 3, ACPI_3BIT_MASK, value)	/* Offset 64+3=67, Len 3 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) #define ACPI_PLD_GET_VERTICAL(dword)            ACPI_GET_BITS (dword, 6, ACPI_2BIT_MASK)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) #define ACPI_PLD_SET_VERTICAL(dword,value)      ACPI_SET_BITS (dword, 6, ACPI_2BIT_MASK, value)	/* Offset 64+6=70, Len 2 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) #define ACPI_PLD_GET_HORIZONTAL(dword)          ACPI_GET_BITS (dword, 8, ACPI_2BIT_MASK)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) #define ACPI_PLD_SET_HORIZONTAL(dword,value)    ACPI_SET_BITS (dword, 8, ACPI_2BIT_MASK, value)	/* Offset 64+8=72, Len 2 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) #define ACPI_PLD_GET_SHAPE(dword)               ACPI_GET_BITS (dword, 10, ACPI_4BIT_MASK)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) #define ACPI_PLD_SET_SHAPE(dword,value)         ACPI_SET_BITS (dword, 10, ACPI_4BIT_MASK, value)	/* Offset 64+10=74, Len 4 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) #define ACPI_PLD_GET_ORIENTATION(dword)         ACPI_GET_BITS (dword, 14, ACPI_1BIT_MASK)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) #define ACPI_PLD_SET_ORIENTATION(dword,value)   ACPI_SET_BITS (dword, 14, ACPI_1BIT_MASK, value)	/* Offset 64+14=78, Len 1 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) #define ACPI_PLD_GET_TOKEN(dword)               ACPI_GET_BITS (dword, 15, ACPI_8BIT_MASK)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) #define ACPI_PLD_SET_TOKEN(dword,value)         ACPI_SET_BITS (dword, 15, ACPI_8BIT_MASK, value)	/* Offset 64+15=79, Len 8 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) #define ACPI_PLD_GET_POSITION(dword)            ACPI_GET_BITS (dword, 23, ACPI_8BIT_MASK)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) #define ACPI_PLD_SET_POSITION(dword,value)      ACPI_SET_BITS (dword, 23, ACPI_8BIT_MASK, value)	/* Offset 64+23=87, Len 8 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) #define ACPI_PLD_GET_BAY(dword)                 ACPI_GET_BITS (dword, 31, ACPI_1BIT_MASK)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) #define ACPI_PLD_SET_BAY(dword,value)           ACPI_SET_BITS (dword, 31, ACPI_1BIT_MASK, value)	/* Offset 64+31=95, Len 1 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) /* Fourth 32-bit dword, bits 96:127 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) #define ACPI_PLD_GET_EJECTABLE(dword)           ACPI_GET_BITS (dword, 0, ACPI_1BIT_MASK)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) #define ACPI_PLD_SET_EJECTABLE(dword,value)     ACPI_SET_BITS (dword, 0, ACPI_1BIT_MASK, value)	/* Offset 96+0=96, Len 1 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) #define ACPI_PLD_GET_OSPM_EJECT(dword)          ACPI_GET_BITS (dword, 1, ACPI_1BIT_MASK)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) #define ACPI_PLD_SET_OSPM_EJECT(dword,value)    ACPI_SET_BITS (dword, 1, ACPI_1BIT_MASK, value)	/* Offset 96+1=97, Len 1 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) #define ACPI_PLD_GET_CABINET(dword)             ACPI_GET_BITS (dword, 2, ACPI_8BIT_MASK)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) #define ACPI_PLD_SET_CABINET(dword,value)       ACPI_SET_BITS (dword, 2, ACPI_8BIT_MASK, value)	/* Offset 96+2=98, Len 8 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) #define ACPI_PLD_GET_CARD_CAGE(dword)           ACPI_GET_BITS (dword, 10, ACPI_8BIT_MASK)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) #define ACPI_PLD_SET_CARD_CAGE(dword,value)     ACPI_SET_BITS (dword, 10, ACPI_8BIT_MASK, value)	/* Offset 96+10=106, Len 8 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) #define ACPI_PLD_GET_REFERENCE(dword)           ACPI_GET_BITS (dword, 18, ACPI_1BIT_MASK)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) #define ACPI_PLD_SET_REFERENCE(dword,value)     ACPI_SET_BITS (dword, 18, ACPI_1BIT_MASK, value)	/* Offset 96+18=114, Len 1 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) #define ACPI_PLD_GET_ROTATION(dword)            ACPI_GET_BITS (dword, 19, ACPI_4BIT_MASK)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) #define ACPI_PLD_SET_ROTATION(dword,value)      ACPI_SET_BITS (dword, 19, ACPI_4BIT_MASK, value)	/* Offset 96+19=115, Len 4 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) #define ACPI_PLD_GET_ORDER(dword)               ACPI_GET_BITS (dword, 23, ACPI_5BIT_MASK)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) #define ACPI_PLD_SET_ORDER(dword,value)         ACPI_SET_BITS (dword, 23, ACPI_5BIT_MASK, value)	/* Offset 96+23=119, Len 5 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) /* Fifth 32-bit dword, bits 128:159 (Revision 2 of _PLD only) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) #define ACPI_PLD_GET_VERT_OFFSET(dword)         ACPI_GET_BITS (dword, 0, ACPI_16BIT_MASK)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) #define ACPI_PLD_SET_VERT_OFFSET(dword,value)   ACPI_SET_BITS (dword, 0, ACPI_16BIT_MASK, value)	/* Offset 128+0=128, Len 16 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) #define ACPI_PLD_GET_HORIZ_OFFSET(dword)        ACPI_GET_BITS (dword, 16, ACPI_16BIT_MASK)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) #define ACPI_PLD_SET_HORIZ_OFFSET(dword,value)  ACPI_SET_BITS (dword, 16, ACPI_16BIT_MASK, value)	/* Offset 128+16=144, Len 16 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) #endif				/* ACBUFFER_H */