Merge tag 'trace-printf-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
[drm/drm-misc.git] / drivers / pinctrl / nuvoton / pinctrl-ma35.h
blob218084100541d2167d58c5d7c30feabc6fc12e65
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3 * Copyright (C) 2024 Nuvoton Technology Corp.
5 * Author: Shan-Chun Hung <schung@nuvoton.com>
6 * * Jacky Huang <ychuang3@nuvoton.com>
7 */
8 #ifndef __PINCTRL_MA35_H
9 #define __PINCTRL_MA35_H
11 #include <linux/pinctrl/pinconf-generic.h>
12 #include <linux/pinctrl/pinmux.h>
13 #include <linux/platform_device.h>
15 struct ma35_mux_desc {
16 const char *name;
17 u32 muxval;
20 struct ma35_pin_data {
21 u32 offset;
22 u32 shift;
23 struct ma35_mux_desc *muxes;
26 struct ma35_pinctrl_soc_info {
27 const struct pinctrl_pin_desc *pins;
28 unsigned int npins;
29 int (*get_pin_num)(int offset, int shift);
32 #define MA35_PIN(num, n, o, s, ...) { \
33 .number = num, \
34 .name = #n, \
35 .drv_data = &(struct ma35_pin_data) { \
36 .offset = o, \
37 .shift = s, \
38 .muxes = (struct ma35_mux_desc[]) { \
39 __VA_ARGS__, { } }, \
40 }, \
43 #define MA35_MUX(_val, _name) { \
44 .name = _name, \
45 .muxval = _val, \
48 int ma35_pinctrl_probe(struct platform_device *pdev, const struct ma35_pinctrl_soc_info *info);
49 int ma35_pinctrl_suspend(struct device *dev);
50 int ma35_pinctrl_resume(struct device *dev);
52 #endif /* __PINCTRL_MA35_H */