]> git.baikalelectronics.ru Git - uboot.git/commitdiff
pinctrl-snapdragon: Get rid of custom drive-strength values
authorSumit Garg <sumit.garg@linaro.org>
Wed, 1 Feb 2023 13:58:52 +0000 (19:28 +0530)
committerTom Rini <trini@konsulko.com>
Fri, 10 Feb 2023 17:50:00 +0000 (12:50 -0500)
Use standard pinconf drive-strength values from Linux DT bindings rather
than ones based on custom u-boot header. These changes are in direction
to make u-boot DTs for Qcom SoCs to be compatible with standard Linux
DT bindings.

Also, add support for pinconf bias-pull-up.

Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
arch/arm/dts/dragonboard410c.dts
arch/arm/dts/dragonboard820c.dts
arch/arm/dts/qcom-ipq4019.dtsi
arch/arm/dts/qcs404-evb.dts
arch/arm/mach-snapdragon/pinctrl-snapdragon.c
include/dt-bindings/pinctrl/pinctrl-snapdragon.h [deleted file]

index 59cf45eb175ea7c38c1acbfc9c15dcee88189f87..9230dd3fd96c821e8c5db7d2581827082e9b9fac 100644 (file)
@@ -9,7 +9,6 @@
 
 #include "skeleton64.dtsi"
 #include <dt-bindings/gpio/gpio.h>
-#include <dt-bindings/pinctrl/pinctrl-snapdragon.h>
 
 / {
        model = "Qualcomm Technologies, Inc. Dragonboard 410c";
@@ -71,7 +70,7 @@
                        blsp1_uart: uart {
                                function = "blsp1_uart";
                                pins = "GPIO_4", "GPIO_5";
-                               drive-strength = <DRIVE_STRENGTH_8MA>;
+                               drive-strength = <8>;
                                bias-disable;
                        };
                };
index aaca681d2e1bcccbade20fabc1fc4e081c18aede..ad201d48749c4da6f517a60630dbf716a1e1f31b 100644 (file)
@@ -8,7 +8,6 @@
 /dts-v1/;
 
 #include "skeleton64.dtsi"
-#include <dt-bindings/pinctrl/pinctrl-snapdragon.h>
 
 / {
        model = "Qualcomm Technologies, Inc. DB820c";
@@ -71,7 +70,7 @@
                        blsp8_uart: uart {
                                function = "blsp_uart8";
                                pins = "GPIO_4", "GPIO_5";
-                               drive-strength = <DRIVE_STRENGTH_8MA>;
+                               drive-strength = <8>;
                                bias-disable;
                        };
                };
index 181732d262270b5290f287ad527cad462e37dc21..6edc69da67472f7e33c865f6b60939474b67df3b 100644 (file)
@@ -9,7 +9,6 @@
 
 #include "skeleton.dtsi"
 #include <dt-bindings/gpio/gpio.h>
-#include <dt-bindings/pinctrl/pinctrl-snapdragon.h>
 #include <dt-bindings/clock/qcom,ipq4019-gcc.h>
 #include <dt-bindings/reset/qcom,ipq4019-reset.h>
 
index c8bcf9f71df22575d7484fcbed3ac0e96fab5891..cc70afa4c8356b0dca65aa44581752df470ca7e6 100644 (file)
@@ -9,7 +9,6 @@
 
 #include "skeleton64.dtsi"
 #include <dt-bindings/gpio/gpio.h>
-#include <dt-bindings/pinctrl/pinctrl-snapdragon.h>
 #include <dt-bindings/clock/qcom,gcc-qcs404.h>
 
 / {
index ab884ab6bf9a86b141ac3cc028825f5a0000dbdc..826dc5148661da3e9a146b93b408a8a047b15f02 100644 (file)
@@ -28,8 +28,9 @@ struct msm_pinctrl_priv {
 #define TLMM_GPIO_DISABLE BIT(9)
 
 static const struct pinconf_param msm_conf_params[] = {
-       { "drive-strength", PIN_CONFIG_DRIVE_STRENGTH, 3 },
+       { "drive-strength", PIN_CONFIG_DRIVE_STRENGTH, 2 },
        { "bias-disable", PIN_CONFIG_BIAS_DISABLE, 0 },
+       { "bias-pull-up", PIN_CONFIG_BIAS_PULL_UP, 3 },
 };
 
 static int msm_get_functions_count(struct udevice *dev)
@@ -89,6 +90,7 @@ static int msm_pinconf_set(struct udevice *dev, unsigned int pin_selector,
 
        switch (param) {
        case PIN_CONFIG_DRIVE_STRENGTH:
+               argument = (argument / 2) - 1;
                clrsetbits_le32(priv->base + GPIO_CONFIG_OFFSET(pin_selector),
                                TLMM_DRV_STRENGTH_MASK, argument << 6);
                break;
@@ -96,6 +98,10 @@ static int msm_pinconf_set(struct udevice *dev, unsigned int pin_selector,
                clrbits_le32(priv->base + GPIO_CONFIG_OFFSET(pin_selector),
                             TLMM_GPIO_PULL_MASK);
                break;
+       case PIN_CONFIG_BIAS_PULL_UP:
+               clrsetbits_le32(priv->base + GPIO_CONFIG_OFFSET(pin_selector),
+                               TLMM_GPIO_PULL_MASK, argument);
+               break;
        default:
                return 0;
        }
diff --git a/include/dt-bindings/pinctrl/pinctrl-snapdragon.h b/include/dt-bindings/pinctrl/pinctrl-snapdragon.h
deleted file mode 100644 (file)
index 615affb..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * This header provides constants for Qualcomm Snapdragon pinctrl bindings.
- *
- * (C) Copyright 2018 Ramon Fried <ramon.fried@gmail.com>
- *
- */
-
-#ifndef _DT_BINDINGS_PINCTRL_SNAPDRAGON_H
-#define _DT_BINDINGS_PINCTRL_SNAPDRAGON_H
-
-/* GPIO Drive Strength */
-#define DRIVE_STRENGTH_2MA        0
-#define DRIVE_STRENGTH_4MA        1
-#define DRIVE_STRENGTH_6MA        2
-#define DRIVE_STRENGTH_8MA        3
-#define DRIVE_STRENGTH_10MA       4
-#define DRIVE_STRENGTH_12MA       5
-#define DRIVE_STRENGTH_14MA       6
-#define DRIVE_STRENGTH_16MA       7
-
-#endif