Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  * Copyright (C) 2018 MediaTek Inc.
0004  *
0005  * Author: Sean Wang <sean.wang@mediatek.com>
0006  *     Zhiyong Tao <zhiyong.tao@mediatek.com>
0007  *     Hongzhou.Yang <hongzhou.yang@mediatek.com>
0008  */
0009 #ifndef __PINCTRL_PARIS_H
0010 #define __PINCTRL_PARIS_H
0011 
0012 #include <linux/io.h>
0013 #include <linux/init.h>
0014 #include <linux/of.h>
0015 #include <linux/of_platform.h>
0016 #include <linux/platform_device.h>
0017 #include <linux/pinctrl/pinctrl.h>
0018 #include <linux/pinctrl/pinmux.h>
0019 #include <linux/pinctrl/pinconf.h>
0020 #include <linux/pinctrl/pinconf-generic.h>
0021 
0022 #include "../core.h"
0023 #include "../pinconf.h"
0024 #include "../pinctrl-utils.h"
0025 #include "../pinmux.h"
0026 #include "mtk-eint.h"
0027 #include "pinctrl-mtk-common-v2.h"
0028 
0029 #define MTK_RANGE(_a)       { .range = (_a), .nranges = ARRAY_SIZE(_a), }
0030 
0031 #define MTK_EINT_FUNCTION(_eintmux, _eintnum)               \
0032     {                           \
0033         .eint_m = _eintmux,                 \
0034         .eint_n = _eintnum,                 \
0035     }
0036 
0037 #define MTK_FUNCTION(_val, _name)               \
0038     {                           \
0039         .muxval = _val,                 \
0040         .name = _name,                  \
0041     }
0042 
0043 #define MTK_PIN(_number, _name, _eint, _drv_n, ...) {   \
0044         .number = _number,          \
0045         .name = _name,              \
0046         .eint = _eint,              \
0047         .drv_n = _drv_n,            \
0048         .funcs = (struct mtk_func_desc[]){  \
0049             __VA_ARGS__, { } },             \
0050     }
0051 
0052 #define PINCTRL_PIN_GROUP(name, id)         \
0053     {                       \
0054         name,                   \
0055         id##_pins,              \
0056         ARRAY_SIZE(id##_pins),          \
0057         id##_funcs,             \
0058     }
0059 
0060 int mtk_paris_pinctrl_probe(struct platform_device *pdev);
0061 
0062 ssize_t mtk_pctrl_show_one_pin(struct mtk_pinctrl *hw,
0063     unsigned int gpio, char *buf, unsigned int bufLen);
0064 
0065 extern const struct dev_pm_ops mtk_paris_pinctrl_pm_ops;
0066 
0067 #endif /* __PINCTRL_PARIS_H */