drivers/pinctrl/mediatek/pinctrl-mt6795.c

Source file repositories/reference/linux-study-clean/drivers/pinctrl/mediatek/pinctrl-mt6795.c

File Facts

System
Linux kernel
Corpus path
drivers/pinctrl/mediatek/pinctrl-mt6795.c
Extension
.c
Size
27394 bytes
Lines
625
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) 2022 Collabora Ltd.
 * Author: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
 */

#include "pinctrl-mtk-mt6795.h"
#include "pinctrl-paris.h"

#define PIN_FIELD15(_s_pin, _e_pin, _s_addr, _x_addrs, _s_bit, _x_bits)	\
	PIN_FIELD_CALC(_s_pin, _e_pin, 0, _s_addr, _x_addrs, _s_bit,	\
		       _x_bits, 15, 0)

#define PIN_FIELD16(_s_pin, _e_pin, _s_addr, _x_addrs, _s_bit, _x_bits)	\
	PIN_FIELD_CALC(_s_pin, _e_pin, 0, _s_addr, _x_addrs, _s_bit,	\
		       _x_bits, 16, 0)

#define PINS_FIELD16(_s_pin, _e_pin, _s_addr, _x_addrs, _s_bit, _x_bits)\
	PIN_FIELD_CALC(_s_pin, _e_pin, 0, _s_addr, _x_addrs, _s_bit,	\
		       _x_bits, 16, 1)

static const struct mtk_pin_field_calc mt6795_pin_dir_range[] = {
	PIN_FIELD16(0, 196, 0x0, 0x10, 0, 1),
};

static const struct mtk_pin_field_calc mt6795_pin_pullen_range[] = {
	PIN_FIELD16(0, 196, 0x100, 0x10, 0, 1),
};

static const struct mtk_pin_field_calc mt6795_pin_pullsel_range[] = {
	PIN_FIELD16(0, 196, 0x200, 0x10, 0, 1),
};

static const struct mtk_pin_field_calc mt6795_pin_do_range[] = {
	PIN_FIELD16(0, 196, 0x400, 0x10, 0, 1),
};

static const struct mtk_pin_field_calc mt6795_pin_di_range[] = {
	PIN_FIELD16(0, 196, 0x500, 0x10, 0, 1),
};

static const struct mtk_pin_field_calc mt6795_pin_mode_range[] = {
	PIN_FIELD15(0, 196, 0x600, 0x10, 0, 3),
};

static const struct mtk_pin_field_calc mt6795_pin_ies_range[] = {
	PINS_FIELD16(0, 4, 0x900, 0x10, 1, 1),
	PINS_FIELD16(5, 9, 0x900, 0x10, 2, 1),
	PINS_FIELD16(10, 15, 0x900, 0x10, 10, 1),
	PINS_FIELD16(16, 16, 0x900, 0x10, 2, 1),
	PINS_FIELD16(17, 19, 0x910, 0x10, 3, 1),
	PINS_FIELD16(20, 22, 0x910, 0x10, 4, 1),
	PINS_FIELD16(23, 26, 0xce0, 0x10, 14, 1),
	PINS_FIELD16(27, 27, 0xcc0, 0x10, 14, 1),
	PINS_FIELD16(28, 28, 0xcd0, 0x10, 14, 1),
	PINS_FIELD16(29, 32, 0x900, 0x10, 3, 1),
	PINS_FIELD16(33, 33, 0x900, 0x10, 4, 1),
	PINS_FIELD16(34, 36, 0x900, 0x10, 5, 1),
	PINS_FIELD16(37, 38, 0x900, 0x10, 6, 1),
	PINS_FIELD16(39, 39, 0x900, 0x10, 7, 1),
	PINS_FIELD16(40, 40, 0x900, 0x10, 8, 1),
	PINS_FIELD16(41, 42, 0x900, 0x10, 9, 1),
	PINS_FIELD16(43, 46, 0x900, 0x10, 11, 1),
	PINS_FIELD16(47, 61, 0x920, 0x10, 3, 1),
	PINS_FIELD16(62, 66, 0x920, 0x10, 4, 1),
	PINS_FIELD16(67, 67, 0x920, 0x10, 3, 1),
	PINS_FIELD16(68, 72, 0x920, 0x10, 5, 1),
	PINS_FIELD16(73, 77, 0x920, 0x10, 6, 1),
	PINS_FIELD16(78, 91, 0x920, 0x10, 7, 1),
	PINS_FIELD16(92, 92, 0x900, 0x10, 13, 1),
	PINS_FIELD16(93, 95, 0x900, 0x10, 14, 1),
	PINS_FIELD16(96, 99, 0x900, 0x10, 15, 1),
	PINS_FIELD16(100, 103, 0xca0, 0x10, 14, 1),
	PINS_FIELD16(104, 104, 0xc80, 0x10, 14, 1),
	PINS_FIELD16(105, 105, 0xc90, 0x10, 14, 1),
	PINS_FIELD16(106, 107, 0x910, 0x10, 0, 1),
	PINS_FIELD16(108, 112, 0x910, 0x10, 1, 1),
	PINS_FIELD16(113, 116, 0x910, 0x10, 2, 1),
	PINS_FIELD16(117, 118, 0x910, 0x10, 5, 1),
	PINS_FIELD16(119, 124, 0x910, 0x10, 6, 1),
	PINS_FIELD16(125, 126, 0x910, 0x10, 7, 1),
	PINS_FIELD16(129, 129, 0x910, 0x10, 8, 1),
	PINS_FIELD16(130, 131, 0x910, 0x10, 9, 1),
	PINS_FIELD16(132, 135, 0x910, 0x10, 8, 1),
	PINS_FIELD16(136, 137, 0x910, 0x10, 7, 1),
	PINS_FIELD16(154, 161, 0xc20, 0x10, 14, 1),
	PINS_FIELD16(162, 162, 0xc10, 0x10, 14, 1),
	PINS_FIELD16(163, 163, 0xc00, 0x10, 14, 1),
	PINS_FIELD16(164, 164, 0xd10, 0x10, 14, 1),
	PINS_FIELD16(165, 165, 0xd00, 0x10, 14, 1),

Annotation

Implementation Notes