xref: /freebsd/sys/contrib/dev/acpica/components/resources/rsserial.c (revision 1719886f6d08408b834d270c59ffcfd821c8f63a)
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 - 2023, 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[17] =
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     {ACPI_RSC_MOVE32,   ACPI_RS_OFFSET (Data.I2cSerialBus.ConnectionSpeed),
519                         AML_OFFSET (I2cSerialBus.ConnectionSpeed),
520                         1},
521 
522     {ACPI_RSC_MOVE16,   ACPI_RS_OFFSET (Data.I2cSerialBus.SlaveAddress),
523                         AML_OFFSET (I2cSerialBus.SlaveAddress),
524                         1},
525 };
526 
527 
528 /*******************************************************************************
529  *
530  * AcpiRsConvertSpiSerialBus
531  *
532  ******************************************************************************/
533 
534 ACPI_RSCONVERT_INFO     AcpiRsConvertSpiSerialBus[21] =
535 {
536     {ACPI_RSC_INITGET,  ACPI_RESOURCE_TYPE_SERIAL_BUS,
537                         ACPI_RS_SIZE (ACPI_RESOURCE_SPI_SERIALBUS),
538                         ACPI_RSC_TABLE_SIZE (AcpiRsConvertSpiSerialBus)},
539 
540     {ACPI_RSC_INITSET,  ACPI_RESOURCE_NAME_SERIAL_BUS,
541                         sizeof (AML_RESOURCE_SPI_SERIALBUS),
542                         0},
543 
544     {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.CommonSerialBus.RevisionId),
545                         AML_OFFSET (CommonSerialBus.RevisionId),
546                         1},
547 
548     {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.CommonSerialBus.Type),
549                         AML_OFFSET (CommonSerialBus.Type),
550                         1},
551 
552     {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.SlaveMode),
553                         AML_OFFSET (CommonSerialBus.Flags),
554                         0},
555 
556     {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.ProducerConsumer),
557                         AML_OFFSET (CommonSerialBus.Flags),
558                         1},
559 
560     {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.ConnectionSharing),
561                         AML_OFFSET (CommonSerialBus.Flags),
562                         2},
563 
564     {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.CommonSerialBus.TypeRevisionId),
565                         AML_OFFSET (CommonSerialBus.TypeRevisionId),
566                         1},
567 
568     {ACPI_RSC_MOVE16,   ACPI_RS_OFFSET (Data.CommonSerialBus.TypeDataLength),
569                         AML_OFFSET (CommonSerialBus.TypeDataLength),
570                         1},
571 
572     /* Vendor data */
573 
574     {ACPI_RSC_COUNT_SERIAL_VEN, ACPI_RS_OFFSET (Data.CommonSerialBus.VendorLength),
575                         AML_OFFSET (CommonSerialBus.TypeDataLength),
576                         AML_RESOURCE_SPI_MIN_DATA_LEN},
577 
578     {ACPI_RSC_MOVE_SERIAL_VEN,  ACPI_RS_OFFSET (Data.CommonSerialBus.VendorData),
579                         0,
580                         sizeof (AML_RESOURCE_SPI_SERIALBUS)},
581 
582     /* Resource Source */
583 
584     {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.Index),
585                         AML_OFFSET (CommonSerialBus.ResSourceIndex),
586                         1},
587 
588     {ACPI_RSC_COUNT_SERIAL_RES, ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.StringLength),
589                         AML_OFFSET (CommonSerialBus.TypeDataLength),
590                         sizeof (AML_RESOURCE_COMMON_SERIALBUS)},
591 
592     {ACPI_RSC_MOVE_SERIAL_RES,  ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.StringPtr),
593                         AML_OFFSET (CommonSerialBus.TypeDataLength),
594                         sizeof (AML_RESOURCE_COMMON_SERIALBUS)},
595 
596     /* Spi bus type specific  */
597 
598     {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.SpiSerialBus.WireMode),
599                         AML_OFFSET (SpiSerialBus.TypeSpecificFlags),
600                         0},
601 
602     {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.SpiSerialBus.DevicePolarity),
603                         AML_OFFSET (SpiSerialBus.TypeSpecificFlags),
604                         1},
605 
606     {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.SpiSerialBus.DataBitLength),
607                         AML_OFFSET (SpiSerialBus.DataBitLength),
608                         1},
609 
610     {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.SpiSerialBus.ClockPhase),
611                         AML_OFFSET (SpiSerialBus.ClockPhase),
612                         1},
613 
614     {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.SpiSerialBus.ClockPolarity),
615                         AML_OFFSET (SpiSerialBus.ClockPolarity),
616                         1},
617 
618     {ACPI_RSC_MOVE16,   ACPI_RS_OFFSET (Data.SpiSerialBus.DeviceSelection),
619                         AML_OFFSET (SpiSerialBus.DeviceSelection),
620                         1},
621 
622     {ACPI_RSC_MOVE32,   ACPI_RS_OFFSET (Data.SpiSerialBus.ConnectionSpeed),
623                         AML_OFFSET (SpiSerialBus.ConnectionSpeed),
624                         1},
625 };
626 
627 
628 /*******************************************************************************
629  *
630  * AcpiRsConvertUartSerialBus
631  *
632  ******************************************************************************/
633 
634 ACPI_RSCONVERT_INFO     AcpiRsConvertUartSerialBus[23] =
635 {
636     {ACPI_RSC_INITGET,  ACPI_RESOURCE_TYPE_SERIAL_BUS,
637                         ACPI_RS_SIZE (ACPI_RESOURCE_UART_SERIALBUS),
638                         ACPI_RSC_TABLE_SIZE (AcpiRsConvertUartSerialBus)},
639 
640     {ACPI_RSC_INITSET,  ACPI_RESOURCE_NAME_SERIAL_BUS,
641                         sizeof (AML_RESOURCE_UART_SERIALBUS),
642                         0},
643 
644     {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.CommonSerialBus.RevisionId),
645                         AML_OFFSET (CommonSerialBus.RevisionId),
646                         1},
647 
648     {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.CommonSerialBus.Type),
649                         AML_OFFSET (CommonSerialBus.Type),
650                         1},
651 
652     {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.SlaveMode),
653                         AML_OFFSET (CommonSerialBus.Flags),
654                         0},
655 
656     {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.ProducerConsumer),
657                         AML_OFFSET (CommonSerialBus.Flags),
658                         1},
659 
660     {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.CommonSerialBus.ConnectionSharing),
661                         AML_OFFSET (CommonSerialBus.Flags),
662                         2},
663 
664     {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.CommonSerialBus.TypeRevisionId),
665                         AML_OFFSET (CommonSerialBus.TypeRevisionId),
666                         1},
667 
668     {ACPI_RSC_MOVE16,   ACPI_RS_OFFSET (Data.CommonSerialBus.TypeDataLength),
669                         AML_OFFSET (CommonSerialBus.TypeDataLength),
670                         1},
671 
672     /* Vendor data */
673 
674     {ACPI_RSC_COUNT_SERIAL_VEN, ACPI_RS_OFFSET (Data.CommonSerialBus.VendorLength),
675                         AML_OFFSET (CommonSerialBus.TypeDataLength),
676                         AML_RESOURCE_UART_MIN_DATA_LEN},
677 
678     {ACPI_RSC_MOVE_SERIAL_VEN,  ACPI_RS_OFFSET (Data.CommonSerialBus.VendorData),
679                         0,
680                         sizeof (AML_RESOURCE_UART_SERIALBUS)},
681 
682     /* Resource Source */
683 
684     {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.Index),
685                         AML_OFFSET (CommonSerialBus.ResSourceIndex),
686                         1},
687 
688     {ACPI_RSC_COUNT_SERIAL_RES, ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.StringLength),
689                         AML_OFFSET (CommonSerialBus.TypeDataLength),
690                         sizeof (AML_RESOURCE_COMMON_SERIALBUS)},
691 
692     {ACPI_RSC_MOVE_SERIAL_RES,  ACPI_RS_OFFSET (Data.CommonSerialBus.ResourceSource.StringPtr),
693                         AML_OFFSET (CommonSerialBus.TypeDataLength),
694                         sizeof (AML_RESOURCE_COMMON_SERIALBUS)},
695 
696     /* Uart bus type specific  */
697 
698     {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET (Data.UartSerialBus.FlowControl),
699                         AML_OFFSET (UartSerialBus.TypeSpecificFlags),
700                         0},
701 
702     {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET (Data.UartSerialBus.StopBits),
703                         AML_OFFSET (UartSerialBus.TypeSpecificFlags),
704                         2},
705 
706     {ACPI_RSC_3BITFLAG, ACPI_RS_OFFSET (Data.UartSerialBus.DataBits),
707                         AML_OFFSET (UartSerialBus.TypeSpecificFlags),
708                         4},
709 
710     {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.UartSerialBus.Endian),
711                         AML_OFFSET (UartSerialBus.TypeSpecificFlags),
712                         7},
713 
714     {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.UartSerialBus.Parity),
715                         AML_OFFSET (UartSerialBus.Parity),
716                         1},
717 
718     {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.UartSerialBus.LinesEnabled),
719                         AML_OFFSET (UartSerialBus.LinesEnabled),
720                         1},
721 
722     {ACPI_RSC_MOVE16,   ACPI_RS_OFFSET (Data.UartSerialBus.RxFifoSize),
723                         AML_OFFSET (UartSerialBus.RxFifoSize),
724                         1},
725 
726     {ACPI_RSC_MOVE16,   ACPI_RS_OFFSET (Data.UartSerialBus.TxFifoSize),
727                         AML_OFFSET (UartSerialBus.TxFifoSize),
728                         1},
729 
730     {ACPI_RSC_MOVE32,   ACPI_RS_OFFSET (Data.UartSerialBus.DefaultBaudRate),
731                         AML_OFFSET (UartSerialBus.DefaultBaudRate),
732                         1},
733 };
734 
735 
736 /*******************************************************************************
737  *
738  * AcpiRsConvertPinConfig
739  *
740  ******************************************************************************/
741 
742 ACPI_RSCONVERT_INFO     AcpiRsConvertPinConfig[14] =
743 {
744     {ACPI_RSC_INITGET,  ACPI_RESOURCE_TYPE_PIN_CONFIG,
745                         ACPI_RS_SIZE (ACPI_RESOURCE_PIN_CONFIG),
746                         ACPI_RSC_TABLE_SIZE (AcpiRsConvertPinConfig)},
747 
748     {ACPI_RSC_INITSET,  ACPI_RESOURCE_NAME_PIN_CONFIG,
749                         sizeof (AML_RESOURCE_PIN_CONFIG),
750                         0},
751 
752     {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.PinConfig.RevisionId),
753                         AML_OFFSET (PinConfig.RevisionId),
754                         1},
755 
756     {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.PinConfig.Shareable),
757                         AML_OFFSET (PinConfig.Flags),
758                         0},
759 
760     {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.PinConfig.ProducerConsumer),
761                         AML_OFFSET (PinConfig.Flags),
762                         1},
763 
764     {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.PinConfig.PinConfigType),
765                         AML_OFFSET (PinConfig.PinConfigType),
766                         1},
767 
768     {ACPI_RSC_MOVE32,   ACPI_RS_OFFSET (Data.PinConfig.PinConfigValue),
769                         AML_OFFSET (PinConfig.PinConfigValue),
770                         1},
771 
772     /* Pin Table */
773 
774     /*
775      * It is OK to use GPIO operations here because none of them refer GPIO
776      * structures directly but instead use offsets given here.
777      */
778 
779     {ACPI_RSC_COUNT_GPIO_PIN, ACPI_RS_OFFSET (Data.PinConfig.PinTableLength),
780                         AML_OFFSET (PinConfig.PinTableOffset),
781                         AML_OFFSET (PinConfig.ResSourceOffset)},
782 
783     {ACPI_RSC_MOVE_GPIO_PIN, ACPI_RS_OFFSET (Data.PinConfig.PinTable),
784                         AML_OFFSET (PinConfig.PinTableOffset),
785                         0},
786 
787     /* Resource Source */
788 
789     {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.PinConfig.ResourceSource.Index),
790                         AML_OFFSET (PinConfig.ResSourceIndex),
791                         1},
792 
793     {ACPI_RSC_COUNT_GPIO_RES,  ACPI_RS_OFFSET (Data.PinConfig.ResourceSource.StringLength),
794                         AML_OFFSET (PinConfig.ResSourceOffset),
795                         AML_OFFSET (PinConfig.VendorOffset)},
796 
797     {ACPI_RSC_MOVE_GPIO_RES,   ACPI_RS_OFFSET (Data.PinConfig.ResourceSource.StringPtr),
798                         AML_OFFSET (PinConfig.ResSourceOffset),
799                         0},
800 
801     /* Vendor Data */
802 
803     {ACPI_RSC_COUNT_GPIO_VEN,   ACPI_RS_OFFSET (Data.PinConfig.VendorLength),
804                         AML_OFFSET (PinConfig.VendorLength),
805                         1},
806 
807     {ACPI_RSC_MOVE_GPIO_RES,   ACPI_RS_OFFSET (Data.PinConfig.VendorData),
808                         AML_OFFSET (PinConfig.VendorOffset),
809                         0},
810 };
811 
812 /*******************************************************************************
813  *
814  * AcpiRsConvertPinGroup
815  *
816  ******************************************************************************/
817 
818 ACPI_RSCONVERT_INFO     AcpiRsConvertPinGroup[10] =
819 {
820     {ACPI_RSC_INITGET,  ACPI_RESOURCE_TYPE_PIN_GROUP,
821                         ACPI_RS_SIZE (ACPI_RESOURCE_PIN_GROUP),
822                         ACPI_RSC_TABLE_SIZE (AcpiRsConvertPinGroup)},
823 
824     {ACPI_RSC_INITSET,  ACPI_RESOURCE_NAME_PIN_GROUP,
825                         sizeof (AML_RESOURCE_PIN_GROUP),
826                         0},
827 
828     {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.PinGroup.RevisionId),
829                         AML_OFFSET (PinGroup.RevisionId),
830                         1},
831 
832     {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.PinGroup.ProducerConsumer),
833                         AML_OFFSET (PinGroup.Flags),
834                         0},
835 
836     /* Pin Table */
837 
838     /*
839      * It is OK to use GPIO operations here because none of them refer GPIO
840      * structures directly but instead use offsets given here.
841      */
842 
843     {ACPI_RSC_COUNT_GPIO_PIN, ACPI_RS_OFFSET (Data.PinGroup.PinTableLength),
844                         AML_OFFSET (PinGroup.PinTableOffset),
845                         AML_OFFSET (PinGroup.LabelOffset)},
846 
847     {ACPI_RSC_MOVE_GPIO_PIN, ACPI_RS_OFFSET (Data.PinGroup.PinTable),
848                         AML_OFFSET (PinGroup.PinTableOffset),
849                         0},
850 
851     /* Resource Label */
852 
853     {ACPI_RSC_COUNT_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroup.ResourceLabel.StringLength),
854                         AML_OFFSET (PinGroup.LabelOffset),
855                         AML_OFFSET (PinGroup.VendorOffset)},
856 
857     {ACPI_RSC_MOVE_GPIO_RES, ACPI_RS_OFFSET (Data.PinGroup.ResourceLabel.StringPtr),
858                         AML_OFFSET (PinGroup.LabelOffset),
859                         0},
860 
861     /* Vendor Data */
862 
863     {ACPI_RSC_COUNT_GPIO_VEN,   ACPI_RS_OFFSET (Data.PinGroup.VendorLength),
864                         AML_OFFSET (PinGroup.VendorLength),
865                         1},
866 
867     {ACPI_RSC_MOVE_GPIO_RES,   ACPI_RS_OFFSET (Data.PinGroup.VendorData),
868                         AML_OFFSET (PinGroup.VendorOffset),
869                         0},
870 };
871 
872 /*******************************************************************************
873  *
874  * AcpiRsConvertPinGroupFunction
875  *
876  ******************************************************************************/
877 
878 ACPI_RSCONVERT_INFO     AcpiRsConvertPinGroupFunction[13] =
879 {
880     {ACPI_RSC_INITGET,  ACPI_RESOURCE_TYPE_PIN_GROUP_FUNCTION,
881                         ACPI_RS_SIZE (ACPI_RESOURCE_PIN_GROUP_FUNCTION),
882                         ACPI_RSC_TABLE_SIZE (AcpiRsConvertPinGroupFunction)},
883 
884     {ACPI_RSC_INITSET,  ACPI_RESOURCE_NAME_PIN_GROUP_FUNCTION,
885                         sizeof (AML_RESOURCE_PIN_GROUP_FUNCTION),
886                         0},
887 
888     {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.PinGroupFunction.RevisionId),
889                         AML_OFFSET (PinGroupFunction.RevisionId),
890                         1},
891 
892     {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.PinGroupFunction.Shareable),
893                         AML_OFFSET (PinGroupFunction.Flags),
894                         0},
895 
896     {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.PinGroupFunction.ProducerConsumer),
897                         AML_OFFSET (PinGroupFunction.Flags),
898                         1},
899 
900     {ACPI_RSC_MOVE16,   ACPI_RS_OFFSET (Data.PinGroupFunction.FunctionNumber),
901                         AML_OFFSET (PinGroupFunction.FunctionNumber),
902                         1},
903 
904     /* Resource Source */
905 
906     {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.PinGroupFunction.ResourceSource.Index),
907                         AML_OFFSET (PinGroupFunction.ResSourceIndex),
908                         1},
909 
910     {ACPI_RSC_COUNT_GPIO_RES,  ACPI_RS_OFFSET (Data.PinGroupFunction.ResourceSource.StringLength),
911                         AML_OFFSET (PinGroupFunction.ResSourceOffset),
912                         AML_OFFSET (PinGroupFunction.ResSourceLabelOffset)},
913 
914     {ACPI_RSC_MOVE_GPIO_RES,   ACPI_RS_OFFSET (Data.PinGroupFunction.ResourceSource.StringPtr),
915                         AML_OFFSET (PinGroupFunction.ResSourceOffset),
916                         0},
917 
918     /* Resource Source Label */
919 
920     {ACPI_RSC_COUNT_GPIO_RES,  ACPI_RS_OFFSET (Data.PinGroupFunction.ResourceSourceLabel.StringLength),
921                         AML_OFFSET (PinGroupFunction.ResSourceLabelOffset),
922                         AML_OFFSET (PinGroupFunction.VendorOffset)},
923 
924     {ACPI_RSC_MOVE_GPIO_RES,   ACPI_RS_OFFSET (Data.PinGroupFunction.ResourceSourceLabel.StringPtr),
925                         AML_OFFSET (PinGroupFunction.ResSourceLabelOffset),
926                         0},
927 
928     /* Vendor Data */
929 
930     {ACPI_RSC_COUNT_GPIO_VEN,   ACPI_RS_OFFSET (Data.PinGroupFunction.VendorLength),
931                         AML_OFFSET (PinGroupFunction.VendorLength),
932                         1},
933 
934     {ACPI_RSC_MOVE_GPIO_RES,   ACPI_RS_OFFSET (Data.PinGroupFunction.VendorData),
935                         AML_OFFSET (PinGroupFunction.VendorOffset),
936                         0},
937 };
938 
939 /*******************************************************************************
940  *
941  * AcpiRsConvertPinGroupConfig
942  *
943  ******************************************************************************/
944 
945 ACPI_RSCONVERT_INFO     AcpiRsConvertPinGroupConfig[14] =
946 {
947     {ACPI_RSC_INITGET,  ACPI_RESOURCE_TYPE_PIN_GROUP_CONFIG,
948                         ACPI_RS_SIZE (ACPI_RESOURCE_PIN_GROUP_CONFIG),
949                         ACPI_RSC_TABLE_SIZE (AcpiRsConvertPinGroupConfig)},
950 
951     {ACPI_RSC_INITSET,  ACPI_RESOURCE_NAME_PIN_GROUP_CONFIG,
952                         sizeof (AML_RESOURCE_PIN_GROUP_CONFIG),
953                         0},
954 
955     {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.PinGroupConfig.RevisionId),
956                         AML_OFFSET (PinGroupConfig.RevisionId),
957                         1},
958 
959     {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.PinGroupConfig.Shareable),
960                         AML_OFFSET (PinGroupConfig.Flags),
961                         0},
962 
963     {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.PinGroupConfig.ProducerConsumer),
964                         AML_OFFSET (PinGroupConfig.Flags),
965                         1},
966 
967     {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.PinGroupConfig.PinConfigType),
968                         AML_OFFSET (PinGroupConfig.PinConfigType),
969                         1},
970 
971     {ACPI_RSC_MOVE32,   ACPI_RS_OFFSET (Data.PinGroupConfig.PinConfigValue),
972                         AML_OFFSET (PinGroupConfig.PinConfigValue),
973                         1},
974 
975     /* Resource Source */
976 
977     {ACPI_RSC_MOVE8,    ACPI_RS_OFFSET (Data.PinGroupConfig.ResourceSource.Index),
978                         AML_OFFSET (PinGroupConfig.ResSourceIndex),
979                         1},
980 
981     {ACPI_RSC_COUNT_GPIO_RES,  ACPI_RS_OFFSET (Data.PinGroupConfig.ResourceSource.StringLength),
982                         AML_OFFSET (PinGroupConfig.ResSourceOffset),
983                         AML_OFFSET (PinGroupConfig.ResSourceLabelOffset)},
984 
985     {ACPI_RSC_MOVE_GPIO_RES,   ACPI_RS_OFFSET (Data.PinGroupConfig.ResourceSource.StringPtr),
986                         AML_OFFSET (PinGroupConfig.ResSourceOffset),
987                         0},
988 
989     /* Resource Source Label */
990 
991     {ACPI_RSC_COUNT_GPIO_RES,  ACPI_RS_OFFSET (Data.PinGroupConfig.ResourceSourceLabel.StringLength),
992                         AML_OFFSET (PinGroupConfig.ResSourceLabelOffset),
993                         AML_OFFSET (PinGroupConfig.VendorOffset)},
994 
995     {ACPI_RSC_MOVE_GPIO_RES,   ACPI_RS_OFFSET (Data.PinGroupConfig.ResourceSourceLabel.StringPtr),
996                         AML_OFFSET (PinGroupConfig.ResSourceLabelOffset),
997                         0},
998 
999     /* Vendor Data */
1000 
1001     {ACPI_RSC_COUNT_GPIO_VEN,   ACPI_RS_OFFSET (Data.PinGroupConfig.VendorLength),
1002                         AML_OFFSET (PinGroupConfig.VendorLength),
1003                         1},
1004 
1005     {ACPI_RSC_MOVE_GPIO_RES,   ACPI_RS_OFFSET (Data.PinGroupConfig.VendorData),
1006                         AML_OFFSET (PinGroupConfig.VendorOffset),
1007                         0},
1008 };
1009