18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0+ */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * IMX pinmux core definitions 48c2ecf20Sopenharmony_ci * 58c2ecf20Sopenharmony_ci * Copyright (C) 2012 Freescale Semiconductor, Inc. 68c2ecf20Sopenharmony_ci * Copyright (C) 2012 Linaro Ltd. 78c2ecf20Sopenharmony_ci * 88c2ecf20Sopenharmony_ci * Author: Dong Aisheng <dong.aisheng@linaro.org> 98c2ecf20Sopenharmony_ci */ 108c2ecf20Sopenharmony_ci 118c2ecf20Sopenharmony_ci#ifndef __DRIVERS_PINCTRL_IMX1_H 128c2ecf20Sopenharmony_ci#define __DRIVERS_PINCTRL_IMX1_H 138c2ecf20Sopenharmony_ci 148c2ecf20Sopenharmony_cistruct platform_device; 158c2ecf20Sopenharmony_ci 168c2ecf20Sopenharmony_ci/** 178c2ecf20Sopenharmony_ci * struct imx1_pin - describes an IMX1/21/27 pin. 188c2ecf20Sopenharmony_ci * @pin_id: ID of the described pin. 198c2ecf20Sopenharmony_ci * @mux_id: ID of the mux setup. 208c2ecf20Sopenharmony_ci * @config: Configuration of the pin (currently only pullup-enable). 218c2ecf20Sopenharmony_ci */ 228c2ecf20Sopenharmony_cistruct imx1_pin { 238c2ecf20Sopenharmony_ci unsigned int pin_id; 248c2ecf20Sopenharmony_ci unsigned int mux_id; 258c2ecf20Sopenharmony_ci unsigned long config; 268c2ecf20Sopenharmony_ci}; 278c2ecf20Sopenharmony_ci 288c2ecf20Sopenharmony_ci/** 298c2ecf20Sopenharmony_ci * struct imx1_pin_group - describes an IMX pin group 308c2ecf20Sopenharmony_ci * @name: the name of this specific pin group 318c2ecf20Sopenharmony_ci * @pins: an array of imx1_pin structs used in this group 328c2ecf20Sopenharmony_ci * @npins: the number of pins in this group array, i.e. the number of 338c2ecf20Sopenharmony_ci * elements in .pins so we can iterate over that array 348c2ecf20Sopenharmony_ci */ 358c2ecf20Sopenharmony_cistruct imx1_pin_group { 368c2ecf20Sopenharmony_ci const char *name; 378c2ecf20Sopenharmony_ci unsigned int *pin_ids; 388c2ecf20Sopenharmony_ci struct imx1_pin *pins; 398c2ecf20Sopenharmony_ci unsigned npins; 408c2ecf20Sopenharmony_ci}; 418c2ecf20Sopenharmony_ci 428c2ecf20Sopenharmony_ci/** 438c2ecf20Sopenharmony_ci * struct imx1_pmx_func - describes IMX pinmux functions 448c2ecf20Sopenharmony_ci * @name: the name of this specific function 458c2ecf20Sopenharmony_ci * @groups: corresponding pin groups 468c2ecf20Sopenharmony_ci * @num_groups: the number of groups 478c2ecf20Sopenharmony_ci */ 488c2ecf20Sopenharmony_cistruct imx1_pmx_func { 498c2ecf20Sopenharmony_ci const char *name; 508c2ecf20Sopenharmony_ci const char **groups; 518c2ecf20Sopenharmony_ci unsigned num_groups; 528c2ecf20Sopenharmony_ci}; 538c2ecf20Sopenharmony_ci 548c2ecf20Sopenharmony_cistruct imx1_pinctrl_soc_info { 558c2ecf20Sopenharmony_ci struct device *dev; 568c2ecf20Sopenharmony_ci const struct pinctrl_pin_desc *pins; 578c2ecf20Sopenharmony_ci unsigned int npins; 588c2ecf20Sopenharmony_ci struct imx1_pin_group *groups; 598c2ecf20Sopenharmony_ci unsigned int ngroups; 608c2ecf20Sopenharmony_ci struct imx1_pmx_func *functions; 618c2ecf20Sopenharmony_ci unsigned int nfunctions; 628c2ecf20Sopenharmony_ci}; 638c2ecf20Sopenharmony_ci 648c2ecf20Sopenharmony_ci#define IMX_PINCTRL_PIN(pin) PINCTRL_PIN(pin, #pin) 658c2ecf20Sopenharmony_ci 668c2ecf20Sopenharmony_ciint imx1_pinctrl_core_probe(struct platform_device *pdev, 678c2ecf20Sopenharmony_ci struct imx1_pinctrl_soc_info *info); 688c2ecf20Sopenharmony_ci#endif /* __DRIVERS_PINCTRL_IMX1_H */ 69