diff mbox series

[1/2] pinctrl: mediatek: fix pull_type data for MT7981

Message ID 7bcc8ead25dbfabc7f5a85d066224a926fbb4941.1692327317.git.daniel@makrotopia.org (mailing list archive)
State New, archived
Headers show
Series [1/2] pinctrl: mediatek: fix pull_type data for MT7981 | expand

Commit Message

Daniel Golle Aug. 18, 2023, 3:02 a.m. UTC
MediaTek has released pull_type data for MT7981 in their SDK.
Use it and set functions to configure pin bias.

Fixes: 6c83b2d94fcc ("pinctrl: add mt7981 pinctrl driver")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
---
 drivers/pinctrl/mediatek/pinctrl-mt7981.c | 44 +++++++----------------
 1 file changed, 13 insertions(+), 31 deletions(-)

Comments

Linus Walleij Aug. 21, 2023, 10:40 a.m. UTC | #1
On Fri, Aug 18, 2023 at 5:02 AM Daniel Golle <daniel@makrotopia.org> wrote:

> MediaTek has released pull_type data for MT7981 in their SDK.
> Use it and set functions to configure pin bias.
>
> Fixes: 6c83b2d94fcc ("pinctrl: add mt7981 pinctrl driver")
> Signed-off-by: Daniel Golle <daniel@makrotopia.org>

This looks pretty urgent but I applied it for v6.6 (non-urgent)
for now so we get some testing in linux-next.

Can some maintainer step in and ACK this and indicate if we
should even put it into fixes?

Yours,
Linus Walleij
Sam Shih (史碩三) Aug. 21, 2023, 2:18 p.m. UTC | #2
On Mon, 2023-08-21 at 12:40 +0200, Linus Walleij wrote:
>  	 
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
>  On Fri, Aug 18, 2023 at 5:02 AM Daniel Golle <daniel@makrotopia.org>
> wrote:
> 
> > MediaTek has released pull_type data for MT7981 in their SDK.
> > Use it and set functions to configure pin bias.
> >
> > Fixes: 6c83b2d94fcc ("pinctrl: add mt7981 pinctrl driver")
> > Signed-off-by: Daniel Golle <daniel@makrotopia.org>
> 
> This looks pretty urgent but I applied it for v6.6 (non-urgent)
> for now so we get some testing in linux-next.
> 
The MediaTek MT7981 SoC only has pin0 to pin56 which defined in
'mt7981_pins', This patch removes the non-existent pin57 to pin100 and
fixes the pull type for pins 40 through 56.

The driver can still work due to the pin numbers of MT7981 is defined
by ARRAY_SIZE(mt7981_pins), and the default hardware configuration for
pins 40 through 56 can work correctly without advanced adjustments,
However, without this patch, attempts to use pinconf to configure pins
40 through 56 result in a "-EINVAL" error.


Acked-by: Sam Shih <sam.shih@mediatek.com>


Best Regards,
Sam
diff mbox series

Patch

diff --git a/drivers/pinctrl/mediatek/pinctrl-mt7981.c b/drivers/pinctrl/mediatek/pinctrl-mt7981.c
index 18abc57800111..0fd2c0c451f95 100644
--- a/drivers/pinctrl/mediatek/pinctrl-mt7981.c
+++ b/drivers/pinctrl/mediatek/pinctrl-mt7981.c
@@ -457,37 +457,15 @@  static const unsigned int mt7981_pull_type[] = {
 	MTK_PULL_PUPD_R1R0_TYPE,/*34*/ MTK_PULL_PUPD_R1R0_TYPE,/*35*/
 	MTK_PULL_PUPD_R1R0_TYPE,/*36*/ MTK_PULL_PUPD_R1R0_TYPE,/*37*/
 	MTK_PULL_PUPD_R1R0_TYPE,/*38*/ MTK_PULL_PUPD_R1R0_TYPE,/*39*/
-	MTK_PULL_PUPD_R1R0_TYPE,/*40*/ MTK_PULL_PUPD_R1R0_TYPE,/*41*/
-	MTK_PULL_PUPD_R1R0_TYPE,/*42*/ MTK_PULL_PUPD_R1R0_TYPE,/*43*/
-	MTK_PULL_PUPD_R1R0_TYPE,/*44*/ MTK_PULL_PUPD_R1R0_TYPE,/*45*/
-	MTK_PULL_PUPD_R1R0_TYPE,/*46*/ MTK_PULL_PUPD_R1R0_TYPE,/*47*/
-	MTK_PULL_PUPD_R1R0_TYPE,/*48*/ MTK_PULL_PUPD_R1R0_TYPE,/*49*/
-	MTK_PULL_PUPD_R1R0_TYPE,/*50*/ MTK_PULL_PUPD_R1R0_TYPE,/*51*/
-	MTK_PULL_PUPD_R1R0_TYPE,/*52*/ MTK_PULL_PUPD_R1R0_TYPE,/*53*/
-	MTK_PULL_PUPD_R1R0_TYPE,/*54*/ M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L_PU_PD_TYPE,/*92*/ MTK_PULL_PU_PD_TYPE,/*93*/
-	MTK_PULL_PU_PD_TYPE,/*94*/ MTK_PULL_PU_PD_TYPE,/*95*/
-	MTK_PULL_PU_PD_TYPE,/*96*/ MTK_PULL_PU_PD_TYPE,/*97*/
-	MTK_PULL_PU_PD_TYPE,/*98*/ MTK_PULL_PU_PD_TYPE,/*99*/
-	MTK_PULL_PU_PD_TYPE,/*100*/
+	MTK_PULL_PU_PD_TYPE,/*40*/ MTK_PULL_PU_PD_TYPE,/*41*/
+	MTK_PULL_PU_PD_TYPE,/*42*/ MTK_PULL_PU_PD_TYPE,/*43*/
+	MTK_PULL_PU_PD_TYPE,/*44*/ MTK_PULL_PU_PD_TYPE,/*45*/
+	MTK_PULL_PU_PD_TYPE,/*46*/ MTK_PULL_PU_PD_TYPE,/*47*/
+	MTK_PULL_PU_PD_TYPE,/*48*/ MTK_PULL_PU_PD_TYPE,/*49*/
+	MTK_PULL_PU_PD_TYPE,/*50*/ MTK_PULL_PU_PD_TYPE,/*51*/
+	MTK_PULL_PU_PD_TYPE,/*52*/ MTK_PULL_PU_PD_TYPE,/*53*/
+	MTK_PULL_PU_PD_TYPE,/*54*/ MTK_PULL_PU_PD_TYPE,/*55*/
+	MTK_PULL_PU_PD_TYPE,/*56*/
 };
 
 static const struct mtk_pin_reg_calc mt7981_reg_cals[] = {
@@ -1014,6 +992,10 @@  static struct mtk_pin_soc mt7981_data = {
 	.ies_present = false,
 	.base_names = mt7981_pinctrl_register_base_names,
 	.nbase_names = ARRAY_SIZE(mt7981_pinctrl_register_base_names),
+	.bias_disable_set = mtk_pinconf_bias_disable_set,
+	.bias_disable_get = mtk_pinconf_bias_disable_get,
+	.bias_set = mtk_pinconf_bias_set,
+	.bias_get = mtk_pinconf_bias_get,
 	.pull_type = mt7981_pull_type,
 	.bias_set_combo = mtk_pinconf_bias_set_combo,
 	.bias_get_combo = mtk_pinconf_bias_get_combo,