1/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
2/*
3 * Sunplus dt-bindings Pinctrl header file
4 * Copyright (C) Sunplus Tech / Tibbo Tech.
5 * Author: Dvorkin Dmitry <dvorkin@tibbo.com>
6 */
7
8#ifndef __DT_BINDINGS_PINCTRL_SPPCTL_H__
9#define __DT_BINDINGS_PINCTRL_SPPCTL_H__
10
11#define IOP_G_MASTE		(0x01 << 0)
12#define IOP_G_FIRST		(0x01 << 1)
13
14#define SPPCTL_PCTL_G_PMUX	(0x00        | IOP_G_MASTE)
15#define SPPCTL_PCTL_G_GPIO	(IOP_G_FIRST | IOP_G_MASTE)
16#define SPPCTL_PCTL_G_IOPP	(IOP_G_FIRST | 0x00)
17
18#define SPPCTL_PCTL_L_OUT	(0x01 << 0)	/* Output LOW        */
19#define SPPCTL_PCTL_L_OU1	(0x01 << 1)	/* Output HIGH       */
20#define SPPCTL_PCTL_L_INV	(0x01 << 2)	/* Input Invert      */
21#define SPPCTL_PCTL_L_ONV	(0x01 << 3)	/* Output Invert     */
22#define SPPCTL_PCTL_L_ODR	(0x01 << 4)	/* Output Open Drain */
23
24/*
25 * pack into 32-bit value:
26 * pin# (8bit), typ (8bit), function (8bit), flag (8bit)
27 */
28#define SPPCTL_IOPAD(pin, typ, fun, flg)	(((pin) << 24) | ((typ) << 16) | \
29						((fun) << 8) | (flg))
30
31#endif
32