* [PATCH V32 17/27] Lock down TIOCSSERIAL
From: Matthew Garrett @ 2019-04-04 0:32 UTC (permalink / raw)
To: jmorris
Cc: linux-security-module, linux-kernel, dhowells, linux-api, luto,
Greg Kroah-Hartman, Matthew Garrett, Jiri Slaby, linux-serial
In-Reply-To: <20190404003249.14356-1-matthewgarrett@google.com>
From: David Howells <dhowells@redhat.com>
Lock down TIOCSSERIAL as that can be used to change the ioport and irq
settings on a serial port. This only appears to be an issue for the serial
drivers that use the core serial code. All other drivers seem to either
ignore attempts to change port/irq or give an error.
Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Matthew Garrett <mjg59@google.com>
cc: Jiri Slaby <jslaby@suse.com>
Cc: linux-serial@vger.kernel.org
---
drivers/tty/serial/serial_core.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index d4cca5bdaf1c..65b67f0d4386 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -842,6 +842,12 @@ static int uart_set_info(struct tty_struct *tty, struct tty_port *port,
new_flags = (__force upf_t)new_info->flags;
old_custom_divisor = uport->custom_divisor;
+ if ((change_port || change_irq) &&
+ kernel_is_locked_down("Using TIOCSSERIAL to change device addresses, irqs and dma channels", LOCKDOWN_INTEGRITY)) {
+ retval = -EPERM;
+ goto exit;
+ }
+
if (!capable(CAP_SYS_ADMIN)) {
retval = -EPERM;
if (change_irq || change_port ||
--
2.21.0.392.gf8f6787159e-goog
^ permalink raw reply related
* Re: [PATCH 1/2] tty: add SPDX identifiers to Kconfig and Makefiles
From: David Sterba @ 2019-04-02 14:20 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: linux-serial, Jiri Kosina, Rob Herring, Jiri Slaby, linux-kernel
In-Reply-To: <20190402140708.519-1-gregkh@linuxfoundation.org>
On Tue, Apr 02, 2019 at 04:07:07PM +0200, Greg Kroah-Hartman wrote:
> There were a few Kconfig and Makefiles under drivers/tty/ that were
> missing a SPDX identifier. Fix that up so that automated tools can
> properly classify all kernel source files.
>
> Cc: Jiri Slaby <jslaby@suse.com>
> Cc: Jiri Kosina <jikos@kernel.org>
> Cc: David Sterba <dsterba@suse.com>
> Cc: Rob Herring <robh@kernel.org>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> ---
For
> drivers/tty/ipwireless/Makefile | 1 +
Acked-by: David Sterba <dsterba@suse.com>
^ permalink raw reply
* [PATCH 2/2] tty: fix up a few remaining files without SPDX identifiers
From: Greg Kroah-Hartman @ 2019-04-02 14:07 UTC (permalink / raw)
To: linux-serial
Cc: linux-kernel, Greg Kroah-Hartman, Jiri Slaby, David S. Miller
In-Reply-To: <20190402140708.519-1-gregkh@linuxfoundation.org>
There were a few straggling files under drivers/tty/ that did not have
any SPDX identifier either because they entered the tree recently, or
they somehow missed the mass-tagging of commit b24413180f56 ("License
cleanup: add SPDX GPL-2.0 license identifier to files with no license")
This commit follows the same rule as b24413180f56 ("License cleanup: add
SPDX GPL-2.0 license identifier to files with no license") where files
without any specified license in them fall under GPL-2.0 as the correct
license for the individual file. Add that identifier to these remaining
files so that we don't have to guess at the license of them in the
future.
Cc: Jiri Slaby <jslaby@suse.com>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/tty/serial/8250/8250_men_mcb.c | 1 +
drivers/tty/serial/sn_console.c | 1 +
drivers/tty/vcc.c | 1 +
drivers/tty/vt/.gitignore | 1 +
drivers/tty/vt/cp437.uni | 1 +
drivers/tty/vt/defkeymap.c_shipped | 1 +
drivers/tty/vt/defkeymap.map | 1 +
7 files changed, 7 insertions(+)
diff --git a/drivers/tty/serial/8250/8250_men_mcb.c b/drivers/tty/serial/8250/8250_men_mcb.c
index 127017cc41d9..02c5aff58a74 100644
--- a/drivers/tty/serial/8250/8250_men_mcb.c
+++ b/drivers/tty/serial/8250/8250_men_mcb.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
#include <linux/device.h>
#include <linux/kernel.h>
#include <linux/module.h>
diff --git a/drivers/tty/serial/sn_console.c b/drivers/tty/serial/sn_console.c
index fe9170731c16..283493358a62 100644
--- a/drivers/tty/serial/sn_console.c
+++ b/drivers/tty/serial/sn_console.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* C-Brick Serial Port (and console) driver for SGI Altix machines.
*
diff --git a/drivers/tty/vcc.c b/drivers/tty/vcc.c
index 58b454c34560..d2a1e1228c82 100644
--- a/drivers/tty/vcc.c
+++ b/drivers/tty/vcc.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/* vcc.c: sun4v virtual channel concentrator
*
* Copyright (C) 2017 Oracle. All rights reserved.
diff --git a/drivers/tty/vt/.gitignore b/drivers/tty/vt/.gitignore
index 83683a2d8e6a..9b38b85f9d9a 100644
--- a/drivers/tty/vt/.gitignore
+++ b/drivers/tty/vt/.gitignore
@@ -1,2 +1,3 @@
+# SPDX-License-Identifier: GPL-2.0
consolemap_deftbl.c
defkeymap.c
diff --git a/drivers/tty/vt/cp437.uni b/drivers/tty/vt/cp437.uni
index bc6163484f62..a1991904c559 100644
--- a/drivers/tty/vt/cp437.uni
+++ b/drivers/tty/vt/cp437.uni
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
#
# Unicode table for IBM Codepage 437. Note that there are many more
# substitutions that could be conceived (for example, thick-line
diff --git a/drivers/tty/vt/defkeymap.c_shipped b/drivers/tty/vt/defkeymap.c_shipped
index d2208dfe3f67..c7095fb7d2d1 100644
--- a/drivers/tty/vt/defkeymap.c_shipped
+++ b/drivers/tty/vt/defkeymap.c_shipped
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0
/* Do not edit this file! It was automatically generated by */
/* loadkeys --mktable defkeymap.map > defkeymap.c */
diff --git a/drivers/tty/vt/defkeymap.map b/drivers/tty/vt/defkeymap.map
index 50b30cace261..37f1ac6ddfb9 100644
--- a/drivers/tty/vt/defkeymap.map
+++ b/drivers/tty/vt/defkeymap.map
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
# Default kernel keymap. This uses 7 modifier combinations.
keymaps 0-2,4-5,8,12
# Change the above line into
--
2.21.0
^ permalink raw reply related
* [PATCH 1/2] tty: add SPDX identifiers to Kconfig and Makefiles
From: Greg Kroah-Hartman @ 2019-04-02 14:07 UTC (permalink / raw)
To: linux-serial
Cc: linux-kernel, Greg Kroah-Hartman, Jiri Slaby, Jiri Kosina,
David Sterba, Rob Herring
There were a few Kconfig and Makefiles under drivers/tty/ that were
missing a SPDX identifier. Fix that up so that automated tools can
properly classify all kernel source files.
Cc: Jiri Slaby <jslaby@suse.com>
Cc: Jiri Kosina <jikos@kernel.org>
Cc: David Sterba <dsterba@suse.com>
Cc: Rob Herring <robh@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/tty/Kconfig | 1 +
drivers/tty/hvc/Kconfig | 1 +
drivers/tty/ipwireless/Makefile | 1 +
drivers/tty/serdev/Kconfig | 1 +
drivers/tty/serdev/Makefile | 1 +
drivers/tty/serial/8250/Kconfig | 1 +
drivers/tty/serial/Kconfig | 1 +
drivers/tty/serial/cpm_uart/Makefile | 1 +
drivers/tty/serial/jsm/Makefile | 1 +
9 files changed, 9 insertions(+)
diff --git a/drivers/tty/Kconfig b/drivers/tty/Kconfig
index e0a04bfc873e..8034473c54ca 100644
--- a/drivers/tty/Kconfig
+++ b/drivers/tty/Kconfig
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
config TTY
bool "Enable TTY" if EXPERT
default y
diff --git a/drivers/tty/hvc/Kconfig b/drivers/tty/hvc/Kconfig
index 4293c172e120..1a910ec9f643 100644
--- a/drivers/tty/hvc/Kconfig
+++ b/drivers/tty/hvc/Kconfig
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
if TTY
config HVC_DRIVER
diff --git a/drivers/tty/ipwireless/Makefile b/drivers/tty/ipwireless/Makefile
index fe2e1730986b..a665d021e24d 100644
--- a/drivers/tty/ipwireless/Makefile
+++ b/drivers/tty/ipwireless/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
#
# Makefile for the IPWireless driver
#
diff --git a/drivers/tty/serdev/Kconfig b/drivers/tty/serdev/Kconfig
index 1dbc8352e027..46ae732bfc68 100644
--- a/drivers/tty/serdev/Kconfig
+++ b/drivers/tty/serdev/Kconfig
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
#
# Serial bus device driver configuration
#
diff --git a/drivers/tty/serdev/Makefile b/drivers/tty/serdev/Makefile
index 0cbdb9444d9d..078417e5b068 100644
--- a/drivers/tty/serdev/Makefile
+++ b/drivers/tty/serdev/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
serdev-objs := core.o
obj-$(CONFIG_SERIAL_DEV_BUS) += serdev.o
diff --git a/drivers/tty/serial/8250/Kconfig b/drivers/tty/serial/8250/Kconfig
index 15c2c5463835..296115f6a4d8 100644
--- a/drivers/tty/serial/8250/Kconfig
+++ b/drivers/tty/serial/8250/Kconfig
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
#
# The 8250/16550 serial drivers. You shouldn't be in this list unless
# you somehow have an implicit or explicit dependency on SERIAL_8250.
diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index 72966bc0ac76..a5032e58c737 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
#
# Serial device configuration
#
diff --git a/drivers/tty/serial/cpm_uart/Makefile b/drivers/tty/serial/cpm_uart/Makefile
index 896a5d57881c..3f3a6ed02ed4 100644
--- a/drivers/tty/serial/cpm_uart/Makefile
+++ b/drivers/tty/serial/cpm_uart/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
#
# Makefile for the Motorola 8xx FEC ethernet controller
#
diff --git a/drivers/tty/serial/jsm/Makefile b/drivers/tty/serial/jsm/Makefile
index 705d1ff6fdeb..4f2dbada7741 100644
--- a/drivers/tty/serial/jsm/Makefile
+++ b/drivers/tty/serial/jsm/Makefile
@@ -1,3 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0
#
# Makefile for Jasmine adapter
#
--
2.21.0
^ permalink raw reply related
* [PATCH 3.16 14/99] panic: avoid deadlocks in re-entrant console drivers
From: Ben Hutchings @ 2019-04-02 13:38 UTC (permalink / raw)
To: linux-kernel, stable
Cc: akpm, Denis Kirjanov, Sergey Senozhatsky, Greg Kroah-Hartman,
Daniel Wang, Jiri Slaby, Petr Mladek, Sergey Senozhatsky,
Peter Feiner, Alan Cox, linux-serial, Linus Torvalds,
Peter Zijlstra, Steven Rostedt
In-Reply-To: <lsq.1554212307.17110877@decadent.org.uk>
3.16.65-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
commit c7c3f05e341a9a2bd1a92993d4f996cfd6e7348e upstream.
=46romprintk()/serial console point of view panic() is special, because
it may force CPU to re-enter printk() or/and serial console driver.
Therefore, some of serial consoles drivers are re-entrant. E.g. 8250:
serial8250_console_write()
{
if (port->sysrq)
locked = 0;
else if (oops_in_progress)
locked = spin_trylock_irqsave(&port->lock, flags);
else
spin_lock_irqsave(&port->lock, flags);
...
}
panic() does set oops_in_progress via bust_spinlocks(1), so in theory
we should be able to re-enter serial console driver from panic():
CPU0
<NMI>
uart_console_write()
serial8250_console_write() // if (oops_in_progress)
// spin_trylock_irqsave()
call_console_drivers()
console_unlock()
console_flush_on_panic()
bust_spinlocks(1) // oops_in_progress++
panic()
<NMI/>
spin_lock_irqsave(&port->lock, flags) // spin_lock_irqsave()
serial8250_console_write()
call_console_drivers()
console_unlock()
printk()
...
However, this does not happen and we deadlock in serial console on
port->lock spinlock. And the problem is that console_flush_on_panic()
called after bust_spinlocks(0):
void panic(const char *fmt, ...)
{
bust_spinlocks(1);
...
bust_spinlocks(0);
console_flush_on_panic();
...
}
bust_spinlocks(0) decrements oops_in_progress, so oops_in_progress
can go back to zero. Thus even re-entrant console drivers will simply
spin on port->lock spinlock. Given that port->lock may already be
locked either by a stopped CPU, or by the very same CPU we execute
panic() on (for instance, NMI panic() on printing CPU) the system
deadlocks and does not reboot.
Fix this by removing bust_spinlocks(0), so oops_in_progress is always
set in panic() now and, thus, re-entrant console drivers will trylock
the port->lock instead of spinning on it forever, when we call them
from console_flush_on_panic().
Link: http://lkml.kernel.org/r/20181025101036.6823-1-sergey.senozhatsky@gmail.com
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Daniel Wang <wonderfly@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Alan Cox <gnomes@lxorguk.ukuu.org.uk>
Cc: Jiri Slaby <jslaby@suse.com>
Cc: Peter Feiner <pfeiner@google.com>
Cc: linux-serial@vger.kernel.org
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Signed-off-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
kernel/panic.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -13,6 +13,7 @@
#include <linux/kmsg_dump.h>
#include <linux/kallsyms.h>
#include <linux/notifier.h>
+#include <linux/vt_kern.h>
#include <linux/module.h>
#include <linux/random.h>
#include <linux/ftrace.h>
@@ -178,7 +179,10 @@ void panic(const char *fmt, ...)
*/
crash_kexec(NULL);
- bust_spinlocks(0);
+#ifdef CONFIG_VT
+ unblank_screen();
+#endif
+ console_unblank();
/*
* We may have ended up stopping the CPU holding the lock (in
^ permalink raw reply
* Re: [PATCH 16/24] pinctrl: mediatek: Add MT8516 Pinctrl driver
From: Sean Wang @ 2019-04-01 21:02 UTC (permalink / raw)
To: Fabien Parent
Cc: Matthias Brugger, Rob Herring, Mark Rutland,
Ryder Lee (李庚諺), Hsin-Hsiung Wang,
wenzhen.yu, chaotian.jing, yong.mao, jjian.zhou, devicetree,
linux-kernel, linux-i2c, linux-arm-kernel, linux-mediatek,
linux-mmc, linux-gpio, linux-serial, linux-spi, linux-watchdog,
linux-clk, stephane.leprovost
In-Reply-To: <20190323211612.860-17-fparent@baylibre.com>
Hi, Fabien
On Sat, Mar 23, 2019 at 2:17 PM Fabien Parent <fparent@baylibre.com> wrote:
>
> Signed-off-by: Fabien Parent <fparent@baylibre.com>
> ---
> drivers/pinctrl/mediatek/Kconfig | 7 +
> drivers/pinctrl/mediatek/Makefile | 1 +
> drivers/pinctrl/mediatek/pinctrl-mt8516.c | 384 ++++++
> drivers/pinctrl/mediatek/pinctrl-mtk-mt8516.h | 1182 +++++++++++++++++
> 4 files changed, 1574 insertions(+)
> create mode 100644 drivers/pinctrl/mediatek/pinctrl-mt8516.c
> create mode 100644 drivers/pinctrl/mediatek/pinctrl-mtk-mt8516.h
>
> diff --git a/drivers/pinctrl/mediatek/Kconfig b/drivers/pinctrl/mediatek/Kconfig
> index a005cbccb4f7..26ed5dca1460 100644
> --- a/drivers/pinctrl/mediatek/Kconfig
> +++ b/drivers/pinctrl/mediatek/Kconfig
> @@ -113,6 +113,13 @@ config PINCTRL_MT8183
> default ARM64 && ARCH_MEDIATEK
> select PINCTRL_MTK_PARIS
>
> +config PINCTRL_MT8516
> + bool "Mediatek MT8516 pin control"
> + depends on OF
> + depends on ARM64 || COMPILE_TEST
> + default ARM64 && ARCH_MEDIATEK
> + select PINCTRL_MTK
> +
> # For PMIC
> config PINCTRL_MT6397
> bool "Mediatek MT6397 pin control"
> diff --git a/drivers/pinctrl/mediatek/Makefile b/drivers/pinctrl/mediatek/Makefile
> index 4b4e2eaf6f2d..a74325abd877 100644
> --- a/drivers/pinctrl/mediatek/Makefile
> +++ b/drivers/pinctrl/mediatek/Makefile
> @@ -17,4 +17,5 @@ obj-$(CONFIG_PINCTRL_MT7623) += pinctrl-mt7623.o
> obj-$(CONFIG_PINCTRL_MT7629) += pinctrl-mt7629.o
> obj-$(CONFIG_PINCTRL_MT8173) += pinctrl-mt8173.o
> obj-$(CONFIG_PINCTRL_MT8183) += pinctrl-mt8183.o
> +obj-$(CONFIG_PINCTRL_MT8516) += pinctrl-mt8516.o
> obj-$(CONFIG_PINCTRL_MT6397) += pinctrl-mt6397.o
> diff --git a/drivers/pinctrl/mediatek/pinctrl-mt8516.c b/drivers/pinctrl/mediatek/pinctrl-mt8516.c
> new file mode 100644
> index 000000000000..1e965f119eca
> --- /dev/null
> +++ b/drivers/pinctrl/mediatek/pinctrl-mt8516.c
> @@ -0,0 +1,384 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Copyright (c) 2019 MediaTek Inc.
> + * Author: Min.Guo <min.guo@mediatek.com>
> + */
> +
> +#include <dt-bindings/pinctrl/mt65xx.h>
> +#include <linux/of.h>
> +#include <linux/of_device.h>
> +#include <linux/module.h>
> +#include <linux/pinctrl/pinctrl.h>
> +#include <linux/platform_device.h>
> +#include <linux/regmap.h>
> +
> +#include "pinctrl-mtk-common.h"
> +#include "pinctrl-mtk-mt8516.h"
> +
> +static const struct mtk_drv_group_desc mt8516_drv_grp[] = {
> + /* 0E4E8SR 4/8/12/16 */
> + MTK_DRV_GRP(4, 16, 1, 2, 4),
> + /* 0E2E4SR 2/4/6/8 */
> + MTK_DRV_GRP(2, 8, 1, 2, 2),
> + /* E8E4E2 2/4/6/8/10/12/14/16 */
> + MTK_DRV_GRP(2, 16, 0, 2, 2)
> +};
> +
> +static const struct mtk_pin_drv_grp mt8516_pin_drv[] = {
> + MTK_PIN_DRV_GRP(0, 0xd00, 0, 0),
> + MTK_PIN_DRV_GRP(1, 0xd00, 0, 0),
> + MTK_PIN_DRV_GRP(2, 0xd00, 0, 0),
> + MTK_PIN_DRV_GRP(3, 0xd00, 0, 0),
> + MTK_PIN_DRV_GRP(4, 0xd00, 0, 0),
> +
> + MTK_PIN_DRV_GRP(5, 0xd00, 4, 0),
> + MTK_PIN_DRV_GRP(6, 0xd00, 4, 0),
> + MTK_PIN_DRV_GRP(7, 0xd00, 4, 0),
> + MTK_PIN_DRV_GRP(8, 0xd00, 4, 0),
> + MTK_PIN_DRV_GRP(9, 0xd00, 4, 0),
> + MTK_PIN_DRV_GRP(10, 0xd00, 4, 0),
> +
> + MTK_PIN_DRV_GRP(11, 0xd00, 8, 0),
> + MTK_PIN_DRV_GRP(12, 0xd00, 8, 0),
> + MTK_PIN_DRV_GRP(13, 0xd00, 8, 0),
> +
> + MTK_PIN_DRV_GRP(14, 0xd00, 12, 2),
> + MTK_PIN_DRV_GRP(15, 0xd00, 12, 2),
> + MTK_PIN_DRV_GRP(16, 0xd00, 12, 2),
> + MTK_PIN_DRV_GRP(17, 0xd00, 12, 2),
> +
> + MTK_PIN_DRV_GRP(18, 0xd10, 0, 0),
> + MTK_PIN_DRV_GRP(19, 0xd10, 0, 0),
> + MTK_PIN_DRV_GRP(20, 0xd10, 0, 0),
> +
> + MTK_PIN_DRV_GRP(21, 0xd00, 12, 2),
> + MTK_PIN_DRV_GRP(22, 0xd00, 12, 2),
> + MTK_PIN_DRV_GRP(23, 0xd00, 12, 2),
> +
> + MTK_PIN_DRV_GRP(24, 0xd00, 8, 0),
> + MTK_PIN_DRV_GRP(25, 0xd00, 8, 0),
> +
> + MTK_PIN_DRV_GRP(26, 0xd10, 4, 1),
> + MTK_PIN_DRV_GRP(27, 0xd10, 4, 1),
> + MTK_PIN_DRV_GRP(28, 0xd10, 4, 1),
> + MTK_PIN_DRV_GRP(29, 0xd10, 4, 1),
> + MTK_PIN_DRV_GRP(30, 0xd10, 4, 1),
> +
> + MTK_PIN_DRV_GRP(31, 0xd10, 8, 1),
> + MTK_PIN_DRV_GRP(32, 0xd10, 8, 1),
> + MTK_PIN_DRV_GRP(33, 0xd10, 8, 1),
> +
> + MTK_PIN_DRV_GRP(34, 0xd10, 12, 0),
> + MTK_PIN_DRV_GRP(35, 0xd10, 12, 0),
> +
> + MTK_PIN_DRV_GRP(36, 0xd20, 0, 0),
> + MTK_PIN_DRV_GRP(37, 0xd20, 0, 0),
> + MTK_PIN_DRV_GRP(38, 0xd20, 0, 0),
> + MTK_PIN_DRV_GRP(39, 0xd20, 0, 0),
> +
> + MTK_PIN_DRV_GRP(40, 0xd20, 4, 1),
> +
> + MTK_PIN_DRV_GRP(41, 0xd20, 8, 1),
> + MTK_PIN_DRV_GRP(42, 0xd20, 8, 1),
> + MTK_PIN_DRV_GRP(43, 0xd20, 8, 1),
> +
> + MTK_PIN_DRV_GRP(44, 0xd20, 12, 1),
> + MTK_PIN_DRV_GRP(45, 0xd20, 12, 1),
> + MTK_PIN_DRV_GRP(46, 0xd20, 12, 1),
> + MTK_PIN_DRV_GRP(47, 0xd20, 12, 1),
> +
> + MTK_PIN_DRV_GRP(48, 0xd30, 0, 1),
> + MTK_PIN_DRV_GRP(49, 0xd30, 0, 1),
> + MTK_PIN_DRV_GRP(50, 0xd30, 0, 1),
> + MTK_PIN_DRV_GRP(51, 0xd30, 0, 1),
> +
> + MTK_PIN_DRV_GRP(54, 0xd30, 8, 1),
> +
> + MTK_PIN_DRV_GRP(55, 0xd30, 12, 1),
> + MTK_PIN_DRV_GRP(56, 0xd30, 12, 1),
> + MTK_PIN_DRV_GRP(57, 0xd30, 12, 1),
> +
> + MTK_PIN_DRV_GRP(62, 0xd40, 8, 1),
> + MTK_PIN_DRV_GRP(63, 0xd40, 8, 1),
> + MTK_PIN_DRV_GRP(64, 0xd40, 8, 1),
> + MTK_PIN_DRV_GRP(65, 0xd40, 8, 1),
> + MTK_PIN_DRV_GRP(66, 0xd40, 8, 1),
> + MTK_PIN_DRV_GRP(67, 0xd40, 8, 1),
> +
> + MTK_PIN_DRV_GRP(68, 0xd40, 12, 2),
> +
> + MTK_PIN_DRV_GRP(69, 0xd50, 0, 2),
> +
> + MTK_PIN_DRV_GRP(70, 0xd50, 4, 2),
> + MTK_PIN_DRV_GRP(71, 0xd50, 4, 2),
> + MTK_PIN_DRV_GRP(72, 0xd50, 4, 2),
> + MTK_PIN_DRV_GRP(73, 0xd50, 4, 2),
> +
> + MTK_PIN_DRV_GRP(100, 0xd50, 8, 1),
> + MTK_PIN_DRV_GRP(101, 0xd50, 8, 1),
> + MTK_PIN_DRV_GRP(102, 0xd50, 8, 1),
> + MTK_PIN_DRV_GRP(103, 0xd50, 8, 1),
> +
> + MTK_PIN_DRV_GRP(104, 0xd50, 12, 2),
> +
> + MTK_PIN_DRV_GRP(105, 0xd60, 0, 2),
> +
> + MTK_PIN_DRV_GRP(106, 0xd60, 4, 2),
> + MTK_PIN_DRV_GRP(107, 0xd60, 4, 2),
> + MTK_PIN_DRV_GRP(108, 0xd60, 4, 2),
> + MTK_PIN_DRV_GRP(109, 0xd60, 4, 2),
> +
> + MTK_PIN_DRV_GRP(110, 0xd70, 0, 2),
> + MTK_PIN_DRV_GRP(111, 0xd70, 0, 2),
> + MTK_PIN_DRV_GRP(112, 0xd70, 0, 2),
> + MTK_PIN_DRV_GRP(113, 0xd70, 0, 2),
> +
> + MTK_PIN_DRV_GRP(114, 0xd70, 4, 2),
> +
> + MTK_PIN_DRV_GRP(115, 0xd60, 12, 2),
> +
> + MTK_PIN_DRV_GRP(116, 0xd60, 8, 2),
> +
> + MTK_PIN_DRV_GRP(117, 0xd70, 0, 2),
> + MTK_PIN_DRV_GRP(118, 0xd70, 0, 2),
> + MTK_PIN_DRV_GRP(119, 0xd70, 0, 2),
> + MTK_PIN_DRV_GRP(120, 0xd70, 0, 2),
> +};
> +
> +static const struct mtk_pin_spec_pupd_set_samereg mt8516_spec_pupd[] = {
> + MTK_PIN_PUPD_SPEC_SR(14, 0xe50, 14, 13, 12),
> + MTK_PIN_PUPD_SPEC_SR(15, 0xe60, 2, 1, 0),
> + MTK_PIN_PUPD_SPEC_SR(16, 0xe60, 6, 5, 4),
> + MTK_PIN_PUPD_SPEC_SR(17, 0xe60, 10, 9, 8),
> +
> + MTK_PIN_PUPD_SPEC_SR(21, 0xe60, 14, 13, 12),
> + MTK_PIN_PUPD_SPEC_SR(22, 0xe70, 2, 1, 0),
> + MTK_PIN_PUPD_SPEC_SR(23, 0xe70, 6, 5, 4),
> +
> + MTK_PIN_PUPD_SPEC_SR(40, 0xe80, 2, 1, 0),
> + MTK_PIN_PUPD_SPEC_SR(41, 0xe80, 6, 5, 4),
> + MTK_PIN_PUPD_SPEC_SR(42, 0xe90, 2, 1, 0),
> + MTK_PIN_PUPD_SPEC_SR(43, 0xe90, 6, 5, 4),
> +
> + MTK_PIN_PUPD_SPEC_SR(68, 0xe50, 10, 9, 8),
> + MTK_PIN_PUPD_SPEC_SR(69, 0xe50, 6, 5, 4),
> + MTK_PIN_PUPD_SPEC_SR(70, 0xe40, 6, 5, 4),
> + MTK_PIN_PUPD_SPEC_SR(71, 0xe40, 10, 9, 8),
> + MTK_PIN_PUPD_SPEC_SR(72, 0xe40, 14, 13, 12),
> + MTK_PIN_PUPD_SPEC_SR(73, 0xe50, 2, 1, 0),
> +
> + MTK_PIN_PUPD_SPEC_SR(104, 0xe40, 2, 1, 0),
> + MTK_PIN_PUPD_SPEC_SR(105, 0xe30, 14, 13, 12),
> + MTK_PIN_PUPD_SPEC_SR(106, 0xe20, 14, 13, 12),
> + MTK_PIN_PUPD_SPEC_SR(107, 0xe30, 2, 1, 0),
> + MTK_PIN_PUPD_SPEC_SR(108, 0xe30, 6, 5, 4),
> + MTK_PIN_PUPD_SPEC_SR(109, 0xe30, 10, 9, 8),
> + MTK_PIN_PUPD_SPEC_SR(110, 0xe10, 14, 13, 12),
> + MTK_PIN_PUPD_SPEC_SR(111, 0xe10, 10, 9, 8),
> + MTK_PIN_PUPD_SPEC_SR(112, 0xe10, 6, 5, 4),
> + MTK_PIN_PUPD_SPEC_SR(113, 0xe10, 2, 1, 0),
> + MTK_PIN_PUPD_SPEC_SR(114, 0xe20, 10, 9, 8),
> + MTK_PIN_PUPD_SPEC_SR(115, 0xe20, 2, 1, 0),
> + MTK_PIN_PUPD_SPEC_SR(116, 0xe20, 6, 5, 4),
> + MTK_PIN_PUPD_SPEC_SR(117, 0xe00, 14, 13, 12),
> + MTK_PIN_PUPD_SPEC_SR(118, 0xe00, 10, 9, 8),
> + MTK_PIN_PUPD_SPEC_SR(119, 0xe00, 6, 5, 4),
> + MTK_PIN_PUPD_SPEC_SR(120, 0xe00, 2, 1, 0),
> +};
> +
> +static int mt8516_spec_pull_set(struct regmap *regmap, unsigned int pin,
> + unsigned char align, bool isup, unsigned int r1r0)
> +{
> + return mtk_pctrl_spec_pull_set_samereg(regmap, mt8516_spec_pupd,
> + ARRAY_SIZE(mt8516_spec_pupd), pin, align, isup, r1r0);
> +}
> +
> +static const struct mtk_pin_ies_smt_set mt8516_ies_set[] = {
> + MTK_PIN_IES_SMT_SPEC(0, 6, 0x900, 2),
> + MTK_PIN_IES_SMT_SPEC(7, 10, 0x900, 3),
> + MTK_PIN_IES_SMT_SPEC(11, 13, 0x900, 12),
> + MTK_PIN_IES_SMT_SPEC(14, 17, 0x900, 13),
> + MTK_PIN_IES_SMT_SPEC(18, 20, 0x910, 10),
> + MTK_PIN_IES_SMT_SPEC(21, 23, 0x900, 13),
> + MTK_PIN_IES_SMT_SPEC(24, 25, 0x900, 12),
> + MTK_PIN_IES_SMT_SPEC(26, 30, 0x900, 0),
> + MTK_PIN_IES_SMT_SPEC(31, 33, 0x900, 1),
> + MTK_PIN_IES_SMT_SPEC(34, 39, 0x900, 2),
> + MTK_PIN_IES_SMT_SPEC(40, 40, 0x910, 11),
> + MTK_PIN_IES_SMT_SPEC(41, 43, 0x900, 10),
> + MTK_PIN_IES_SMT_SPEC(44, 47, 0x900, 11),
> + MTK_PIN_IES_SMT_SPEC(48, 51, 0x900, 14),
> + MTK_PIN_IES_SMT_SPEC(52, 53, 0x910, 0),
> + MTK_PIN_IES_SMT_SPEC(54, 54, 0x910, 2),
> + MTK_PIN_IES_SMT_SPEC(55, 57, 0x910, 4),
> + MTK_PIN_IES_SMT_SPEC(58, 59, 0x900, 15),
> + MTK_PIN_IES_SMT_SPEC(60, 61, 0x910, 1),
> + MTK_PIN_IES_SMT_SPEC(62, 65, 0x910, 5),
> + MTK_PIN_IES_SMT_SPEC(66, 67, 0x910, 6),
> + MTK_PIN_IES_SMT_SPEC(68, 68, 0x930, 2),
> + MTK_PIN_IES_SMT_SPEC(69, 69, 0x930, 1),
> + MTK_PIN_IES_SMT_SPEC(70, 70, 0x930, 6),
> + MTK_PIN_IES_SMT_SPEC(71, 71, 0x930, 5),
> + MTK_PIN_IES_SMT_SPEC(72, 72, 0x930, 4),
> + MTK_PIN_IES_SMT_SPEC(73, 73, 0x930, 3),
> + MTK_PIN_IES_SMT_SPEC(100, 103, 0x910, 7),
> + MTK_PIN_IES_SMT_SPEC(104, 104, 0x920, 12),
> + MTK_PIN_IES_SMT_SPEC(105, 105, 0x920, 11),
> + MTK_PIN_IES_SMT_SPEC(106, 106, 0x930, 0),
> + MTK_PIN_IES_SMT_SPEC(107, 107, 0x920, 15),
> + MTK_PIN_IES_SMT_SPEC(108, 108, 0x920, 14),
> + MTK_PIN_IES_SMT_SPEC(109, 109, 0x920, 13),
> + MTK_PIN_IES_SMT_SPEC(110, 110, 0x920, 9),
> + MTK_PIN_IES_SMT_SPEC(111, 111, 0x920, 8),
> + MTK_PIN_IES_SMT_SPEC(112, 112, 0x920, 7),
> + MTK_PIN_IES_SMT_SPEC(113, 113, 0x920, 6),
> + MTK_PIN_IES_SMT_SPEC(114, 114, 0x920, 10),
> + MTK_PIN_IES_SMT_SPEC(115, 115, 0x920, 1),
> + MTK_PIN_IES_SMT_SPEC(116, 116, 0x920, 0),
> + MTK_PIN_IES_SMT_SPEC(117, 117, 0x920, 5),
> + MTK_PIN_IES_SMT_SPEC(118, 118, 0x920, 4),
> + MTK_PIN_IES_SMT_SPEC(119, 119, 0x920, 3),
> + MTK_PIN_IES_SMT_SPEC(120, 120, 0x920, 2),
> + MTK_PIN_IES_SMT_SPEC(121, 124, 0x910, 9),
> +};
> +
> +static const struct mtk_pin_ies_smt_set mt8516_smt_set[] = {
> + MTK_PIN_IES_SMT_SPEC(0, 6, 0xA00, 2),
> + MTK_PIN_IES_SMT_SPEC(7, 10, 0xA00, 3),
> + MTK_PIN_IES_SMT_SPEC(11, 13, 0xA00, 12),
> + MTK_PIN_IES_SMT_SPEC(14, 17, 0xA00, 13),
> + MTK_PIN_IES_SMT_SPEC(18, 20, 0xA10, 10),
> + MTK_PIN_IES_SMT_SPEC(21, 23, 0xA00, 13),
> + MTK_PIN_IES_SMT_SPEC(24, 25, 0xA00, 12),
> + MTK_PIN_IES_SMT_SPEC(26, 30, 0xA00, 0),
> + MTK_PIN_IES_SMT_SPEC(31, 33, 0xA00, 1),
> + MTK_PIN_IES_SMT_SPEC(34, 39, 0xA900, 2),
> + MTK_PIN_IES_SMT_SPEC(40, 40, 0xA10, 11),
> + MTK_PIN_IES_SMT_SPEC(41, 43, 0xA00, 10),
> + MTK_PIN_IES_SMT_SPEC(44, 47, 0xA00, 11),
> + MTK_PIN_IES_SMT_SPEC(48, 51, 0xA00, 14),
> + MTK_PIN_IES_SMT_SPEC(52, 53, 0xA10, 0),
> + MTK_PIN_IES_SMT_SPEC(54, 54, 0xA10, 2),
> + MTK_PIN_IES_SMT_SPEC(55, 57, 0xA10, 4),
> + MTK_PIN_IES_SMT_SPEC(58, 59, 0xA00, 15),
> + MTK_PIN_IES_SMT_SPEC(60, 61, 0xA10, 1),
> + MTK_PIN_IES_SMT_SPEC(62, 65, 0xA10, 5),
> + MTK_PIN_IES_SMT_SPEC(66, 67, 0xA10, 6),
> + MTK_PIN_IES_SMT_SPEC(68, 68, 0xA30, 2),
> + MTK_PIN_IES_SMT_SPEC(69, 69, 0xA30, 1),
> + MTK_PIN_IES_SMT_SPEC(70, 70, 0xA30, 3),
> + MTK_PIN_IES_SMT_SPEC(71, 71, 0xA30, 4),
> + MTK_PIN_IES_SMT_SPEC(72, 72, 0xA30, 5),
> + MTK_PIN_IES_SMT_SPEC(73, 73, 0xA30, 6),
> +
> + MTK_PIN_IES_SMT_SPEC(100, 103, 0xA10, 7),
> + MTK_PIN_IES_SMT_SPEC(104, 104, 0xA20, 12),
> + MTK_PIN_IES_SMT_SPEC(105, 105, 0xA20, 11),
> + MTK_PIN_IES_SMT_SPEC(106, 106, 0xA30, 13),
> + MTK_PIN_IES_SMT_SPEC(107, 107, 0xA20, 14),
> + MTK_PIN_IES_SMT_SPEC(108, 108, 0xA20, 15),
> + MTK_PIN_IES_SMT_SPEC(109, 109, 0xA30, 0),
> + MTK_PIN_IES_SMT_SPEC(110, 110, 0xA20, 9),
> + MTK_PIN_IES_SMT_SPEC(111, 111, 0xA20, 8),
> + MTK_PIN_IES_SMT_SPEC(112, 112, 0xA20, 7),
> + MTK_PIN_IES_SMT_SPEC(113, 113, 0xA20, 6),
> + MTK_PIN_IES_SMT_SPEC(114, 114, 0xA20, 10),
> + MTK_PIN_IES_SMT_SPEC(115, 115, 0xA20, 1),
> + MTK_PIN_IES_SMT_SPEC(116, 116, 0xA20, 0),
> + MTK_PIN_IES_SMT_SPEC(117, 117, 0xA20, 5),
> + MTK_PIN_IES_SMT_SPEC(118, 118, 0xA20, 4),
> + MTK_PIN_IES_SMT_SPEC(119, 119, 0xA20, 3),
> + MTK_PIN_IES_SMT_SPEC(120, 120, 0xA20, 2),
> + MTK_PIN_IES_SMT_SPEC(121, 124, 0xA10, 9),
> +};
> +
> +static int mt8516_ies_smt_set(struct regmap *regmap, unsigned int pin,
> + unsigned char align, int value, enum pin_config_param arg)
> +{
> + if (arg == PIN_CONFIG_INPUT_ENABLE)
> + return mtk_pconf_spec_set_ies_smt_range(regmap, mt8516_ies_set,
> + ARRAY_SIZE(mt8516_ies_set), pin, align, value);
> + else if (arg == PIN_CONFIG_INPUT_SCHMITT_ENABLE)
> + return mtk_pconf_spec_set_ies_smt_range(regmap, mt8516_smt_set,
> + ARRAY_SIZE(mt8516_smt_set), pin, align, value);
> + return -EINVAL;
> +}
> +
> +static struct mtk_eint_regs mt8516_eint_regs = {
> + .stat = 0x000,
> + .ack = 0x040,
> + .mask = 0x080,
> + .mask_set = 0x0c0,
> + .mask_clr = 0x100,
> + .sens = 0x140,
> + .sens_set = 0x180,
> + .sens_clr = 0x1c0,
> + .soft = 0x200,
> + .soft_set = 0x240,
> + .soft_clr = 0x280,
> + .pol = 0x300,
> + .pol_set = 0x340,
> + .pol_clr = 0x380,
> + .dom_en = 0x400,
> + .dbnc_ctrl = 0x500,
> + .dbnc_set = 0x600,
> + .dbnc_clr = 0x700,
> +};
> +
> +static const struct mtk_pinctrl_devdata mt8516_pinctrl_data = {
> + .pins = mtk_pins_mt8516,
> + .npins = ARRAY_SIZE(mtk_pins_mt8516),
> + .grp_desc = mt8516_drv_grp,
> + .n_grp_cls = ARRAY_SIZE(mt8516_drv_grp),
> + .pin_drv_grp = mt8516_pin_drv,
> + .n_pin_drv_grps = ARRAY_SIZE(mt8516_pin_drv),
> + .spec_pull_set = mt8516_spec_pull_set,
> + .spec_ies_smt_set = mt8516_ies_smt_set,
> + .dir_offset = 0x0000,
> + .pullen_offset = 0x0500,
> + .pullsel_offset = 0x0600,
> + .dout_offset = 0x0100,
> + .din_offset = 0x0200,
> + .pinmux_offset = 0x0300,
> + .type1_start = 125,
> + .type1_end = 125,
> + .port_shf = 4,
> + .port_mask = 0xf,
> + .port_align = 4,
> + .eint_regs = &mt8516_eint_regs,
The eint register layout seems definitely the same to the generic one.
So mt8516_eint_regs struct defintions and the field assignment can be
dropped. And then the driver will fall back to use a generic one
"mtk_generic_eint_regs" which are currently common to all MediaTek
pinctrls devices. Others look good to me.
> + .eint_hw = {
> + .port_mask = 7,
> + .ports = 6,
> + .ap_num = 169,
> + .db_cnt = 64,
> + },
> +};
> +
> +static int mt8516_pinctrl_probe(struct platform_device *pdev)
> +{
> + return mtk_pctrl_init(pdev, &mt8516_pinctrl_data, NULL);
> +}
> +
> +static const struct of_device_id mt8516_pctrl_match[] = {
> + {
> + .compatible = "mediatek,mt8516-pinctrl",
> + },
> + {}
> +};
> +
> +MODULE_DEVICE_TABLE(of, mt8516_pctrl_match);
> +
> +static struct platform_driver mtk_pinctrl_driver = {
> + .probe = mt8516_pinctrl_probe,
> + .driver = {
> + .name = "mediatek-mt8516-pinctrl",
> + .of_match_table = mt8516_pctrl_match,
> + .pm = &mtk_eint_pm_ops,
> + },
> +};
> +
> +static int __init mtk_pinctrl_init(void)
> +{
> + return platform_driver_register(&mtk_pinctrl_driver);
> +}
> +arch_initcall(mtk_pinctrl_init);
> diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-mt8516.h b/drivers/pinctrl/mediatek/pinctrl-mtk-mt8516.h
> new file mode 100644
> index 000000000000..f7a4c6e4a026
> --- /dev/null
> +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-mt8516.h
> @@ -0,0 +1,1182 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +/*
> + * Copyright (C) 2019 MediaTek Inc.
> + */
> +#ifndef __PINCTRL_MTK_MT8516_H
> +#define __PINCTRL_MTK_MT8516_H
> +
> +#include <linux/pinctrl/pinctrl.h>
> +#include "pinctrl-mtk-common.h"
> +
> +static const struct mtk_desc_pin mtk_pins_mt8516[] = {
> + MTK_PIN(
> + PINCTRL_PIN(0, "EINT0"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 0),
> + MTK_FUNCTION(0, "GPIO0"),
> + MTK_FUNCTION(1, "PWM_B"),
> + MTK_FUNCTION(3, "I2S2_BCK"),
> + MTK_FUNCTION(4, "EXT_TXD0"),
> + MTK_FUNCTION(6, "SQICS"),
> + MTK_FUNCTION(7, "DBG_MON_A[6]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(1, "EINT1"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 1),
> + MTK_FUNCTION(0, "GPIO1"),
> + MTK_FUNCTION(1, "PWM_C"),
> + MTK_FUNCTION(3, "I2S2_DI"),
> + MTK_FUNCTION(4, "EXT_TXD1"),
> + MTK_FUNCTION(5, "CONN_MCU_TDO"),
> + MTK_FUNCTION(6, "SQISO"),
> + MTK_FUNCTION(7, "DBG_MON_A[7]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(2, "EINT2"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 2),
> + MTK_FUNCTION(0, "GPIO2"),
> + MTK_FUNCTION(1, "CLKM0"),
> + MTK_FUNCTION(3, "I2S2_LRCK"),
> + MTK_FUNCTION(4, "EXT_TXD2"),
> + MTK_FUNCTION(5, "CONN_MCU_DBGACK_N"),
> + MTK_FUNCTION(6, "SQISI"),
> + MTK_FUNCTION(7, "DBG_MON_A[8]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(3, "EINT3"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 3),
> + MTK_FUNCTION(0, "GPIO3"),
> + MTK_FUNCTION(1, "CLKM1"),
> + MTK_FUNCTION(3, "SPI_MI"),
> + MTK_FUNCTION(4, "EXT_TXD3"),
> + MTK_FUNCTION(5, "CONN_MCU_DBGI_N"),
> + MTK_FUNCTION(6, "SQIWP"),
> + MTK_FUNCTION(7, "DBG_MON_A[9]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(4, "EINT4"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 4),
> + MTK_FUNCTION(0, "GPIO4"),
> + MTK_FUNCTION(1, "CLKM2"),
> + MTK_FUNCTION(3, "SPI_MO"),
> + MTK_FUNCTION(4, "EXT_TXC"),
> + MTK_FUNCTION(5, "CONN_MCU_TCK"),
> + MTK_FUNCTION(6, "CONN_MCU_AICE_JCKC"),
> + MTK_FUNCTION(7, "DBG_MON_A[10]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(5, "EINT5"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 5),
> + MTK_FUNCTION(0, "GPIO5"),
> + MTK_FUNCTION(1, "UCTS2"),
> + MTK_FUNCTION(3, "SPI_CSB"),
> + MTK_FUNCTION(4, "EXT_RXER"),
> + MTK_FUNCTION(5, "CONN_MCU_TDI"),
> + MTK_FUNCTION(6, "CONN_TEST_CK"),
> + MTK_FUNCTION(7, "DBG_MON_A[11]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(6, "EINT6"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 6),
> + MTK_FUNCTION(0, "GPIO6"),
> + MTK_FUNCTION(1, "URTS2"),
> + MTK_FUNCTION(3, "SPI_CLK"),
> + MTK_FUNCTION(4, "EXT_RXC"),
> + MTK_FUNCTION(5, "CONN_MCU_TRST_B"),
> + MTK_FUNCTION(7, "DBG_MON_A[12]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(7, "EINT7"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 7),
> + MTK_FUNCTION(0, "GPIO7"),
> + MTK_FUNCTION(1, "SQIRST"),
> + MTK_FUNCTION(3, "SDA1_0"),
> + MTK_FUNCTION(4, "EXT_RXDV"),
> + MTK_FUNCTION(5, "CONN_MCU_TMS"),
> + MTK_FUNCTION(6, "CONN_MCU_AICE_JMSC"),
> + MTK_FUNCTION(7, "DBG_MON_A[13]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(8, "EINT8"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 8),
> + MTK_FUNCTION(0, "GPIO8"),
> + MTK_FUNCTION(1, "SQICK"),
> + MTK_FUNCTION(2, "CLKM3"),
> + MTK_FUNCTION(3, "SCL1_0"),
> + MTK_FUNCTION(4, "EXT_RXD0"),
> + MTK_FUNCTION(5, "ANT_SEL0"),
> + MTK_FUNCTION(7, "DBG_MON_A[14]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(9, "EINT9"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 9),
> + MTK_FUNCTION(0, "GPIO9"),
> + MTK_FUNCTION(1, "CLKM4"),
> + MTK_FUNCTION(2, "SDA2_0"),
> + MTK_FUNCTION(3, "EXT_FRAME_SYNC"),
> + MTK_FUNCTION(4, "EXT_RXD1"),
> + MTK_FUNCTION(5, "ANT_SEL1"),
> + MTK_FUNCTION(7, "DBG_MON_A[15]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(10, "EINT10"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 10),
> + MTK_FUNCTION(0, "GPIO10"),
> + MTK_FUNCTION(1, "CLKM5"),
> + MTK_FUNCTION(2, "SCL2_0"),
> + MTK_FUNCTION(3, "EXT_FRAME_SYNC"),
> + MTK_FUNCTION(4, "EXT_RXD2"),
> + MTK_FUNCTION(5, "ANT_SEL2"),
> + MTK_FUNCTION(7, "DBG_MON_A[16]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(11, "EINT11"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 11),
> + MTK_FUNCTION(0, "GPIO11"),
> + MTK_FUNCTION(1, "CLKM4"),
> + MTK_FUNCTION(2, "PWM_C"),
> + MTK_FUNCTION(3, "CONN_TEST_CK"),
> + MTK_FUNCTION(4, "ANT_SEL3"),
> + MTK_FUNCTION(6, "EXT_RXD3"),
> + MTK_FUNCTION(7, "DBG_MON_A[17]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(12, "EINT12"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 12),
> + MTK_FUNCTION(0, "GPIO12"),
> + MTK_FUNCTION(1, "CLKM5"),
> + MTK_FUNCTION(2, "PWM_A"),
> + MTK_FUNCTION(3, "SPDIF_OUT"),
> + MTK_FUNCTION(4, "ANT_SEL4"),
> + MTK_FUNCTION(6, "EXT_TXEN"),
> + MTK_FUNCTION(7, "DBG_MON_A[18]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(13, "EINT13"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 13),
> + MTK_FUNCTION(0, "GPIO13"),
> + MTK_FUNCTION(3, "TSF_IN"),
> + MTK_FUNCTION(4, "ANT_SEL5"),
> + MTK_FUNCTION(6, "SPDIF_IN"),
> + MTK_FUNCTION(7, "DBG_MON_A[19]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(14, "EINT14"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 14),
> + MTK_FUNCTION(0, "GPIO14"),
> + MTK_FUNCTION(2, "I2S_8CH_DO1"),
> + MTK_FUNCTION(3, "TDM_RX_MCK"),
> + MTK_FUNCTION(4, "ANT_SEL1"),
> + MTK_FUNCTION(5, "CONN_MCU_DBGACK_N"),
> + MTK_FUNCTION(6, "NCLE"),
> + MTK_FUNCTION(7, "DBG_MON_B[8]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(15, "EINT15"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 15),
> + MTK_FUNCTION(0, "GPIO15"),
> + MTK_FUNCTION(2, "I2S_8CH_LRCK"),
> + MTK_FUNCTION(3, "TDM_RX_BCK"),
> + MTK_FUNCTION(4, "ANT_SEL2"),
> + MTK_FUNCTION(5, "CONN_MCU_DBGI_N"),
> + MTK_FUNCTION(6, "NCEB1"),
> + MTK_FUNCTION(7, "DBG_MON_B[9]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(16, "EINT16"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 16),
> + MTK_FUNCTION(0, "GPIO16"),
> + MTK_FUNCTION(2, "I2S_8CH_BCK"),
> + MTK_FUNCTION(3, "TDM_RX_LRCK"),
> + MTK_FUNCTION(4, "ANT_SEL3"),
> + MTK_FUNCTION(5, "CONN_MCU_TRST_B"),
> + MTK_FUNCTION(6, "NCEB0"),
> + MTK_FUNCTION(7, "DBG_MON_B[10]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(17, "EINT17"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 17),
> + MTK_FUNCTION(0, "GPIO17"),
> + MTK_FUNCTION(2, "I2S_8CH_MCK"),
> + MTK_FUNCTION(3, "TDM_RX_DI"),
> + MTK_FUNCTION(4, "IDDIG"),
> + MTK_FUNCTION(5, "ANT_SEL4"),
> + MTK_FUNCTION(6, "NREB"),
> + MTK_FUNCTION(7, "DBG_MON_B[11]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(18, "EINT18"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 18),
> + MTK_FUNCTION(0, "GPIO18"),
> + MTK_FUNCTION(2, "USB_DRVVBUS"),
> + MTK_FUNCTION(3, "I2S3_LRCK"),
> + MTK_FUNCTION(4, "CLKM1"),
> + MTK_FUNCTION(5, "ANT_SEL3"),
> + MTK_FUNCTION(6, "I2S2_BCK"),
> + MTK_FUNCTION(7, "DBG_MON_A[20]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(19, "EINT19"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 19),
> + MTK_FUNCTION(0, "GPIO19"),
> + MTK_FUNCTION(1, "UCTS1"),
> + MTK_FUNCTION(2, "IDDIG"),
> + MTK_FUNCTION(3, "I2S3_BCK"),
> + MTK_FUNCTION(4, "CLKM2"),
> + MTK_FUNCTION(5, "ANT_SEL4"),
> + MTK_FUNCTION(6, "I2S2_DI"),
> + MTK_FUNCTION(7, "DBG_MON_A[21]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(20, "EINT20"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 20),
> + MTK_FUNCTION(0, "GPIO20"),
> + MTK_FUNCTION(1, "URTS1"),
> + MTK_FUNCTION(3, "I2S3_DO"),
> + MTK_FUNCTION(4, "CLKM3"),
> + MTK_FUNCTION(5, "ANT_SEL5"),
> + MTK_FUNCTION(6, "I2S2_LRCK"),
> + MTK_FUNCTION(7, "DBG_MON_A[22]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(21, "EINT21"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 21),
> + MTK_FUNCTION(0, "GPIO21"),
> + MTK_FUNCTION(1, "NRNB"),
> + MTK_FUNCTION(2, "ANT_SEL0"),
> + MTK_FUNCTION(3, "I2S_8CH_DO4"),
> + MTK_FUNCTION(7, "DBG_MON_B[31]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(22, "EINT22"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 22),
> + MTK_FUNCTION(0, "GPIO22"),
> + MTK_FUNCTION(2, "I2S_8CH_DO2"),
> + MTK_FUNCTION(3, "TSF_IN"),
> + MTK_FUNCTION(4, "USB_DRVVBUS"),
> + MTK_FUNCTION(5, "SPDIF_OUT"),
> + MTK_FUNCTION(6, "NRE_C"),
> + MTK_FUNCTION(7, "DBG_MON_B[12]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(23, "EINT23"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 23),
> + MTK_FUNCTION(0, "GPIO23"),
> + MTK_FUNCTION(2, "I2S_8CH_DO3"),
> + MTK_FUNCTION(3, "CLKM0"),
> + MTK_FUNCTION(4, "IR"),
> + MTK_FUNCTION(5, "SPDIF_IN"),
> + MTK_FUNCTION(6, "NDQS_C"),
> + MTK_FUNCTION(7, "DBG_MON_B[13]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(24, "EINT24"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 24),
> + MTK_FUNCTION(0, "GPIO24"),
> + MTK_FUNCTION(3, "ANT_SEL1"),
> + MTK_FUNCTION(4, "UCTS2"),
> + MTK_FUNCTION(5, "PWM_A"),
> + MTK_FUNCTION(6, "I2S0_MCK"),
> + MTK_FUNCTION(7, "DBG_MON_A[0]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(25, "EINT25"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 25),
> + MTK_FUNCTION(0, "GPIO25"),
> + MTK_FUNCTION(3, "ANT_SEL0"),
> + MTK_FUNCTION(4, "URTS2"),
> + MTK_FUNCTION(5, "PWM_B"),
> + MTK_FUNCTION(6, "I2S_8CH_MCK"),
> + MTK_FUNCTION(7, "DBG_MON_A[1]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(26, "PWRAP_SPI0_MI"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 26),
> + MTK_FUNCTION(0, "GPIO26"),
> + MTK_FUNCTION(1, "PWRAP_SPI0_MO"),
> + MTK_FUNCTION(2, "PWRAP_SPI0_MI")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(27, "PWRAP_SPI0_MO"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 27),
> + MTK_FUNCTION(0, "GPIO27"),
> + MTK_FUNCTION(1, "PWRAP_SPI0_MI"),
> + MTK_FUNCTION(2, "PWRAP_SPI0_MO")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(28, "PWRAP_INT"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 28),
> + MTK_FUNCTION(0, "GPIO28"),
> + MTK_FUNCTION(1, "I2S0_MCK"),
> + MTK_FUNCTION(4, "I2S_8CH_MCK"),
> + MTK_FUNCTION(5, "I2S2_MCK"),
> + MTK_FUNCTION(6, "I2S3_MCK")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(29, "PWRAP_SPI0_CK"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 29),
> + MTK_FUNCTION(0, "GPIO29"),
> + MTK_FUNCTION(1, "PWRAP_SPI0_CK")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(30, "PWRAP_SPI0_CSN"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 30),
> + MTK_FUNCTION(0, "GPIO30"),
> + MTK_FUNCTION(1, "PWRAP_SPI0_CSN")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(31, "RTC32K_CK"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 31),
> + MTK_FUNCTION(0, "GPIO31"),
> + MTK_FUNCTION(1, "RTC32K_CK")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(32, "WATCHDOG"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 32),
> + MTK_FUNCTION(0, "GPIO32"),
> + MTK_FUNCTION(1, "WATCHDOG")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(33, "SRCLKENA"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 33),
> + MTK_FUNCTION(0, "GPIO33"),
> + MTK_FUNCTION(1, "SRCLKENA0")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(34, "URXD2"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 34),
> + MTK_FUNCTION(0, "GPIO34"),
> + MTK_FUNCTION(1, "URXD2"),
> + MTK_FUNCTION(3, "UTXD2"),
> + MTK_FUNCTION(4, "DBG_SCL"),
> + MTK_FUNCTION(6, "I2S2_MCK"),
> + MTK_FUNCTION(7, "DBG_MON_B[0]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(35, "UTXD2"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 35),
> + MTK_FUNCTION(0, "GPIO35"),
> + MTK_FUNCTION(1, "UTXD2"),
> + MTK_FUNCTION(3, "URXD2"),
> + MTK_FUNCTION(4, "DBG_SDA"),
> + MTK_FUNCTION(6, "I2S3_MCK"),
> + MTK_FUNCTION(7, "DBG_MON_B[1]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(36, "MRG_CLK"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 36),
> + MTK_FUNCTION(0, "GPIO36"),
> + MTK_FUNCTION(1, "MRG_CLK"),
> + MTK_FUNCTION(3, "I2S0_BCK"),
> + MTK_FUNCTION(4, "I2S3_BCK"),
> + MTK_FUNCTION(5, "PCM0_CLK"),
> + MTK_FUNCTION(6, "IR"),
> + MTK_FUNCTION(7, "DBG_MON_A[2]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(37, "MRG_SYNC"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 37),
> + MTK_FUNCTION(0, "GPIO37"),
> + MTK_FUNCTION(1, "MRG_SYNC"),
> + MTK_FUNCTION(3, "I2S0_LRCK"),
> + MTK_FUNCTION(4, "I2S3_LRCK"),
> + MTK_FUNCTION(5, "PCM0_SYNC"),
> + MTK_FUNCTION(6, "EXT_COL"),
> + MTK_FUNCTION(7, "DBG_MON_A[3]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(38, "MRG_DI"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 38),
> + MTK_FUNCTION(0, "GPIO38"),
> + MTK_FUNCTION(1, "MRG_DI"),
> + MTK_FUNCTION(3, "I2S0_DI"),
> + MTK_FUNCTION(4, "I2S3_DO"),
> + MTK_FUNCTION(5, "PCM0_DI"),
> + MTK_FUNCTION(6, "EXT_MDIO"),
> + MTK_FUNCTION(7, "DBG_MON_A[4]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(39, "MRG_DO"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 39),
> + MTK_FUNCTION(0, "GPIO39"),
> + MTK_FUNCTION(1, "MRG_DO"),
> + MTK_FUNCTION(3, "I2S0_MCK"),
> + MTK_FUNCTION(4, "I2S3_MCK"),
> + MTK_FUNCTION(5, "PCM0_DO"),
> + MTK_FUNCTION(6, "EXT_MDC"),
> + MTK_FUNCTION(7, "DBG_MON_A[5]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(40, "KPROW0"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 40),
> + MTK_FUNCTION(0, "GPIO40"),
> + MTK_FUNCTION(1, "KPROW0"),
> + MTK_FUNCTION(7, "DBG_MON_B[4]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(41, "KPROW1"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 41),
> + MTK_FUNCTION(0, "GPIO41"),
> + MTK_FUNCTION(1, "KPROW1"),
> + MTK_FUNCTION(2, "IDDIG"),
> + MTK_FUNCTION(3, "EXT_FRAME_SYNC"),
> + MTK_FUNCTION(7, "DBG_MON_B[5]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(42, "KPCOL0"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 42),
> + MTK_FUNCTION(0, "GPIO42"),
> + MTK_FUNCTION(1, "KPCOL0"),
> + MTK_FUNCTION(7, "DBG_MON_B[6]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(43, "KPCOL1"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 43),
> + MTK_FUNCTION(0, "GPIO43"),
> + MTK_FUNCTION(1, "KPCOL1"),
> + MTK_FUNCTION(2, "USB_DRVVBUS"),
> + MTK_FUNCTION(3, "EXT_FRAME_SYNC"),
> + MTK_FUNCTION(4, "TSF_IN"),
> + MTK_FUNCTION(7, "DBG_MON_B[7]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(44, "JTMS"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 44),
> + MTK_FUNCTION(0, "GPIO44"),
> + MTK_FUNCTION(1, "JTMS"),
> + MTK_FUNCTION(2, "CONN_MCU_TMS"),
> + MTK_FUNCTION(3, "CONN_MCU_AICE_JMSC")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(45, "JTCK"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 45),
> + MTK_FUNCTION(0, "GPIO45"),
> + MTK_FUNCTION(1, "JTCK"),
> + MTK_FUNCTION(2, "CONN_MCU_TCK"),
> + MTK_FUNCTION(3, "CONN_MCU_AICE_JCKC")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(46, "JTDI"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 46),
> + MTK_FUNCTION(0, "GPIO46"),
> + MTK_FUNCTION(1, "JTDI"),
> + MTK_FUNCTION(2, "CONN_MCU_TDI")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(47, "JTDO"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 47),
> + MTK_FUNCTION(0, "GPIO47"),
> + MTK_FUNCTION(1, "JTDO"),
> + MTK_FUNCTION(2, "CONN_MCU_TDO")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(48, "SPI_CS"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 48),
> + MTK_FUNCTION(0, "GPIO48"),
> + MTK_FUNCTION(1, "SPI_CSB"),
> + MTK_FUNCTION(3, "I2S0_DI"),
> + MTK_FUNCTION(4, "I2S2_BCK"),
> + MTK_FUNCTION(7, "DBG_MON_A[23]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(49, "SPI_CK"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 49),
> + MTK_FUNCTION(0, "GPIO49"),
> + MTK_FUNCTION(1, "SPI_CLK"),
> + MTK_FUNCTION(3, "I2S0_LRCK"),
> + MTK_FUNCTION(4, "I2S2_DI"),
> + MTK_FUNCTION(7, "DBG_MON_A[24]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(50, "SPI_MI"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 50),
> + MTK_FUNCTION(0, "GPIO50"),
> + MTK_FUNCTION(1, "SPI_MI"),
> + MTK_FUNCTION(2, "SPI_MO"),
> + MTK_FUNCTION(3, "I2S0_BCK"),
> + MTK_FUNCTION(4, "I2S2_LRCK"),
> + MTK_FUNCTION(7, "DBG_MON_A[25]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(51, "SPI_MO"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 51),
> + MTK_FUNCTION(0, "GPIO51"),
> + MTK_FUNCTION(1, "SPI_MO"),
> + MTK_FUNCTION(2, "SPI_MI"),
> + MTK_FUNCTION(3, "I2S0_MCK"),
> + MTK_FUNCTION(4, "I2S2_MCK"),
> + MTK_FUNCTION(7, "DBG_MON_A[26]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(52, "SDA1"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 52),
> + MTK_FUNCTION(0, "GPIO52"),
> + MTK_FUNCTION(1, "SDA1_0")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(53, "SCL1"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 53),
> + MTK_FUNCTION(0, "GPIO53"),
> + MTK_FUNCTION(1, "SCL1_0")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(54, "GPIO54"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 54),
> + MTK_FUNCTION(0, "GPIO54"),
> + MTK_FUNCTION(2, "PWM_B"),
> + MTK_FUNCTION(7, "DBG_MON_B[2]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(55, "I2S_DATA_IN"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 55),
> + MTK_FUNCTION(0, "GPIO55"),
> + MTK_FUNCTION(1, "I2S0_DI"),
> + MTK_FUNCTION(2, "UCTS0"),
> + MTK_FUNCTION(3, "I2S3_DO"),
> + MTK_FUNCTION(4, "I2S_8CH_DO1"),
> + MTK_FUNCTION(5, "PWM_A"),
> + MTK_FUNCTION(6, "I2S2_BCK"),
> + MTK_FUNCTION(7, "DBG_MON_A[28]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(56, "I2S_LRCK"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 56),
> + MTK_FUNCTION(0, "GPIO56"),
> + MTK_FUNCTION(1, "I2S0_LRCK"),
> + MTK_FUNCTION(3, "I2S3_LRCK"),
> + MTK_FUNCTION(4, "I2S_8CH_LRCK"),
> + MTK_FUNCTION(5, "PWM_B"),
> + MTK_FUNCTION(6, "I2S2_DI"),
> + MTK_FUNCTION(7, "DBG_MON_A[29]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(57, "I2S_BCK"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 57),
> + MTK_FUNCTION(0, "GPIO57"),
> + MTK_FUNCTION(1, "I2S0_BCK"),
> + MTK_FUNCTION(2, "URTS0"),
> + MTK_FUNCTION(3, "I2S3_BCK"),
> + MTK_FUNCTION(4, "I2S_8CH_BCK"),
> + MTK_FUNCTION(5, "PWM_C"),
> + MTK_FUNCTION(6, "I2S2_LRCK"),
> + MTK_FUNCTION(7, "DBG_MON_A[30]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(58, "SDA0"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 58),
> + MTK_FUNCTION(0, "GPIO58"),
> + MTK_FUNCTION(1, "SDA0_0")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(59, "SCL0"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 59),
> + MTK_FUNCTION(0, "GPIO59"),
> + MTK_FUNCTION(1, "SCL0_0")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(60, "SDA2"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 60),
> + MTK_FUNCTION(0, "GPIO60"),
> + MTK_FUNCTION(1, "SDA2_0"),
> + MTK_FUNCTION(2, "PWM_B")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(61, "SCL2"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 61),
> + MTK_FUNCTION(0, "GPIO61"),
> + MTK_FUNCTION(1, "SCL2_0"),
> + MTK_FUNCTION(2, "PWM_C")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(62, "URXD0"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 62),
> + MTK_FUNCTION(0, "GPIO62"),
> + MTK_FUNCTION(1, "URXD0"),
> + MTK_FUNCTION(2, "UTXD0")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(63, "UTXD0"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 63),
> + MTK_FUNCTION(0, "GPIO63"),
> + MTK_FUNCTION(1, "UTXD0"),
> + MTK_FUNCTION(2, "URXD0")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(64, "URXD1"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 64),
> + MTK_FUNCTION(0, "GPIO64"),
> + MTK_FUNCTION(1, "URXD1"),
> + MTK_FUNCTION(2, "UTXD1"),
> + MTK_FUNCTION(7, "DBG_MON_A[27]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(65, "UTXD1"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 65),
> + MTK_FUNCTION(0, "GPIO65"),
> + MTK_FUNCTION(1, "UTXD1"),
> + MTK_FUNCTION(2, "URXD1"),
> + MTK_FUNCTION(7, "DBG_MON_A[31]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(66, "LCM_RST"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 66),
> + MTK_FUNCTION(0, "GPIO66"),
> + MTK_FUNCTION(1, "LCM_RST"),
> + MTK_FUNCTION(3, "I2S0_MCK"),
> + MTK_FUNCTION(7, "DBG_MON_B[3]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(67, "GPIO67"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 67),
> + MTK_FUNCTION(0, "GPIO67"),
> + MTK_FUNCTION(3, "I2S_8CH_MCK"),
> + MTK_FUNCTION(7, "DBG_MON_B[14]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(68, "MSDC2_CMD"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 68),
> + MTK_FUNCTION(0, "GPIO68"),
> + MTK_FUNCTION(1, "MSDC2_CMD"),
> + MTK_FUNCTION(2, "I2S_8CH_DO4"),
> + MTK_FUNCTION(3, "SDA1_0"),
> + MTK_FUNCTION(5, "USB_SDA"),
> + MTK_FUNCTION(6, "I2S3_BCK"),
> + MTK_FUNCTION(7, "DBG_MON_B[15]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(69, "MSDC2_CLK"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 69),
> + MTK_FUNCTION(0, "GPIO69"),
> + MTK_FUNCTION(1, "MSDC2_CLK"),
> + MTK_FUNCTION(2, "I2S_8CH_DO3"),
> + MTK_FUNCTION(3, "SCL1_0"),
> + MTK_FUNCTION(5, "USB_SCL"),
> + MTK_FUNCTION(6, "I2S3_LRCK"),
> + MTK_FUNCTION(7, "DBG_MON_B[16]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(70, "MSDC2_DAT0"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 70),
> + MTK_FUNCTION(0, "GPIO70"),
> + MTK_FUNCTION(1, "MSDC2_DAT0"),
> + MTK_FUNCTION(2, "I2S_8CH_DO2"),
> + MTK_FUNCTION(5, "UTXD0"),
> + MTK_FUNCTION(6, "I2S3_DO"),
> + MTK_FUNCTION(7, "DBG_MON_B[17]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(71, "MSDC2_DAT1"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 71),
> + MTK_FUNCTION(0, "GPIO71"),
> + MTK_FUNCTION(1, "MSDC2_DAT1"),
> + MTK_FUNCTION(2, "I2S_8CH_DO1"),
> + MTK_FUNCTION(3, "PWM_A"),
> + MTK_FUNCTION(4, "I2S3_MCK"),
> + MTK_FUNCTION(5, "URXD0"),
> + MTK_FUNCTION(6, "PWM_B"),
> + MTK_FUNCTION(7, "DBG_MON_B[18]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(72, "MSDC2_DAT2"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 72),
> + MTK_FUNCTION(0, "GPIO72"),
> + MTK_FUNCTION(1, "MSDC2_DAT2"),
> + MTK_FUNCTION(2, "I2S_8CH_LRCK"),
> + MTK_FUNCTION(3, "SDA2_0"),
> + MTK_FUNCTION(5, "UTXD1"),
> + MTK_FUNCTION(6, "PWM_C"),
> + MTK_FUNCTION(7, "DBG_MON_B[19]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(73, "MSDC2_DAT3"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 73),
> + MTK_FUNCTION(0, "GPIO73"),
> + MTK_FUNCTION(1, "MSDC2_DAT3"),
> + MTK_FUNCTION(2, "I2S_8CH_BCK"),
> + MTK_FUNCTION(3, "SCL2_0"),
> + MTK_FUNCTION(4, "EXT_FRAME_SYNC"),
> + MTK_FUNCTION(5, "URXD1"),
> + MTK_FUNCTION(6, "PWM_A"),
> + MTK_FUNCTION(7, "DBG_MON_B[20]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(74, "TDN3"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 74),
> + MTK_FUNCTION(0, "GPIO74"),
> + MTK_FUNCTION(1, "TDN3")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(75, "TDP3"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 75),
> + MTK_FUNCTION(0, "GPIO75"),
> + MTK_FUNCTION(1, "TDP3")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(76, "TDN2"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 76),
> + MTK_FUNCTION(0, "GPIO76"),
> + MTK_FUNCTION(1, "TDN2")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(77, "TDP2"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 77),
> + MTK_FUNCTION(0, "GPIO77"),
> + MTK_FUNCTION(1, "TDP2")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(78, "TCN"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 78),
> + MTK_FUNCTION(0, "GPIO78"),
> + MTK_FUNCTION(1, "TCN")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(79, "TCP"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 79),
> + MTK_FUNCTION(0, "GPIO79"),
> + MTK_FUNCTION(1, "TCP")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(80, "TDN1"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 80),
> + MTK_FUNCTION(0, "GPIO80"),
> + MTK_FUNCTION(1, "TDN1")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(81, "TDP1"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 81),
> + MTK_FUNCTION(0, "GPIO81"),
> + MTK_FUNCTION(1, "TDP1")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(82, "TDN0"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 82),
> + MTK_FUNCTION(0, "GPIO82"),
> + MTK_FUNCTION(1, "TDN0")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(83, "TDP0"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 83),
> + MTK_FUNCTION(0, "GPIO83"),
> + MTK_FUNCTION(1, "TDP0")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(84, "RDN0"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 84),
> + MTK_FUNCTION(0, "GPIO84"),
> + MTK_FUNCTION(1, "RDN0")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(85, "RDP0"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 85),
> + MTK_FUNCTION(0, "GPIO85"),
> + MTK_FUNCTION(1, "RDP0")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(86, "RDN1"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 86),
> + MTK_FUNCTION(0, "GPIO86"),
> + MTK_FUNCTION(1, "RDN1")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(87, "RDP1"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 87),
> + MTK_FUNCTION(0, "GPIO87"),
> + MTK_FUNCTION(1, "RDP1")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(88, "RCN"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 88),
> + MTK_FUNCTION(0, "GPIO88"),
> + MTK_FUNCTION(1, "RCN")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(89, "RCP"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 89),
> + MTK_FUNCTION(0, "GPIO89"),
> + MTK_FUNCTION(1, "RCP")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(90, "RDN2"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 90),
> + MTK_FUNCTION(0, "GPIO90"),
> + MTK_FUNCTION(1, "RDN2"),
> + MTK_FUNCTION(2, "CMDAT8")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(91, "RDP2"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 91),
> + MTK_FUNCTION(0, "GPIO91"),
> + MTK_FUNCTION(1, "RDP2"),
> + MTK_FUNCTION(2, "CMDAT9")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(92, "RDN3"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 92),
> + MTK_FUNCTION(0, "GPIO92"),
> + MTK_FUNCTION(1, "RDN3"),
> + MTK_FUNCTION(2, "CMDAT4")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(93, "RDP3"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 93),
> + MTK_FUNCTION(0, "GPIO93"),
> + MTK_FUNCTION(1, "RDP3"),
> + MTK_FUNCTION(2, "CMDAT5")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(94, "RCN_A"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 94),
> + MTK_FUNCTION(0, "GPIO94"),
> + MTK_FUNCTION(1, "RCN_A"),
> + MTK_FUNCTION(2, "CMDAT6")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(95, "RCP_A"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 95),
> + MTK_FUNCTION(0, "GPIO95"),
> + MTK_FUNCTION(1, "RCP_A"),
> + MTK_FUNCTION(2, "CMDAT7")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(96, "RDN1_A"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 96),
> + MTK_FUNCTION(0, "GPIO96"),
> + MTK_FUNCTION(1, "RDN1_A"),
> + MTK_FUNCTION(2, "CMDAT2"),
> + MTK_FUNCTION(3, "CMCSD2")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(97, "RDP1_A"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 97),
> + MTK_FUNCTION(0, "GPIO97"),
> + MTK_FUNCTION(1, "RDP1_A"),
> + MTK_FUNCTION(2, "CMDAT3"),
> + MTK_FUNCTION(3, "CMCSD3")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(98, "RDN0_A"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 98),
> + MTK_FUNCTION(0, "GPIO98"),
> + MTK_FUNCTION(1, "RDN0_A"),
> + MTK_FUNCTION(2, "CMHSYNC")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(99, "RDP0_A"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 99),
> + MTK_FUNCTION(0, "GPIO99"),
> + MTK_FUNCTION(1, "RDP0_A"),
> + MTK_FUNCTION(2, "CMVSYNC")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(100, "CMDAT0"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 100),
> + MTK_FUNCTION(0, "GPIO100"),
> + MTK_FUNCTION(1, "CMDAT0"),
> + MTK_FUNCTION(2, "CMCSD0"),
> + MTK_FUNCTION(3, "ANT_SEL2"),
> + MTK_FUNCTION(5, "TDM_RX_MCK"),
> + MTK_FUNCTION(7, "DBG_MON_B[21]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(101, "CMDAT1"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 101),
> + MTK_FUNCTION(0, "GPIO101"),
> + MTK_FUNCTION(1, "CMDAT1"),
> + MTK_FUNCTION(2, "CMCSD1"),
> + MTK_FUNCTION(3, "ANT_SEL3"),
> + MTK_FUNCTION(4, "CMFLASH"),
> + MTK_FUNCTION(5, "TDM_RX_BCK"),
> + MTK_FUNCTION(7, "DBG_MON_B[22]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(102, "CMMCLK"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 102),
> + MTK_FUNCTION(0, "GPIO102"),
> + MTK_FUNCTION(1, "CMMCLK"),
> + MTK_FUNCTION(3, "ANT_SEL4"),
> + MTK_FUNCTION(5, "TDM_RX_LRCK"),
> + MTK_FUNCTION(7, "DBG_MON_B[23]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(103, "CMPCLK"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 103),
> + MTK_FUNCTION(0, "GPIO103"),
> + MTK_FUNCTION(1, "CMPCLK"),
> + MTK_FUNCTION(2, "CMCSK"),
> + MTK_FUNCTION(3, "ANT_SEL5"),
> + MTK_FUNCTION(5, " TDM_RX_DI"),
> + MTK_FUNCTION(7, "DBG_MON_B[24]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(104, "MSDC1_CMD"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 104),
> + MTK_FUNCTION(0, "GPIO104"),
> + MTK_FUNCTION(1, "MSDC1_CMD"),
> + MTK_FUNCTION(4, "SQICS"),
> + MTK_FUNCTION(7, "DBG_MON_B[25]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(105, "MSDC1_CLK"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 105),
> + MTK_FUNCTION(0, "GPIO105"),
> + MTK_FUNCTION(1, "MSDC1_CLK"),
> + MTK_FUNCTION(4, "SQISO"),
> + MTK_FUNCTION(7, "DBG_MON_B[26]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(106, "MSDC1_DAT0"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 106),
> + MTK_FUNCTION(0, "GPIO106"),
> + MTK_FUNCTION(1, "MSDC1_DAT0"),
> + MTK_FUNCTION(4, "SQISI"),
> + MTK_FUNCTION(7, "DBG_MON_B[27]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(107, "MSDC1_DAT1"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 107),
> + MTK_FUNCTION(0, "GPIO107"),
> + MTK_FUNCTION(1, "MSDC1_DAT1"),
> + MTK_FUNCTION(4, "SQIWP"),
> + MTK_FUNCTION(7, "DBG_MON_B[28]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(108, "MSDC1_DAT2"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 108),
> + MTK_FUNCTION(0, "GPIO108"),
> + MTK_FUNCTION(1, "MSDC1_DAT2"),
> + MTK_FUNCTION(4, "SQIRST"),
> + MTK_FUNCTION(7, "DBG_MON_B[29]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(109, "MSDC1_DAT3"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 109),
> + MTK_FUNCTION(0, "GPIO109"),
> + MTK_FUNCTION(1, "MSDC1_DAT3"),
> + MTK_FUNCTION(4, "SQICK"), /* WIP */
> + MTK_FUNCTION(7, "DBG_MON_B[30]")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(110, "MSDC0_DAT7"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 110),
> + MTK_FUNCTION(0, "GPIO110"),
> + MTK_FUNCTION(1, "MSDC0_DAT7"),
> + MTK_FUNCTION(4, "NLD7")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(111, "MSDC0_DAT6"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 111),
> + MTK_FUNCTION(0, "GPIO111"),
> + MTK_FUNCTION(1, "MSDC0_DAT6"),
> + MTK_FUNCTION(4, "NLD6")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(112, "MSDC0_DAT5"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 112),
> + MTK_FUNCTION(0, "GPIO112"),
> + MTK_FUNCTION(1, "MSDC0_DAT5"),
> + MTK_FUNCTION(4, "NLD4")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(113, "MSDC0_DAT4"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 113),
> + MTK_FUNCTION(0, "GPIO113"),
> + MTK_FUNCTION(1, "MSDC0_DAT4"),
> + MTK_FUNCTION(4, "NLD3")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(114, "MSDC0_RSTB"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 114),
> + MTK_FUNCTION(0, "GPIO114"),
> + MTK_FUNCTION(1, "MSDC0_RSTB"),
> + MTK_FUNCTION(4, "NLD0")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(115, "MSDC0_CMD"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 115),
> + MTK_FUNCTION(0, "GPIO115"),
> + MTK_FUNCTION(1, "MSDC0_CMD"),
> + MTK_FUNCTION(4, "NALE")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(116, "MSDC0_CLK"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 116),
> + MTK_FUNCTION(0, "GPIO116"),
> + MTK_FUNCTION(1, "MSDC0_CLK"),
> + MTK_FUNCTION(4, "NWEB")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(117, "MSDC0_DAT3"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 117),
> + MTK_FUNCTION(0, "GPIO117"),
> + MTK_FUNCTION(1, "MSDC0_DAT3"),
> + MTK_FUNCTION(4, "NLD1")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(118, "MSDC0_DAT2"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 118),
> + MTK_FUNCTION(0, "GPIO118"),
> + MTK_FUNCTION(1, "MSDC0_DAT2"),
> + MTK_FUNCTION(4, "NLD5")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(119, "MSDC0_DAT1"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 119),
> + MTK_FUNCTION(0, "GPIO119"),
> + MTK_FUNCTION(1, "MSDC0_DAT1"),
> + MTK_FUNCTION(4, "NLD8")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(120, "MSDC0_DAT0"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 120),
> + MTK_FUNCTION(0, "GPIO120"),
> + MTK_FUNCTION(1, "MSDC0_DAT0"),
> + MTK_FUNCTION(4, "WATCHDOG"),
> + MTK_FUNCTION(5, "NLD2")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(121, "GPIO121"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 121),
> + MTK_FUNCTION(0, "GPIO121")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(122, "GPIO122"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 122),
> + MTK_FUNCTION(0, "GPIO122")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(123, "GPIO123"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 123),
> + MTK_FUNCTION(0, "GPIO123")
> + ),
> + MTK_PIN(
> + PINCTRL_PIN(124, "GPIO124"),
> + NULL, "mt8516",
> + MTK_EINT_FUNCTION(0, 124),
> + MTK_FUNCTION(0, "GPIO124")
> + ),
> +};
> +
> +#endif /* __PINCTRL_MTK_MT8516_H */
> --
> 2.20.1
>
^ permalink raw reply
* Re: [PATCH] serial: sh-sci: Fix HSCIF RX sampling point calculation
From: Ulrich Hecht @ 2019-04-01 15:05 UTC (permalink / raw)
To: Geert Uytterhoeven, Greg Kroah-Hartman, Jiri Slaby, Ulrich Hecht
Cc: Eugeniu Rosca, Dirk Behme, linux-serial, linux-kernel
In-Reply-To: <20190401112510.23145-1-geert+renesas@glider.be>
> On April 1, 2019 at 1:25 PM Geert Uytterhoeven <geert+renesas@glider.be> wrote:
>
>
> There are several issues with the formula used for calculating the
> deviation from the intended rate:
> 1. While min_err and last_stop are signed, srr and baud are unsigned.
> Hence the signed values are promoted to unsigned, which will lead
> to a bogus value of deviation if min_err is negative,
> 2. Srr is the register field value, which is one less than the actual
> sampling rate factor,
> 3. The divisions do not use rounding.
>
> Fix this by casting unsigned variables to int, adding one to srr, and
> using a single DIV_ROUND_CLOSEST().
>
> Fixes: 63ba1e00f178a448 ("serial: sh-sci: Support for HSCIF RX sampling point adjustment")
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Ulrich Hecht <uli+renesas@fpond.eu>
CU
Uli
^ permalink raw reply
* Re: [PATCH] serial: sh-sci: Fix HSCIF RX sampling point calculation
From: Mukesh Ojha @ 2019-04-01 12:12 UTC (permalink / raw)
To: Geert Uytterhoeven, Greg Kroah-Hartman, Jiri Slaby, Ulrich Hecht
Cc: Eugeniu Rosca, Dirk Behme, linux-serial, linux-kernel
In-Reply-To: <20190401112510.23145-1-geert+renesas@glider.be>
On 4/1/2019 4:55 PM, Geert Uytterhoeven wrote:
> There are several issues with the formula used for calculating the
> deviation from the intended rate:
> 1. While min_err and last_stop are signed, srr and baud are unsigned.
> Hence the signed values are promoted to unsigned, which will lead
> to a bogus value of deviation if min_err is negative,
> 2. Srr is the register field value, which is one less than the actual
> sampling rate factor,
> 3. The divisions do not use rounding.
>
> Fix this by casting unsigned variables to int, adding one to srr, and
> using a single DIV_ROUND_CLOSEST().
>
> Fixes: 63ba1e00f178a448 ("serial: sh-sci: Support for HSCIF RX sampling point adjustment")
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Mukesh Ojha <mojha@codeaurora.org>
Cheers,
-Mukesh
> ---
> Anyone with a good test setup for verifying this feature actually works
> as advertised?
> ---
> drivers/tty/serial/sh-sci.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
> index 2bdaeba5d527a6ce..8dea59edde34c224 100644
> --- a/drivers/tty/serial/sh-sci.c
> +++ b/drivers/tty/serial/sh-sci.c
> @@ -2522,7 +2522,9 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios,
> * center of the last stop bit in sampling clocks.
> */
> int last_stop = bits * 2 - 1;
> - int deviation = min_err * srr * last_stop / 2 / baud;
> + int deviation = DIV_ROUND_CLOSEST(min_err * last_stop *
> + (int)(srr + 1),
> + 2 * (int)baud);
>
> if (abs(deviation) >= 2) {
> /* At least two sampling clocks off at the
^ permalink raw reply
* [PATCH] serial: sh-sci: Fix HSCIF RX sampling point calculation
From: Geert Uytterhoeven @ 2019-04-01 11:25 UTC (permalink / raw)
To: Greg Kroah-Hartman, Jiri Slaby, Ulrich Hecht
Cc: Eugeniu Rosca, Dirk Behme, linux-serial, linux-kernel,
Geert Uytterhoeven
There are several issues with the formula used for calculating the
deviation from the intended rate:
1. While min_err and last_stop are signed, srr and baud are unsigned.
Hence the signed values are promoted to unsigned, which will lead
to a bogus value of deviation if min_err is negative,
2. Srr is the register field value, which is one less than the actual
sampling rate factor,
3. The divisions do not use rounding.
Fix this by casting unsigned variables to int, adding one to srr, and
using a single DIV_ROUND_CLOSEST().
Fixes: 63ba1e00f178a448 ("serial: sh-sci: Support for HSCIF RX sampling point adjustment")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
Anyone with a good test setup for verifying this feature actually works
as advertised?
---
drivers/tty/serial/sh-sci.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index 2bdaeba5d527a6ce..8dea59edde34c224 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -2522,7 +2522,9 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios,
* center of the last stop bit in sampling clocks.
*/
int last_stop = bits * 2 - 1;
- int deviation = min_err * srr * last_stop / 2 / baud;
+ int deviation = DIV_ROUND_CLOSEST(min_err * last_stop *
+ (int)(srr + 1),
+ 2 * (int)baud);
if (abs(deviation) >= 2) {
/* At least two sampling clocks off at the
--
2.17.1
^ permalink raw reply related
* Re: [GIT PULL] TTY/Serial fixes for 5.1-rc3
From: pr-tracker-bot @ 2019-03-30 18:50 UTC (permalink / raw)
To: Greg KH
Cc: Linus Torvalds, Jiri Slaby, Stephen Rothwell, Andrew Morton,
linux-kernel, linux-serial
In-Reply-To: <20190330090400.GA5598@kroah.com>
The pull request you sent on Sat, 30 Mar 2019 10:04:00 +0100:
> git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git tags/tty-5.1-rc3
has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/52afe190ff034f25546fb0a2cb7380dcb896d371
Thank you!
--
Deet-doot-dot, I am a bot.
https://korg.wiki.kernel.org/userdoc/prtracker
^ permalink raw reply
* [GIT PULL] TTY/Serial fixes for 5.1-rc3
From: Greg KH @ 2019-03-30 9:04 UTC (permalink / raw)
To: Linus Torvalds
Cc: Jiri Slaby, Stephen Rothwell, Andrew Morton, linux-kernel,
linux-serial
The following changes since commit 9e98c678c2d6ae3a17cb2de55d17f69dddaa231b:
Linux 5.1-rc1 (2019-03-17 14:22:26 -0700)
are available in the Git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git tags/tty-5.1-rc3
for you to fetch changes up to f4e68d58cf2b20a581759bbc7228052534652673:
tty: fix NULL pointer issue when tty_port ops is not set (2019-03-28 01:21:21 +0900)
----------------------------------------------------------------
TTY/Serial fixes for 5.1-rc3
Here are some small tty and serial driver fixes for 5.1-rc3.
Nothing major here, just a number of potential problems fixes for error
handling paths, as well as some other minor bugfixes for reported issues
with 5.1-rc1.
All of these have been in linux-next with no reported issues.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
----------------------------------------------------------------
Aditya Pakki (2):
serial: mvebu-uart: Fix to avoid a potential NULL pointer dereference
serial: max310x: Fix to avoid potential NULL pointer dereference
Erin Lo (1):
dt-bindings: serial: Add compatible for Mediatek MT8183
Fabien Dessenne (1):
tty: fix NULL pointer issue when tty_port ops is not set
Hoan Nguyen An (1):
serial: sh-sci: Fix setting SCSCR_TIE while transferring data
Kangjie Lu (2):
tty: atmel_serial: fix a potential NULL pointer dereference
tty: mxs-auart: fix a potential NULL pointer dereference
Mao Wenan (1):
sc16is7xx: missing unregister/delete driver on error in sc16is7xx_init()
Nathan Chancellor (1):
tty: serial: qcom_geni_serial: Initialize baud in qcom_geni_console_setup
Petr Štetiar (1):
serial: ar933x_uart: Fix build failure with disabled console
Razvan Stefanescu (2):
tty/serial: atmel: Add is_half_duplex helper
tty/serial: atmel: RS485 HD w/DMA: enable RX after TX is stopped
Wentao Wang (1):
Disable kgdboc failed by echo space to /sys/module/kgdboc/parameters/kgdboc
.../devicetree/bindings/serial/mtk-uart.txt | 1 +
drivers/tty/serial/ar933x_uart.c | 24 ++++------
drivers/tty/serial/atmel_serial.c | 52 +++++++++++++++-------
drivers/tty/serial/kgdboc.c | 4 +-
drivers/tty/serial/max310x.c | 2 +
drivers/tty/serial/mvebu-uart.c | 3 ++
drivers/tty/serial/mxs-auart.c | 4 ++
drivers/tty/serial/qcom_geni_serial.c | 2 +-
drivers/tty/serial/sc16is7xx.c | 12 ++++-
drivers/tty/serial/sh-sci.c | 12 +----
drivers/tty/tty_port.c | 10 ++---
11 files changed, 75 insertions(+), 51 deletions(-)
^ permalink raw reply
* [PATCH AUTOSEL 3.18 04/10] serial: uartps: console_setup() can't be placed to init section
From: Sasha Levin @ 2019-03-30 1:32 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Michal Simek, Greg Kroah-Hartman, Sasha Levin, linux-serial
In-Reply-To: <20190330013227.1365-1-sashal@kernel.org>
From: Michal Simek <michal.simek@xilinx.com>
[ Upstream commit 4bb1ce2350a598502b23088b169e16b43d4bc639 ]
When console device is rebinded, console_setup() is called again.
But marking it as __init means that function will be clear after boot is
complete. If console device is binded again console_setup() is not found
and error "Unable to handle kernel paging request at virtual address"
is reported.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/tty/serial/xilinx_uartps.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c
index df28ef14382b..892446cc28fa 100644
--- a/drivers/tty/serial/xilinx_uartps.c
+++ b/drivers/tty/serial/xilinx_uartps.c
@@ -1120,7 +1120,7 @@ static void cdns_uart_console_write(struct console *co, const char *s,
*
* Return: 0 on success, negative errno otherwise.
*/
-static int __init cdns_uart_console_setup(struct console *co, char *options)
+static int cdns_uart_console_setup(struct console *co, char *options)
{
struct uart_port *port = &cdns_uart_port[co->index];
int baud = 9600;
--
2.19.1
^ permalink raw reply related
* [PATCH AUTOSEL 4.4 05/16] serial: uartps: console_setup() can't be placed to init section
From: Sasha Levin @ 2019-03-30 1:31 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Michal Simek, Greg Kroah-Hartman, Sasha Levin, linux-serial
In-Reply-To: <20190330013200.1130-1-sashal@kernel.org>
From: Michal Simek <michal.simek@xilinx.com>
[ Upstream commit 4bb1ce2350a598502b23088b169e16b43d4bc639 ]
When console device is rebinded, console_setup() is called again.
But marking it as __init means that function will be clear after boot is
complete. If console device is binded again console_setup() is not found
and error "Unable to handle kernel paging request at virtual address"
is reported.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/tty/serial/xilinx_uartps.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c
index 4f2f4aca8d2e..06efcef1b495 100644
--- a/drivers/tty/serial/xilinx_uartps.c
+++ b/drivers/tty/serial/xilinx_uartps.c
@@ -1145,7 +1145,7 @@ static void cdns_uart_console_write(struct console *co, const char *s,
*
* Return: 0 on success, negative errno otherwise.
*/
-static int __init cdns_uart_console_setup(struct console *co, char *options)
+static int cdns_uart_console_setup(struct console *co, char *options)
{
struct uart_port *port = &cdns_uart_port[co->index];
int baud = 9600;
--
2.19.1
^ permalink raw reply related
* [PATCH AUTOSEL 4.9 06/21] serial: uartps: console_setup() can't be placed to init section
From: Sasha Levin @ 2019-03-30 1:30 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Michal Simek, Greg Kroah-Hartman, Sasha Levin, linux-serial
In-Reply-To: <20190330013112.784-1-sashal@kernel.org>
From: Michal Simek <michal.simek@xilinx.com>
[ Upstream commit 4bb1ce2350a598502b23088b169e16b43d4bc639 ]
When console device is rebinded, console_setup() is called again.
But marking it as __init means that function will be clear after boot is
complete. If console device is binded again console_setup() is not found
and error "Unable to handle kernel paging request at virtual address"
is reported.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/tty/serial/xilinx_uartps.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c
index ffb474c49f0f..eb61a07fcbbc 100644
--- a/drivers/tty/serial/xilinx_uartps.c
+++ b/drivers/tty/serial/xilinx_uartps.c
@@ -1261,7 +1261,7 @@ static void cdns_uart_console_write(struct console *co, const char *s,
*
* Return: 0 on success, negative errno otherwise.
*/
-static int __init cdns_uart_console_setup(struct console *co, char *options)
+static int cdns_uart_console_setup(struct console *co, char *options)
{
struct uart_port *port = &cdns_uart_port[co->index];
int baud = 9600;
--
2.19.1
^ permalink raw reply related
* [PATCH AUTOSEL 4.14 07/37] serial: uartps: console_setup() can't be placed to init section
From: Sasha Levin @ 2019-03-30 1:29 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Michal Simek, Greg Kroah-Hartman, Sasha Levin, linux-serial
In-Reply-To: <20190330013020.379-1-sashal@kernel.org>
From: Michal Simek <michal.simek@xilinx.com>
[ Upstream commit 4bb1ce2350a598502b23088b169e16b43d4bc639 ]
When console device is rebinded, console_setup() is called again.
But marking it as __init means that function will be clear after boot is
complete. If console device is binded again console_setup() is not found
and error "Unable to handle kernel paging request at virtual address"
is reported.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/tty/serial/xilinx_uartps.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c
index f438a2158006..b0da63737aa1 100644
--- a/drivers/tty/serial/xilinx_uartps.c
+++ b/drivers/tty/serial/xilinx_uartps.c
@@ -1270,7 +1270,7 @@ static void cdns_uart_console_write(struct console *co, const char *s,
*
* Return: 0 on success, negative errno otherwise.
*/
-static int __init cdns_uart_console_setup(struct console *co, char *options)
+static int cdns_uart_console_setup(struct console *co, char *options)
{
struct uart_port *port = &cdns_uart_port[co->index];
int baud = 9600;
--
2.19.1
^ permalink raw reply related
* [PATCH AUTOSEL 4.19 10/57] serial: uartps: console_setup() can't be placed to init section
From: Sasha Levin @ 2019-03-30 1:28 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Michal Simek, Greg Kroah-Hartman, Sasha Levin, linux-serial
In-Reply-To: <20190330012854.32212-1-sashal@kernel.org>
From: Michal Simek <michal.simek@xilinx.com>
[ Upstream commit 4bb1ce2350a598502b23088b169e16b43d4bc639 ]
When console device is rebinded, console_setup() is called again.
But marking it as __init means that function will be clear after boot is
complete. If console device is binded again console_setup() is not found
and error "Unable to handle kernel paging request at virtual address"
is reported.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/tty/serial/xilinx_uartps.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c
index 0e3627289047..77efa0a43fe7 100644
--- a/drivers/tty/serial/xilinx_uartps.c
+++ b/drivers/tty/serial/xilinx_uartps.c
@@ -1223,7 +1223,7 @@ static void cdns_uart_console_write(struct console *co, const char *s,
*
* Return: 0 on success, negative errno otherwise.
*/
-static int __init cdns_uart_console_setup(struct console *co, char *options)
+static int cdns_uart_console_setup(struct console *co, char *options)
{
struct uart_port *port = console_port;
--
2.19.1
^ permalink raw reply related
* Re: [PATCH v2] tty/serial: Add a serial port simulator
From: Corey Minyard @ 2019-03-29 22:13 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: minyard, linux-serial, linux-kernel
In-Reply-To: <20190327154439.GA18500@kroah.com>
On Thu, Mar 28, 2019 at 12:44:39AM +0900, Greg Kroah-Hartman wrote:
> On Tue, Mar 05, 2019 at 11:12:31AM -0600, minyard@acm.org wrote:
> > From: Corey Minyard <cminyard@mvista.com>
> >
> > This creates simulated serial ports, both as echo devices and pipe
> > devices. The driver reasonably approximates the serial port speed
> > and simulates some modem control lines. It allows error injection
> > and direct control of modem control lines.
>
> I like this, thanks for doing it!
Hopefully this is useful for others. I guess you could test the
kernel serial code with it, too.
>
> Minor nits below:
Deleted and made the changes I agreed with or understood. Other
comment below...
> > +
> > +#define circ_sbuf_space(buf) CIRC_SPACE((buf)->head, (buf)->tail, \
> > + SERIALSIM_XBUFSIZE)
> > +#define circ_sbuf_empty(buf) ((buf)->head == (buf)->tail)
> > +#define circ_sbuf_next(idx) (((idx) + 1) % SERIALSIM_XBUFSIZE)
>
> Don't we have a ring buffer (or 3) structure already? Did you create
> another one?
I'm using circ_buf, same as the main serial code, these are just helpers.
Is there something else I can use? The only ring buffer I saw that was
named that was for tracing, and that really wouldn't work.
>
> > +static void serialsim_thread_delay(void)
> > +{
> > +#ifdef CONFIG_HIGH_RES_TIMERS
> > + ktime_t timeout;
> > +
> > + timeout = ns_to_ktime(1000000000 / SERIALSIM_WAKES_PER_SEC);
> > + set_current_state(TASK_INTERRUPTIBLE);
> > + schedule_hrtimeout(&timeout, HRTIMER_MODE_REL);
> > +#else
> > + schedule_timeout_interruptible(1);
> > +#endif
> > +}
>
> Why do you care about hires timers here? Why not always just sleep to
> slow things down?
It makes things smoother, otherwise you get no data for a while then
big bursts of data at higher speeds.
>
> > +
> > +static int serialsim_thread(void *data)
> > +{
> > + struct serialsim_intf *intf = data;
> > + struct serialsim_intf *ointf = intf->ointf;
> > + struct uart_port *port = &intf->port;
> > + struct uart_port *oport = &ointf->port;
> > + struct circ_buf *tbuf = &intf->buf;
> > + unsigned int residual = 0;
> > +
> > + while (!kthread_should_stop()) {
>
> Aren't we trying to get away from creating new kthreads?
>
> Can you just use a workqueue entry?
The purpose of this is to wait short periods of time and copy characters
from one serial port to the other. I'm not sure how a work queue would
do that. I could drive it from timers, would that be better? I don't
need something that runs in thread context.
Either way, it's not a terribly efficient mechanism, but that wasn't
a big concern for this, I don't think.
>
> > +static unsigned int nr_echo_ports = 4;
> > +module_param(nr_echo_ports, uint, 0444);
> > +MODULE_PARM_DESC(nr_echo_ports,
> > + "The number of echo ports to create. Defaults to 4");
> > +
> > +static unsigned int nr_pipe_ports = 4;
> > +module_param(nr_pipe_ports, uint, 0444);
> > +MODULE_PARM_DESC(nr_pipe_ports,
> > + "The number of pipe ports to create. Defaults to 4");
>
> No way to just do this with configfs and not worry about module params?
I'll look. Module parameters seem a lot simpler, though. I could also
just make it not configurable.
>
> > +static char *gettok(char **s)
> > +{
> > + char *t = skip_spaces(*s);
> > + char *p = t;
> > +
> > + while (*p && !isspace(*p))
> > + p++;
> > + if (*p)
> > + *p++ = '\0';
> > + *s = p;
> > +
> > + return t;
> > +}
>
> We don't have this already in the tree?
There is strsep(), but there's no way to do isspace() on it. I don't
see a set of space characters anyplace.
>
> > +static bool tokeq(const char *t, const char *m)
> > +{
> > + return strcmp(t, m) == 0;
> > +}
>
> same here.
There is sysfs_streq(), but it's not quite the same. I didn't see
anything else.
>
> > +
> > +static unsigned int parse_modem_line(char op, unsigned int flag,
> > + unsigned int *mctrl)
> > +{
> > + if (op == '+')
> > + *mctrl |= flag;
> > + else
> > + *mctrl &= ~flag;
> > + return flag;
> > +}
> > +
> > +static void serialsim_ctrl_append(char **val, int *left, char *n, bool enabled)
> > +{
> > + int count;
> > +
> > + count = snprintf(*val, *left, " %c%s", enabled ? '+' : '-', n);
> > + *left -= count;
> > + *val += count;
> > +}
>
> sysfs files really should only be "one value per file", so this api is
> troubling :(
Yeah, it is. I wanted something that was easy for scripts to parse.
More on this below...
>
> This worries me, parsing sysfs files is ripe for problems. configfs
> might be better here.
Maybe so, but wouldn't you still have to do parsing?
I could separate these out into individual items (dtr, dsr, etc.). You
wouldn't be able to get an atomic view of the modem lines, though.
On the whole sysfs thing, I'm not currently using the sysfs interface
for my testing, but I thought I would use it from scripts. It would
still be better for scripts, but perhaps it's better to just pull the
whole sysfs part.
>
> > +
> > +static DEVICE_ATTR(ctrl, 0660, serialsim_ctrl_read, serialsim_ctrl_write);
>
> DEVICE_ATTR_RW()?
Doesn't take show or store functions.
> > +
> > +#define TIOCSERSREMNULLMODEM 0x54e4
> > +#define TIOCSERSREMMCTRL 0x54e5
> > +#define TIOCSERSREMERR 0x54e6
> > +#ifdef TCGETS2
> > +#define TIOCSERGREMTERMIOS _IOR('T', 0xe7, struct termios2)
> > +#else
> > +#define TIOCSERGREMTERMIOS _IOR('T', 0xe7, struct termios)
> > +#endif
> > +#define TIOCSERGREMNULLMODEM _IOR('T', 0xe8, int)
> > +#define TIOCSERGREMMCTRL _IOR('T', 0xe9, unsigned int)
> > +#define TIOCSERGREMERR _IOR('T', 0xea, unsigned int)
> > +#define TIOCSERGREMRS485 _IOR('T', 0xeb, struct serial_rs485)
>
> Wait, don't we have ioctls for these things in the tty layer already?
> WHy add new ones?
These are for getting and setting the remote end's modem control
lines. I'm not sure how I could do that with the same ioctls.
-corey
^ permalink raw reply
* Re: [PATCH v2] tty/serial: Add a serial port simulator
From: Grant Edwards @ 2019-03-29 18:24 UTC (permalink / raw)
To: linux-kernel; +Cc: linux-serial
In-Reply-To: <20190329165140.GD31733@minyard.net>
On 2019-03-29, Corey Minyard <minyard@acm.org> wrote:
> On Thu, Mar 28, 2019 at 12:39:12PM -0700, H. Peter Anvin wrote:
>
>> Dumb question: this is basically a pty on steroids. Wouldn't this be
>> better done by enhancing the pty devices?
I proposed doing that several years ago, and offered to start working
on it if there was a decent chance it would be accepted into the tree.
I got no response.
> I did look at that, but it would be pretty invasive to pty. There's
> no modem control stuff, none of the other special serial ioctls.
> And the locking in this driver is fairly strange because you have
> two serial ports looking at each other's data for modem control.
> But that might not be a big deal.
>
> Adding the speed simulation to ptys would also be really strange.
> That's not a deal-breaker, I suppose, but it's not much of a serial
> port simulation without it.
My goal wasn't really to simulate two serial ports with a null-mode
cable in-between, so the speed simluaiton wasn't on my list. my goal
was to provide a way to implement a serial port in userspace by
attaching an application to the master end of a pty.
The pty(7) man page states "The slave end of the pseudoterminal
provides an interface that behaves exactly like a classical terminal."
But, we all know that's a pretty big lie: the pty slave end implements
only a small subset of a "classical termial" device, and there are all
sorts of applications that expect to talk to a serial port which fail
miserably when connected to a pty.
--
Grant Edwards grant.b.edwards Yow! I had a lease on an
at OEDIPUS COMPLEX back in
gmail.com '81 ...
^ permalink raw reply
* Re: [PATCH v2] tty/serial: Add a serial port simulator
From: Corey Minyard @ 2019-03-29 16:51 UTC (permalink / raw)
To: H. Peter Anvin
Cc: Randy Dunlap, cminyard, Greg Kroah-Hartman, linux-serial,
linux-kernel
In-Reply-To: <447407be-0f49-f29d-6e81-bf4ed0a6e56b@zytor.com>
On Thu, Mar 28, 2019 at 12:39:12PM -0700, H. Peter Anvin wrote:
> Dumb question: this is basically a pty on steroids. Wouldn't this be
> better done by enhancing the pty devices?
I did look at that, but it would be pretty invasive to pty. There's
no modem control stuff, none of the other special serial ioctls. And
the locking in this driver is fairly strange because you have two
serial ports looking at each other's data for modem control. But
that might not be a big deal.
Adding the speed simulation to ptys would also be really strange.
That's not a deal-breaker, I suppose, but it's not much of a serial
port simulation without it.
-corey
^ permalink raw reply
* Re: [PATCH v2 4/9] serial: 8250: add support for rs485 RTS delays in microseconds
From: Ahmad Fatoum @ 2019-03-29 14:36 UTC (permalink / raw)
To: Martin Kepplinger, gregkh, robh+dt, mark.rutland, jslaby, corbet,
richard.genoud, nicolas.ferre, alexandre.belloni,
ludovic.desroches, mcoquelin.stm32, alexandre.torgue,
linux-serial, devicetree, linux-arm-kernel, linux-stm32
Cc: linux-kernel, kernel
In-Reply-To: <20190221171758.10322-4-martin.kepplinger@ginzinger.com>
On 21/2/19 18:17, Martin Kepplinger wrote:
> Read struct serial_rs485's flag SER_RS485_DELAY_IN_USEC and apply the delay
> accordingly.
>
> Signed-off-by: Martin Kepplinger <martin.kepplinger@ginzinger.com>
> ---
> drivers/tty/serial/8250/8250_omap.c | 13 +++++++++++--
> drivers/tty/serial/8250/8250_port.c | 25 +++++++++++++++++++++----
> 2 files changed, 32 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/tty/serial/8250/8250_omap.c b/drivers/tty/serial/8250/8250_omap.c
> index 0a8316632d75..cbce43ac60b1 100644
> --- a/drivers/tty/serial/8250/8250_omap.c
> +++ b/drivers/tty/serial/8250/8250_omap.c
> @@ -720,8 +720,17 @@ static int omap_8250_rs485_config(struct uart_port *port,
> struct uart_8250_port *up = up_to_u8250p(port);
>
> /* Clamp the delays to [0, 100ms] */
> - rs485->delay_rts_before_send = min(rs485->delay_rts_before_send, 100U);
> - rs485->delay_rts_after_send = min(rs485->delay_rts_after_send, 100U);
> + if (rs485->flags & SER_RS485_DELAY_IN_USEC) {
> + rs485->delay_rts_before_send = min(rs485->delay_rts_before_send,
> + 100000U);
> + rs485->delay_rts_after_send = min(rs485->delay_rts_after_send,
> + 100000U);
> + } else {
> + rs485->delay_rts_before_send = min(rs485->delay_rts_before_send,
> + 100U);
> + rs485->delay_rts_after_send = min(rs485->delay_rts_after_send,
> + 100U);
> + }
>
> port->rs485 = *rs485;
>
> diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c
> index d2f3310abe54..0cee4aa8323d 100644
> --- a/drivers/tty/serial/8250/8250_port.c
> +++ b/drivers/tty/serial/8250/8250_port.c
> @@ -1483,6 +1483,15 @@ static void start_hrtimer_ms(struct hrtimer *hrt, unsigned long msec)
> hrtimer_start(hrt, t, HRTIMER_MODE_REL);
> }
>
> +static void start_hrtimer_us(struct hrtimer *hrt, unsigned long usec)
> +{
> + long sec = usec / 1000000;
> + long nsec = (usec % 1000000) * 1000000000;
This 1e9 should be 1000 ("NSEC_PER_USEC").
While at it you might want to use USEC_PER_SEC (and MSEC_PER_SEC
above) to make the code more readable.
Cheers
Ahmad
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply
* Re: [PATCH v2] tty/serial: Add a serial port simulator
From: H. Peter Anvin @ 2019-03-28 19:39 UTC (permalink / raw)
To: Randy Dunlap, cminyard
Cc: minyard, Greg Kroah-Hartman, linux-serial, linux-kernel
In-Reply-To: <041e137e-0b9d-04f9-255d-b1f402b23c17@infradead.org>
Dumb question: this is basically a pty on steroids. Wouldn't this be
better done by enhancing the pty devices?
-0hpa
^ permalink raw reply
* Re: [PATCH 23/24] arm64: dts: mediatek: add dtsi for MT8516
From: Rob Herring @ 2019-03-28 19:22 UTC (permalink / raw)
To: Fabien Parent
Cc: Matthias Brugger, Mark Rutland, Sean Wang, Ryder Lee,
Hsin-Hsiung Wang, Wenzhen Yu, Chaotian Jing, Yong Mao, jjian.zhou,
devicetree, linux-kernel@vger.kernel.org, Linux I2C,
moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
moderated list:ARM/Mediatek SoC support, linux-mmc,
open list:GPIO SUBSYSTEM, SE
In-Reply-To: <20190323211612.860-24-fparent@baylibre.com>
On Sat, Mar 23, 2019 at 4:17 PM Fabien Parent <fparent@baylibre.com> wrote:
>
> The MT8516 SoC provides the following peripherals: GPIO, UART, USB2,
> SPI, eMMC, SDIO, NAND, Flash, ADC, I2C, PWM, Timers, IR, Ethernet, and
> Audio (I2S, SPDIF, TDM).
>
> This commit is adding the basic dtsi file with the support of the
> following IOs: GPIO, UART, SPI, eMMC, I2C, Timers.
>
> Signed-off-by: Fabien Parent <fparent@baylibre.com>
> ---
> arch/arm64/boot/dts/mediatek/mt8516-pinfunc.h | 663 ++++++++++++++++++
> arch/arm64/boot/dts/mediatek/mt8516.dtsi | 409 +++++++++++
> 2 files changed, 1072 insertions(+)
> create mode 100644 arch/arm64/boot/dts/mediatek/mt8516-pinfunc.h
> create mode 100644 arch/arm64/boot/dts/mediatek/mt8516.dtsi
Reviewed-by: Rob Herring <robh@kernel.org>
^ permalink raw reply
* Re: [PATCH 07/24] arm64: dts: mt6392: Add PMIC mt6392 dtsi
From: Rob Herring @ 2019-03-28 19:18 UTC (permalink / raw)
To: Fabien Parent
Cc: Matthias Brugger, Mark Rutland, Sean Wang, Ryder Lee,
Hsin-Hsiung Wang, Wenzhen Yu, Chaotian Jing, Yong Mao, jjian.zhou,
devicetree, linux-kernel@vger.kernel.org, Linux I2C,
moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
moderated list:ARM/Mediatek SoC support, linux-mmc,
open list:GPIO SUBSYSTEM, SE
In-Reply-To: <20190323211612.860-8-fparent@baylibre.com>
On Sat, Mar 23, 2019 at 4:16 PM Fabien Parent <fparent@baylibre.com> wrote:
>
> Add the regulator nodes for the MT6392 PMIC.
>
> Signed-off-by: Fabien Parent <fparent@baylibre.com>
> ---
> arch/arm64/boot/dts/mediatek/mt6392.dtsi | 208 +++++++++++++++++++++++
> 1 file changed, 208 insertions(+)
> create mode 100644 arch/arm64/boot/dts/mediatek/mt6392.dtsi
>
> diff --git a/arch/arm64/boot/dts/mediatek/mt6392.dtsi b/arch/arm64/boot/dts/mediatek/mt6392.dtsi
> new file mode 100644
> index 000000000000..e33a45fd52af
> --- /dev/null
> +++ b/arch/arm64/boot/dts/mediatek/mt6392.dtsi
> @@ -0,0 +1,208 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Copyright (c) 2019 MediaTek Inc.
> + */
> +
> +&pwrap {
> + pmic: mt6392 {
Same comments in binding example apply here.
> + compatible = "mediatek,mt6392", "mediatek,mt6323";
> + mediatek,system-power-controller;
> +
> + mt6392_regulator: mt6392_regulator {
> + compatible = "mediatek,mt6392-regulator";
> +
> + mt6392_vproc_reg: buck_vproc {
> + regulator-name = "buck_vproc";
> + regulator-min-microvolt = < 700000>;
> + regulator-max-microvolt = <1350000>;
> + regulator-ramp-delay = <12500>;
> + regulator-always-on;
> + regulator-boot-on;
> + };
> +
> + mt6392_vsys_reg: buck_vsys {
> + regulator-name = "buck_vsys";
> + regulator-min-microvolt = <1400000>;
> + regulator-max-microvolt = <2987500>;
> + regulator-ramp-delay = <25000>;
> + regulator-always-on;
> + regulator-boot-on;
> + };
> +
> + mt6392_vcore_reg: buck_vcore {
> + regulator-name = "buck_vcore";
> + regulator-min-microvolt = < 700000>;
> + regulator-max-microvolt = <1350000>;
> + regulator-ramp-delay = <12500>;
> + regulator-always-on;
> + regulator-boot-on;
> + };
> +
> + mt6392_vxo22_reg: ldo_vxo22 {
> + regulator-name = "ldo_vxo22";
> + regulator-min-microvolt = <2200000>;
> + regulator-max-microvolt = <2200000>;
> + regulator-enable-ramp-delay = <110>;
> + regulator-always-on;
> + regulator-boot-on;
> + };
> +
> + mt6392_vaud22_reg: ldo_vaud22 {
> + regulator-name = "ldo_vaud22";
> + regulator-min-microvolt = <1800000>;
> + regulator-max-microvolt = <2200000>;
> + regulator-enable-ramp-delay = <264>;
> + regulator-always-on;
> + regulator-boot-on;
> + };
> +
> + mt6392_vcama_reg: ldo_vcama {
> + regulator-name = "ldo_vcama";
> + regulator-min-microvolt = <2800000>;
> + regulator-max-microvolt = <2800000>;
> + regulator-enable-ramp-delay = <264>;
> + };
> +
> + mt6392_vaud28_reg: ldo_vaud28 {
> + regulator-name = "ldo_vaud28";
> + regulator-min-microvolt = <2800000>;
> + regulator-max-microvolt = <2800000>;
> + regulator-enable-ramp-delay = <264>;
> + regulator-always-on;
> + regulator-boot-on;
> + };
> +
> + mt6392_vadc18_reg: ldo_vadc18 {
> + regulator-name = "ldo_vadc18";
> + regulator-min-microvolt = <1800000>;
> + regulator-max-microvolt = <1800000>;
> + regulator-enable-ramp-delay = <264>;
> + regulator-always-on;
> + regulator-boot-on;
> + };
> +
> + mt6392_vcn35_reg: ldo_vcn35 {
> + regulator-name = "ldo_vcn35";
> + regulator-min-microvolt = <3300000>;
> + regulator-max-microvolt = <3600000>;
> + regulator-enable-ramp-delay = <264>;
> + };
> +
> + mt6392_vio28_reg: ldo_vio28 {
> + regulator-name = "ldo_vio28";
> + regulator-min-microvolt = <2800000>;
> + regulator-max-microvolt = <2800000>;
> + regulator-enable-ramp-delay = <264>;
> + regulator-always-on;
> + regulator-boot-on;
> + };
> +
> + mt6392_vusb_reg: ldo_vusb {
> + regulator-name = "ldo_vusb";
> + regulator-min-microvolt = <3300000>;
> + regulator-max-microvolt = <3300000>;
> + regulator-enable-ramp-delay = <264>;
> + regulator-always-on;
> + regulator-boot-on;
> + };
> +
> + mt6392_vmc_reg: ldo_vmc {
> + regulator-name = "ldo_vmc";
> + regulator-min-microvolt = <1800000>;
> + regulator-max-microvolt = <3300000>;
> + regulator-enable-ramp-delay = <264>;
> + regulator-boot-on;
> + };
> +
> + mt6392_vmch_reg: ldo_vmch {
> + regulator-name = "ldo_vmch";
> + regulator-min-microvolt = <3000000>;
> + regulator-max-microvolt = <3300000>;
> + regulator-enable-ramp-delay = <264>;
> + regulator-boot-on;
> + };
> +
> + mt6392_vemc3v3_reg: ldo_vemc3v3 {
> + regulator-name = "ldo_vemc3v3";
> + regulator-min-microvolt = <3000000>;
> + regulator-max-microvolt = <3300000>;
> + regulator-enable-ramp-delay = <264>;
> + regulator-boot-on;
> + };
> +
> + mt6392_vgp1_reg: ldo_vgp1 {
> + regulator-name = "ldo_vgp1";
> + regulator-min-microvolt = <1200000>;
> + regulator-max-microvolt = <3300000>;
> + regulator-enable-ramp-delay = <264>;
> + };
> +
> + mt6392_vgp2_reg: ldo_vgp2 {
> + regulator-name = "ldo_vgp2";
> + regulator-min-microvolt = <1200000>;
> + regulator-max-microvolt = <3300000>;
> + regulator-enable-ramp-delay = <264>;
> + };
> +
> + mt6392_vcn18_reg: ldo_vcn18 {
> + regulator-name = "ldo_vcn18";
> + regulator-min-microvolt = <1800000>;
> + regulator-max-microvolt = <1800000>;
> + regulator-enable-ramp-delay = <264>;
> + };
> +
> + mt6392_vcamaf_reg: ldo_vcamaf {
> + regulator-name = "ldo_vcamaf";
> + regulator-min-microvolt = <1200000>;
> + regulator-max-microvolt = <3300000>;
> + regulator-enable-ramp-delay = <264>;
> + };
> +
> + mt6392_vm_reg: ldo_vm {
> + regulator-name = "ldo_vm";
> + regulator-min-microvolt = <1240000>;
> + regulator-max-microvolt = <1390000>;
> + regulator-enable-ramp-delay = <264>;
> + regulator-always-on;
> + regulator-boot-on;
> + };
> +
> + mt6392_vio18_reg: ldo_vio18 {
> + regulator-name = "ldo_vio18";
> + regulator-min-microvolt = <1800000>;
> + regulator-max-microvolt = <1800000>;
> + regulator-enable-ramp-delay = <264>;
> + regulator-always-on;
> + regulator-boot-on;
> + };
> +
> + mt6392_vcamd_reg: ldo_vcamd {
> + regulator-name = "ldo_vcamd";
> + regulator-min-microvolt = <1200000>;
> + regulator-max-microvolt = <1800000>;
> + regulator-enable-ramp-delay = <264>;
> + };
> +
> + mt6392_vcamio_reg: ldo_vcamio {
> + regulator-name = "ldo_vcamio";
> + regulator-min-microvolt = <1800000>;
> + regulator-max-microvolt = <1800000>;
> + regulator-enable-ramp-delay = <264>;
> + };
> +
> + mt6392_vm25_reg: ldo_vm25 {
> + regulator-name = "ldo_vm25";
> + regulator-min-microvolt = <2500000>;
> + regulator-max-microvolt = <2500000>;
> + regulator-enable-ramp-delay = <264>;
> + };
> +
> + mt6392_vefuse_reg: ldo_vefuse {
> + regulator-name = "ldo_vefuse";
> + regulator-min-microvolt = <1800000>;
> + regulator-max-microvolt = <2000000>;
> + regulator-enable-ramp-delay = <264>;
> + };
> + };
> + };
> +};
> --
> 2.20.1
>
^ permalink raw reply
* Re: [PATCH 01/24] dt-bindings: regulator: add support for MT6392
From: Rob Herring @ 2019-03-28 19:17 UTC (permalink / raw)
To: Fabien Parent
Cc: Matthias Brugger, Mark Rutland, Sean Wang, Ryder Lee,
Hsin-Hsiung Wang, Wenzhen Yu, Chaotian Jing, Yong Mao, jjian.zhou,
devicetree, linux-kernel@vger.kernel.org, Linux I2C,
moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
moderated list:ARM/Mediatek SoC support, linux-mmc,
open list:GPIO SUBSYSTEM, SE
In-Reply-To: <20190323211612.860-2-fparent@baylibre.com>
On Sat, Mar 23, 2019 at 4:16 PM Fabien Parent <fparent@baylibre.com> wrote:
>
> Add binding documentation of the regulator for MT6392 SoCs.
>
> Signed-off-by: Fabien Parent <fparent@baylibre.com>
> ---
> .../bindings/regulator/mt6392-regulator.txt | 220 ++++++++++++++++++
> 1 file changed, 220 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/regulator/mt6392-regulator.txt
>
> diff --git a/Documentation/devicetree/bindings/regulator/mt6392-regulator.txt b/Documentation/devicetree/bindings/regulator/mt6392-regulator.txt
> new file mode 100644
> index 000000000000..edf207c838dc
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/regulator/mt6392-regulator.txt
> @@ -0,0 +1,220 @@
> +Mediatek MT6392 Regulator
> +
> +Required properties:
> +- compatible: "mediatek,mt6392-regulator"
> +- mt6392regulator: List of regulators provided by this controller. It is named
> + according to its regulator type, buck_<name> and ldo_<name>.
> + The definition for each of these nodes is defined using the standard binding
> + for regulators at Documentation/devicetree/bindings/regulator/regulator.txt.
> +
> +The valid names for regulators are::
> +BUCK:
> + buck_vproc, buck_vsys, buck_vcore
> +LDO:
> + ldo_vxo22, ldo_vaud22, ldo_vcama, ldo_vaud28, ldo_vadc18, ldo_vcn35,
> + ldo_vio28. ldo_vusb, ldo_vmc, ldo_vmch, ldo_vemc3v3, ldo_vgp1, ldo_vgp2,
> + ldo_vcn18, ldo_vcamaf, ldo_vm, ldo_vio18, ldo_vcamd, ldo_vcamio, ldo_vm25,
> + ldo_vefuse
> +
> +Example:
> + pmic: mt6392 {
pmic {
> + compatible = "mediatek,mt6392", "mediatek,mt6323";
> + mediatek,system-power-controller;
> +
> + mt6392_regulator: mt6392_regulator {
regulators {
> + compatible = "mediatek,mt6392-regulator";
> +
> + mt6392_vproc_reg: buck_vproc {
buck-vproc {
And similar for the rest.
> + regulator-name = "buck_vproc";
> + regulator-min-microvolt = < 700000>;
> + regulator-max-microvolt = <1350000>;
> + regulator-ramp-delay = <12500>;
> + regulator-always-on;
> + regulator-boot-on;
> + };
> +
> + mt6392_vsys_reg: buck_vsys {
> + regulator-name = "buck_vsys";
> + regulator-min-microvolt = <1400000>;
> + regulator-max-microvolt = <2987500>;
> + regulator-ramp-delay = <25000>;
> + regulator-always-on;
> + regulator-boot-on;
> + };
> +
> + mt6392_vcore_reg: buck_vcore {
> + regulator-name = "buck_vcore";
> + regulator-min-microvolt = < 700000>;
> + regulator-max-microvolt = <1350000>;
> + regulator-ramp-delay = <12500>;
> + regulator-always-on;
> + regulator-boot-on;
> + };
> +
> + mt6392_vxo22_reg: ldo_vxo22 {
> + regulator-name = "ldo_vxo22";
> + regulator-min-microvolt = <2200000>;
> + regulator-max-microvolt = <2200000>;
> + regulator-enable-ramp-delay = <110>;
> + regulator-always-on;
> + regulator-boot-on;
> + };
> +
> + mt6392_vaud22_reg: ldo_vaud22 {
> + regulator-name = "ldo_vaud22";
> + regulator-min-microvolt = <1800000>;
> + regulator-max-microvolt = <2200000>;
> + regulator-enable-ramp-delay = <264>;
> + regulator-always-on;
> + regulator-boot-on;
> + };
> +
> + mt6392_vcama_reg: ldo_vcama {
> + regulator-name = "ldo_vcama";
> + regulator-min-microvolt = <2800000>;
> + regulator-max-microvolt = <2800000>;
> + regulator-enable-ramp-delay = <264>;
> + };
> +
> + mt6392_vaud28_reg: ldo_vaud28 {
> + regulator-name = "ldo_vaud28";
> + regulator-min-microvolt = <2800000>;
> + regulator-max-microvolt = <2800000>;
> + regulator-enable-ramp-delay = <264>;
> + regulator-always-on;
> + regulator-boot-on;
> + };
> +
> + mt6392_vadc18_reg: ldo_vadc18 {
> + regulator-name = "ldo_vadc18";
> + regulator-min-microvolt = <1800000>;
> + regulator-max-microvolt = <1800000>;
> + regulator-enable-ramp-delay = <264>;
> + regulator-always-on;
> + regulator-boot-on;
> + };
> +
> + mt6392_vcn35_reg: ldo_vcn35 {
> + regulator-name = "ldo_vcn35";
> + regulator-min-microvolt = <3300000>;
> + regulator-max-microvolt = <3600000>;
> + regulator-enable-ramp-delay = <264>;
> + };
> +
> + mt6392_vio28_reg: ldo_vio28 {
> + regulator-name = "ldo_vio28";
> + regulator-min-microvolt = <2800000>;
> + regulator-max-microvolt = <2800000>;
> + regulator-enable-ramp-delay = <264>;
> + regulator-always-on;
> + regulator-boot-on;
> + };
> +
> + mt6392_vusb_reg: ldo_vusb {
> + regulator-name = "ldo_vusb";
> + regulator-min-microvolt = <3300000>;
> + regulator-max-microvolt = <3300000>;
> + regulator-enable-ramp-delay = <264>;
> + regulator-always-on;
> + regulator-boot-on;
> + };
> +
> + mt6392_vmc_reg: ldo_vmc {
> + regulator-name = "ldo_vmc";
> + regulator-min-microvolt = <1800000>;
> + regulator-max-microvolt = <3300000>;
> + regulator-enable-ramp-delay = <264>;
> + regulator-boot-on;
> + };
> +
> + mt6392_vmch_reg: ldo_vmch {
> + regulator-name = "ldo_vmch";
> + regulator-min-microvolt = <3000000>;
> + regulator-max-microvolt = <3300000>;
> + regulator-enable-ramp-delay = <264>;
> + regulator-boot-on;
> + };
> +
> + mt6392_vemc3v3_reg: ldo_vemc3v3 {
> + regulator-name = "ldo_vemc3v3";
> + regulator-min-microvolt = <3000000>;
> + regulator-max-microvolt = <3300000>;
> + regulator-enable-ramp-delay = <264>;
> + regulator-boot-on;
> + };
> +
> + mt6392_vgp1_reg: ldo_vgp1 {
> + regulator-name = "ldo_vgp1";
> + regulator-min-microvolt = <1200000>;
> + regulator-max-microvolt = <3300000>;
> + regulator-enable-ramp-delay = <264>;
> + };
> +
> + mt6392_vgp2_reg: ldo_vgp2 {
> + regulator-name = "ldo_vgp2";
> + regulator-min-microvolt = <1200000>;
> + regulator-max-microvolt = <3300000>;
> + regulator-enable-ramp-delay = <264>;
> + };
> +
> + mt6392_vcn18_reg: ldo_vcn18 {
> + regulator-name = "ldo_vcn18";
> + regulator-min-microvolt = <1800000>;
> + regulator-max-microvolt = <1800000>;
> + regulator-enable-ramp-delay = <264>;
> + };
> +
> + mt6392_vcamaf_reg: ldo_vcamaf {
> + regulator-name = "ldo_vcamaf";
> + regulator-min-microvolt = <1200000>;
> + regulator-max-microvolt = <3300000>;
> + regulator-enable-ramp-delay = <264>;
> + };
> +
> + mt6392_vm_reg: ldo_vm {
> + regulator-name = "ldo_vm";
> + regulator-min-microvolt = <1240000>;
> + regulator-max-microvolt = <1390000>;
> + regulator-enable-ramp-delay = <264>;
> + regulator-always-on;
> + regulator-boot-on;
> + };
> +
> + mt6392_vio18_reg: ldo_vio18 {
> + regulator-name = "ldo_vio18";
> + regulator-min-microvolt = <1800000>;
> + regulator-max-microvolt = <1800000>;
> + regulator-enable-ramp-delay = <264>;
> + regulator-always-on;
> + regulator-boot-on;
> + };
> +
> + mt6392_vcamd_reg: ldo_vcamd {
> + regulator-name = "ldo_vcamd";
> + regulator-min-microvolt = <1200000>;
> + regulator-max-microvolt = <1800000>;
> + regulator-enable-ramp-delay = <264>;
> + };
> +
> + mt6392_vcamio_reg: ldo_vcamio {
> + regulator-name = "ldo_vcamio";
> + regulator-min-microvolt = <1800000>;
> + regulator-max-microvolt = <1800000>;
> + regulator-enable-ramp-delay = <264>;
> + };
> +
> + mt6392_vm25_reg: ldo_vm25 {
> + regulator-name = "ldo_vm25";
> + regulator-min-microvolt = <2500000>;
> + regulator-max-microvolt = <2500000>;
> + regulator-enable-ramp-delay = <264>;
> + };
> +
> + mt6392_vefuse_reg: ldo_vefuse {
> + regulator-name = "ldo_vefuse";
> + regulator-min-microvolt = <1800000>;
> + regulator-max-microvolt = <2000000>;
> + regulator-enable-ramp-delay = <264>;
> + };
> + };
> + };
> --
> 2.20.1
>
^ permalink raw reply
* Re: [PATCH 17/24] dt-bindings: wdog: mtk-wdt: add support for MT851
From: Rob Herring @ 2019-03-28 19:13 UTC (permalink / raw)
To: Fabien Parent
Cc: Matthias Brugger, Mark Rutland, Sean Wang, Ryder Lee,
Hsin-Hsiung Wang, Wenzhen Yu, Chaotian Jing, Yong Mao, jjian.zhou,
devicetree, linux-kernel@vger.kernel.org, Linux I2C,
moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE,
moderated list:ARM/Mediatek SoC support, linux-mmc,
open list:GPIO SUBSYSTEM, SE
In-Reply-To: <20190323211612.860-18-fparent@baylibre.com>
On Sat, Mar 23, 2019 at 4:17 PM Fabien Parent <fparent@baylibre.com> wrote:
>
> Add binding documentation of mtk-wdt for MT8516 SoC.
>
> Signed-off-by: Fabien Parent <fparent@baylibre.com>
> ---
> Documentation/devicetree/bindings/watchdog/mtk-wdt.txt | 1 +
> 1 file changed, 1 insertion(+)
Acked-by: Rob Herring <robh@kernel.org>
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox