xref: /freebsd/sys/arm/allwinner/allwinner_pinctrl.h (revision 7192454558532101229629a8575d161013f3a7cb)
14b68de9cSAndrew Turner /*-
2b6d40d93SEmmanuel Vadot  * Copyright (c) 2016 Emmanuel Vadot <manu@freebsd.org>
34b68de9cSAndrew Turner  *
44b68de9cSAndrew Turner  * Redistribution and use in source and binary forms, with or without
54b68de9cSAndrew Turner  * modification, are permitted provided that the following conditions
64b68de9cSAndrew Turner  * are met:
74b68de9cSAndrew Turner  * 1. Redistributions of source code must retain the above copyright
84b68de9cSAndrew Turner  *    notice, this list of conditions and the following disclaimer.
94b68de9cSAndrew Turner  * 2. Redistributions in binary form must reproduce the above copyright
104b68de9cSAndrew Turner  *    notice, this list of conditions and the following disclaimer in the
114b68de9cSAndrew Turner  *    documentation and/or other materials provided with the distribution.
124b68de9cSAndrew Turner  *
134b68de9cSAndrew Turner  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
144b68de9cSAndrew Turner  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
154b68de9cSAndrew Turner  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
164b68de9cSAndrew Turner  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
174b68de9cSAndrew Turner  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
184b68de9cSAndrew Turner  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
194b68de9cSAndrew Turner  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
204b68de9cSAndrew Turner  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
214b68de9cSAndrew Turner  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
224b68de9cSAndrew Turner  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
234b68de9cSAndrew Turner  * SUCH DAMAGE.
244b68de9cSAndrew Turner  */
254b68de9cSAndrew Turner 
264b68de9cSAndrew Turner #ifndef _ALLWINNER_PINCTRL_H_
274b68de9cSAndrew Turner #define	_ALLWINNER_PINCTRL_H_
284b68de9cSAndrew Turner 
29*71924545SJulien Cassette #define AW_MAX_FUNC_BY_PIN	15
304b68de9cSAndrew Turner 
314b68de9cSAndrew Turner struct allwinner_pins {
324b68de9cSAndrew Turner 	const char *name;
334b68de9cSAndrew Turner 	uint8_t port;
344b68de9cSAndrew Turner 	uint8_t pin;
35*71924545SJulien Cassette 	const char *functions[AW_MAX_FUNC_BY_PIN];
3615b2342cSEmmanuel Vadot 	uint8_t eint_func;
3715b2342cSEmmanuel Vadot 	uint8_t eint_num;
38d07cc22bSEmmanuel Vadot 	uint8_t eint_bank;
394b68de9cSAndrew Turner };
404b68de9cSAndrew Turner 
414b68de9cSAndrew Turner struct allwinner_padconf {
424b68de9cSAndrew Turner 	uint32_t			npins;
434b68de9cSAndrew Turner 	const struct allwinner_pins *	pins;
444b68de9cSAndrew Turner };
454b68de9cSAndrew Turner 
464b68de9cSAndrew Turner #endif /* _ALLWINNER_PINCTRL_H_ */
47