linux/include/acpi/acrestyp.h

/* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 */
/******************************************************************************
 *
 * Name: acrestyp.h - Defines, types, and structures for resource descriptors
 *
 * Copyright (C) 2000 - 2023, Intel Corp.
 *
 *****************************************************************************/

#ifndef __ACRESTYP_H__
#define __ACRESTYP_H__

/*
 * Definitions for Resource Attributes
 */
acpi_rs_length;	/* Resource Length field is fixed at 16 bits */
acpi_rsdesc_size;	/* Max Resource Descriptor size is (Length+3) = (64K-1)+3 */

/*
 * Memory Attributes
 */
#define ACPI_READ_ONLY_MEMORY
#define ACPI_READ_WRITE_MEMORY

#define ACPI_NON_CACHEABLE_MEMORY
#define ACPI_CACHABLE_MEMORY
#define ACPI_WRITE_COMBINING_MEMORY
#define ACPI_PREFETCHABLE_MEMORY

/*! [Begin] no source code translation */
/*
 * IO Attributes
 * The ISA IO ranges are:     n000-n0FFh,  n400-n4FFh, n800-n8FFh, nC00-nCFFh.
 * The non-ISA IO ranges are: n100-n3FFh,  n500-n7FFh, n900-nBFFh, nCD0-nFFFh.
 */
/*! [End] no source code translation !*/

#define ACPI_NON_ISA_ONLY_RANGES
#define ACPI_ISA_ONLY_RANGES
#define ACPI_ENTIRE_RANGE

/* Type of translation - 1=Sparse, 0=Dense */

#define ACPI_SPARSE_TRANSLATION

/*
 * IO Port Descriptor Decode
 */
#define ACPI_DECODE_10
#define ACPI_DECODE_16

/*
 * Interrupt attributes - used in multiple descriptors
 */

/* Triggering */

#define ACPI_LEVEL_SENSITIVE
#define ACPI_EDGE_SENSITIVE

/* Polarity */

#define ACPI_ACTIVE_HIGH
#define ACPI_ACTIVE_LOW
#define ACPI_ACTIVE_BOTH

/* Sharing */

#define ACPI_EXCLUSIVE
#define ACPI_SHARED

/* Wake */

#define ACPI_NOT_WAKE_CAPABLE
#define ACPI_WAKE_CAPABLE

/*
 * DMA Attributes
 */
#define ACPI_COMPATIBILITY
#define ACPI_TYPE_A
#define ACPI_TYPE_B
#define ACPI_TYPE_F

#define ACPI_NOT_BUS_MASTER
#define ACPI_BUS_MASTER

#define ACPI_TRANSFER_8
#define ACPI_TRANSFER_8_16
#define ACPI_TRANSFER_16

/*
 * Start Dependent Functions Priority definitions
 */
#define ACPI_GOOD_CONFIGURATION
#define ACPI_ACCEPTABLE_CONFIGURATION
#define ACPI_SUB_OPTIMAL_CONFIGURATION

/*
 * 16, 32 and 64-bit Address Descriptor resource types
 */
#define ACPI_MEMORY_RANGE
#define ACPI_IO_RANGE
#define ACPI_BUS_NUMBER_RANGE

#define ACPI_ADDRESS_NOT_FIXED
#define ACPI_ADDRESS_FIXED

#define ACPI_POS_DECODE
#define ACPI_SUB_DECODE

/* Producer/Consumer */

#define ACPI_PRODUCER
#define ACPI_CONSUMER

/*
 * If possible, pack the following structures to byte alignment
 */
#ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED
#pragma pack(1)
#endif

/* UUID data structures for use in vendor-defined resource descriptors */

struct acpi_uuid {};

struct acpi_vendor_uuid {};

/*
 * Structures used to describe device resources
 */
struct acpi_resource_irq {};

struct acpi_resource_dma {};

struct acpi_resource_start_dependent {};

/*
 * The END_DEPENDENT_FUNCTIONS_RESOURCE struct is not
 * needed because it has no fields
 */

struct acpi_resource_io {};

struct acpi_resource_fixed_io {};

struct acpi_resource_fixed_dma {};

/* Values for Width field above */

#define ACPI_DMA_WIDTH8
#define ACPI_DMA_WIDTH16
#define ACPI_DMA_WIDTH32
#define ACPI_DMA_WIDTH64
#define ACPI_DMA_WIDTH128
#define ACPI_DMA_WIDTH256

