]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mfd: da9063: Fix missing volatile registers in the core regmap_range volatile lists
authorSteve Twiss <stwiss.opensource@diasemi.com>
Wed, 10 Feb 2016 17:35:07 +0000 (17:35 +0000)
committerLee Jones <lee.jones@linaro.org>
Fri, 12 Feb 2016 09:20:25 +0000 (09:20 +0000)
Add an updated set of registers listed in the core regmap_range volatile
ranges defined for the DA9063.

These new registers contain bits that cannot be considered under the full
control of software. Under various conditions the hardware will set and/or
automatically clear bit(s) contained in these registers.

When using a cached version of regmap, the volatility of these registers must
be identified otherwise the regmap operations may not ensure the registers
are explicitly altered.

As well as updating the list of volatile registers, this change will fix a
corner case discovered in the DA9063 ONKEY which is used by the DA9063 core.

In the ONKEY case, the CONTROL_B register is now listed as volatile in the
regmap_range because it contains the bit field NONKEY_LOCK. This bit can be
altered by hardware, in which case regmap must be notified of its ability
to be manpiulated outside of software control.

Signed-off-by: Steve Twiss <stwiss.opensource@diasemi.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/mfd/da9063-i2c.c

index 2d4e3e0f4e940f2681b14a4f42e1566322ccc86a..73901084945fcf24e52f646dd8df61706d7ed10c 100644 (file)
@@ -74,17 +74,29 @@ static const struct regmap_range da9063_ad_writeable_ranges[] = {
 
 static const struct regmap_range da9063_ad_volatile_ranges[] = {
        {
-               .range_min = DA9063_REG_STATUS_A,
+               .range_min = DA9063_REG_PAGE_CON,
                .range_max = DA9063_REG_EVENT_D,
        }, {
-               .range_min = DA9063_REG_CONTROL_F,
+               .range_min = DA9063_REG_CONTROL_A,
+               .range_max = DA9063_REG_CONTROL_B,
+       }, {
+               .range_min = DA9063_REG_CONTROL_E,
                .range_max = DA9063_REG_CONTROL_F,
        }, {
-               .range_min = DA9063_REG_ADC_MAN,
+               .range_min = DA9063_REG_BCORE2_CONT,
+               .range_max = DA9063_REG_LDO11_CONT,
+       }, {
+               .range_min = DA9063_REG_DVC_1,
                .range_max = DA9063_REG_ADC_MAN,
        }, {
                .range_min = DA9063_REG_ADC_RES_L,
                .range_max = DA9063_AD_REG_SECOND_D,
+       }, {
+               .range_min = DA9063_REG_SEQ,
+               .range_max = DA9063_REG_SEQ,
+       }, {
+               .range_min = DA9063_REG_EN_32K,
+               .range_max = DA9063_REG_EN_32K,
        }, {
                .range_min = DA9063_AD_REG_MON_REG_5,
                .range_max = DA9063_AD_REG_MON_REG_6,
@@ -152,17 +164,29 @@ static const struct regmap_range da9063_bb_writeable_ranges[] = {
 
 static const struct regmap_range da9063_bb_volatile_ranges[] = {
        {
-               .range_min = DA9063_REG_STATUS_A,
+               .range_min = DA9063_REG_PAGE_CON,
                .range_max = DA9063_REG_EVENT_D,
        }, {
-               .range_min = DA9063_REG_CONTROL_F,
+               .range_min = DA9063_REG_CONTROL_A,
+               .range_max = DA9063_REG_CONTROL_B,
+       }, {
+               .range_min = DA9063_REG_CONTROL_E,
                .range_max = DA9063_REG_CONTROL_F,
        }, {
-               .range_min = DA9063_REG_ADC_MAN,
+               .range_min = DA9063_REG_BCORE2_CONT,
+               .range_max = DA9063_REG_LDO11_CONT,
+       }, {
+               .range_min = DA9063_REG_DVC_1,
                .range_max = DA9063_REG_ADC_MAN,
        }, {
                .range_min = DA9063_REG_ADC_RES_L,
                .range_max = DA9063_BB_REG_SECOND_D,
+       }, {
+               .range_min = DA9063_REG_SEQ,
+               .range_max = DA9063_REG_SEQ,
+       }, {
+               .range_min = DA9063_REG_EN_32K,
+               .range_max = DA9063_REG_EN_32K,
        }, {
                .range_min = DA9063_BB_REG_MON_REG_5,
                .range_max = DA9063_BB_REG_MON_REG_6,