drivers/pinctrl/nomadik/pinctrl-abx500.h

Source file repositories/reference/linux-study-clean/drivers/pinctrl/nomadik/pinctrl-abx500.h

File Facts

System
Linux kernel
Corpus path
drivers/pinctrl/nomadik/pinctrl-abx500.h
Extension
.h
Size
6074 bytes
Lines
210
Domain
Driver Families
Bucket
drivers/pinctrl
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

struct abx500_function {
	const char *name;
	const char * const *groups;
	unsigned ngroups;
};

/**
 * struct abx500_pingroup - describes a ABx500 pin group
 * @name: the name of this specific pin group
 * @pins: an array of discrete physical pins used in this group, taken
 *	from the driver-local pin enumeration space
 * @num_pins: the number of pins in this group array, i.e. the number of
 *	elements in .pins so we can iterate over that array
 * @altsetting: the altsetting to apply to all pins in this group to
 *	configure them to be used by a function
 */
struct abx500_pingroup {
	const char *name;
	const unsigned int *pins;
	const unsigned npins;
	int altsetting;
};

#define ALTERNATE_FUNCTIONS(pin, sel_bit, alt1, alt2, alta, altb, altc)	\
{									\
	.pin_number = pin,						\
	.gpiosel_bit = sel_bit,						\
	.alt_bit1 = alt1,						\
	.alt_bit2 = alt2,						\
	.alta_val = alta,						\
	.altb_val = altb,						\
	.altc_val = altc,						\
}

#define UNUSED -1
/**
 * struct alternate_functions
 * @pin_number:		The pin number
 * @gpiosel_bit:	Control bit in GPIOSEL register,
 * @alt_bit1:		First AlternateFunction bit used to select the
 *			alternate function
 * @alt_bit2:		Second AlternateFunction bit used to select the
 *			alternate function
 *
 *			these 3 following fields are necessary due to none
 *			coherency on how to select the altA, altB and altC
 *			function between the ABx500 SOC family when using
 *			alternatfunc register.
 * @alta_val:		value to write in alternatfunc to select altA function
 * @altb_val:		value to write in alternatfunc to select altB function
 * @altc_val:		value to write in alternatfunc to select altC function
 */
struct alternate_functions {
	unsigned pin_number;
	s8 gpiosel_bit;
	s8 alt_bit1;
	s8 alt_bit2;
	u8 alta_val;
	u8 altb_val;
	u8 altc_val;
};

#define GPIO_IRQ_CLUSTER(a, b, c)	\
{					\
	.start = a,			\
	.end = b,			\
	.to_irq = c,			\
}

/**
 * struct abx500_gpio_irq_cluster - indicates GPIOs which are interrupt
 *			capable
 * @start:		The pin number of the first pin interrupt capable
 * @end:		The pin number of the last pin interrupt capable
 * @to_irq:		The ABx500 GPIO's associated IRQs are clustered
 *                      together throughout the interrupt numbers at irregular
 *                      intervals. To solve this quandary, we will place the
 *                      read-in values into the cluster information table
 */

struct abx500_gpio_irq_cluster {
	int start;
	int end;
	int to_irq;
};

/**
 * struct abx500_pinrange - map pin numbers to GPIO offsets
 * @offset:		offset into the GPIO local numberspace, incidentally
 *			identical to the offset into the local pin numberspace

Annotation

Implementation Notes