mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-22 23:12:32 +00:00
9dfc2b3ca4
MediaTek published their current U-Boot patchset on github: https://github.com/mtk-openwrt/u-boot/commits/mtksoc Import the platform patches from there (`00-mtk-*.patch`), arrange, them nicely, drop no longer needed local patches and rebase on top of U-Boot 2021.04-rc3. Tested and works well on Linksys E8450 (snand-1ddr) as well as Bananapi BPi-R64 (sdmmc-2ddr, emmc-2ddr). Signed-off-by: Daniel Golle <daniel@makrotopia.org>
44 lines
1.4 KiB
Diff
44 lines
1.4 KiB
Diff
From ca73da39ff0c9f599f75d7ccac0196030aa946b9 Mon Sep 17 00:00:00 2001
|
|
From: Sam Shih <sam.shih@mediatek.com>
|
|
Date: Thu, 17 Dec 2020 19:32:48 +0800
|
|
Subject: [PATCH 04/21] pinctrl: mediatek: add get_pin_muxing ops for mediatek
|
|
pinctrl
|
|
|
|
This patch add get_pin_muxing support for mediatek pinctrl drivers
|
|
|
|
Signed-off-by: Sam Shih <sam.shih@mediatek.com>
|
|
---
|
|
drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 14 ++++++++++++++
|
|
1 file changed, 14 insertions(+)
|
|
|
|
--- a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
|
|
+++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
|
|
@@ -232,6 +232,19 @@ static int mtk_get_pins_count(struct ude
|
|
return priv->soc->npins;
|
|
}
|
|
|
|
+static int mtk_get_pin_muxing(struct udevice *dev,
|
|
+ unsigned int selector,
|
|
+ char *buf, int size)
|
|
+{
|
|
+ int val, err;
|
|
+ err = mtk_hw_get_value(dev, selector, PINCTRL_PIN_REG_MODE, &val);
|
|
+ if (err)
|
|
+ return err;
|
|
+
|
|
+ snprintf(buf, size, "Aux Func.%d", val);
|
|
+ return 0;
|
|
+}
|
|
+
|
|
static const char *mtk_get_group_name(struct udevice *dev,
|
|
unsigned int selector)
|
|
{
|
|
@@ -512,6 +525,7 @@ static int mtk_pinconf_group_set(struct
|
|
const struct pinctrl_ops mtk_pinctrl_ops = {
|
|
.get_pins_count = mtk_get_pins_count,
|
|
.get_pin_name = mtk_get_pin_name,
|
|
+ .get_pin_muxing = mtk_get_pin_muxing,
|
|
.get_groups_count = mtk_get_groups_count,
|
|
.get_group_name = mtk_get_group_name,
|
|
.get_functions_count = mtk_get_functions_count,
|