switch (param) {
case PIN_CONFIG_BIAS_PULL_PIN_DEFAULT:
case PIN_CONFIG_BIAS_DISABLE:
+ case PIN_CONFIG_DRIVE_PUSH_PULL:
+ ret = stmfx_pinconf_set_type(pctl, pin, 0);
+ if (ret)
+ return ret;
+ break;
case PIN_CONFIG_BIAS_PULL_DOWN:
+ ret = stmfx_pinconf_set_type(pctl, pin, 1);
+ if (ret)
+ return ret;
ret = stmfx_pinconf_set_pupd(pctl, pin, 0);
if (ret)
return ret;
break;
case PIN_CONFIG_BIAS_PULL_UP:
- ret = stmfx_pinconf_set_pupd(pctl, pin, 1);
+ ret = stmfx_pinconf_set_type(pctl, pin, 1);
if (ret)
return ret;
- break;
- case PIN_CONFIG_DRIVE_OPEN_DRAIN:
- if (!dir)
- ret = stmfx_pinconf_set_type(pctl, pin, 1);
- else
- ret = stmfx_pinconf_set_type(pctl, pin, 0);
+ ret = stmfx_pinconf_set_pupd(pctl, pin, 1);
if (ret)
return ret;
break;
- case PIN_CONFIG_DRIVE_PUSH_PULL:
- if (!dir)
- ret = stmfx_pinconf_set_type(pctl, pin, 0);
- else
- ret = stmfx_pinconf_set_type(pctl, pin, 1);
+ case PIN_CONFIG_DRIVE_OPEN_DRAIN:
+ ret = stmfx_pinconf_set_type(pctl, pin, 1);
if (ret)
return ret;
break;