aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/da9121-regulator.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2021-05-18regulator: da9121: Return REGULATOR_MODE_INVALID for invalid modeAxel Lin1-3/+7
-EINVAL is not a valid return value for .of_map_mode, return REGULATOR_MODE_INVALID instead. Fixes: 65ac97042d4e ("regulator: da9121: add mode support") Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Adam Ward <Adam.Ward.opensource@diasemi.com> Link: https://lore.kernel.org/r/20210517052721.1063375-1-axel.lin@ingics.com Signed-off-by: Mark Brown <broonie@kernel.org>
2021-04-21regulator: da9121: automotive variants identity fixAdam Ward1-28/+52
This patch fixes identification of DA913x parts by the DA9121 driver, where a lack of clarity lead to implementation on the basis that variant IDs were to be identical to the equivalent rated non-automotive parts. There is a new emphasis on the DT identity to cope with overlap in these ID's - this is not considered to be problematic, because projects would be exclusively using automotive or consumer grade parts. Signed-off-by: Adam Ward <Adam.Ward.opensource@diasemi.com> Link: https://lore.kernel.org/r/20210421120306.DB5B880007F@slsrvapps-01.diasemi.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-08Merge series "regulator: da9121: bug fixes" from Adam Ward <Adam.Ward.opensource@diasemi.com>:Mark Brown1-3/+2
This patch fixes a couple of bugs in the DA9121 driver. One in an uninialised string I forgot to remove when changing to of_parse_cb() The other is an index for an optional DT property which overflows Adam Ward (2): regulator: da9121: Remove uninitialised string variable regulator: da9121: Fix index used for DT property drivers/regulator/da9121-regulator.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) -- 1.9.1
2020-12-08regulator: da9121: Potential Oops in da9121_assign_chip_model()Dan Carpenter1-0/+1
There is a missing "return ret;" on this error path so we call "da9121_check_device_type(i2c, chip);" which will end up dereferencing "chip->regmap" and lead to an Oops. Fixes: c860476b9e3a ("regulator: da9121: Add device variant regmaps") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Adam Ward <Adam.Ward.opensource@diasemi.com> Link: https://lore.kernel.org/r/X85soGKnWAjPUA7a@mwanda Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-07regulator: da9121: Fix index used for DT propertyAdam Ward1-1/+1
Signed-off-by: Adam Ward <Adam.Ward.opensource@diasemi.com> Link: https://lore.kernel.org/r/2cf324b68d37c4059c7995e8cab5fc9a608ea65d.1607361013.git.Adam.Ward.opensource@diasemi.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-07regulator: da9121: Remove uninitialised string variableAdam Ward1-2/+1
Erroneously left in when switched to using of_parse_cb() Signed-off-by: Adam Ward <Adam.Ward.opensource@diasemi.com> Link: https://lore.kernel.org/r/c7a9e947a9582fe0150d860b5eab7e093cd832bb.1607361013.git.Adam.Ward.opensource@diasemi.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-04regulator: da9121: include linux/gpio/consumer.hArnd Bergmann1-0/+1
When CONFIG_GPIOLIB is disabled, the declarations from linux/gpio/consumer.h are not visible: drivers/regulator/da9121-regulator.c:371:14: error: implicit declaration of function 'fwnode_gpiod_get_index' [-Werror,-Wimplicit-function-declaration] ena_gpiod = fwnode_gpiod_get_index(of_fwnode_handle(np), "enable", 0, ^ drivers/regulator/da9121-regulator.c:372:7: error: use of undeclared identifier 'GPIOD_OUT_HIGH' GPIOD_OUT_HIGH | ^ drivers/regulator/da9121-regulator.c:373:7: error: use of undeclared identifier 'GPIOD_FLAGS_BIT_NONEXCLUSIVE' GPIOD_FLAGS_BIT_NONEXCLUSIVE, Include this explicitly to help compile testing. Fixes: 46c413d5bb23 ("regulator: da9121: Add support for device variants via devicetree") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Link: https://lore.kernel.org/r/20201204165229.3754763-1-arnd@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-03regulator: da9121: Mark some symbols with static keywordZou Wei1-5/+5
Fix the following sparse warnings: drivers/regulator/da9121-regulator.c:55:21: warning: symbol 'da9121_10A_2phase_current' was not declared. Should it be static? drivers/regulator/da9121-regulator.c:63:21: warning: symbol 'da9121_6A_2phase_current' was not declared. Should it be static? drivers/regulator/da9121-regulator.c:71:21: warning: symbol 'da9121_5A_1phase_current' was not declared. Should it be static? drivers/regulator/da9121-regulator.c:79:21: warning: symbol 'da9121_3A_1phase_current' was not declared. Should it be static? drivers/regulator/da9121-regulator.c:151:32: warning: symbol 'status_event_handling' was not declared. Should it be static? Signed-off-by: Zou Wei <zou_wei@huawei.com> Acked-by: Adam Ward <Adam.Ward.opensource@diasemi.com> Link: https://lore.kernel.org/r/1606994795-36182-1-git-send-email-zou_wei@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-02regulator: da9121: Request IRQ directly and free in release function to avoid masking raceAdam Ward1-3/+6
Signed-off-by: Adam Ward <Adam.Ward.opensource@diasemi.com> Link: https://lore.kernel.org/r/24b2d8b0c3536408369add034221b1141e58bbfc.1606908582.git.Adam.Ward.opensource@diasemi.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-01regulator: da9121: add interrupt supportAdam Ward1-0/+286
Adds interrupt handler for variants, and notifications for events; over temperature/voltage/current. Because the IRQs are triggered by persisting status, they must be masked and the status polled until clear, before the IRQ can be enabled again. Signed-off-by: Adam Ward <Adam.Ward.opensource@diasemi.com> Link: https://lore.kernel.org/r/fe21796bbcbadff84a472a4cc581ae8fafc7f8f5.1606755367.git.Adam.Ward.opensource@diasemi.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-01regulator: da9121: add mode supportAdam Ward1-0/+74
Adds get/set for mode, and mapping from REGULATOR_MODE_* to select PFM/PWM/Auto operation. Signed-off-by: Adam Ward <Adam.Ward.opensource@diasemi.com> Link: https://lore.kernel.org/r/7844c8f6facb6f7c0649381629cc75ccad14723d.1606755367.git.Adam.Ward.opensource@diasemi.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-01regulator: da9121: add current supportAdam Ward1-0/+113
This commit adds support for getting/setting current for all supported variants. Limits are adjusted per variant to match HW implementation. Signed-off-by: Adam Ward <Adam.Ward.opensource@diasemi.com> Link: https://lore.kernel.org/r/9aa80b909893dbe609730919ed595c6a8ac26606.1606755367.git.Adam.Ward.opensource@diasemi.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-01regulator: da9121: Update registration to support multiple buck variantsAdam Ward1-13/+31
Add function which iterates the regulator descriptors for the confirmed variant ID and registers each buck. Signed-off-by: Adam Ward <Adam.Ward.opensource@diasemi.com> Link: https://lore.kernel.org/r/1fd53c3ab032ef3c8a92f80a2247381db1c09ced.1606755367.git.Adam.Ward.opensource@diasemi.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-01regulator: da9121: Add support for device variants via devicetreeAdam Ward1-0/+119
Add devicetree configuration and device variant parameters. Use the latter to enable the check and use of parameters specific to dual buck variants. Signed-off-by: Adam Ward <Adam.Ward.opensource@diasemi.com> Link: https://lore.kernel.org/r/5849ce60595aef1018bdde7dcfb54a7397597545.1606755367.git.Adam.Ward.opensource@diasemi.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-01regulator: da9121: Add device variant descriptorsAdam Ward1-0/+110
Descriptors for bucks in all variants, ready for of_regulator_match Signed-off-by: Adam Ward <Adam.Ward.opensource@diasemi.com> Link: https://lore.kernel.org/r/8f7a11d59e5ac3ba1bfd448bcfc905efc99b7874.1606755367.git.Adam.Ward.opensource@diasemi.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-01regulator: da9121: Add device variant regmapsAdam Ward1-18/+226
Add ability to probe device and validate configuration, then apply a regmap configuration for a single or dual buck device accordingly. Signed-off-by: Adam Ward <Adam.Ward.opensource@diasemi.com> Link: https://lore.kernel.org/r/068c6b8d5e1b4e221e899e4c914c429429a2ec7d.1606755367.git.Adam.Ward.opensource@diasemi.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-01regulator: da9121: Add device variantsAdam Ward1-3/+43
Add basic support for configuration to reference variants of this device, and track the selected variant within the driver. Signed-off-by: Adam Ward <Adam.Ward.opensource@diasemi.com> Link: https://lore.kernel.org/r/aaabd3063593e5172fa6b605884d475df64e6d65.1606755367.git.Adam.Ward.opensource@diasemi.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-12-01regulator: da9121: Add header fileAdam Ward1-10/+5
Add header file for Dialog Semiconductor DA9121 regulator and related devices, mostly autogenerated from the chip design databases, and update driver to replace local defines with those from header. Signed-off-by: Adam Ward <Adam.Ward.opensource@diasemi.com> Link: https://lore.kernel.org/r/3527d84448d1e6ddc0fcb883ae564880f75a6cb0.1606755367.git.Adam.Ward.opensource@diasemi.com Signed-off-by: Mark Brown <broonie@kernel.org>
2020-11-03regulator: Add support for DA9121 regulatorVincent Whitchurch1-0/+108
Add support for the Dialog Semiconductor DA9121, a single-channel dual-phase buck converter controlled via I2C. Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com> Link: https://lore.kernel.org/r/20201103100021.19603-3-vincent.whitchurch@axis.com Signed-off-by: Mark Brown <broonie@kernel.org>