aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/cpcap-regulator.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2022-06-10treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_30.RULE (part 2)Thomas Gleixner1-9/+1
Based on the normalized pattern: this program is free software you can redistribute it and/or modify it under the terms of the gnu general public license as published by the free software foundation version 2 this program is distributed as is without any warranty of any kind whether express or implied without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference. Reviewed-by: Allison Randal <allison@lohutok.net> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-06-25regulator: cpcap-regulator: Demote kerneldoc header to standard commentLee Jones1-2/+2
Nothing about this comment identifies it as a kerneldoc header. They're missing all of their struct's property descriptions and the correct 'struct *' header. Fixes the following W=1 warning(s): drivers/regulator/cpcap-regulator.c:99: warning: cannot understand function prototype: 'struct cpcap_regulator ' drivers/regulator/cpcap-regulator.c:337: warning: cannot understand function prototype: 'const struct cpcap_regulator omap4_regulators[] = ' Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20200625163614.4001403-9-lee.jones@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-25regulator: cpcap-regulator: Remove declared and set, but never used variable 'ignore'Lee Jones1-6/+6
It's okay to not check the return value that you're not conserned about, however it is not okay to assign a variable and not check or use the result. Fixes W=1 warnings(s): drivers/regulator/cpcap-regulator.c:172:13: warning: variable ‘ignore’ set but not used [-Wunused-but-set-variable] 172 | int error, ignore; | ^~~~~~ drivers/regulator/cpcap-regulator.c: In function ‘cpcap_regulator_disable’: drivers/regulator/cpcap-regulator.c:196:13: warning: variable ‘ignore’ set but not used [-Wunused-but-set-variable] 196 | int error, ignore; | ^~~~~~ Signed-off-by: Lee Jones <lee.jones@linaro.org> Link: https://lore.kernel.org/r/20200625163614.4001403-8-lee.jones@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
2020-06-18regulator: cpcap: Constify cpcap_regulator_opsRikard Falkeborn1-1/+1
cpcap_regulator_ops is not modified and can be made const to allow the compiler to put it in read-only memory. Before: text data bss dec hex filename 14472 236 0 14708 3974 drivers/regulator/cpcap-regulator.o After: text data bss dec hex filename 14604 104 0 14708 3974 drivers/regulator/cpcap-regulator.o Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com> Link: https://lore.kernel.org/r/20200617223247.25566-3-rikard.falkeborn@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-06-07regulator: cpcap: Spelling s/configuraion/configuration/Geert Uytterhoeven1-1/+1
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-18regulator: cpcap: Convert to use of_device_get_match_dataAxel Lin1-8/+4
Use of_device_get_match_data to simplify the code a bit. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-03-18regulator: cpcap: Remove unneeded init_data settingAxel Lin1-3/+0
This driver is using regulator core's simplified DT parsing code, so regulator will call regulator_of_get_init_data() to get init_data. No need to set config.init_data. In additional, current code does not properly set the init_data setting, so just remove it. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-26regulator: cpcap: Constify omap4_regulators and xoom_regulatorsAxel Lin1-2/+2
They should never change, make them const. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Tony Lindgren <tony@atomide.com> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2019-02-26regulator: cpcap: Remove unused vsel_shift from struct cpcap_regulatorAxel Lin1-52/+50
This driver uses regulator_get/set_voltage_sel_regmap so it does not use vsel_shift. Actually, vsel_shift can be calculated by vsel_mask setting. Signed-off-by: Axel Lin <axel.lin@ingics.com> Tested-by: Tony Lindgren <tony@atomide.com> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-24regulator: Add support for CPCAP regulators on Motorola Xoom devices.Peter Geis1-0/+80
Added support for the CPCAP power management regulator functions on Tegra based Motorola Xoom devices. Added sw2_sw4 value tables, which provide power to the Tegra core and aux devices. Added the Xoom init tables and device tree compatibility match. Signed-off-by: Peter Geis <pgwipeout@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-07-24regulator: Add sw2_sw4 voltage table to cpcap regulator.Peter Geis1-0/+23
SW2 and SW4 use a shared table to provide voltage to the cpu core and devices on Tegra hardware. Added this table to the cpcap regulator driver as the first step to supporting this device on Tegra. Signed-off-by: Peter Geis <pgwipeout@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2018-04-20regulator: Don't return or expect -errno from of_map_mode()Douglas Anderson1-1/+1
In of_get_regulation_constraints() we were taking the result of of_map_mode() (an unsigned int) and assigning it to an int. We were then checking whether this value was -EINVAL. Some implementers of of_map_mode() were returning -EINVAL (even though the return type of their function needed to be unsigned int) because they needed to signal an error back to of_get_regulation_constraints(). In general in the regulator framework the mode is always referred to as an unsigned int. While we could fix this to be a signed int (the highest value we store in there right now is 0x8), it's actually pretty clean to just define the regulator mode 0x0 (the lack of any bits set) as an invalid mode. Let's do that. Fixes: 5e5e3a42c653 ("regulator: of: Add support for parsing initial and suspend modes") Suggested-by: Javier Martinez Canillas <javierm@redhat.com> Signed-off-by: Douglas Anderson <dianders@chromium.org> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-07-17regulator: cpcap: Add OF mode mappingSebastian Reichel1-0/+13
Add device tree mode mapping capabilities to the cpcap driver. Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk> Signed-off-by: Mark Brown <broonie@kernel.org>
2017-07-17regulator: cpcap: Fix standby modeSebastian Reichel1-3/+5
The original patch from Tony uses standby mode bit inverted, which is not correct. This fixes all instances in the driver code for get & set mode. This did not yet make problems, since mode has not been changed by any mainline driver so far. Fixes: 0ad4c07edd41 ("regulator: cpcap: Add basic regulator support") Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
2017-02-04regulator: cpcap: Add basic regulator supportTony Lindgren1-0/+464
Many Motorola phones like droid 4 are using a custom PMIC called CPCAP or 6556002. This PMIC is used with several SoCs, I've noticed at least omap3, omap4 and Tegra2 based Motorola phones and tablets using it. Cc: devicetree@vger.kernel.org Cc: Marcel Partap <mpartap@gmx.net> Cc: Michael Scott <michael.scott@linaro.org> Cc: Rob Herring <robh@kernel.org> Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Mark Brown <broonie@kernel.org>