Skip to content

Commit

Permalink
vt8500: pinctrl: Change devicetree data parsing
Browse files Browse the repository at this point in the history
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.

With 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.

Signed-off-by: Tony Prisk <linux@prisktech.co.nz>
  • Loading branch information
tonyprisk committed Jan 18, 2014
1 parent 86a07b9 commit c4386ef
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions drivers/pinctrl/vt8500/pinctrl-wmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,17 @@ static int wmt_pctl_dt_node_to_map_pull(struct wmt_pinctrl_data *data,
if (!configs)
return -ENOMEM;

switch (pull) {
case 0:
pull = PIN_CONFIG_BIAS_DISABLE;
break;
case 1:
pull = PIN_CONFIG_BIAS_PULL_DOWN;
break;
case 2:
pull = PIN_CONFIG_BIAS_PULL_UP;
break;
}
configs[0] = pull;

map->type = PIN_MAP_TYPE_CONFIGS_PIN;
Expand Down

0 comments on commit c4386ef

Please # to comment.