2 * Allwinner A83T SoCs special pins pinctrl driver.
4 * Copyright (C) 2017 Chen-Yu Tsai
5 * Chen-Yu Tsai <wens@csie.org>
7 * Based on pinctrl-sun50i-a64-r.c
9 * Copyright (C) 2016 Icenowy Zheng
10 * Icenowy Zheng <icenowy@aosc.xyz>
12 * Copyright (C) 2014 Chen-Yu Tsai
13 * Chen-Yu Tsai <wens@csie.org>
15 * Copyright (C) 2014 Boris Brezillon
16 * Boris Brezillon <boris.brezillon@free-electrons.com>
18 * Copyright (C) 2014 Maxime Ripard
19 * Maxime Ripard <maxime.ripard@free-electrons.com>
21 * This file is licensed under the terms of the GNU General Public
22 * License version 2. This program is licensed "as is" without any
23 * warranty of any kind, whether express or implied.
27 #include <linux/of_device.h>
28 #include <linux/pinctrl/pinctrl.h>
29 #include <linux/platform_device.h>
31 #include "pinctrl-sunxi.h"
33 static const struct sunxi_desc_pin sun8i_a83t_r_pins[] = {
34 SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 0),
35 SUNXI_FUNCTION(0x0, "gpio_in"),
36 SUNXI_FUNCTION(0x1, "gpio_out"),
37 SUNXI_FUNCTION(0x2, "s_rsb"), /* SCK */
38 SUNXI_FUNCTION(0x3, "s_i2c"), /* SCK */
39 SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 0)), /* PL_EINT0 */
40 SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 1),
41 SUNXI_FUNCTION(0x0, "gpio_in"),
42 SUNXI_FUNCTION(0x1, "gpio_out"),
43 SUNXI_FUNCTION(0x2, "s_rsb"), /* SDA */
44 SUNXI_FUNCTION(0x3, "s_i2c"), /* SDA */
45 SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 1)), /* PL_EINT1 */
46 SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 2),
47 SUNXI_FUNCTION(0x0, "gpio_in"),
48 SUNXI_FUNCTION(0x1, "gpio_out"),
49 SUNXI_FUNCTION(0x2, "s_uart"), /* TX */
50 SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 2)), /* PL_EINT2 */
51 SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 3),
52 SUNXI_FUNCTION(0x0, "gpio_in"),
53 SUNXI_FUNCTION(0x1, "gpio_out"),
54 SUNXI_FUNCTION(0x2, "s_uart"), /* RX */
55 SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 3)), /* PL_EINT3 */
56 SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 4),
57 SUNXI_FUNCTION(0x0, "gpio_in"),
58 SUNXI_FUNCTION(0x1, "gpio_out"),
59 SUNXI_FUNCTION(0x2, "s_jtag"), /* MS */
60 SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 4)), /* PL_EINT4 */
61 SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 5),
62 SUNXI_FUNCTION(0x0, "gpio_in"),
63 SUNXI_FUNCTION(0x1, "gpio_out"),
64 SUNXI_FUNCTION(0x2, "s_jtag"), /* CK */
65 SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 5)), /* PL_EINT5 */
66 SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 6),
67 SUNXI_FUNCTION(0x0, "gpio_in"),
68 SUNXI_FUNCTION(0x1, "gpio_out"),
69 SUNXI_FUNCTION(0x2, "s_jtag"), /* DO */
70 SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 6)), /* PL_EINT6 */
71 SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 7),
72 SUNXI_FUNCTION(0x0, "gpio_in"),
73 SUNXI_FUNCTION(0x1, "gpio_out"),
74 SUNXI_FUNCTION(0x2, "s_jtag"), /* DI */
75 SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 7)), /* PL_EINT7 */
76 SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 8),
77 SUNXI_FUNCTION(0x0, "gpio_in"),
78 SUNXI_FUNCTION(0x1, "gpio_out"),
79 SUNXI_FUNCTION(0x2, "s_i2c"), /* SCK */
80 SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 8)), /* PL_EINT8 */
81 SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 9),
82 SUNXI_FUNCTION(0x0, "gpio_in"),
83 SUNXI_FUNCTION(0x1, "gpio_out"),
84 SUNXI_FUNCTION(0x2, "s_i2c"), /* SDA */
85 SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 9)), /* PL_EINT9 */
86 SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 10),
87 SUNXI_FUNCTION(0x0, "gpio_in"),
88 SUNXI_FUNCTION(0x1, "gpio_out"),
89 SUNXI_FUNCTION(0x2, "s_pwm"),
90 SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 10)), /* PL_EINT10 */
91 SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 11),
92 SUNXI_FUNCTION(0x0, "gpio_in"),
93 SUNXI_FUNCTION(0x1, "gpio_out"),
94 SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 11)), /* PL_EINT11 */
95 SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 12),
96 SUNXI_FUNCTION(0x0, "gpio_in"),
97 SUNXI_FUNCTION(0x1, "gpio_out"),
98 SUNXI_FUNCTION(0x2, "s_cir_rx"),
99 SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 12)), /* PL_EINT12 */
102 static const struct sunxi_pinctrl_desc sun8i_a83t_r_pinctrl_data = {
103 .pins = sun8i_a83t_r_pins,
104 .npins = ARRAY_SIZE(sun8i_a83t_r_pins),
109 static int sun8i_a83t_r_pinctrl_probe(struct platform_device *pdev)
111 return sunxi_pinctrl_init(pdev,
112 &sun8i_a83t_r_pinctrl_data);
115 static const struct of_device_id sun8i_a83t_r_pinctrl_match[] = {
116 { .compatible = "allwinner,sun8i-a83t-r-pinctrl", },
120 static struct platform_driver sun8i_a83t_r_pinctrl_driver = {
121 .probe = sun8i_a83t_r_pinctrl_probe,
123 .name = "sun8i-a83t-r-pinctrl",
124 .of_match_table = sun8i_a83t_r_pinctrl_match,
127 builtin_platform_driver(sun8i_a83t_r_pinctrl_driver);