summaryrefslogtreecommitdiffstats
path: root/drivers/regulator/fan53555.c
Commit message (Collapse)AuthorAgeFilesLines
* regulator: fan53555: constify regulator_ops structureBhumika Goyal2017-01-311-1/+1
| | | | | | | | | | | | | | | | | Declare regulator_ops structure as const as it is only stored in the ops field of a regulator_desc structure. This field is of type const, so regulator_ops structures having this property can be made const too. File size before: drivers/regulator/fan53555.o text data bss dec hex filename 3512 496 8 4016 fb0 drivers/regulator/fan53555.o File size after: drivers/regulator/fan53555.o text data bss dec hex filename 3768 240 8 4016 fb0 drivers/regulator/fan53555.o Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: fan53555: Add support for FAN53555UC13X typeWadim Egorov2016-04-201-0/+22
| | | | | | | | | | IC type options 00, 13 and 23 are sharing the same DIE_ID 0. Let's differentiate between these revisions. FAN53555UC13X has the ID 0 and REV 0xf, starts at 800mV and increments in 10mV steps. Signed-off-by: Wadim Egorov <w.egorov@phytec.de> Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: fan53555: Add support for FAN53555BUC18X typeWadim Egorov2016-04-201-0/+2
| | | | | | | | FAN53555BUC18X has the DIE_ID 8, starts at 600mV and increments in 10mV steps. Signed-off-by: Wadim Egorov <w.egorov@phytec.de> Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: fan53555: fill set_suspend_enable/disable callbackzhangqing2016-01-151-0/+18
| | | | | | | | | Setting the set_suspend_enable/disable callback to support enable and disable the dcdc when system is suspend. Signed-off-by: zhangqing <zhangqing@rock-chips.com> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: fan53555: Export I2C module alias informationJavier Martinez Canillas2015-07-311-0/+1
| | | | | | | | | | | The I2C core always reports the MODALIAS uevent as "i2c:<client name" regardless if the driver was matched using the I2C id_table or the of_match_table. So the driver needs to export the I2C table and this be built into the module or udev won't have the necessary information to auto load the correct module when the device is added. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: fan53555: fill set_voltage_time_set callbackHeiko Stuebner2015-05-261-0/+1
| | | | | | | | | Setting the set_voltage_time_sel callback to the standard function regulator_set_voltage_time_sel enables the regulator to actually honor ramp-delays when during regulator_set_voltage calls. Signed-off-by: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: fan53555: Constify struct regmap_config and slew_rates arrayKrzysztof Kozlowski2015-01-051-2/+2
| | | | | | | | | The regmap_config struct may be const because it is not modified by the driver and regmap_init() accepts pointer to const. Make const also slew_rates array. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: of: Add regulator desc param to of_get_regulator_init_data()Javier Martinez Canillas2014-11-261-8/+9
| | | | | | | | | | | | | | | | The of_get_regulator_init_data() function is used to extract the regulator init_data but information on how to extract certain data is defined in the static regulator descriptor (e.g: how to map the hardware operating modes). Add a const struct regulator_desc * parameter to the function signature so the parsing logic could use the information in the struct regulator_desc. of_get_regulator_init_data() relies on of_get_regulation_constraints() to actually extract the init_data so it has to pass the struct regulator_desc but that is modified on a later patch. Signed-off-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk> Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: fan53555: Fix null pointer dereferenceAxel Lin2014-09-181-1/+1
| | | | | | | | Set di->regulator before dereference it. Signed-off-by: Axel Lin <axel.lin@ingics.com> Reviewed-by: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: fan53555: Fixup report wrong vendor messageAxel Lin2014-09-181-2/+1
| | | | | | Signed-off-by: Axel Lin <axel.lin@ingics.com> Reviewed-by: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: fan53555: fix wrong cast in probeHeiko Stübner2014-09-171-1/+1
| | | | | | | | | | | | | | | The vendor-id gathered from the dt match-data was cast to int but assigned to an unsigned long, producing warnings on at least sparc, like drivers/regulator/fan53555.c: In function 'fan53555_regulator_probe': >> drivers/regulator/fan53555.c:373:16: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] di->vendor = (int) match->data; Fix this by using an appropriate cast. Reported-by: kbuild test robot Signed-off-by: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: fan53555: add support for Silergy SYR82x regulatorsHeiko Stuebner2014-09-161-15/+87
| | | | | | | | | | | | | | | | Silergy SYR82x regulators share the exact same functionality and register layout as the Fairchild FAN53555 regulators. Therefore extend the driver to add support for them. Both types use the same vendor id in their ID1 register, so it's not possible to distinguish them automatically. Similarly, the types also do not match. Type 8 used by the SYR827 and SYR828 start at 712.5mV and increment in 12.5mv steps, while the FAN53555 type 8 starts at 600mV and increments in 10mV steps. Signed-off-by: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: fan53555: add devicetree supportHeiko Stuebner2014-09-161-4/+46
| | | | | | | Add the ability to parse regulator-data from the devicetree. Signed-off-by: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: fan53555: use set_ramp_delay to set the ramp up slew rateHeiko Stuebner2014-09-161-11/+42
| | | | | | | | | The regulator constraints already provide a field for the ramp_delay, so there is no need to set this manually. Therefore implement the set_ramp_delay callback and convert the pdata value to the constraint value if necessary. Signed-off-by: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: fan53555: enable vin supplyHeiko Stuebner2014-09-151-0/+1
| | | | | | | | The regulator can be supplied by a parent regulator through its vin pin, so add the supply_name for it. Signed-off-by: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Mark Brown <broonie@kernel.org>
* regulator: fan53555: Remove redundant error messageSachin Kamat2014-02-201-3/+2
| | | | | | | | kzalloc prints its own OOM message upon failure. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Cc: Yunfan Zhang <yfzhang@marvell.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* regulator: fan53555: Do not hardcode return valuesSachin Kamat2014-02-201-4/+4
| | | | | | | Propagate the error values returned by the function instead. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Mark Brown <broonie@linaro.org>
* regulator: fan53555: Convert to devm_regulator_registerAxel Lin2013-09-171-11/+1
| | | | | Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* Merge tag 'PTR_RET-for-linus' of ↵Linus Torvalds2013-09-041-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux Pull PTR_RET() removal patches from Rusty Russell: "PTR_RET() is a weird name, and led to some confusing usage. We ended up with PTR_ERR_OR_ZERO(), and replacing or fixing all the usages. This has been sitting in linux-next for a whole cycle" [ There are still some PTR_RET users scattered about, with some of them possibly being new, but most of them existing in Rusty's tree too. We have that #define PTR_RET(p) PTR_ERR_OR_ZERO(p) thing in <linux/err.h>, so they continue to work for now - Linus ] * tag 'PTR_RET-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux: GFS2: Replace PTR_RET with PTR_ERR_OR_ZERO Btrfs: volume: Replace PTR_RET with PTR_ERR_OR_ZERO drm/cma: Replace PTR_RET with PTR_ERR_OR_ZERO sh_veu: Replace PTR_RET with PTR_ERR_OR_ZERO dma-buf: Replace PTR_RET with PTR_ERR_OR_ZERO drivers/rtc: Replace PTR_RET with PTR_ERR_OR_ZERO mm/oom_kill: remove weird use of ERR_PTR()/PTR_ERR(). staging/zcache: don't use PTR_RET(). remoteproc: don't use PTR_RET(). pinctrl: don't use PTR_RET(). acpi: Replace weird use of PTR_RET. s390: Replace weird use of PTR_RET. PTR_RET is now PTR_ERR_OR_ZERO(): Replace most. PTR_RET is now PTR_ERR_OR_ZERO
| * PTR_RET is now PTR_ERR_OR_ZERO(): Replace most.Rusty Russell2013-07-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Sweep of the simple cases. Cc: netdev@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-arm-kernel@lists.infradead.org Cc: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Acked-by: David S. Miller <davem@davemloft.net> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
* | regulator: use dev_get_platdata()Jingoo Han2013-07-301-1/+1
|/ | | | | | | | Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* regulator: fan53555: Use PTR_RET functionAlexandru Gheorghiu2013-03-201-3/+1
| | | | | | | | Used PTR_RET function instead of IS_ERR and PTR_ERR. Patch found using coccinelle. Signed-off-by: Alexandru Gheorghiu <gheorghiuandru@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: remove use of __devexitBill Pemberton2012-11-201-1/+1
| | | | | | | | CONFIG_HOTPLUG is going away as an option so __devexit is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: remove use of __devinitBill Pemberton2012-11-201-1/+1
| | | | | | | | CONFIG_HOTPLUG is going away as an option so __devinit is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: remove use of __devexit_pBill Pemberton2012-11-201-1/+1
| | | | | | | | CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: fan53555: remove vsel_max not usedYunfan Zhang2012-09-101-3/+0
| | | | | | | | | The max voltage will be bounded by min_uV, uV_step and n_voltages, so remove it to avoid confusing. Signed-off-by: Yunfan Zhang <yfzhang@marvell.com> Reviewed-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* regulator: Fairchild fan53555 supportYunfan Zhang2012-09-101-0/+325
This driver supports Fairchild FAN53555 Digitally Programmable TinyBuck Regulator. The FAN53555 is a step-down switching voltage regulator that delivers a digitally programmable output from an input voltage supply of 2.5V to 5.5V. The output voltage is programmed through an I2C interface. Signed-off-by: Yunfan Zhang <yfzhang@marvell.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>