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>
Tue, 28 Aug 2012 18:00:24 +0000 (11:00 -0700)
commit0f4c46d2e2150ef68d4c100d74f186ae93f00f3c
tree6a09599b81e007e1d7e4a823890a15a173b2b825
parentc42ea5cdfb14418a9d81e7192d65196b2785c3c2
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