Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  * Marvell Berlin SoC pinctrl driver.
0004  *
0005  * Copyright (C) 2014 Marvell Technology Group Ltd.
0006  *
0007  * Antoine Ténart <antoine.tenart@free-electrons.com>
0008  */
0009 
0010 #ifndef __PINCTRL_BERLIN_H
0011 #define __PINCTRL_BERLIN_H
0012 
0013 struct berlin_desc_function {
0014     const char  *name;
0015     u8      muxval;
0016 };
0017 
0018 struct berlin_desc_group {
0019     const char          *name;
0020     u8              offset;
0021     u8              bit_width;
0022     u8              lsb;
0023     struct berlin_desc_function *functions;
0024 };
0025 
0026 struct berlin_pinctrl_desc {
0027     const struct berlin_desc_group  *groups;
0028     unsigned            ngroups;
0029 };
0030 
0031 struct berlin_pinctrl_function {
0032     const char  *name;
0033     const char  **groups;
0034     unsigned    ngroups;
0035 };
0036 
0037 #define BERLIN_PINCTRL_GROUP(_name, _offset, _width, _lsb, ...)     \
0038     {                               \
0039         .name = _name,                      \
0040         .offset = _offset,                  \
0041         .bit_width = _width,                    \
0042         .lsb = _lsb,                        \
0043         .functions = (struct berlin_desc_function[]){       \
0044             __VA_ARGS__, { } },             \
0045     }
0046 
0047 #define BERLIN_PINCTRL_FUNCTION(_muxval, _name)     \
0048     {                       \
0049         .name = _name,              \
0050         .muxval = _muxval,          \
0051     }
0052 
0053 #define BERLIN_PINCTRL_FUNCTION_UNKNOWN     {}
0054 
0055 int berlin_pinctrl_probe(struct platform_device *pdev,
0056              const struct berlin_pinctrl_desc *desc);
0057 
0058 int berlin_pinctrl_probe_regmap(struct platform_device *pdev,
0059                 const struct berlin_pinctrl_desc *desc,
0060                 struct regmap *regmap);
0061 
0062 #endif /* __PINCTRL_BERLIN_H */