{
struct pcs_device *pcs = pinctrl_dev_get_drvdata(pctldev);
struct pcs_function *func;
- unsigned offset = 0, shift = 0, arg = 0, i, data, ret;
- u16 argument;
+ unsigned offset = 0, shift = 0, i, data, ret;
+ u16 arg;
ret = pcs_get_function(pctldev, pin, &func);
if (ret)
if (pinconf_to_config_param(config) == func->conf[i].param) {
offset = pin * (pcs->width / BITS_PER_BYTE);
data = pcs->read(pcs->base + offset);
- argument = pinconf_to_config_argument(config);
+ arg = pinconf_to_config_argument(config);
switch (func->conf[i].param) {
/* 2 parameters */
case PIN_CONFIG_INPUT_SCHMITT:
case PIN_CONFIG_DRIVE_STRENGTH:
case PIN_CONFIG_SLEW_RATE:
shift = ffs(func->conf[i].mask) - 1;
- arg = pinconf_to_config_argument(config);
data &= ~func->conf[i].mask;
data |= (arg << shift) & func->conf[i].mask;
break;
break;
case PIN_CONFIG_BIAS_PULL_DOWN:
case PIN_CONFIG_BIAS_PULL_UP:
- if (argument)
+ if (arg)
pcs_pinconf_clear_bias(pctldev, pin);
/* fall through */
case PIN_CONFIG_INPUT_SCHMITT_ENABLE:
data &= ~func->conf[i].mask;
- if (argument)
+ if (arg)
data |= func->conf[i].enable;
else
data |= func->conf[i].disable;
const char *name, enum pin_config_param param,
struct pcs_conf_vals **conf, unsigned long **settings)
{
- unsigned value[2];
+ unsigned value[2], shift;
int ret;
ret = of_property_read_u32_array(np, name, value, 2);
return;
/* set value & mask */
value[0] &= value[1];
+ shift = ffs(value[1]) - 1;
/* skip enable & disable */
add_config(conf, param, value[0], 0, 0, value[1]);
- add_setting(settings, param, value[0]);
+ add_setting(settings, param, value[0] >> shift);
}
/* add pinconf setting with 4 parameters */