struct acpi_resource_vendor {};

/* Vendor resource with UUID info (introduced in ACPI 3.0) */

struct acpi_resource_vendor_typed {};

struct acpi_resource_end_tag {};

struct acpi_resource_memory24 {};

struct acpi_resource_memory32 {};

struct acpi_resource_fixed_memory32 {};

struct acpi_memory_attribute {};

struct acpi_io_attribute {};

acpi_resource_attribute;

struct acpi_resource_label {};

struct acpi_resource_source {};

/* Fields common to all address descriptors, 16/32/64 bit */

#define ACPI_RESOURCE_ADDRESS_COMMON

struct acpi_address16_attribute {};

struct acpi_address32_attribute {};

struct acpi_address64_attribute {};

struct acpi_resource_address {};

struct acpi_resource_address16 {};

struct acpi_resource_address32 {};

struct acpi_resource_address64 {};

struct acpi_resource_extended_address64 {};

struct acpi_resource_extended_irq {};

struct acpi_resource_generic_register {};

struct acpi_resource_gpio {};

/* Values for GPIO connection_type field above */

#define ACPI_RESOURCE_GPIO_TYPE_INT
#define ACPI_RESOURCE_GPIO_TYPE_IO

/* Values for pin_config field above */

#define ACPI_PIN_CONFIG_DEFAULT
#define ACPI_PIN_CONFIG_PULLUP
#define ACPI_PIN_CONFIG_PULLDOWN
#define ACPI_PIN_CONFIG_NOPULL

/* Values for io_restriction field above */

#define ACPI_IO_RESTRICT_NONE
#define ACPI_IO_RESTRICT_INPUT
#define ACPI_IO_RESTRICT_OUTPUT
#define ACPI_IO_RESTRICT_NONE_PRESERVE

/* Common structure for I2C, SPI, UART, CSI2 serial descriptors */

#define ACPI_RESOURCE_SERIAL_COMMON

struct acpi_resource_common_serialbus {};

/* Values for the Type field above */

#define ACPI_RESOURCE_SERIAL_TYPE_I2C
#define ACPI_RESOURCE_SERIAL_TYPE_SPI
#define ACPI_RESOURCE_SERIAL_TYPE_UART
#define ACPI_RESOURCE_SERIAL_TYPE_CSI2

/* Values for slave_mode field above */

#define ACPI_CONTROLLER_INITIATED
#define ACPI_DEVICE_INITIATED

struct acpi_resource_i2c_serialbus {};

/* Values for access_mode field above */

#define ACPI_I2C_7BIT_MODE
#define ACPI_I2C_10BIT_MODE

struct acpi_resource_spi_serialbus {};

/* Values for wire_mode field above */

#define ACPI_SPI_4WIRE_MODE
#define ACPI_SPI_3WIRE_MODE

/* Values for device_polarity field above */

#define ACPI_SPI_ACTIVE_LOW
#define ACPI_SPI_ACTIVE_HIGH

/* Values for clock_phase field above */

#define ACPI_SPI_FIRST_PHASE
#define ACPI_SPI_SECOND_PHASE

/* Values for clock_polarity field above */

#define ACPI_SPI_START_LOW
#define ACPI_SPI_START_HIGH

struct acpi_resource_uart_serialbus {};

/* Values for Endian field above */

#define ACPI_UART_LITTLE_ENDIAN
#define ACPI_UART_BIG_ENDIAN

/* Values for data_bits field above */

#define ACPI_UART_5_DATA_BITS
#define ACPI_UART_6_DATA_BITS
#define ACPI_UART_7_DATA_BITS
#define ACPI_UART_8_DATA_BITS
#define ACPI_UART_9_DATA_BITS

/* Values for stop_bits field above */

#define ACPI_UART_NO_STOP_BITS
#define ACPI_UART_1_STOP_BIT
#define ACPI_UART_1P5_STOP_BITS
#define ACPI_UART_2_STOP_BITS

/* Values for flow_control field above */

#define ACPI_UART_FLOW_CONTROL_NONE
#define ACPI_UART_FLOW_CONTROL_HW
#define ACPI_UART_FLOW_CONTROL_XON_XOFF

/* Values for Parity field above */

