On Fri, 2017-04-21 at 09:34 +0200, Hans de Goede wrote: > Some Bay Trail devices use a GPI1 regulator field (address 0x4c) in > their 0x8d power OpRegion, add support for this. > > This fixes AE_BAD_PARAMETER errors getting thrown on these devices and > fixes these errors causing these devices to not suspend. > int data; > > + /* GPIO1 LDO regulator needs special handling */ > + if (reg == 0x92) { > + if (on) > + data = 0x03; > + else > + data = 0x04; > + > + return regmap_update_bits(regmap, reg, 0x07, data); > + } I would go with if (reg == 0x92) return regmap_update_bits(regmap, reg, 0x07, on ? 0x03 : 0x04); -- Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx> Intel Finland Oy -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html