On Mon, Feb 10, 2020 at 02:13:13PM +0200, Matti Vaittinen wrote: > Provide a linear_range helper which can do conversion from user value > to register value 'selector'. > Mark, this is loosely bound to register handling... Do you think > the regmap could host these helpers? There's no real tie to regmap here, something like this could quite happily be used by memory mapped devices where regmap has limited uses and would be a lot to pull in. A separate library would probably make more sense. Not sure how many users there would be outside of power related stuff, I don't recall seeing the pattern elsewhere. Note also that we already have quite extensive helpers for this sort of stuff in the regulator API which I sense may have been involved in this implementation and to an extent in ALSA which takes a different approach with TLVs since it baked selectors directly into the ABI.