Commit Graph

16 Commits

Author SHA1 Message Date
Mark Brown a2a2be6309 Merge remote-tracking branches 'regulator/topic/db8500', 'regulator/topic/gpio', 'regulator/topic/lp3971', 'regulator/topic/lp3972', 'regulator/topic/max14577', 'regulator/topic/max77693', 'regulator/topic/mc13892', 'regulator/topic/pcf50633' and 'regulator/topic/pfuze100' into regulator-linus 2014-01-23 12:01:27 +00:00
Fabio Estevam f269438368 regulator: pfuze100-regulator: Improve dev_info() message
'lay' is not very meaningful, so use it 'layer' instead to let the dev_info()
clearer.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-01-23 12:00:17 +00:00
Fabio Estevam 62b389161f regulator: pfuze100-regulator: Fix some checkpatch complaints
Fix the following checkpatch error and warning:

ERROR: switch and case should be at the same indent
#311: FILE: drivers/regulator/pfuze100-regulator.c:311:
+	switch (value & 0x0f) {
[...]
+		case 0x8:
[...]
+		case 0x0:
[...]
+		default:

WARNING: line over 80 characters
#312: FILE: drivers/regulator/pfuze100-regulator.c:312:
+		/* Freescale misprogrammed 1-3% of parts prior to week 8 of 2013 as ID=8 */

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-01-15 11:46:56 +00:00
Mark Brown 598911b42c Linux 3.13-rc4
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.15 (GNU/Linux)
 
 iQEcBAABAgAGBQJSrhGrAAoJEHm+PkMAQRiGsNoH/jIK3CsQ2lbW7yRLXmfgtbzz
 i2Kep6D4SDvmaLpLYOVC8xNYTiE8jtTbSXHomwP5wMZ63MQDhBfnEWsEWqeZ9+D9
 3Q46p0QWuoBgYu2VGkoxTfygkT6hhSpwWIi3SeImbY4fg57OHiUil/+YGhORM4Qc
 K4549OCTY3sIrgmWL77gzqjRUo+pQ4C73NKqZ3+5nlOmYBZC1yugk8mFwEpQkwhK
 4NRNU760Fo+XIht/bINqRiPMddzC15p0mxvJy3cDW8bZa1tFSS9SB7AQUULBbcHL
 +2dFlFOEb5SV1sNiNPrJ0W+h2qUh2e7kPB0F8epaBppgbwVdyQoC2u4uuLV2ZN0=
 =lI2r
 -----END PGP SIGNATURE-----

Merge tag 'v3.13-rc4' into regulator-pfuze100

Linux 3.13-rc4
2014-01-15 11:46:35 +00:00
Jingoo Han f5247b401c regulator: pfuze100: use devm_regulator_register()
Use devm_regulator_register() to make cleanup paths simpler,
and remove unnecessary remove().

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Robin Gong <b38343@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-09 17:42:18 +00:00
Tim Harvey 236c427cbc regulator: pfuze100: allow misprogrammed ID
prior to week 08 of 2013 Freescale misprogrammed between 1 and 3% of
PFUZE1000 parts with a ID=0x8 instead of the expected ID=0x0

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Cc: stable@vger.kernel.org
2013-12-09 17:19:30 +00:00
Axel Lin a1b6fa85c6 regulator: pfuze100: Fix address of FABID
According to the datasheet, the address of FABID is 0x4. Fix it.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Robin Gong <b38343@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Cc: stable@vger.kernel.org
2013-12-09 17:18:19 +00:00
Axel Lin 6b8430c3f3 regulator: pfuze100: Fix off-by-one for max_register setting
max_register should be register count - 1.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Reviewed-by: Robin Gong <b38343@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-08-02 11:29:00 +01:00
Axel Lin e56566699c regulator: pfuze100: Simplify pfuze100_set_ramp_delay implementation
Simplify the equation to calculate ramp_delay.
Below equations are equivalent:
  ramp_delay = 25000 / (2 * ramp_delay);
  ramp_delay = 50000 / (4 * ramp_delay);
  ramp_delay = 25000 / (2 * ramp_delay);
  ramp_delay = 12500 / ramp_delay;
So we don't need to read BIT6 of rdev->desc->vsel_reg for applying different
equations.

Also use rdev->desc->vsel_reg instead of run-time calculate register address.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Reviewed-by: Robin Gong <b38343@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-31 17:53:46 +01:00
Axel Lin d9493234e2 regulator: pfuze100: Fix n_voltages setting for SW2~SW4 with high bit set
Current code adjust min_uV and uV_step but missed adjusting the n_voltages
setting.

When BIT6 is clear:
        n_voltages = (1975000 - 400000) / 25000 + 1 = 64
When BIT6 is set:
        n_voltages = (3300000 - 800000) / 50000 + 1 = 51

The n_voltages needs update because when BIT6 is set 0x73 ~ 0x7f are reserved.
When using regulator_list_voltage_linear, the n_voltages does matter here
because wrong n_voltages setting make the equation return wrong result.
e.g. if selector is 63, regulator_list_voltage_linear returns
     800000 + (50000 * 63) = 4000000
     It should return -EINVAL if the selector is in the range of 51 ~ 63.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-30 11:20:00 +01:00
Axel Lin 2e04cc41a6 regulator: pfuze100: Use regulator_map_voltage_ascend
All table based voltage list have ascendant order.
Use regulator_map_voltage_ascend for them.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-29 12:43:04 +01:00
Axel Lin 40839bff8b regulator: pfuze100: Fix module alias prefix
i2c drivers use "i2c:" prefix for module alias.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-29 06:52:14 +01:00
Axel Lin 8c86ab257d regulator: pfuze100: Use i2c_[set|get]_clientdata
Since this is a i2c driver, use i2c_[set|get]_clientdata instead of
dev_[set|get]_drvdata.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-29 06:49:56 +01:00
Robin Gong 12d20fc2f3 regulator: pfuze100: add MODULE_LICENSE() in pfuze100 driver
Fix building error on x86_64 and i386:
WARNING: modpost: missing MODULE_LICENSE() in
drivers/regulator/pfuze100-regulator.o

Signed-off-by: Robin Gong <b38343@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-29 06:00:54 +01:00
Robin Gong 205c97bcb8 regulator:pfuze100: fix build warning and correct the binding doc
fix building warning and correct the binding doc

Signed-off-by: Robin Gong <b38343@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-26 19:06:48 +01:00
Robin Gong 3784b6d64d regulator: pfuze100: add pfuze100 regulator driver
Add pfuze100 regulator driver.

Signed-off-by: Robin Gong <b38343@freescale.com>
Tested-by: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-25 10:34:34 +01:00