#define ACPI_UART_PARITY_NONE
#define ACPI_UART_PARITY_EVEN
#define ACPI_UART_PARITY_ODD
#define ACPI_UART_PARITY_MARK
#define ACPI_UART_PARITY_SPACE

/* Values for lines_enabled bitfield above */

#define ACPI_UART_CARRIER_DETECT
#define ACPI_UART_RING_INDICATOR
#define ACPI_UART_DATA_SET_READY
#define ACPI_UART_DATA_TERMINAL_READY
#define ACPI_UART_CLEAR_TO_SEND
#define ACPI_UART_REQUEST_TO_SEND

struct acpi_resource_csi2_serialbus {};

struct acpi_resource_pin_function {};

struct acpi_resource_pin_config {};

struct acpi_resource_clock_input {};

/* Values for pin_config_type field above */

#define ACPI_PIN_CONFIG_DEFAULT
#define ACPI_PIN_CONFIG_BIAS_PULL_UP
#define ACPI_PIN_CONFIG_BIAS_PULL_DOWN
#define ACPI_PIN_CONFIG_BIAS_DEFAULT
#define ACPI_PIN_CONFIG_BIAS_DISABLE
#define ACPI_PIN_CONFIG_BIAS_HIGH_IMPEDANCE
#define ACPI_PIN_CONFIG_BIAS_BUS_HOLD
#define ACPI_PIN_CONFIG_DRIVE_OPEN_DRAIN
#define ACPI_PIN_CONFIG_DRIVE_OPEN_SOURCE
#define ACPI_PIN_CONFIG_DRIVE_PUSH_PULL
#define ACPI_PIN_CONFIG_DRIVE_STRENGTH
#define ACPI_PIN_CONFIG_SLEW_RATE
#define ACPI_PIN_CONFIG_INPUT_DEBOUNCE
#define ACPI_PIN_CONFIG_INPUT_SCHMITT_TRIGGER

struct acpi_resource_pin_group {};

struct acpi_resource_pin_group_function {};

struct acpi_resource_pin_group_config {};

/* ACPI_RESOURCE_TYPEs */

#define ACPI_RESOURCE_TYPE_IRQ
#define ACPI_RESOURCE_TYPE_DMA
#define ACPI_RESOURCE_TYPE_START_DEPENDENT
#define ACPI_RESOURCE_TYPE_END_DEPENDENT
#define ACPI_RESOURCE_TYPE_IO
#define ACPI_RESOURCE_TYPE_FIXED_IO
#define ACPI_RESOURCE_TYPE_VENDOR
#define ACPI_RESOURCE_TYPE_END_TAG
#define ACPI_RESOURCE_TYPE_MEMORY24
#define ACPI_RESOURCE_TYPE_MEMORY32
#define ACPI_RESOURCE_TYPE_FIXED_MEMORY32
#define ACPI_RESOURCE_TYPE_ADDRESS16
#define ACPI_RESOURCE_TYPE_ADDRESS32
#define ACPI_RESOURCE_TYPE_ADDRESS64
#define ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64
#define ACPI_RESOURCE_TYPE_EXTENDED_IRQ
#define ACPI_RESOURCE_TYPE_GENERIC_REGISTER
#define ACPI_RESOURCE_TYPE_GPIO
#define ACPI_RESOURCE_TYPE_FIXED_DMA
#define ACPI_RESOURCE_TYPE_SERIAL_BUS
#define ACPI_RESOURCE_TYPE_PIN_FUNCTION
#define ACPI_RESOURCE_TYPE_PIN_CONFIG
#define ACPI_RESOURCE_TYPE_PIN_GROUP
#define ACPI_RESOURCE_TYPE_PIN_GROUP_FUNCTION
#define ACPI_RESOURCE_TYPE_PIN_GROUP_CONFIG
#define ACPI_RESOURCE_TYPE_CLOCK_INPUT
#define ACPI_RESOURCE_TYPE_MAX

/* Master union for resource descriptors */

acpi_resource_data;

/* Common resource header */

struct acpi_resource {};

/* restore default alignment */

#pragma pack()

#define ACPI_RS_SIZE_NO_DATA
#define ACPI_RS_SIZE_MIN
#define ACPI_RS_SIZE(type)

/* Macro for walking resource templates with multiple descriptors */

#define ACPI_NEXT_RESOURCE(res)

struct acpi_pci_routing_table {};

#endif				/* __ACRESTYP_H__ */