mirror of
https://github.com/torvalds/linux.git
synced 2024-12-19 09:32:32 +00:00
78df7bba4a
All of the SoCs using Paris pinctrl are defining a custom probe function that is simply calling mtk_paris_pinctrl_probe() passing a pointer to the SoC specific mtk_pin_soc structure and nothing else. Simplify the probe mechanism across all pinctrl drivers that are using pinctrl-paris by passing the specific mtk_pin_soc as match data and using function mtk_paris_pinctrl_probe as a common probe function for all of them. Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Reviewed-by: Chen-Yu Tsai <wenst@chromium.org> Link: https://lore.kernel.org/r/20220222111144.20796-2-angelogioacchino.delregno@collabora.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
68 lines
1.6 KiB
C
68 lines
1.6 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/*
|
|
* Copyright (C) 2018 MediaTek Inc.
|
|
*
|
|
* Author: Sean Wang <sean.wang@mediatek.com>
|
|
* Zhiyong Tao <zhiyong.tao@mediatek.com>
|
|
* Hongzhou.Yang <hongzhou.yang@mediatek.com>
|
|
*/
|
|
#ifndef __PINCTRL_PARIS_H
|
|
#define __PINCTRL_PARIS_H
|
|
|
|
#include <linux/io.h>
|
|
#include <linux/init.h>
|
|
#include <linux/of.h>
|
|
#include <linux/of_platform.h>
|
|
#include <linux/platform_device.h>
|
|
#include <linux/pinctrl/pinctrl.h>
|
|
#include <linux/pinctrl/pinmux.h>
|
|
#include <linux/pinctrl/pinconf.h>
|
|
#include <linux/pinctrl/pinconf-generic.h>
|
|
|
|
#include "../core.h"
|
|
#include "../pinconf.h"
|
|
#include "../pinctrl-utils.h"
|
|
#include "../pinmux.h"
|
|
#include "mtk-eint.h"
|
|
#include "pinctrl-mtk-common-v2.h"
|
|
|
|
#define MTK_RANGE(_a) { .range = (_a), .nranges = ARRAY_SIZE(_a), }
|
|
|
|
#define MTK_EINT_FUNCTION(_eintmux, _eintnum) \
|
|
{ \
|
|
.eint_m = _eintmux, \
|
|
.eint_n = _eintnum, \
|
|
}
|
|
|
|
#define MTK_FUNCTION(_val, _name) \
|
|
{ \
|
|
.muxval = _val, \
|
|
.name = _name, \
|
|
}
|
|
|
|
#define MTK_PIN(_number, _name, _eint, _drv_n, ...) { \
|
|
.number = _number, \
|
|
.name = _name, \
|
|
.eint = _eint, \
|
|
.drv_n = _drv_n, \
|
|
.funcs = (struct mtk_func_desc[]){ \
|
|
__VA_ARGS__, { } }, \
|
|
}
|
|
|
|
#define PINCTRL_PIN_GROUP(name, id) \
|
|
{ \
|
|
name, \
|
|
id##_pins, \
|
|
ARRAY_SIZE(id##_pins), \
|
|
id##_funcs, \
|
|
}
|
|
|
|
int mtk_paris_pinctrl_probe(struct platform_device *pdev);
|
|
|
|
ssize_t mtk_pctrl_show_one_pin(struct mtk_pinctrl *hw,
|
|
unsigned int gpio, char *buf, unsigned int bufLen);
|
|
|
|
extern const struct dev_pm_ops mtk_paris_pinctrl_pm_ops;
|
|
|
|
#endif /* __PINCTRL_PARIS_H */
|