Files
android/drivers/pinctrl/sprd/pinctrl-sprd.h
threeeye bc1d038eac REVVL 6 Pro kernel bring-up: full working tree snapshot (2026-09-12)
Squashed backup commit (no shallow-clone history issues) of
xiaomi-mt6833-dev/kernel_xiaomi_mt6833 (lineage-23.2 branch, upstream
commit 9eece662e) plus all fixes applied to get everpal_defconfig building
clean against a modern (GCC 15.2.0) toolchain -- see the previous commit
message on the lineage-23.2 branch (also in this repo history is not
available here since this is a squashed snapshot; full incremental history
lives in the local DL380 checkout and the upstream GitHub remote).

Upstream: https://github.com/xiaomi-mt6833-dev/kernel_xiaomi_mt6833 (lineage-23.2)
2026-09-12 13:36:46 +00:00

68 lines
1.8 KiB
C

/*
* Driver header file for pin controller driver
* Copyright (C) 2017 Spreadtrum - http://www.spreadtrum.com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*/
#ifndef __PINCTRL_SPRD_H__
#define __PINCTRL_SPRD_H__
struct platform_device;
#define NUM_OFFSET (20)
#define TYPE_OFFSET (16)
#define BIT_OFFSET (8)
#define WIDTH_OFFSET (4)
#define SPRD_PIN_INFO(num, type, offset, width, reg) \
(((num) & 0xFFF) << NUM_OFFSET | \
((type) & 0xF) << TYPE_OFFSET | \
((offset) & 0xFF) << BIT_OFFSET | \
((width) & 0xF) << WIDTH_OFFSET | \
((reg) & 0xF))
#define SPRD_PINCTRL_PIN(pin) SPRD_PINCTRL_PIN_DATA(pin, #pin)
#define SPRD_PINCTRL_PIN_DATA(a, b) \
{ \
.name = b, \
.num = (((a) >> NUM_OFFSET) & 0xfff), \
.type = (((a) >> TYPE_OFFSET) & 0xf), \
.bit_offset = (((a) >> BIT_OFFSET) & 0xff), \
.bit_width = ((a) >> WIDTH_OFFSET & 0xf), \
.reg = ((a) & 0xf) \
}
enum pin_type {
GLOBAL_CTRL_PIN,
COMMON_PIN,
MISC_PIN,
};
struct sprd_pins_info {
const char *name;
unsigned int num;
enum pin_type type;
/* for global control pins configuration */
unsigned long bit_offset;
unsigned long bit_width;
unsigned int reg;
};
int sprd_pinctrl_core_probe(struct platform_device *pdev,
struct sprd_pins_info *sprd_soc_pin_info,
int pins_cnt);
int sprd_pinctrl_remove(struct platform_device *pdev);
void sprd_pinctrl_shutdown(struct platform_device *pdev);
#endif /* __PINCTRL_SPRD_H__ */