]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
pinctrl: qcom: pass pin number to get_function_mux callback
authorVolodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Mon, 11 Mar 2024 21:33:46 +0000 (21:33 +0000)
committerCaleb Connolly <caleb.connolly@linaro.org>
Thu, 4 Apr 2024 15:46:45 +0000 (17:46 +0200)
This patch is the preparation for SM8150 support. This new SoC
depending on the particular pin can have different numbers for the
same function. For example "rgmii" function for GPIO4 has id=2 while
for GPIO59 it has id=1. So, to support this type of SoCs,
get_function_mux() callback needs to know for which pin the function
is requested.

Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>
Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
drivers/pinctrl/qcom/pinctrl-apq8016.c
drivers/pinctrl/qcom/pinctrl-apq8096.c
drivers/pinctrl/qcom/pinctrl-ipq4019.c
drivers/pinctrl/qcom/pinctrl-qcom.c
drivers/pinctrl/qcom/pinctrl-qcom.h
drivers/pinctrl/qcom/pinctrl-qcs404.c
drivers/pinctrl/qcom/pinctrl-sdm845.c

index db0e212468473c9c56730d748df1a94c3da8faa2..a9a00f4b081952fd94aa6d3c7ada01ac08838d86 100644 (file)
@@ -49,7 +49,8 @@ static const char *apq8016_get_pin_name(struct udevice *dev,
        }
 }
 
-static unsigned int apq8016_get_function_mux(unsigned int selector)
+static unsigned int apq8016_get_function_mux(__maybe_unused unsigned int pin,
+                                            unsigned int selector)
 {
        return msm_pinctrl_functions[selector].val;
 }
index 880df8fe3c74b7890691ea9faa210dd3b5052b95..9697cb5beb7a0a30d9a10f3e556bc06c5fc5349a 100644 (file)
@@ -44,7 +44,8 @@ static const char *apq8096_get_pin_name(struct udevice *dev,
        }
 }
 
-static unsigned int apq8096_get_function_mux(unsigned int selector)
+static unsigned int apq8096_get_function_mux(__maybe_unused unsigned int pin,
+                                            unsigned int selector)
 {
        return msm_pinctrl_functions[selector].val;
 }
index 74c04ab87cdf48bc0e7e27b17a9d06e77941cfb7..447923031334f4243fe64af2094bfa9770eb90d5 100644 (file)
@@ -40,7 +40,8 @@ static const char *ipq4019_get_pin_name(struct udevice *dev,
        return pin_name;
 }
 
-static unsigned int ipq4019_get_function_mux(unsigned int selector)
+static unsigned int ipq4019_get_function_mux(__maybe_unused unsigned int pin,
+                                            unsigned int selector)
 {
        return msm_pinctrl_functions[selector].val;
 }
index ee0624df296e2b23301b3d77cfe4fb4ea89a64f1..909e566acf5e1e193db39bdfb1e43aa680efeeec 100644 (file)
@@ -83,14 +83,14 @@ static int msm_pinmux_set(struct udevice *dev, unsigned int pin_selector,
                          unsigned int func_selector)
 {
        struct msm_pinctrl_priv *priv = dev_get_priv(dev);
+       u32 func = priv->data->get_function_mux(pin_selector, func_selector);
 
        /* Always NOP for special pins, assume they're in the correct state */
        if (qcom_is_special_pin(&priv->data->pin_data, pin_selector))
                return 0;
 
        clrsetbits_le32(priv->base + GPIO_CONFIG_REG(priv, pin_selector),
-                       TLMM_FUNC_SEL_MASK | TLMM_GPIO_DISABLE,
-                       priv->data->get_function_mux(func_selector) << 2);
+                       TLMM_FUNC_SEL_MASK | TLMM_GPIO_DISABLE, func << 2);
        return 0;
 }
 
index 07f2eae9baeadfd996ab40e021f3ad7da4ecd380..49b7bfbc00102ae6ff40ee0d07b63c38ad7eca5a 100644 (file)
@@ -18,7 +18,8 @@ struct msm_pinctrl_data {
        int functions_count;
        const char *(*get_function_name)(struct udevice *dev,
                                         unsigned int selector);
-       unsigned int (*get_function_mux)(unsigned int selector);
+       unsigned int (*get_function_mux)(unsigned int pin,
+                                        unsigned int selector);
        const char *(*get_pin_name)(struct udevice *dev,
                                    unsigned int selector);
 };
index 3a2d4685997ecb0a34cf9a024600dae365c53df5..4b7c670c90b7ab24f22602cd4fdee6e69aea8ee2 100644 (file)
@@ -94,7 +94,8 @@ static const char *qcs404_get_pin_name(struct udevice *dev,
        }
 }
 
-static unsigned int qcs404_get_function_mux(unsigned int selector)
+static unsigned int qcs404_get_function_mux(__maybe_unused unsigned int pin,
+                                           unsigned int selector)
 {
        return msm_pinctrl_functions[selector].val;
 }
index 76bd8c4ef4134fcd009a798d401fdaacd0b73cda..459a4329ec8048416fd19bb4bea6745207306400 100644 (file)
@@ -70,7 +70,8 @@ static const char *sdm845_get_pin_name(struct udevice *dev,
        return pin_name;
 }
 
-static unsigned int sdm845_get_function_mux(unsigned int selector)
+static unsigned int sdm845_get_function_mux(__maybe_unused unsigned int pin,
+                                           unsigned int selector)
 {
        return msm_pinctrl_functions[selector].val;
 }