regulator: arizona: Add support for microphone supplies on Arizona devices
PATCH 1/1 regulator: arizona: Add support for microphone supplies on Arizona devices
The Wolfson Arizona platform is used for a range of low power audio hub CODECs. Many of these devices feature an integrated power supply for the microphone which is supported by this driver.
--- drivers/regulator/Kconfig | 7 ++ drivers/regulator/Makefile | 1 + drivers/regulator/arizona-micsupp.c | 184 +++++++++++++++++++++++++++++++++++ 3 files changed, 192 insertions(+) create mode 100644 drivers/regulator/arizona-micsupp.c
drivers/regulator/Kconfig +7 -0
@@ -88,6 +88,13 @@ config REGULATOR_AAT2870 If you have a AnalogicTech AAT2870 say Y to enable the regulator driver. +config REGULATOR_ARIZONA + tristate "Wolfson Arizona class devices" + depends on MFD_ARIZONA + help + Support for the regulators found on Wolfson Arizona class + devices. + config REGULATOR_DA903X tristate "Dialog Semiconductor DA9030/DA9034 regulators" depends on PMIC_DA903X
drivers/regulator/Makefile +1 -0
@@ -15,6 +15,7 @@ obj-$(CONFIG_REGULATOR_AB3100) += ab3100.o obj-$(CONFIG_REGULATOR_AB8500) += ab8500.o obj-$(CONFIG_REGULATOR_AD5398) += ad5398.o obj-$(CONFIG_REGULATOR_ANATOP) += anatop-regulator.o +obj-$(CONFIG_REGULATOR_ARIZONA) += arizona-micsupp.o obj-$(CONFIG_REGULATOR_DA903X) += da903x.o obj-$(CONFIG_REGULATOR_DA9052) += da9052-regulator.o obj-$(CONFIG_REGULATOR_DBX500_PRCMU) += dbx500-prcmu.o
drivers/regulator/arizona-micsupp.c new file +184 -0
184 lines not on this page · raw message
Signature · 1 line
1.7.10
drivers/regulator/Kconfig config REGULATOR_AAT2870 · line 97
Quoted 13 lines
drivers/regulator/Kconfig +0
-0@@ -88,6 +88,13 @@ config REGULATOR_AAT2870If you have a AnalogicTech AAT2870 say Y to enable the regulator driver.
drivers/regulator/Kconfig +7
-0+config REGULATOR_ARIZONA + tristate "Wolfson Arizona class devices" + depends on MFD_ARIZONA + help + Support for the regulators found on Wolfson Arizona class + devices. +
I think you may want to put this Kconfig entriy along with other Wolfson Microelectronics chips. So all Wolfson chips show in a group.
BTW, seems the MFD_ARIZONA patchs are not (yet) available in LKML.
Quoted 6 lines
drivers/regulator/Kconfig +6
-0+static int arizona_micsupp_map_voltage(struct regulator_dev *rdev, + int min_uV, int max_uV) +{ + unsigned int voltage; + int selector; +
drivers/regulator/Kconfig
Quoted 10 lines
drivers/regulator/Kconfig +10
-0+ if (min_uV < 1700000) + min_uV = 1700000; + + if (min_uV >= 3300000) + selector = ARIZONA_MICSUPP_MAX_SELECTOR; + else + selector = DIV_ROUND_UP(min_uV - 1700000, 50000); + + if (selector < 0) + return -EINVAL;
I think you don't need this checking. You already ensure min_uV >= 1700000.
The rest of the code looks good to me.
Regards,
Axel
Quoted 2 lines · Axel Lin
I think you may want to put this
Kconfigentriy along with other Wolfson Microelectronics chips. So all Wolfson chips show in a group.
I'd rather keep the Kconfig entries sorted alphabetically.
Quoted 1 line
BTW, seems the
MFD_ARIZONApatchs are not (yet) available in LKML.
Surprisingly I am aware of that...
Quoted 4 lines
Quoted 2 lines
+ if (selector < 0)
+ return-EINVAL;I think you don't need this checking. You already ensure
min_uV>= 1700000.
No harm in being paranoid.