regulator: Add devm_regulator_get()

Add a resource managed regulator_get() to simplify regulator
usage in drivers. This allows driver authors to "get and forget"
about their regulators by automatically calling regulator_put()
when the driver is detached.

[Fixed up a couple of coding style issues -- broonie]

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
regulator: Implement devm_regulator_free()

Allow consumers to free regulators allocated using devm_regulator_get()
if they need to. This will not normally be required.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
regulator: Provide devm_regulator_bulk_get()

Allow drivers to benefit from both the bulk APIs and managed resources
simultaneously.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
regulator: Add empty devm_regulator_bulk_get for !CONFIG_REGULATOR

This fixes below build error if CONFIG_REGULATOR is disabled.

  CC      sound/soc/codecs/wm5100.o
sound/soc/codecs/wm5100.c: In function ‘wm5100_i2c_probe’:
sound/soc/codecs/wm5100.c:2462: error: implicit declaration of function ‘devm_regulator_bulk_get’
make[3]: *** [sound/soc/codecs/wm5100.o] Error 1
make[2]: *** [sound/soc/codecs] Error 2
make[1]: *** [sound/soc] Error 2
make: *** [sound] Error 2

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
regulator: Add devm_regulator_put in consumer.h

Commit d5ad34f7cb "regulator: Implement devm_regulator_free()"
actually implements devm_regulator_put.
Thus rename devm_regulator_free to devm_regulator_put.

Also add empty devm_regulator_put for !CONFIG_REGULATOR

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
 regulator: Add regulator_count_voltages dummy API

This is required to avoid compilation errors
when CONFIG_REGULATOR is not defined.

Change-Id: I05f51792ce9431d55d509625db30296f4a169a1c
Signed-off-by: Amy Maloche <amaloche@codeaurora.org>
regulator: Add regulator_bulk_set_voltage

Add a convenience API to set the voltage on multiple consumers
stored in a struct regulator_bulk_data[] in one API call.

Change-Id: Iaeb5ba8c357a66f1401fb1e142bb03904e8e9c7c
Signed-off-by: Justin Paupore <jpaupore@codeaurora.org>