1 // SPDX-License-Identifier: GPL-2.0
3 * Allwinner H616 R_PIO pin controller driver
5 * Copyright (C) 2020 Arm Ltd.
6 * Based on former work, which is:
7 * Copyright (C) 2017 Icenowy Zheng <icenowy@aosc.io>
10 #include <linux/init.h>
11 #include <linux/platform_device.h>
13 #include <linux/of_device.h>
14 #include <linux/pinctrl/pinctrl.h>
15 #include <linux/reset.h>
17 #include "pinctrl-sunxi.h"
19 static const struct sunxi_desc_pin sun50i_h616_r_pins[] = {
20 SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 0),
21 SUNXI_FUNCTION(0x0, "gpio_in"),
22 SUNXI_FUNCTION(0x1, "gpio_out"),
23 SUNXI_FUNCTION(0x2, "s_rsb"), /* SCK */
24 SUNXI_FUNCTION(0x3, "s_i2c")), /* SCK */
25 SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 1),
26 SUNXI_FUNCTION(0x0, "gpio_in"),
27 SUNXI_FUNCTION(0x1, "gpio_out"),
28 SUNXI_FUNCTION(0x2, "s_rsb"), /* SDA */
29 SUNXI_FUNCTION(0x3, "s_i2c")), /* SDA */
32 static const struct sunxi_pinctrl_desc sun50i_h616_r_pinctrl_data = {
33 .pins = sun50i_h616_r_pins,
34 .npins = ARRAY_SIZE(sun50i_h616_r_pins),
38 static int sun50i_h616_r_pinctrl_probe(struct platform_device *pdev)
40 return sunxi_pinctrl_init(pdev,
41 &sun50i_h616_r_pinctrl_data);
44 static const struct of_device_id sun50i_h616_r_pinctrl_match[] = {
45 { .compatible = "allwinner,sun50i-h616-r-pinctrl", },
49 static struct platform_driver sun50i_h616_r_pinctrl_driver = {
50 .probe = sun50i_h616_r_pinctrl_probe,
52 .name = "sun50i-h616-r-pinctrl",
53 .of_match_table = sun50i_h616_r_pinctrl_match,
56 builtin_platform_driver(sun50i_h616_r_pinctrl_driver);