/** * struct intel_pingroup - Description about group of pins * @grp: Generic data of the pin group (name and pins) * @mode: Native mode in which the group is muxed out @pins. Used if @modes is %NULL. * @modes: If not %NULL this will hold mode for each pin in @pins
*/ struct intel_pingroup { struct pingroup grp; unsignedshort mode; constunsignedint *modes;
};
/** * struct intel_function - Description about a function * @func: Generic data of the pin function (name and groups of pins)
*/ struct intel_function { struct pinfunction func;
};
#define INTEL_PINCTRL_MAX_GPP_SIZE 32
/** * struct intel_padgroup - Hardware pad group information * @reg_num: GPI_IS register number * @base: Starting pin of this group * @size: Size of this group (maximum is %INTEL_PINCTRL_MAX_GPP_SIZE). * @gpio_base: Starting GPIO base of this group * @padown_num: PAD_OWN register number (assigned by the core driver) * * If pad groups of a community are not the same size, use this structure * to specify them.
*/ struct intel_padgroup { unsignedint reg_num; unsignedint base; unsignedint size; int gpio_base; unsignedint padown_num;
};
/** * enum - Special treatment for GPIO base in pad group * * @INTEL_GPIO_BASE_ZERO: force GPIO base to be 0 * @INTEL_GPIO_BASE_NOMAP: no GPIO mapping should be created * @INTEL_GPIO_BASE_MATCH: matches with starting pin number
*/ enum {
INTEL_GPIO_BASE_ZERO = -2,
INTEL_GPIO_BASE_NOMAP = -1,
INTEL_GPIO_BASE_MATCH = 0,
};
/** * struct intel_community - Intel pin community description * @barno: MMIO BAR number where registers for this community reside * @padown_offset: Register offset of PAD_OWN register from @regs. If %0 * then there is no support for owner. * @padcfglock_offset: Register offset of PADCFGLOCK from @regs. If %0 then * locking is not supported. * @hostown_offset: Register offset of HOSTSW_OWN from @regs. If %0 then it * is assumed that the host owns the pin (rather than * ACPI). * @is_offset: Register offset of GPI_IS from @regs. * @ie_offset: Register offset of GPI_IE from @regs. * @features: Additional features supported by the hardware * @pin_base: Starting pin of pins in this community * @npins: Number of pins in this community * @gpp_size: Maximum number of pads in each group, such as PADCFGLOCK, * HOSTSW_OWN, GPI_IS, GPI_IE. Used when @gpps is %NULL. * @gpp_num_padown_regs: Number of pad registers each pad group consumes at * minimum. Used when @gpps is %NULL. * @gpps: Pad groups if the controller has variable size pad groups * @ngpps: Number of pad groups in this community * @pad_map: Optional non-linear mapping of the pads * @nirqs: Optional total number of IRQs this community can generate * @acpi_space_id: Optional address space ID for ACPI OpRegion handler * @regs: Community specific common registers (reserved for core driver) * @pad_regs: Community specific pad registers (reserved for core driver) * * In older Intel GPIO host controllers, this driver supports, each pad group * is of equal size (except the last one). In that case the driver can just * fill in @gpp_size and @gpp_num_padown_regs fields and let the core driver * to handle the rest. * * In newer Intel GPIO host controllers each pad group is of variable size, * so the client driver can pass custom @gpps and @ngpps instead.
*/ struct intel_community { unsignedint barno; unsignedint padown_offset; unsignedint padcfglock_offset; unsignedint hostown_offset; unsignedint is_offset; unsignedint ie_offset; unsignedint features; unsignedint pin_base;
size_t npins; unsignedint gpp_size; unsignedint gpp_num_padown_regs; conststruct intel_padgroup *gpps;
size_t ngpps; constunsignedint *pad_map; unsignedshort nirqs; unsignedshort acpi_space_id;
/* Reserved for the core driver */ void __iomem *regs; void __iomem *pad_regs;
};
/* Additional features supported by the hardware */ #define PINCTRL_FEATURE_DEBOUNCE BIT(0) #define PINCTRL_FEATURE_1K_PD BIT(1) #define PINCTRL_FEATURE_GPIO_HW_INFO BIT(2) #define PINCTRL_FEATURE_PWM BIT(3) #define PINCTRL_FEATURE_BLINK BIT(4) #define PINCTRL_FEATURE_EXP BIT(5)
#define INTEL_COMMUNITY_GPPS(b, s, e, g, soc) \
__INTEL_COMMUNITY(b, s, e, g, ARRAY_SIZE(g), 0, 0, soc)
#define INTEL_COMMUNITY_SIZE(b, s, e, gs, gn, soc) \
__INTEL_COMMUNITY(b, s, e, NULL, 0, gs, gn, soc)
/** * PIN_GROUP - Declare a pin group * @n: Name of the group * @p: An array of pins this group consists * @m: Mode which the pins are put when this group is active. Can be either * a single integer or an array of integers in which case mode is per * pin.
*/ #define PIN_GROUP(n, p, m) \
{ \
.grp = PINCTRL_PINGROUP((n), (p), ARRAY_SIZE((p))), \
.mode = __builtin_choose_expr(__builtin_constant_p((m)), (m), 0), \
.modes = __builtin_choose_expr(__builtin_constant_p((m)), NULL, (m)), \
}
#define PIN_GROUP_GPIO(n, p, m) \
PIN_GROUP(n, p, m), \
PIN_GROUP(n "_gpio", p, 0)
/** * struct intel_pinctrl_soc_data - Intel pin controller per-SoC configuration * @uid: ACPI _UID for the probe driver use if needed * @pins: Array if pins this pinctrl controls * @npins: Number of pins in the array * @groups: Array of pin groups * @ngroups: Number of groups in the array * @functions: Array of functions * @nfunctions: Number of functions in the array * @communities: Array of communities this pinctrl handles * @ncommunities: Number of communities in the array * * The @communities is used as a template by the core driver. It will make * copy of all communities and fill in rest of the information.
*/ struct intel_pinctrl_soc_data { constchar *uid; conststruct pinctrl_pin_desc *pins;
size_t npins; conststruct intel_pingroup *groups;
size_t ngroups; conststruct intel_function *functions;
size_t nfunctions; conststruct intel_community *communities;
size_t ncommunities;
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.