* hex = (uV - 750000) / 50000. We assume that dynamic voltage
* scaling via GPIOs is not enabled and don't support that.
* If this is enabled then the driver will need to take that
- * into account anrd check different registers depending on
- * the current setting See the datasheet for details.
+ * into account and check different registers depending on
+ * the current setting. See the datasheet for details.
*/
hex = (uV - MAX77686_BUCK_UV_HMIN) / MAX77686_BUCK_UV_HSTEP;
hex_max = MAX77686_BUCK_VOLT_MAX_HEX;
switch (on_off) {
case OPMODE_OFF:
- *enable = 0;
+ *enable = false;
break;
case OPMODE_ON:
- *enable = 1;
+ *enable = true;
break;
default:
return -EINVAL;
}
} else if (op == PMIC_OP_SET) {
- switch (*enable) {
- case 0:
- on_off = OPMODE_OFF;
- break;
- case 1:
+ if (*enable)
on_off = OPMODE_ON;
- break;
- default:
- return -EINVAL;
- }
+ else
+ on_off = OPMODE_OFF;
ret = max77686_ldo_mode(dev, op, &on_off);
if (ret)
return -EINVAL;
}
} else if (op == PMIC_OP_SET) {
- switch (*enable) {
- case 0:
- on_off = OPMODE_OFF;
- break;
- case 1:
+ if (*enable)
on_off = OPMODE_ON;
- break;
- default:
- return -EINVAL;
- }
+ else
+ on_off = OPMODE_OFF;
ret = max77686_buck_mode(dev, op, &on_off);
if (ret)