11.1Sskrll/*	$NetBSD: sppctl.h,v 1.1.1.1 2026/01/18 05:21:54 skrll Exp $	*/
21.1Sskrll
31.1Sskrll/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
41.1Sskrll/*
51.1Sskrll * Sunplus dt-bindings Pinctrl header file
61.1Sskrll * Copyright (C) Sunplus Tech / Tibbo Tech.
71.1Sskrll * Author: Dvorkin Dmitry <dvorkin@tibbo.com>
81.1Sskrll */
91.1Sskrll
101.1Sskrll#ifndef __DT_BINDINGS_PINCTRL_SPPCTL_H__
111.1Sskrll#define __DT_BINDINGS_PINCTRL_SPPCTL_H__
121.1Sskrll
131.1Sskrll#define IOP_G_MASTE		(0x01 << 0)
141.1Sskrll#define IOP_G_FIRST		(0x01 << 1)
151.1Sskrll
161.1Sskrll#define SPPCTL_PCTL_G_PMUX	(0x00        | IOP_G_MASTE)
171.1Sskrll#define SPPCTL_PCTL_G_GPIO	(IOP_G_FIRST | IOP_G_MASTE)
181.1Sskrll#define SPPCTL_PCTL_G_IOPP	(IOP_G_FIRST | 0x00)
191.1Sskrll
201.1Sskrll#define SPPCTL_PCTL_L_OUT	(0x01 << 0)	/* Output LOW        */
211.1Sskrll#define SPPCTL_PCTL_L_OU1	(0x01 << 1)	/* Output HIGH       */
221.1Sskrll#define SPPCTL_PCTL_L_INV	(0x01 << 2)	/* Input Invert      */
231.1Sskrll#define SPPCTL_PCTL_L_ONV	(0x01 << 3)	/* Output Invert     */
241.1Sskrll#define SPPCTL_PCTL_L_ODR	(0x01 << 4)	/* Output Open Drain */
251.1Sskrll
261.1Sskrll/*
271.1Sskrll * pack into 32-bit value:
281.1Sskrll * pin# (8bit), typ (8bit), function (8bit), flag (8bit)
291.1Sskrll */
301.1Sskrll#define SPPCTL_IOPAD(pin, typ, fun, flg)	(((pin) << 24) | ((typ) << 16) | \
311.1Sskrll						((fun) << 8) | (flg))
321.1Sskrll
331.1Sskrll#endif
34