pinctrl: tegra: fix pinconfig_group_set
Bibek Basu [Tue, 9 Sep 2014 09:18:12 +0000 (14:18 +0530)]
Prepare config using param parameter to generate the right
value for pinmux register

Bug 200033491

Change-Id: I973cc449e8cf89cb3b6f5b5da1021d21d193b47d
Signed-off-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-on: http://git-master/r/496827
(cherry picked from commit 418c027e40353a4b99fe7fcfbc0743de7e07d15c)
Reviewed-on: http://git-master/r/498329
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Venkat Moganty <vmoganty@nvidia.com>
Reviewed-by: Matthew Pedro <mapedro@nvidia.com>

drivers/pinctrl/pinctrl-tegra.c

index 5f3a110..04132e0 100644 (file)
@@ -373,13 +373,13 @@ static int tegra_pinctrl_get_func_groups(struct pinctrl_dev *pctldev,
        return 0;
 }
 
-static int tegra_pinconfig_froup_set(struct pinctrl_dev *pctldev,
+static int tegra_pinconfig_group_set(struct pinctrl_dev *pctldev,
                unsigned group, unsigned long param, unsigned long arg)
 {
        unsigned long config;
        int ret;
 
-       config = TEGRA_PINCONF_PACK(TEGRA_PINCONF_PARAM_TRISTATE, arg);
+       config = TEGRA_PINCONF_PACK(param, arg);
        ret = tegra_pinconf_group_set(pctldev, group, config);
        if (ret < 0)
                dev_err(pctldev->dev,
@@ -495,10 +495,10 @@ static int tegra_pinctrl_gpio_set_direction(struct pinctrl_dev *pctldev,
         * tristate = 0 for output direction.
         */
        if (input)
-               ret = tegra_pinconfig_froup_set(pctldev, group,
+               ret = tegra_pinconfig_group_set(pctldev, group,
                                        TEGRA_PINCONF_PARAM_ENABLE_INPUT, 1);
        else
-               ret = tegra_pinconfig_froup_set(pctldev, group,
+               ret = tegra_pinconfig_group_set(pctldev, group,
                                        TEGRA_PINCONF_PARAM_TRISTATE, 0);
        return ret;
 }