Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0+ */
0002 /*
0003  * IMX pinmux core definitions
0004  *
0005  * Copyright (C) 2012 Freescale Semiconductor, Inc.
0006  * Copyright (C) 2012 Linaro Ltd.
0007  *
0008  * Author: Dong Aisheng <dong.aisheng@linaro.org>
0009  */
0010 
0011 #ifndef __DRIVERS_PINCTRL_IMX1_H
0012 #define __DRIVERS_PINCTRL_IMX1_H
0013 
0014 struct platform_device;
0015 
0016 /**
0017  * struct imx1_pin - describes an IMX1/21/27 pin.
0018  * @pin_id: ID of the described pin.
0019  * @mux_id: ID of the mux setup.
0020  * @config: Configuration of the pin (currently only pullup-enable).
0021  */
0022 struct imx1_pin {
0023     unsigned int pin_id;
0024     unsigned int mux_id;
0025     unsigned long config;
0026 };
0027 
0028 /**
0029  * struct imx1_pin_group - describes an IMX pin group
0030  * @name: the name of this specific pin group
0031  * @pins: an array of imx1_pin structs used in this group
0032  * @npins: the number of pins in this group array, i.e. the number of
0033  *  elements in .pins so we can iterate over that array
0034  */
0035 struct imx1_pin_group {
0036     const char *name;
0037     unsigned int *pin_ids;
0038     struct imx1_pin *pins;
0039     unsigned npins;
0040 };
0041 
0042 /**
0043  * struct imx1_pmx_func - describes IMX pinmux functions
0044  * @name: the name of this specific function
0045  * @groups: corresponding pin groups
0046  * @num_groups: the number of groups
0047  */
0048 struct imx1_pmx_func {
0049     const char *name;
0050     const char **groups;
0051     unsigned num_groups;
0052 };
0053 
0054 struct imx1_pinctrl_soc_info {
0055     struct device *dev;
0056     const struct pinctrl_pin_desc *pins;
0057     unsigned int npins;
0058     struct imx1_pin_group *groups;
0059     unsigned int ngroups;
0060     struct imx1_pmx_func *functions;
0061     unsigned int nfunctions;
0062 };
0063 
0064 #define IMX_PINCTRL_PIN(pin) PINCTRL_PIN(pin, #pin)
0065 
0066 int imx1_pinctrl_core_probe(struct platform_device *pdev,
0067             struct imx1_pinctrl_soc_info *info);
0068 #endif /* __DRIVERS_PINCTRL_IMX1_H */