]> git.karo-electronics.de Git - karo-tx-linux.git/commit
regulator: Use BUCK_FPWM_[MASK|SHIFT] macros to replace buck_pmap table
authorAxel Lin <axel.lin@gmail.com>
Fri, 20 Jul 2012 15:10:55 +0000 (23:10 +0800)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Fri, 3 Aug 2012 22:21:30 +0000 (23:21 +0100)
commit01d493f710748645b053613ac7f7c0a89c2cea2c
tree208130c7a480498cb9fc8111c30aa97baa735da8
parent6883aed790f0ae92f7d414e72cf896d9df7b0eb0
regulator: Use BUCK_FPWM_[MASK|SHIFT] macros to replace buck_pmap table

Below is the buck_pmap mapping table:

BUCK1:  mask = 1 << 0,  shift = 0
BUCK2:  mask = 1 << 1,  shift = 1
BUCK3:  mask = 1 << 2,  shift = 2
BUCK4:  mask = 1 << 3,  shift = 3

The mask and shift can be easily calculated by:
        mask = 1 << BUCK_ID
        shift = BUCK_ID

This patch defines BUCK_FPWM_MASK and BUCK_FPWM_SHIFT macros to replace
buck_pmap mapping table.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Milo(Woogyom) Kim <milo.kim@ti.com>
Tested-by: Milo(Woogyom) Kim <milo.kim@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
drivers/regulator/lp8788-buck.c