aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Prisk <linux@prisktech.co.nz>2014-01-23 03:57:33 -0500
committerLinus Walleij <linus.walleij@linaro.org>2014-02-03 03:08:01 -0500
commitf17248ed868767567298e1cdf06faf8159a81f7c (patch)
treea1623ea67c5ed0b193fb5f34696cce90e0198719
parent795779df22afc8bdee4e9fbe5c18c47e44974d75 (diff)
pinctrl: vt8500: Change devicetree data parsing
Due to an assumption in the VT8500 pinctrl driver, the value passed from devicetree for 'wm,pull' was not explicitly translated before being passed to pinconf. Since v3.10, changes to 'enum pin_config_param', PIN_CONFIG_BIAS_PULL_(UP/DOWN) no longer map 1-to-1 with the expected values in devicetree. This patch adds a small translation between the devicetree values (0..2) and the enum pin_config_param equivalent values. Cc: <stable@vger.kernel.org> # v3.10+ Signed-off-by: Tony Prisk <linux@prisktech.co.nz> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r--drivers/pinctrl/vt8500/pinctrl-wmt.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/pinctrl/vt8500/pinctrl-wmt.c b/drivers/pinctrl/vt8500/pinctrl-wmt.c
index b28d1af9c232..9802b67040cc 100644
--- a/drivers/pinctrl/vt8500/pinctrl-wmt.c
+++ b/drivers/pinctrl/vt8500/pinctrl-wmt.c
@@ -276,7 +276,20 @@ static int wmt_pctl_dt_node_to_map_pull(struct wmt_pinctrl_data *data,
276 if (!configs) 276 if (!configs)
277 return -ENOMEM; 277 return -ENOMEM;
278 278
279 configs[0] = pull; 279 switch (pull) {
280 case 0:
281 configs[0] = PIN_CONFIG_BIAS_DISABLE;
282 break;
283 case 1:
284 configs[0] = PIN_CONFIG_BIAS_PULL_DOWN;
285 break;
286 case 2:
287 configs[0] = PIN_CONFIG_BIAS_PULL_UP;
288 break;
289 default:
290 configs[0] = PIN_CONFIG_BIAS_DISABLE;
291 dev_err(data->dev, "invalid pull state %d - disabling\n", pull);
292 }
280 293
281 map->type = PIN_MAP_TYPE_CONFIGS_PIN; 294 map->type = PIN_MAP_TYPE_CONFIGS_PIN;
282 map->data.configs.group_or_pin = data->groups[group]; 295 map->data.configs.group_or_pin = data->groups[group];