From: Mark Brown Date: Mon, 6 May 2024 01:05:06 +0000 (+0900) Subject: regulator: new API for voltage reference supplies X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=48b6faae69a432b76e453c73ff5210bf5affa936;p=linux.git regulator: new API for voltage reference supplies Merge series from David Lechner : In the IIO subsystem, we noticed a pattern in many drivers where we need to get, enable and get the voltage of a supply that provides a reference voltage. In these cases, we only need the voltage and not a handle to the regulator. Another common pattern is for chips to have an internal reference voltage that is used when an external reference is not available. There are also a few drivers outside of IIO that do the same. So we would like to propose a new regulator consumer API to handle these specific cases to avoid repeating the same boilerplate code in multiple drivers. As an example of how these functions are used, I have included a few patches to consumer drivers. But to avoid a giant patch bomb, I have omitted the iio/adc and iio/dac patches I have prepared from this series. I will send those separately but these will add 36 more users of devm_regulator_get_enable_read_voltage() in addition to the 6 here. In total, this will eliminate nearly 1000 lines of similar code and will simplify writing and reviewing new drivers in the future. --- 48b6faae69a432b76e453c73ff5210bf5affa936