drivers/pinctrl/nomadik/pinctrl-ab8505.c

Source file repositories/reference/linux-study-clean/drivers/pinctrl/nomadik/pinctrl-ab8505.c

File Facts

System
Linux kernel
Corpus path
drivers/pinctrl/nomadik/pinctrl-ab8505.c
Extension
.c
Size
17025 bytes
Lines
381
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

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (C) ST-Ericsson SA 2012
 *
 * Author: Patrice Chotard <patrice.chotard@stericsson.com> for ST-Ericsson.
 */

#include <linux/kernel.h>
#include <linux/pinctrl/pinctrl.h>

#include <linux/mfd/abx500/ab8500.h>

#include "pinctrl-abx500.h"

/* All the pins that can be used for GPIO and some other functions */
#define ABX500_GPIO(offset)	(offset)

#define AB8505_PIN_N4		ABX500_GPIO(1)
#define AB8505_PIN_R5		ABX500_GPIO(2)
#define AB8505_PIN_P5		ABX500_GPIO(3)
/* hole */
#define AB8505_PIN_B16		ABX500_GPIO(10)
#define AB8505_PIN_B17		ABX500_GPIO(11)
/* hole */
#define AB8505_PIN_D17		ABX500_GPIO(13)
#define AB8505_PIN_C16		ABX500_GPIO(14)
/* hole */
#define AB8505_PIN_P2		ABX500_GPIO(17)
#define AB8505_PIN_N3		ABX500_GPIO(18)
#define AB8505_PIN_T1		ABX500_GPIO(19)
#define AB8505_PIN_P3		ABX500_GPIO(20)
/* hole */
#define AB8505_PIN_H14		ABX500_GPIO(34)
/* hole */
#define AB8505_PIN_J15		ABX500_GPIO(40)
#define AB8505_PIN_J14		ABX500_GPIO(41)
/* hole */
#define AB8505_PIN_L4		ABX500_GPIO(50)
/* hole */
#define AB8505_PIN_D16		ABX500_GPIO(52)
#define AB8505_PIN_D15		ABX500_GPIO(53)

/* indicates the higher GPIO number */
#define AB8505_GPIO_MAX_NUMBER	53

/*
 * The names of the pins are denoted by GPIO number and ball name, even
 * though they can be used for other things than GPIO, this is the first
 * column in the table of the data sheet and often used on schematics and
 * such.
 */
static const struct pinctrl_pin_desc ab8505_pins[] = {
	PINCTRL_PIN(AB8505_PIN_N4, "GPIO1_N4"),
	PINCTRL_PIN(AB8505_PIN_R5, "GPIO2_R5"),
	PINCTRL_PIN(AB8505_PIN_P5, "GPIO3_P5"),
/* hole */
	PINCTRL_PIN(AB8505_PIN_B16, "GPIO10_B16"),
	PINCTRL_PIN(AB8505_PIN_B17, "GPIO11_B17"),
/* hole */
	PINCTRL_PIN(AB8505_PIN_D17, "GPIO13_D17"),
	PINCTRL_PIN(AB8505_PIN_C16, "GPIO14_C16"),
/* hole */
	PINCTRL_PIN(AB8505_PIN_P2, "GPIO17_P2"),
	PINCTRL_PIN(AB8505_PIN_N3, "GPIO18_N3"),
	PINCTRL_PIN(AB8505_PIN_T1, "GPIO19_T1"),
	PINCTRL_PIN(AB8505_PIN_P3, "GPIO20_P3"),
/* hole */
	PINCTRL_PIN(AB8505_PIN_H14, "GPIO34_H14"),
/* hole */
	PINCTRL_PIN(AB8505_PIN_J15, "GPIO40_J15"),
	PINCTRL_PIN(AB8505_PIN_J14, "GPIO41_J14"),
/* hole */
	PINCTRL_PIN(AB8505_PIN_L4, "GPIO50_L4"),
/* hole */
	PINCTRL_PIN(AB8505_PIN_D16, "GPIO52_D16"),
	PINCTRL_PIN(AB8505_PIN_D15, "GPIO53_D15"),
};

/*
 * Maps local GPIO offsets to local pin numbers
 */
static const struct abx500_pinrange ab8505_pinranges[] = {
	ABX500_PINRANGE(1, 3, ABX500_ALT_A),
	ABX500_PINRANGE(10, 2, ABX500_DEFAULT),
	ABX500_PINRANGE(13, 1, ABX500_DEFAULT),
	ABX500_PINRANGE(14, 1, ABX500_ALT_A),
	ABX500_PINRANGE(17, 4, ABX500_ALT_A),
	ABX500_PINRANGE(34, 1, ABX500_ALT_A),
	ABX500_PINRANGE(40, 2, ABX500_ALT_A),
	ABX500_PINRANGE(50, 1, ABX500_DEFAULT),

Annotation

Implementation Notes