xref: /freebsd/sys/contrib/dev/acpica/components/resources/rsserial.c (revision 7697e6c4df7188ee3a2aa66f73c572c27479bdf2)
1 /*******************************************************************************
2  *
3  * Module Name: rsserial - GPIO/SerialBus resource descriptors
4  *
5  ******************************************************************************/
6 
7 /******************************************************************************
8  *
9  * 1. Copyright Notice
10  *
11  * Some or all of this work - Copyright (c) 1999 - 2026, Intel Corp.
12  * All rights reserved.
13  *
14  * 2. License
15  *
16  * 2.1. This is your license from Intel Corp. under its intellectual property
17  * rights. You may have additional license terms from the party that provided
18  * you this software, covering your right to use that party's intellectual
19  * property rights.
20  *
21  * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
22  * copy of the source code appearing in this file ("Covered Code") an
23  * irrevocable, perpetual, worldwide license under Intel's copyrights in the
24  * base code distributed originally by Intel ("Original Intel Code") to copy,
25  * make derivatives, distribute, use and display any portion of the Covered
26  * Code in any form, with the right to sublicense such rights; and
27  *
28  * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
29  * license (with the right to sublicense), under only those claims of Intel
30  * patents that are infringed by the Original Intel Code, to make, use, sell,
31  * offer to sell, and import the Covered Code and derivative works thereof
32  * solely to the minimum extent necessary to exercise the above copyright
33  * license, and in no event shall the patent license extend to any additions
34  * to or modifications of the Original Intel Code. No other license or right
35  * is granted directly or by implication, estoppel or otherwise;
36  *
37  * The above copyright and patent license is granted only if the following
38  * conditions are met:
39  *
40  * 3. Conditions
41  *
42  * 3.1. Redistribution of Source with Rights to Further Distribute Source.
43  * Redistribution of source code of any substantial portion of the Covered
44  * Code or modification with rights to further distribute source must include
45  * the above Copyright Notice, the above License, this list of Conditions,
46  * and the following Disclaimer and Export Compliance provision. In addition,
47  * Licensee must cause all Covered Code to which Licensee contributes to
48  * contain a file documenting the changes Licensee made to create that Covered
49  * Code and the date of any change. Licensee must include in that file the
50  * documentation of any changes made by any predecessor Licensee. Licensee
51  * must include a prominent statement that the modification is derived,
52  * directly or indirectly, from Original Intel Code.
53  *
54  * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
55  * Redistribution of source code of any substantial portion of the Covered
56  * Code or modification without rights to further distribute source must
57  * include the following Disclaimer and Export Compliance provision in the
58  * documentation and/or other materials provided with distribution. In
59  * addition, Licensee may not authorize further sublicense of source of any
60  * portion of the Covered Code, and must include terms to the effect that the
61  * license from Licensee to its licensee is limited to the intellectual
62  * property embodied in the software Licensee provides to its licensee, and
63  * not to intellectual property embodied in modifications its licensee may
64  * make.
65  *
66  * 3.3. Redistribution of Executable. Redistribution in executable form of any
67  * substantial portion of the Covered Code or modification must reproduce the
68  * above Copyright Notice, and the following Disclaimer and Export Compliance
69  * provision in the documentation and/or other materials provided with the
70  * distribution.
71  *
72  * 3.4. Intel retains all right, title, and interest in and to the Original
73  * Intel Code.
74  *
75  * 3.5. Neither the name Intel nor any other trademark owned or controlled by
76  * Intel shall be used in advertising or otherwise to promote the sale, use or
77  * other dealings in products derived from or relating to the Covered Code
78  * without prior written authorization from Intel.
79  *
80  * 4. Disclaimer and Export Compliance
81  *
82  * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
83  * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
84  * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
85  * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
86  * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
87  * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
88  * PARTICULAR PURPOSE.
89  *
90  * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
91  * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
92  * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
93  * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
94  * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
95  * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
96  * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
97  * LIMITED REMEDY.
98  *
99  * 4.3. Licensee shall not export, either directly or indirectly, any of this
100  * software or system incorporating such software without first obtaining any
101  * required license or other approval from the U. S. Department of Commerce or
102  * any other agency or department of the United States Government. In the
103  * event Licensee exports any such software from the United States or
104  * re-exports any such software from a foreign destination, Licensee shall
105  * ensure that the distribution and export/re-export of the software is in
106  * compliance with all laws, regulations, orders, or other restrictions of the
107  * U.S. Export Administration Regulations. Licensee agrees that neither it nor
108  * any of its subsidiaries will export/re-export any technical data, process,
109  * software, or service, directly or indirectly, to any country for which the
110  * United States government or any agency thereof requires an export license,
111  * other governmental approval, or letter of assurance, without first obtaining
112  * such license, approval or letter.
113  *
114  *****************************************************************************
115  *
116  * Alternatively, you may choose to be licensed under the terms of the
117  * following license:
118  *
119  * Redistribution and use in source and binary forms, with or without
120  * modification, are permitted provided that the following conditions
121  * are met:
122  * 1. Redistributions of source code must retain the above copyright
123  *    notice, this list of conditions, and the following disclaimer,
124  *    without modification.
125  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
126  *    substantially similar to the "NO WARRANTY" disclaimer below
127  *    ("Disclaimer") and any redistribution must be conditioned upon
128  *    including a substantially similar Disclaimer requirement for further
129  *    binary redistribution.
130  * 3. Neither the names of the above-listed copyright holders nor the names
131  *    of any contributors may be used to endorse or promote products derived
132  *    from this software without specific prior written permission.
133  *
134  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
135  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
136  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
137  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
138  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
139  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
140  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
141  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
142  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
143  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
144  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
145  *
146  * Alternatively, you may choose to be licensed under the terms of the
147  * GNU General Public License ("GPL") version 2 as published by the Free
148  * Software Foundation.
149  *
150  *****************************************************************************/
151 
152 #include <contrib/dev/acpica/include/acpi.h>
153 #include <contrib/dev/acpica/include/accommon.h>
154 #include <contrib/dev/acpica/include/acresrc.h>
155 
156 #define _COMPONENT          ACPI_RESOURCES
157         ACPI_MODULE_NAME    ("rsserial")
158 
159 
160 /*******************************************************************************
161  *
162  * AcpiRsConvertGpio
163  *
164  ******************************************************************************/
165 
166 ACPI_RSCONVERT_INFO     AcpiRsConvertGpio[18] =
167 {
168     {ACPI_RSC_INITGET,  ACPI_RESOURCE_TYPE_GPIO,
169                         ACPI_RS_SIZE (ACPI_RESOURCE_GPIO),
170                         ACPI_RSC_TABLE_SIZE (AcpiRsConvertGpio)},
171 
172     {ACPI_RSC_INITSET,  ACPI_RESOURCE_NAME_GPIO,
173                         sizeof (AML_RESOURCE_GPIO),
174                         0},
175 
176     /*
177      * These fields are contiguous in both the source and destination:
178      * RevisionId
179      * ConnectionType
180      */
181     {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.Gpio.RevisionId),
182                         AML_OFFSET (Gpio.RevisionId),
183                         2},
184 
185     {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Gpio.ProducerConsumer),
186                         AML_OFFSET (Gpio.Flags),
187                         0},
188 
189     {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Gpio.Shareable),
190                         AML_OFFSET (Gpio.IntFlags),
191                         3},
192 
193     {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Gpio.WakeCapable),
194                         AML_OFFSET (Gpio.IntFlags),
195                         4},
196 
197     {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET (Data.Gpio.IoRestriction),
198                         AML_OFFSET (Gpio.IntFlags),
199                         0},
200 
201     {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Gpio.Triggering),
202                         AML_OFFSET (Gpio.IntFlags),
203                         0},
204 
205     {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET (Data.Gpio.Polarity),
206                         AML_OFFSET (Gpio.IntFlags),
207                         1},
208 
209     {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.Gpio.PinConfig),
210                         AML_OFFSET (Gpio.PinConfig),
211                         1},
212 
213     /*
214      * These fields are contiguous in both the source and destination:
215      * DriveStrength
216      * DebounceTimeout
217      */
218     {ACPI_RSC_MOVE16,   ACPI_RS_OFFSET (Data.Gpio.DriveStrength),
219                         AML_OFFSET (Gpio.DriveStrength),
220                         2},
221 
222     /* Pin Table */
223 
224     {ACPI_RSC_COUNT_GPIO_PIN, ACPI_RS_OFFSET (Data.Gpio.PinTableLength),
225                         AML_OFFSET (Gpio.PinTableOffset),
226                         AML_OFFSET (Gpio.ResSourceOffset)},
227 
228     {ACPI_RSC_MOVE_GPIO_PIN, ACPI_RS_OFFSET (Data.Gpio.PinTable),
229                         AML_OFFSET (Gpio.PinTableOffset),
230                         0},
231 
232     /* Resource Source */
233 
234     {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.Gpio.ResourceSource.Index),
235                         AML_OFFSET (Gpio.ResSourceIndex),
236                         1},
237 
238     {ACPI_RSC_COUNT_GPIO_RES,  ACPI_RS_OFFSET (Data.Gpio.ResourceSource.StringLength),
239                         AML_OFFSET (Gpio.ResSourceOffset),
240                         AML_OFFSET (Gpio.VendorOffset)},
241 
242     {ACPI_RSC_MOVE_GPIO_RES,   ACPI_RS_OFFSET (Data.Gpio.ResourceSource.StringPtr),
243                         AML_OFFSET (Gpio.ResSourceOffset),
244                         0},
245 
246     /* Vendor Data */
247 
248     {ACPI_RSC_COUNT_GPIO_VEN,   ACPI_RS_OFFSET (Data.Gpio.VendorLength),
249                         AML_OFFSET (Gpio.VendorLength),
250                         1},
251 
252     {ACPI_RSC_MOVE_GPIO_RES,   ACPI_RS_OFFSET (Data.Gpio.VendorData),
253                         AML_OFFSET (Gpio.VendorOffset),
254                         0},
255 };
256 
257 /*******************************************************************************
258  *
259  * AcpiRsConvertClockInput
260  *
261  ******************************************************************************/
262 
263 ACPI_RSCONVERT_INFO     AcpiRsConvertClockInput[8] =
264 {
265     {ACPI_RSC_INITGET,  ACPI_RESOURCE_TYPE_CLOCK_INPUT,
266                         ACPI_RS_SIZE (ACPI_RESOURCE_CLOCK_INPUT),
267                         ACPI_RSC_TABLE_SIZE (AcpiRsConvertClockInput)},
268 
269     {ACPI_RSC_INITSET,  ACPI_RESOURCE_NAME_CLOCK_INPUT,
270                         sizeof (AML_RESOURCE_CLOCK_INPUT),
271                         0},
272 
273     {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.ClockInput.RevisionId),
274                         AML_OFFSET (ClockInput.RevisionId),
275                         1},
276 
277     {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.ClockInput.Mode),
278                         AML_OFFSET (ClockInput.Flags),
279                         0},
280 
281     {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET (Data.ClockInput.Scale),
282                         AML_OFFSET (ClockInput.Flags),
283                         1},
284 
285     {ACPI_RSC_MOVE16,   ACPI_RS_OFFSET (Data.ClockInput.FrequencyDivisor),
286                         AML_OFFSET (ClockInput.FrequencyDivisor),
287                         2},
288 
289     {ACPI_RSC_MOVE32,   ACPI_RS_OFFSET (Data.ClockInput.FrequencyNumerator),
290                         AML_OFFSET (ClockInput.FrequencyNumerator),
291                         4},
292 
293     /* Resource Source */
294     {ACPI_RSC_SOURCE,    ACPI_RS_OFFSET (Data.ClockInput.ResourceSource),
295                         0,
296                         sizeof(AML_RESOURCE_CLOCK_INPUT)},
297 
298 };
299 
300 
301 /*******************************************************************************
302  *
303  * AcpiRsConvertPinfunction
304  *
305  ******************************************************************************/
306 
307 ACPI_RSCONVERT_INFO     AcpiRsConvertPinFunction[13] =
308 {
309     {ACPI_RSC_INITGET,  ACPI_RESOURCE_TYPE_PIN_FUNCTION,
310                         ACPI_RS_SIZE (ACPI_RESOURCE_PIN_FUNCTION),
311                         ACPI_RSC_TABLE_SIZE (AcpiRsConvertPinFunction)},
312 
313     {ACPI_RSC_INITSET,  ACPI_RESOURCE_NAME_PIN_FUNCTION,
314                         sizeof (AML_RESOURCE_PIN_FUNCTION),
315                         0},
316 
317     {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.PinFunction.RevisionId),
318                         AML_OFFSET (PinFunction.RevisionId),
319                         1},
320 
321     {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.PinFunction.Shareable),
322                         AML_OFFSET (PinFunction.Flags),
323                         0},
324 
325     {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.PinFunction.PinConfig),
326                         AML_OFFSET (PinFunction.PinConfig),
327                         1},
328 
329     {ACPI_RSC_MOVE16,   ACPI_RS_OFFSET (Data.PinFunction.FunctionNumber),
330                         AML_OFFSET (PinFunction.FunctionNumber),
331                         2},
332 
333     /* Pin Table */
334 
335     /*
336      * It is OK to use GPIO operations here because none of them refer GPIO
337      * structures directly but instead use offsets given here.
338      */
339 
340     {ACPI_RSC_COUNT_GPIO_PIN, ACPI_RS_OFFSET (Data.PinFunction.PinTableLength),
341                         AML_OFFSET (PinFunction.PinTableOffset),
342                         AML_OFFSET (PinFunction.ResSourceOffset)},
343 
344     {ACPI_RSC_MOVE_GPIO_PIN, ACPI_RS_OFFSET (Data.PinFunction.PinTable),
345                         AML_OFFSET (PinFunction.PinTableOffset),
346                         0},
347 
348     /* Resource Source */
349 
350     {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.PinFunction.ResourceSource.Index),
351                         AML_OFFSET (PinFunction.ResSourceIndex),
352                         1},
353 
354     {ACPI_RSC_COUNT_GPIO_RES,  ACPI_RS_OFFSET (Data.PinFunction.ResourceSource.StringLength),
355                         AML_OFFSET (PinFunction.ResSourceOffset),
356                         AML_OFFSET (PinFunction.VendorOffset)},
357 
358     {ACPI_RSC_MOVE_GPIO_RES,   ACPI_RS_OFFSET (Data.PinFunction.ResourceSource.StringPtr),
359                         AML_OFFSET (PinFunction.ResSourceOffset),
360                         0},
361 
362     /* Vendor Data */
363 
364     {ACPI_RSC_COUNT_GPIO_VEN,   ACPI_RS_OFFSET (Data.PinFunction.VendorLength),
365                         AML_OFFSET (PinFunction.VendorLength),
366                         1},
367 
368     {ACPI_RSC_MOVE_GPIO_RES,   ACPI_RS_OFFSET (Data.PinFunction.VendorData),
369                         AML_OFFSET (PinFunction.VendorOffset),
370                         0},
371 };
372 
373 
374 /*******************************************************************************
375  *
376  * AcpiRsConvertCsi2SerialBus
377  *
378  ******************************************************************************/
379 
380 ACPI_RSCONVERT_INFO     AcpiRsConvertCsi2SerialBus[14] =
381 {
382     {ACPI_RSC_INITGET,  ACPI_RESOURCE_TYPE_SERIAL_BUS,
383                         ACPI_RS_SIZE (ACPI_RESOURCE_CSI2_SERIALBUS),
384                         ACPI_RSC_TABLE_SIZE (AcpiRsConvertCsi2SerialBus)},
385 
386     {ACPI_RSC_INITSET,  ACPI_RESOURCE_NAME_SERIAL_BUS,
387                         sizeof (AML_RESOURCE_CSI2_SERIALBUS),
388                         0},
389 
390     {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.CommonSerialBus.RevisionId),
391                         AML_OFFSET (CommonSerialBus.RevisionId),
392                         1},
393 
394     {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.Csi2SerialBus.Type),
395                         AML_OFFSET (Csi2SerialBus.Type),
396                         1},
397 
398     {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Csi2SerialBus.ProducerConsumer),
399                         AML_OFFSET (Csi2SerialBus.Flags),
400                         1},
401 
402     {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Csi2SerialBus.SlaveMode),
403                         AML_OFFSET (Csi2SerialBus.Flags),
404                         0},
405 
406     {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET (Data.Csi2SerialBus.PhyType),
407                         AML_OFFSET (Csi2SerialBus.TypeSpecificFlags),
408                         0},
409 
410     {ACPI_RSC_6BITFLAG, ACPI_RS_OFFSET (Data.Csi2SerialBus.LocalPortInstance),
411                         AML_OFFSET (Csi2SerialBus.TypeSpecificFlags),
412                         2},
413 
414     {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.Csi2SerialBus.TypeRevisionId),
415                         AML_OFFSET (Csi2SerialBus.TypeRevisionId),
416                         1},
417 
418     /* Vendor data */
419 
420     {ACPI_RSC_COUNT_SERIAL_VEN, ACPI_RS_OFFSET (Data.Csi2SerialBus.VendorLength),
421                         AML_OFFSET (Csi2SerialBus.TypeDataLength),
422                         AML_RESOURCE_CSI2_MIN_DATA_LEN},
423 
424     {ACPI_RSC_MOVE_SERIAL_VEN,  ACPI_RS_OFFSET (Data.Csi2SerialBus.VendorData),
425                         0,
426                         sizeof (AML_RESOURCE_CSI2_SERIALBUS)},
427 
428     /* Resource Source */
429 
430     {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.Csi2SerialBus.ResourceSource.Index),
431                         AML_OFFSET (Csi2SerialBus.ResSourceIndex),
432                         1},
433 
434     {ACPI_RSC_COUNT_SERIAL_RES, ACPI_RS_OFFSET (Data.Csi2SerialBus.ResourceSource.StringLength),
435                         AML_OFFSET (Csi2SerialBus.TypeDataLength),
436                         sizeof (AML_RESOURCE_CSI2_SERIALBUS)},
437 
438     {ACPI_RSC_MOVE_SERIAL_RES,  ACPI_RS_OFFSET (Data.Csi2SerialBus.ResourceSource.StringPtr),
439                         AML_OFFSET (Csi2SerialBus.TypeDataLength),
440                         sizeof (AML_RESOURCE_CSI2_SERIALBUS)},
441 };
442 
443 
444 /*******************************************************************************
445  *
446  * AcpiRsConvertI2cSerialBus
447  *
448  ******************************************************************************/
449 
450 ACPI_RSCONVERT_INFO     AcpiRsConvertI2cSerialBus[18] =
451 {
452     {ACPI_RSC_INITGET,  ACPI_RESOURCE_TYPE_SERIAL_BUS,
453                         ACPI_RS_SIZE (ACPI_RESOURCE_I2C_SERIALBUS),
454                         ACPI_RSC_TABLE_SIZE (AcpiRsConvertI2cSerialBus)},
455 
456     {ACPI_RSC_INITSET,  ACPI_RESOURCE_NAME_SERIAL_BUS,
457                         sizeof (AML_RESOURCE_I2C_SERIALBUS),
458                         0},
459 
460     {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.CommonSerialBus.RevisionId),
461                         AML_OFFSET (CommonSerialBus.RevisionId),
462                         1},
463 
464     {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.CommonSerialBus.Type),
465                         AML_OFFSET (CommonSerialBus.Type),
466                         1},
467 
468     {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.SlaveMode),
469                         AML_OFFSET (CommonSerialBus.Flags),
470                         0},
471 
472     {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.ProducerConsumer),
473                         AML_OFFSET (CommonSerialBus.Flags),
474                         1},
475 
476     {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.ConnectionSharing),
477                         AML_OFFSET (CommonSerialBus.Flags),
478                         2},
479 
480     {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.CommonSerialBus.TypeRevisionId),
481                         AML_OFFSET (CommonSerialBus.TypeRevisionId),
482                         1},
483 
484     {ACPI_RSC_MOVE16,   ACPI_RS_OFFSET (Data.CommonSerialBus.TypeDataLength),
485                         AML_OFFSET (CommonSerialBus.TypeDataLength),
486                         1},
487 
488     /* Vendor data */
489 
490     {ACPI_RSC_COUNT_SERIAL_VEN, ACPI_RS_OFFSET (Data.CommonSerialBus.VendorLength),
491                         AML_OFFSET (CommonSerialBus.TypeDataLength),
492                         AML_RESOURCE_I2C_MIN_DATA_LEN},
493 
494     {ACPI_RSC_MOVE_SERIAL_VEN,  ACPI_RS_OFFSET (Data.CommonSerialBus.VendorData),
495                         0,
496                         sizeof (AML_RESOURCE_I2C_SERIALBUS)},
497 
498     /* Resource Source */
499 
500     {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.Index),
501                         AML_OFFSET (CommonSerialBus.ResSourceIndex),
502                         1},
503 
504     {ACPI_RSC_COUNT_SERIAL_RES, ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.StringLength),
505                         AML_OFFSET (CommonSerialBus.TypeDataLength),
506                         sizeof (AML_RESOURCE_COMMON_SERIALBUS)},
507 
508     {ACPI_RSC_MOVE_SERIAL_RES,  ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.StringPtr),
509                         AML_OFFSET (CommonSerialBus.TypeDataLength),
510                         sizeof (AML_RESOURCE_COMMON_SERIALBUS)},
511 
512     /* I2C bus type specific */
513 
514     {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.I2cSerialBus.AccessMode),
515                         AML_OFFSET (I2cSerialBus.TypeSpecificFlags),
516                         0},
517 
518     /* Read LVR from Type Specific Flags, bits[15:8] */
519     {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.I2cSerialBus.Lvr),
520                         AML_OFFSET (I2cSerialBus.TypeSpecificFlags) + 1,
521                         1},
522 
523     {ACPI_RSC_MOVE32,   ACPI_RS_OFFSET (Data.I2cSerialBus.ConnectionSpeed),
524                         AML_OFFSET (I2cSerialBus.ConnectionSpeed),
525                         1},
526 
527     {ACPI_RSC_MOVE16,   ACPI_RS_OFFSET (Data.I2cSerialBus.SlaveAddress),
528                         AML_OFFSET (I2cSerialBus.SlaveAddress),
529                         1},
530 };
531 
532 
533 /*******************************************************************************
534  *
535  * AcpiRsConvertSpiSerialBus
536  *
537  ******************************************************************************/
538 
539 ACPI_RSCONVERT_INFO     AcpiRsConvertSpiSerialBus[21] =
540 {
541     {ACPI_RSC_INITGET,  ACPI_RESOURCE_TYPE_SERIAL_BUS,
542                         ACPI_RS_SIZE (ACPI_RESOURCE_SPI_SERIALBUS),
543                         ACPI_RSC_TABLE_SIZE (AcpiRsConvertSpiSerialBus)},
544 
545     {ACPI_RSC_INITSET,  ACPI_RESOURCE_NAME_SERIAL_BUS,
546                         sizeof (AML_RESOURCE_SPI_SERIALBUS),
547                         0},
548 
549     {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.CommonSerialBus.RevisionId),
550                         AML_OFFSET (CommonSerialBus.RevisionId),
551                         1},
552 
553     {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.CommonSerialBus.Type),
554                         AML_OFFSET (CommonSerialBus.Type),
555                         1},
556 
557     {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.SlaveMode),
558                         AML_OFFSET (CommonSerialBus.Flags),
559                         0},
560 
561     {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.ProducerConsumer),
562                         AML_OFFSET (CommonSerialBus.Flags),
563                         1},
564 
565     {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.ConnectionSharing),
566                         AML_OFFSET (CommonSerialBus.Flags),
567                         2},
568 
569     {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.CommonSerialBus.TypeRevisionId),
570                         AML_OFFSET (CommonSerialBus.TypeRevisionId),
571                         1},
572 
573     {ACPI_RSC_MOVE16,   ACPI_RS_OFFSET (Data.CommonSerialBus.TypeDataLength),
574                         AML_OFFSET (CommonSerialBus.TypeDataLength),
575                         1},
576 
577     /* Vendor data */
578 
579     {ACPI_RSC_COUNT_SERIAL_VEN, ACPI_RS_OFFSET (Data.CommonSerialBus.VendorLength),
580                         AML_OFFSET (CommonSerialBus.TypeDataLength),
581                         AML_RESOURCE_SPI_MIN_DATA_LEN},
582 
583     {ACPI_RSC_MOVE_SERIAL_VEN,  ACPI_RS_OFFSET (Data.CommonSerialBus.VendorData),
584                         0,
585                         sizeof (AML_RESOURCE_SPI_SERIALBUS)},
586 
587     /* Resource Source */
588 
589     {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.Index),
590                         AML_OFFSET (CommonSerialBus.ResSourceIndex),
591                         1},
592 
593     {ACPI_RSC_COUNT_SERIAL_RES, ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.StringLength),
594                         AML_OFFSET (CommonSerialBus.TypeDataLength),
595                         sizeof (AML_RESOURCE_COMMON_SERIALBUS)},
596 
597     {ACPI_RSC_MOVE_SERIAL_RES,  ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.StringPtr),
598                         AML_OFFSET (CommonSerialBus.TypeDataLength),
599                         sizeof (AML_RESOURCE_COMMON_SERIALBUS)},
600 
601     /* Spi bus type specific  */
602 
603     {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.SpiSerialBus.WireMode),
604                         AML_OFFSET (SpiSerialBus.TypeSpecificFlags),
605                         0},
606 
607     {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.SpiSerialBus.DevicePolarity),
608                         AML_OFFSET (SpiSerialBus.TypeSpecificFlags),
609                         1},
610 
611     {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.SpiSerialBus.DataBitLength),
612                         AML_OFFSET (SpiSerialBus.DataBitLength),
613                         1},
614 
615     {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.SpiSerialBus.ClockPhase),
616                         AML_OFFSET (SpiSerialBus.ClockPhase),
617                         1},
618 
619     {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.SpiSerialBus.ClockPolarity),
620                         AML_OFFSET (SpiSerialBus.ClockPolarity),
621                         1},
622 
623     {ACPI_RSC_MOVE16,   ACPI_RS_OFFSET (Data.SpiSerialBus.DeviceSelection),
624                         AML_OFFSET (SpiSerialBus.DeviceSelection),
625                         1},
626 
627     {ACPI_RSC_MOVE32,   ACPI_RS_OFFSET (Data.SpiSerialBus.ConnectionSpeed),
628                         AML_OFFSET (SpiSerialBus.ConnectionSpeed),
629                         1},
630 };
631 
632 
633 /*******************************************************************************
634  *
635  * AcpiRsConvertUartSerialBus
636  *
637  ******************************************************************************/
638 
639 ACPI_RSCONVERT_INFO     AcpiRsConvertUartSerialBus[23] =
640 {
641     {ACPI_RSC_INITGET,  ACPI_RESOURCE_TYPE_SERIAL_BUS,
642                         ACPI_RS_SIZE (ACPI_RESOURCE_UART_SERIALBUS),
643                         ACPI_RSC_TABLE_SIZE (AcpiRsConvertUartSerialBus)},
644 
645     {ACPI_RSC_INITSET,  ACPI_RESOURCE_NAME_SERIAL_BUS,
646                         sizeof (AML_RESOURCE_UART_SERIALBUS),
647                         0},
648 
649     {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.CommonSerialBus.RevisionId),
650                         AML_OFFSET (CommonSerialBus.RevisionId),
651                         1},
652 
653     {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.CommonSerialBus.Type),
654                         AML_OFFSET (CommonSerialBus.Type),
655                         1},
656 
657     {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.SlaveMode),
658                         AML_OFFSET (CommonSerialBus.Flags),
659                         0},
660 
661     {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.ProducerConsumer),
662                         AML_OFFSET (CommonSerialBus.Flags),
663                         1},
664 
665     {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.ConnectionSharing),
666                         AML_OFFSET (CommonSerialBus.Flags),
667                         2},
668 
669     {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.CommonSerialBus.TypeRevisionId),
670                         AML_OFFSET (CommonSerialBus.TypeRevisionId),
671                         1},
672 
673     {ACPI_RSC_MOVE16,   ACPI_RS_OFFSET (Data.CommonSerialBus.TypeDataLength),
674                         AML_OFFSET (CommonSerialBus.TypeDataLength),
675                         1},
676 
677     /* Vendor data */
678 
679     {ACPI_RSC_COUNT_SERIAL_VEN, ACPI_RS_OFFSET (Data.CommonSerialBus.VendorLength),
680                         AML_OFFSET (CommonSerialBus.TypeDataLength),
681                         AML_RESOURCE_UART_MIN_DATA_LEN},
682 
683     {ACPI_RSC_MOVE_SERIAL_VEN,  ACPI_RS_OFFSET (Data.CommonSerialBus.VendorData),
684                         0,
685                         sizeof (AML_RESOURCE_UART_SERIALBUS)},
686 
687     /* Resource Source */
688 
689     {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.Index),
690                         AML_OFFSET (CommonSerialBus.ResSourceIndex),
691                         1},
692 
693     {ACPI_RSC_COUNT_SERIAL_RES, ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.StringLength),
694                         AML_OFFSET (CommonSerialBus.TypeDataLength),
695                         sizeof (AML_RESOURCE_COMMON_SERIALBUS)},
696 
697     {ACPI_RSC_MOVE_SERIAL_RES,  ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.StringPtr),
698                         AML_OFFSET (CommonSerialBus.TypeDataLength),
699                         sizeof (AML_RESOURCE_COMMON_SERIALBUS)},
700 
701     /* Uart bus type specific  */
702 
703     {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET (Data.UartSerialBus.FlowControl),
704                         AML_OFFSET (UartSerialBus.TypeSpecificFlags),
705                         0},
706 
707     {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET (Data.UartSerialBus.StopBits),
708                         AML_OFFSET (UartSerialBus.TypeSpecificFlags),
709                         2},
710 
711     {ACPI_RSC_3BITFLAG, ACPI_RS_OFFSET (Data.UartSerialBus.DataBits),
712                         AML_OFFSET (UartSerialBus.TypeSpecificFlags),
713                         4},
714 
715     {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.UartSerialBus.Endian),
716                         AML_OFFSET (UartSerialBus.TypeSpecificFlags),
717                         7},
718 
719     {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.UartSerialBus.Parity),
720                         AML_OFFSET (UartSerialBus.Parity),
721                         1},
722 
723     {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.UartSerialBus.LinesEnabled),
724                         AML_OFFSET (UartSerialBus.LinesEnabled),
725                         1},
726 
727     {ACPI_RSC_MOVE16,   ACPI_RS_OFFSET (Data.UartSerialBus.RxFifoSize),
728                         AML_OFFSET (UartSerialBus.RxFifoSize),
729                         1},
730 
731     {ACPI_RSC_MOVE16,   ACPI_RS_OFFSET (Data.UartSerialBus.TxFifoSize),
732                         AML_OFFSET (UartSerialBus.TxFifoSize),
733                         1},
734 
735     {ACPI_RSC_MOVE32,   ACPI_RS_OFFSET (Data.UartSerialBus.DefaultBaudRate),
736                         AML_OFFSET (UartSerialBus.DefaultBaudRate),
737                         1},
738 };
739 
740 
741 /*******************************************************************************
742  *
743  * AcpiRsConvertPinConfig
744  *
745  ******************************************************************************/
746 
747 ACPI_RSCONVERT_INFO     AcpiRsConvertPinConfig[14] =
748 {
749     {ACPI_RSC_INITGET,  ACPI_RESOURCE_TYPE_PIN_CONFIG,
750                         ACPI_RS_SIZE (ACPI_RESOURCE_PIN_CONFIG),
751                         ACPI_RSC_TABLE_SIZE (AcpiRsConvertPinConfig)},
752 
753     {ACPI_RSC_INITSET,  ACPI_RESOURCE_NAME_PIN_CONFIG,
754                         sizeof (AML_RESOURCE_PIN_CONFIG),
755                         0},
756 
757     {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.PinConfig.RevisionId),
758                         AML_OFFSET (PinConfig.RevisionId),
759                         1},
760 
761     {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.PinConfig.Shareable),
762                         AML_OFFSET (PinConfig.Flags),
763                         0},
764 
765     {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.PinConfig.ProducerConsumer),
766                         AML_OFFSET (PinConfig.Flags),
767                         1},
768 
769     {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.PinConfig.PinConfigType),
770                         AML_OFFSET (PinConfig.PinConfigType),
771                         1},
772 
773     {ACPI_RSC_MOVE32,   ACPI_RS_OFFSET (Data.PinConfig.PinConfigValue),
774                         AML_OFFSET (PinConfig.PinConfigValue),
775                         1},
776 
777     /* Pin Table */
778 
779     /*
780      * It is OK to use GPIO operations here because none of them refer GPIO
781      * structures directly but instead use offsets given here.
782      */
783 
784     {ACPI_RSC_COUNT_GPIO_PIN, ACPI_RS_OFFSET (Data.PinConfig.PinTableLength),
785                         AML_OFFSET (PinConfig.PinTableOffset),
786                         AML_OFFSET (PinConfig.ResSourceOffset)},
787 
788     {ACPI_RSC_MOVE_GPIO_PIN, ACPI_RS_OFFSET (Data.PinConfig.PinTable),
789                         AML_OFFSET (PinConfig.PinTableOffset),
790                         0},
791 
792     /* Resource Source */
793 
794     {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.PinConfig.ResourceSource.Index),
795                         AML_OFFSET (PinConfig.ResSourceIndex),
796                         1},
797 
798     {ACPI_RSC_COUNT_GPIO_RES,  ACPI_RS_OFFSET (Data.PinConfig.ResourceSource.StringLength),
799                         AML_OFFSET (PinConfig.ResSourceOffset),
800                         AML_OFFSET (PinConfig.VendorOffset)},
801 
802     {ACPI_RSC_MOVE_GPIO_RES,   ACPI_RS_OFFSET (Data.PinConfig.ResourceSource.StringPtr),
803                         AML_OFFSET (PinConfig.ResSourceOffset),
804                         0},
805 
806     /* Vendor Data */
807 
808     {ACPI_RSC_COUNT_GPIO_VEN,   ACPI_RS_OFFSET (Data.PinConfig.VendorLength),
809                         AML_OFFSET (PinConfig.VendorLength),
810                         1},
811 
812     {ACPI_RSC_MOVE_GPIO_RES,   ACPI_RS_OFFSET (Data.PinConfig.VendorData),
813                         AML_OFFSET (PinConfig.VendorOffset),
814                         0},
815 };
816 
817 /*******************************************************************************
818  *
819  * AcpiRsConvertPinGroup
820  *
821  ******************************************************************************/
822 
823 ACPI_RSCONVERT_INFO     AcpiRsConvertPinGroup[10] =
824 {
825     {ACPI_RSC_INITGET,  ACPI_RESOURCE_TYPE_PIN_GROUP,
826                         ACPI_RS_SIZE (ACPI_RESOURCE_PIN_GROUP),
827                         ACPI_RSC_TABLE_SIZE (AcpiRsConvertPinGroup)},
828 
829     {ACPI_RSC_INITSET,  ACPI_RESOURCE_NAME_PIN_GROUP,
830                         sizeof (AML_RESOURCE_PIN_GROUP),
831                         0},
832 
833     {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.PinGroup.RevisionId),
834                         AML_OFFSET (PinGroup.RevisionId),
835                         1},
836 
837     {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.PinGroup.ProducerConsumer),
838                         AML_OFFSET (PinGroup.Flags),
839                         0},
840 
841     /* Pin Table */
842 
843     /*
844      * It is OK to use GPIO operations here because none of them refer GPIO
845      * structures directly but instead use offsets given here.
846      */
847 
848     {ACPI_RSC_COUNT_GPIO_PIN, ACPI_RS_OFFSET (Data.PinGroup.PinTableLength),
849                         AML_OFFSET (PinGroup.PinTableOffset),
850                         AML_OFFSET (PinGroup.LabelOffset)},
851 
852     {ACPI_RSC_MOVE_GPIO_PIN, ACPI_RS_OFFSET (Data.PinGroup.PinTable),
853                         AML_OFFSET (PinGroup.PinTableOffset),
854                         0},
855 
856     /* Resource Label */
857 
858     {ACPI_RSC_COUNT_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroup.ResourceLabel.StringLength),
859                         AML_OFFSET (PinGroup.LabelOffset),
860                         AML_OFFSET (PinGroup.VendorOffset)},
861 
862     {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroup.ResourceLabel.StringPtr),
863                         AML_OFFSET (PinGroup.LabelOffset),
864                         0},
865 
866     /* Vendor Data */
867 
868     {ACPI_RSC_COUNT_GPIO_VEN,   ACPI_RS_OFFSET (Data.PinGroup.VendorLength),
869                         AML_OFFSET (PinGroup.VendorLength),
870                         1},
871 
872     {ACPI_RSC_MOVE_GPIO_RES,   ACPI_RS_OFFSET (Data.PinGroup.VendorData),
873                         AML_OFFSET (PinGroup.VendorOffset),
874                         0},
875 };
876 
877 /*******************************************************************************
878  *
879  * AcpiRsConvertPinGroupFunction
880  *
881  ******************************************************************************/
882 
883 ACPI_RSCONVERT_INFO     AcpiRsConvertPinGroupFunction[13] =
884 {
885     {ACPI_RSC_INITGET,  ACPI_RESOURCE_TYPE_PIN_GROUP_FUNCTION,
886                         ACPI_RS_SIZE (ACPI_RESOURCE_PIN_GROUP_FUNCTION),
887                         ACPI_RSC_TABLE_SIZE (AcpiRsConvertPinGroupFunction)},
888 
889     {ACPI_RSC_INITSET,  ACPI_RESOURCE_NAME_PIN_GROUP_FUNCTION,
890                         sizeof (AML_RESOURCE_PIN_GROUP_FUNCTION),
891                         0},
892 
893     {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.PinGroupFunction.RevisionId),
894                         AML_OFFSET (PinGroupFunction.RevisionId),
895                         1},
896 
897     {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.PinGroupFunction.Shareable),
898                         AML_OFFSET (PinGroupFunction.Flags),
899                         0},
900 
901     {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.PinGroupFunction.ProducerConsumer),
902                         AML_OFFSET (PinGroupFunction.Flags),
903                         1},
904 
905     {ACPI_RSC_MOVE16,   ACPI_RS_OFFSET (Data.PinGroupFunction.FunctionNumber),
906                         AML_OFFSET (PinGroupFunction.FunctionNumber),
907                         1},
908 
909     /* Resource Source */
910 
911     {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.PinGroupFunction.ResourceSource.Index),
912                         AML_OFFSET (PinGroupFunction.ResSourceIndex),
913                         1},
914 
915     {ACPI_RSC_COUNT_GPIO_RES,  ACPI_RS_OFFSET (Data.PinGroupFunction.ResourceSource.StringLength),
916                         AML_OFFSET (PinGroupFunction.ResSourceOffset),
917                         AML_OFFSET (PinGroupFunction.ResSourceLabelOffset)},
918 
919     {ACPI_RSC_MOVE_GPIO_RES,   ACPI_RS_OFFSET (Data.PinGroupFunction.ResourceSource.StringPtr),
920                         AML_OFFSET (PinGroupFunction.ResSourceOffset),
921                         0},
922 
923     /* Resource Source Label */
924 
925     {ACPI_RSC_COUNT_GPIO_RES,  ACPI_RS_OFFSET (Data.PinGroupFunction.ResourceSourceLabel.StringLength),
926                         AML_OFFSET (PinGroupFunction.ResSourceLabelOffset),
927                         AML_OFFSET (PinGroupFunction.VendorOffset)},
928 
929     {ACPI_RSC_MOVE_GPIO_RES,   ACPI_RS_OFFSET (Data.PinGroupFunction.ResourceSourceLabel.StringPtr),
930                         AML_OFFSET (PinGroupFunction.ResSourceLabelOffset),
931                         0},
932 
933     /* Vendor Data */
934 
935     {ACPI_RSC_COUNT_GPIO_VEN,   ACPI_RS_OFFSET (Data.PinGroupFunction.VendorLength),
936                         AML_OFFSET (PinGroupFunction.VendorLength),
937                         1},
938 
939     {ACPI_RSC_MOVE_GPIO_RES,   ACPI_RS_OFFSET (Data.PinGroupFunction.VendorData),
940                         AML_OFFSET (PinGroupFunction.VendorOffset),
941                         0},
942 };
943 
944 /*******************************************************************************
945  *
946  * AcpiRsConvertPinGroupConfig
947  *
948  ******************************************************************************/
949 
950 ACPI_RSCONVERT_INFO     AcpiRsConvertPinGroupConfig[14] =
951 {
952     {ACPI_RSC_INITGET,  ACPI_RESOURCE_TYPE_PIN_GROUP_CONFIG,
953                         ACPI_RS_SIZE (ACPI_RESOURCE_PIN_GROUP_CONFIG),
954                         ACPI_RSC_TABLE_SIZE (AcpiRsConvertPinGroupConfig)},
955 
956     {ACPI_RSC_INITSET,  ACPI_RESOURCE_NAME_PIN_GROUP_CONFIG,
957                         sizeof (AML_RESOURCE_PIN_GROUP_CONFIG),
958                         0},
959 
960     {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.PinGroupConfig.RevisionId),
961                         AML_OFFSET (PinGroupConfig.RevisionId),
962                         1},
963 
964     {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.PinGroupConfig.Shareable),
965                         AML_OFFSET (PinGroupConfig.Flags),
966                         0},
967 
968     {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.PinGroupConfig.ProducerConsumer),
969                         AML_OFFSET (PinGroupConfig.Flags),
970                         1},
971 
972     {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.PinGroupConfig.PinConfigType),
973                         AML_OFFSET (PinGroupConfig.PinConfigType),
974                         1},
975 
976     {ACPI_RSC_MOVE32,   ACPI_RS_OFFSET (Data.PinGroupConfig.PinConfigValue),
977                         AML_OFFSET (PinGroupConfig.PinConfigValue),
978                         1},
979 
980     /* Resource Source */
981 
982     {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.PinGroupConfig.ResourceSource.Index),
983                         AML_OFFSET (PinGroupConfig.ResSourceIndex),
984                         1},
985 
986     {ACPI_RSC_COUNT_GPIO_RES,  ACPI_RS_OFFSET (Data.PinGroupConfig.ResourceSource.StringLength),
987                         AML_OFFSET (PinGroupConfig.ResSourceOffset),
988                         AML_OFFSET (PinGroupConfig.ResSourceLabelOffset)},
989 
990     {ACPI_RSC_MOVE_GPIO_RES,   ACPI_RS_OFFSET (Data.PinGroupConfig.ResourceSource.StringPtr),
991                         AML_OFFSET (PinGroupConfig.ResSourceOffset),
992                         0},
993 
994     /* Resource Source Label */
995 
996     {ACPI_RSC_COUNT_GPIO_RES,  ACPI_RS_OFFSET (Data.PinGroupConfig.ResourceSourceLabel.StringLength),
997                         AML_OFFSET (PinGroupConfig.ResSourceLabelOffset),
998                         AML_OFFSET (PinGroupConfig.VendorOffset)},
999 
1000     {ACPI_RSC_MOVE_GPIO_RES,   ACPI_RS_OFFSET (Data.PinGroupConfig.ResourceSourceLabel.StringPtr),
1001                         AML_OFFSET (PinGroupConfig.ResSourceLabelOffset),
1002                         0},
1003 
1004     /* Vendor Data */
1005 
1006     {ACPI_RSC_COUNT_GPIO_VEN,   ACPI_RS_OFFSET (Data.PinGroupConfig.VendorLength),
1007                         AML_OFFSET (PinGroupConfig.VendorLength),
1008                         1},
1009 
1010     {ACPI_RSC_MOVE_GPIO_RES,   ACPI_RS_OFFSET (Data.PinGroupConfig.VendorData),
1011                         AML_OFFSET (PinGroupConfig.VendorOffset),
1012                         0},
1013 };
1014