18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Copyright (C) STMicroelectronics 2017 - All Rights Reserved
48c2ecf20Sopenharmony_ci * Author: Torgue Alexandre <alexandre.torgue@st.com> for STMicroelectronics.
58c2ecf20Sopenharmony_ci */
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_ci#ifndef _DT_BINDINGS_STM32_PINFUNC_H
88c2ecf20Sopenharmony_ci#define _DT_BINDINGS_STM32_PINFUNC_H
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ci/*  define PIN modes */
118c2ecf20Sopenharmony_ci#define GPIO	0x0
128c2ecf20Sopenharmony_ci#define AF0	0x1
138c2ecf20Sopenharmony_ci#define AF1	0x2
148c2ecf20Sopenharmony_ci#define AF2	0x3
158c2ecf20Sopenharmony_ci#define AF3	0x4
168c2ecf20Sopenharmony_ci#define AF4	0x5
178c2ecf20Sopenharmony_ci#define AF5	0x6
188c2ecf20Sopenharmony_ci#define AF6	0x7
198c2ecf20Sopenharmony_ci#define AF7	0x8
208c2ecf20Sopenharmony_ci#define AF8	0x9
218c2ecf20Sopenharmony_ci#define AF9	0xa
228c2ecf20Sopenharmony_ci#define AF10	0xb
238c2ecf20Sopenharmony_ci#define AF11	0xc
248c2ecf20Sopenharmony_ci#define AF12	0xd
258c2ecf20Sopenharmony_ci#define AF13	0xe
268c2ecf20Sopenharmony_ci#define AF14	0xf
278c2ecf20Sopenharmony_ci#define AF15	0x10
288c2ecf20Sopenharmony_ci#define ANALOG	0x11
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ci/* define Pins number*/
318c2ecf20Sopenharmony_ci#define PIN_NO(port, line)	(((port) - 'A') * 0x10 + (line))
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_ci#define STM32_PINMUX(port, line, mode) (((PIN_NO(port, line)) << 8) | (mode))
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_ci/*  package information */
368c2ecf20Sopenharmony_ci#define STM32MP_PKG_AA	0x1
378c2ecf20Sopenharmony_ci#define STM32MP_PKG_AB	0x2
388c2ecf20Sopenharmony_ci#define STM32MP_PKG_AC	0x4
398c2ecf20Sopenharmony_ci#define STM32MP_PKG_AD	0x8
408c2ecf20Sopenharmony_ci
418c2ecf20Sopenharmony_ci#endif /* _DT_BINDINGS_STM32_PINFUNC_H */
428c2ecf20Sopenharmony_ci
43