linux-stable/drivers
Matt Sealey ccf3ed782a regulator: mc13892-regulator: correct/refine handling of the SWxHI bit
MC13892 PMIC supports a "HI" bit for 3 of it's 4 buck switcher outputs,
which enables a higher set of voltage ranges.

Despite a comment in the code ('sw regulators need special care due to the
"hi" bit'), it actually does not take special care since it does not modify
it's use of the selector table index when this bit is set, giving us very
odd behavior when setting a high voltage on supported switchers or listing
current voltages. Net effect is in best case the kernel and sysfs report
lower voltages than are actually set in hardware (1300mV instead of 1800mV
for example) and in the worst case setting a voltage (e.g. 1800mV) will cause
an undervoltage condition (e.g. 1300mV).

Correct the behavior, taking into account SW1 doesn't support the HI bit,
and as such we need to ignore it.

While we are modifying these functions, fix and optimize the following;

* set_voltage_sel callback was using .reg instead of .vsel_reg - since
  they were set to the same value it actually didn't break anything but
  it would be semantically incorrect to use .reg in this case. We now use
  .vsel_reg and be consistent.
* vsel_shift is always 0 for every SWx regulator, and constantly shifting
  and masking off the bottom few bits is time consuming and makes the
  code very hard to read - optimize this out.
* get_voltage_sel uses the variable "val" and set_voltage_sel uses the
  variable "selector" (and reg_value). Introduce the variable "selector"
  to get_voltage_sel such that it makes more sense and allow some leaner
  code in light of the modifications in this patch. Add better exposure
  to the debug print so the register value AND the selector are printed as
  this will adequately show the HI bit in the register.
* correct a comment in probe which is doing a version check. Magic
  values are awful but for once instance, a comment does just as
  good a job as something symbolic.

Signed-off-by: Matt Sealey <matt@genesi-usa.com>
Tested-by: Steev Klimaszewski <steev@genesi-usa.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-01-27 11:22:21 +08:00
..
accessibility
acpi ACPI: Check MSR valid bit before using P-state frequencies 2013-01-22 13:37:21 +01:00
amba Drivers: amba: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
ata [libata] replace sata_settings with devslp_timing 2013-01-14 13:29:15 -05:00
atm Drivers: atm: remove __dev* attributes. 2013-01-03 15:57:04 -08:00
auxdisplay Drivers: misc: remove __dev* attributes. 2013-01-03 15:57:16 -08:00
base Merge remote-tracking branch 'regmap/fix/debugfs' into tmp 2013-01-24 19:04:16 +08:00
bcma Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2013-01-08 07:31:49 -08:00
block Various minor fixes, but a slightly more complex one to fix the per-cpu overload 2013-01-20 16:44:28 -08:00
bluetooth Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2012-12-12 18:07:07 -08:00
bus Drivers: misc: remove __dev* attributes. 2013-01-03 15:57:16 -08:00
cdrom Drivers: misc: remove __dev* attributes. 2013-01-03 15:57:16 -08:00
char Drivers: char: remove __dev* attributes. 2013-01-03 15:57:15 -08:00
clk mvebu fixes for v3.8-rc5 2013-01-23 20:30:52 -08:00
clocksource Drivers: clocksource: remove __dev* attributes. 2013-01-03 15:57:15 -08:00
connector Drivers: misc: remove __dev* attributes. 2013-01-03 15:57:16 -08:00
cpufreq cpufreq: Add module aliases for acpi-cpufreq 2013-01-22 22:33:46 +01:00
cpuidle cpuidle: remove the power_specified field in the driver 2013-01-15 14:18:04 +01:00
crypto Drivers: crypto: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
dca
devfreq PM / devfreq: exynos4_bus: honor RCU lock usage 2013-01-22 13:28:40 +01:00
dio
dma Merge branch 'fixes' of git://git.infradead.org/users/vkoul/slave-dma 2013-01-24 10:17:49 -08:00
edac Two error path fixes causing a crash and a Kconfig fix for an issue 2013-01-09 08:43:56 -08:00
eisa
extcon
firewire Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2012-12-13 12:00:02 -08:00
firmware Drivers: misc: remove __dev* attributes. 2013-01-03 15:57:16 -08:00
gpio gpio: mvebu: Don't free chip label memory 2013-01-17 12:27:08 +01:00
gpu ttm: on move memory failure don't leave a node dangling 2013-01-21 13:45:23 +10:00
hid Drivers: misc: remove __dev* attributes. 2013-01-03 15:57:16 -08:00
hsi Drivers: misc: remove __dev* attributes. 2013-01-03 15:57:16 -08:00
hv Drivers: hv: balloon: Fix a memory leak 2013-01-17 11:58:00 -08:00
hwmon hwmon: (vexpress) Fix build error seen if CONFIG_OF_DEVICE is not set 2013-01-09 21:47:22 -08:00
hwspinlock
i2c i2c-designware: add missing MODULE_LICENSE 2013-01-22 16:43:34 +01:00
ide Drivers: ide: remove __dev* attributes. 2013-01-03 15:57:03 -08:00
idle intel_idle: Don't register CPU notifier if we are not running. 2013-01-18 13:43:43 +01:00
iio Staging fixes for 3.8-rc3 2013-01-14 09:08:38 -08:00
infiniband Drivers: infinband: remove __dev* attributes. 2013-01-03 15:57:15 -08:00
input Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2013-01-04 10:30:11 -08:00
iommu Drivers: iommu: remove __dev* attributes. 2013-01-03 15:57:14 -08:00
ipack TTY/Serial merge for 3.8-rc1 2012-12-11 14:08:47 -08:00
irqchip ARM: arm-soc: Device-tree updates, take 2 2012-12-14 14:42:53 -08:00
isdn Drivers: isdn: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
leds leds: leds-gpio: set devm_gpio_request_one() flags param correctly 2013-01-02 17:58:41 -08:00
lguest lguest: fix typo 2012-12-18 15:19:06 +10:30
macintosh Drivers: macintosh: remove __dev* attributes. 2013-01-03 15:57:14 -08:00
md Miscellaneous device-mapper fixes, cleanups and performance improvements. 2012-12-21 17:08:06 -08:00
media ARM: arm-soc: Fixes for 3.8-rc, take 2 2013-01-24 12:42:50 -08:00
memory Drivers: memory: remove __dev* attributes. 2013-01-03 15:57:14 -08:00
memstick
message Drivers: message: remove __dev* attributes. 2013-01-03 15:57:14 -08:00
mfd mfd: vexpress-sysreg: Don't skip initialization on probe 2013-01-24 12:19:23 +00:00
misc Revert "drivers/misc/ti-st: remove gpio handling" 2013-01-22 17:22:47 -08:00
mmc mvebu fixes for v3.8-rc5 2013-01-23 20:30:52 -08:00
mtd Drivers: mtd: remove __dev* attributes. 2013-01-03 15:57:03 -08:00
net be2net: fix unconditionally returning IRQ_HANDLED in INTx 2013-01-12 15:33:01 -08:00
nfc Drivers: misc: remove __dev* attributes. 2013-01-03 15:57:16 -08:00
nubus
of of: Fix export of of_find_matching_node_and_match() 2012-12-19 10:58:53 +00:00
oprofile
parisc Drivers: misc: remove __dev* attributes. 2013-01-03 15:57:16 -08:00
parport Drivers: parport: remove __dev* attributes. 2013-01-03 15:57:03 -08:00
pci PCI updates for v3.8: 2013-01-22 16:36:23 -08:00
pcmcia ARM: arm-soc: Header cleanups 2012-12-12 11:45:16 -08:00
pinctrl ARM: arm-soc fixes for 3.8-rc 2013-01-08 18:53:56 -08:00
platform asus-laptop: Fix potential invalid pointer dereference 2013-01-07 12:33:48 -05:00
pnp PNP: Handle IORESOURCE_BITS in resource allocation 2013-01-03 13:10:53 +01:00
power ARM: arm-soc fixes for 3.8-rc 2013-01-08 18:53:56 -08:00
pps Drivers: misc: remove __dev* attributes. 2013-01-03 15:57:16 -08:00
ps3 Drivers: misc: remove __dev* attributes. 2013-01-03 15:57:16 -08:00
ptp Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2012-12-12 18:07:07 -08:00
pwm pwm: Changes for v3.8-rc1 2012-12-19 08:19:07 -08:00
rapidio Driver core updates for 3.8-rc1 2012-12-11 13:13:55 -08:00
regulator regulator: mc13892-regulator: correct/refine handling of the SWxHI bit 2013-01-27 11:22:21 +08:00
remoteproc Drivers: misc: remove __dev* attributes. 2013-01-03 15:57:16 -08:00
rpmsg Drivers: misc: remove __dev* attributes. 2013-01-03 15:57:16 -08:00
rtc drivers/rtc/rtc-da9055.c: fix cross-section reference 2013-01-11 14:54:54 -08:00
s390 s390/chsc: fix SEI usage 2013-01-16 15:57:54 +01:00
sbus Drivers: sbus: remove __dev* attributes. 2013-01-03 15:57:03 -08:00
scsi Drivers: scsi: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
sfi
sh sh: clkfwk: bugfix: sh_clk_div_enable() care sh_clk_div_set_rate() if div6 2013-01-11 20:57:58 +09:00
sn Drivers: misc: remove __dev* attributes. 2013-01-03 15:57:16 -08:00
spi spi/sh-hspi: fix return value check in hspi_probe(). 2012-12-19 15:11:41 +00:00
ssb Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2013-01-08 07:31:49 -08:00
staging Staging bugfixes for 3.8-rc4 2013-01-18 14:05:25 -08:00
target iscsi-target: Fix CmdSN comparison (use cmd->cmd_sn instead of cmd->stat_sn) 2013-01-10 21:00:37 -08:00
tc
thermal Drivers: thermal: remove __dev* attributes. 2013-01-03 15:57:02 -08:00
tty 8250/16?50: Add support for Broadcom TruManage redirected serial port 2013-01-17 14:02:55 -08:00
uio ARM: arm-soc: SoC updates for 3.8 2012-12-12 12:05:15 -08:00
usb USB: EHCI: fix build error in ehci-mxc 2013-01-23 11:27:08 -08:00
uwb
vfio vfio-pci: Fix buffer overfill 2013-01-15 10:45:26 -07:00
vhost Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending 2012-12-15 14:25:10 -08:00
video This is yet another critical imxfb fixes held off by absence of FB 2013-01-23 20:35:02 -08:00
virt Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc 2012-12-18 09:58:09 -08:00
virtio Drivers: virtio: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
vlynq Drivers: vlynq: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
vme
w1 Drivers: w1: remove last __devexit_p() instance 2013-01-03 15:57:01 -08:00
watchdog watchdog: twl4030_wdt: add DT support 2013-01-02 12:07:05 +01:00
xen Fixes: 2013-01-18 12:02:52 -08:00
zorro Drivers: zorro: remove CONFIG_HOTPLUG usage 2013-01-03 15:57:01 -08:00
Kconfig
Makefile