Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1331359 > unrolled thread

[PATCH V1] mfd: da9063: fix missing volatile registers in the core regmap_range volatile lists

Started bySteve Twiss <stwiss.opensource@diasemi.com>
First post2016-02-10 18:40 +0100
Last post2016-02-11 10:20 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH V1] mfd: da9063: fix missing volatile registers in the core  regmap_range volatile lists Steve Twiss <stwiss.opensource@diasemi.com> - 2016-02-10 18:40 +0100
    Re: [PATCH V1] mfd: da9063: fix missing volatile registers in the  core regmap_range volatile lists Lee Jones <lee.jones@linaro.org> - 2016-02-11 10:20 +0100

#1331359 — [PATCH V1] mfd: da9063: fix missing volatile registers in the core regmap_range volatile lists

FromSteve Twiss <stwiss.opensource@diasemi.com>
Date2016-02-10 18:40 +0100
Subject[PATCH V1] mfd: da9063: fix missing volatile registers in the core regmap_range volatile lists
Message-ID<r0GUa-5nr-5@gated-at.bofh.it>
From: Steve Twiss <stwiss.opensource@diasemi.com>

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>

---

Hi Lee,

This patch applies against linux-next and v4.5-rc1

It is quite similar to a previous patch you recently applied
- https://lkml.org/lkml/2016/2/1/485

But this is for the DA9063 not DA9062

Regards,
Steve


 drivers/mfd/da9063-i2c.c | 36 ++++++++++++++++++++++++++++++------
 1 file changed, 30 insertions(+), 6 deletions(-)

diff --git a/drivers/mfd/da9063-i2c.c b/drivers/mfd/da9063-i2c.c
index 2d4e3e0..7390108 100644
--- a/drivers/mfd/da9063-i2c.c
+++ b/drivers/mfd/da9063-i2c.c
@@ -74,18 +74,30 @@ 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,18 +164,30 @@ 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,
 	},
-- 
end-of-patch for PATCH V1

[toc] | [next] | [standalone]


#1331761 — Re: [PATCH V1] mfd: da9063: fix missing volatile registers in the core regmap_range volatile lists

FromLee Jones <lee.jones@linaro.org>
Date2016-02-11 10:20 +0100
SubjectRe: [PATCH V1] mfd: da9063: fix missing volatile registers in the core regmap_range volatile lists
Message-ID<r0VzP-6IR-13@gated-at.bofh.it>
In reply to#1331359
On Wed, 10 Feb 2016, Steve Twiss wrote:

> From: Steve Twiss <stwiss.opensource@diasemi.com>
> 
> 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>
> 
> ---
> 
> Hi Lee,
> 
> This patch applies against linux-next and v4.5-rc1
> 
> It is quite similar to a previous patch you recently applied
> - https://lkml.org/lkml/2016/2/1/485
> 
> But this is for the DA9063 not DA9062
> 
> Regards,
> Steve
> 
> 
>  drivers/mfd/da9063-i2c.c | 36 ++++++++++++++++++++++++++++++------
>  1 file changed, 30 insertions(+), 6 deletions(-)

Applied, thanks.

> diff --git a/drivers/mfd/da9063-i2c.c b/drivers/mfd/da9063-i2c.c
> index 2d4e3e0..7390108 100644
> --- a/drivers/mfd/da9063-i2c.c
> +++ b/drivers/mfd/da9063-i2c.c
> @@ -74,18 +74,30 @@ 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,18 +164,30 @@ 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,
>  	},

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web