drivers/pinctrl/berlin/berlin-bg2q.c

Source file repositories/reference/linux-study-clean/drivers/pinctrl/berlin/berlin-bg2q.c

File Facts

System
Linux kernel
Corpus path
drivers/pinctrl/berlin/berlin-bg2q.c
Extension
.c
Size
16198 bytes
Lines
404
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
/*
 * Marvell Berlin BG2Q pinctrl driver
 *
 * Copyright (C) 2014 Marvell Technology Group Ltd.
 *
 * Antoine Ténart <antoine.tenart@free-electrons.com>
 */

#include <linux/init.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/property.h>
#include <linux/regmap.h>

#include "berlin.h"

static const struct berlin_desc_group berlin2q_soc_pinctrl_groups[] = {
	/* G */
	BERLIN_PINCTRL_GROUP("G0", 0x18, 0x3, 0x00,
			BERLIN_PINCTRL_FUNCTION(0x0, "nand"),
			BERLIN_PINCTRL_FUNCTION(0x1, "mmc"),
			BERLIN_PINCTRL_FUNCTION(0x2, "gpio")),
	BERLIN_PINCTRL_GROUP("G1", 0x18, 0x3, 0x03,
			BERLIN_PINCTRL_FUNCTION(0x0, "nand"),
			BERLIN_PINCTRL_FUNCTION(0x2, "gpio")),
	BERLIN_PINCTRL_GROUP("G2", 0x18, 0x3, 0x06,
			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
			BERLIN_PINCTRL_FUNCTION(0x2, "arc"),
			BERLIN_PINCTRL_FUNCTION(0x3, "lvds")),
	BERLIN_PINCTRL_GROUP("G3", 0x18, 0x3, 0x09,
			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
			BERLIN_PINCTRL_FUNCTION(0x2, "i2s2"),
			BERLIN_PINCTRL_FUNCTION(0x3, "lvds")),
	BERLIN_PINCTRL_GROUP("G4", 0x18, 0x3, 0x0c,
			BERLIN_PINCTRL_FUNCTION(0x0, "pll"),
			BERLIN_PINCTRL_FUNCTION(0x1, "sd0"),
			BERLIN_PINCTRL_FUNCTION(0x2, "rgmii"),
			BERLIN_PINCTRL_FUNCTION(0x3, "gpio"),
			BERLIN_PINCTRL_FUNCTION(0x5, "sata_dbg"),
			BERLIN_PINCTRL_FUNCTION(0x6, "usb0_dbg"),
			BERLIN_PINCTRL_FUNCTION(0x7, "usb1_dbg")),
	BERLIN_PINCTRL_GROUP("G5", 0x18, 0x3, 0x0f,
			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
			BERLIN_PINCTRL_FUNCTION(0x1, "sd0"),
			BERLIN_PINCTRL_FUNCTION(0x2, "rgmii"),
			BERLIN_PINCTRL_FUNCTION(0x5, "sata_dbg"),
			BERLIN_PINCTRL_FUNCTION(0x6, "usb0_dbg"),
			BERLIN_PINCTRL_FUNCTION(0x7, "usb1_dbg")),
	BERLIN_PINCTRL_GROUP("G6", 0x18, 0x3, 0x12,
			BERLIN_PINCTRL_FUNCTION(0x0, "jtag"),
			BERLIN_PINCTRL_FUNCTION(0x1, "twsi0"),
			BERLIN_PINCTRL_FUNCTION(0x2, "gpio")),
	BERLIN_PINCTRL_GROUP("G7", 0x18, 0x3, 0x15,
			BERLIN_PINCTRL_FUNCTION(0x0, "jtag"),
			BERLIN_PINCTRL_FUNCTION(0x1, "twsi1"),
			BERLIN_PINCTRL_FUNCTION(0x2, "gpio"),
			BERLIN_PINCTRL_FUNCTION(0x3, "eddc")),
	BERLIN_PINCTRL_GROUP("G8", 0x18, 0x3, 0x18,
			BERLIN_PINCTRL_FUNCTION(0x0, "spi1"), /* CLK/SDI/SDO */
			BERLIN_PINCTRL_FUNCTION(0x1, "gpio")),
	BERLIN_PINCTRL_GROUP("G9", 0x18, 0x3, 0x1b,
			BERLIN_PINCTRL_FUNCTION(0x0, "spi1"), /* SS0n/SS1n */
			BERLIN_PINCTRL_FUNCTION(0x1, "gpio"),
			BERLIN_PINCTRL_FUNCTION(0x5, "sata")),
	BERLIN_PINCTRL_GROUP("G10", 0x1c, 0x3, 0x00,
			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
			BERLIN_PINCTRL_FUNCTION(0x1, "spi1"), /* SS2n */
			BERLIN_PINCTRL_FUNCTION(0x3, "i2s0"),
			BERLIN_PINCTRL_FUNCTION(0x4, "pwm"),
			BERLIN_PINCTRL_FUNCTION(0x5, "sata")),
	BERLIN_PINCTRL_GROUP("G11", 0x1c, 0x3, 0x03,
			BERLIN_PINCTRL_FUNCTION(0x0, "jtag"),
			BERLIN_PINCTRL_FUNCTION(0x1, "spi1"), /* SS3n */
			BERLIN_PINCTRL_FUNCTION(0x2, "gpio"),
			BERLIN_PINCTRL_FUNCTION(0x3, "i2s1"),
			BERLIN_PINCTRL_FUNCTION(0x4, "pwm"),
			BERLIN_PINCTRL_FUNCTION(0x5, "sata")),
	BERLIN_PINCTRL_GROUP("G12", 0x1c, 0x3, 0x06,
			BERLIN_PINCTRL_FUNCTION(0x0, "agc"),
			BERLIN_PINCTRL_FUNCTION(0x1, "gpio")),
	BERLIN_PINCTRL_GROUP("G13", 0x1c, 0x3, 0x09,
			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
			BERLIN_PINCTRL_FUNCTION(0x1, "sts1"),
			BERLIN_PINCTRL_FUNCTION(0x2, "rgmii"),
			BERLIN_PINCTRL_FUNCTION(0x6, "usb0_dbg"),
			BERLIN_PINCTRL_FUNCTION(0x7, "usb1_dbg")),
	BERLIN_PINCTRL_GROUP("G14", 0x1c, 0x3, 0x0c,
			BERLIN_PINCTRL_FUNCTION(0x0, "gpio"),
			BERLIN_PINCTRL_FUNCTION(0x1, "sts0"),

Annotation

Implementation Notes