linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] mfd: da9062: Make vbuck_a registers volatile
@ 2021-11-24  7:00 Andrej Picej
  2021-11-24  7:00 ` [PATCH 2/2] mfd: da9063: Make vbcore " Andrej Picej
  0 siblings, 1 reply; 5+ messages in thread
From: Andrej Picej @ 2021-11-24  7:00 UTC (permalink / raw)
  To: support.opensource, lee.jones; +Cc: linux-kernel, andrej.picej, s.riedmueller

From: Stefan Riedmueller <s.riedmueller@phytec.de>

The VBUCK1_A, VBUCK2_A, VBUCK3_A and VBUCK4_A registers are used to set the
desired output voltage of the BUCK 1-4 buck regulators. These values can be
critical if used as input for core voltages. Thus make them volatile so
they do not get cached.

Signed-off-by: Stefan Riedmueller <s.riedmueller@phytec.de>
Signed-off-by: Andrej Picej <andrej.picej@norik.com>
---
 drivers/mfd/da9062-core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/mfd/da9062-core.c b/drivers/mfd/da9062-core.c
index 2774b2cbaea6..c0dad5461946 100644
--- a/drivers/mfd/da9062-core.c
+++ b/drivers/mfd/da9062-core.c
@@ -572,6 +572,8 @@ static const struct regmap_range da9062_aa_volatile_ranges[] = {
 	regmap_reg_range(DA9062AA_COUNT_S, DA9062AA_SECOND_D),
 	regmap_reg_range(DA9062AA_SEQ, DA9062AA_SEQ),
 	regmap_reg_range(DA9062AA_EN_32K, DA9062AA_EN_32K),
+	regmap_reg_range(DA9062AA_VBUCK2_A, DA9062AA_VBUCK2_A),
+	regmap_reg_range(DA9062AA_VBUCK3_A, DA9062AA_VBUCK3_A),
 };
 
 static const struct regmap_access_table da9062_aa_readable_table = {
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] mfd: da9063: Make vbcore registers volatile
  2021-11-24  7:00 [PATCH 1/2] mfd: da9062: Make vbuck_a registers volatile Andrej Picej
@ 2021-11-24  7:00 ` Andrej Picej
  2021-11-24  9:34   ` Adam Thomson
  0 siblings, 1 reply; 5+ messages in thread
From: Andrej Picej @ 2021-11-24  7:00 UTC (permalink / raw)
  To: support.opensource, lee.jones; +Cc: linux-kernel, andrej.picej, s.riedmueller

From: Stefan Riedmueller <s.riedmueller@phytec.de>

The VBCORE1_A and VBCORE2_A registers are used to set the desired output
voltage of the BCORE 1 and 2 buck regulators. These values can be critical
if used as input for core voltages. Thus make them volatile so they do not
get cached.

Signed-off-by: Stefan Riedmueller <s.riedmueller@phytec.de>
Signed-off-by: Andrej Picej <andrej.picej@norik.com>
---
 drivers/mfd/da9063-i2c.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/mfd/da9063-i2c.c b/drivers/mfd/da9063-i2c.c
index 343ed6e96d87..8a3629c30382 100644
--- a/drivers/mfd/da9063-i2c.c
+++ b/drivers/mfd/da9063-i2c.c
@@ -161,6 +161,7 @@ static const struct regmap_range da9063_ad_volatile_ranges[] = {
 	regmap_reg_range(DA9063_REG_ADC_RES_L, DA9063_AD_REG_SECOND_D),
 	regmap_reg_range(DA9063_REG_SEQ, DA9063_REG_SEQ),
 	regmap_reg_range(DA9063_REG_EN_32K, DA9063_REG_EN_32K),
+	regmap_reg_range(DA9063_REG_VBCORE2_A, DA9063_REG_VBCORE2_A),
 	regmap_reg_range(DA9063_AD_REG_MON_REG_5, DA9063_AD_REG_MON_REG_6),
 };
 
@@ -206,6 +207,7 @@ static const struct regmap_range da9063_bb_da_volatile_ranges[] = {
 	regmap_reg_range(DA9063_REG_ADC_RES_L, DA9063_BB_REG_SECOND_D),
 	regmap_reg_range(DA9063_REG_SEQ, DA9063_REG_SEQ),
 	regmap_reg_range(DA9063_REG_EN_32K, DA9063_REG_EN_32K),
+	regmap_reg_range(DA9063_REG_VBCORE2_A, DA9063_REG_VBCORE2_A),
 	regmap_reg_range(DA9063_BB_REG_MON_REG_5, DA9063_BB_REG_MON_REG_6),
 };
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* RE: [PATCH 2/2] mfd: da9063: Make vbcore registers volatile
  2021-11-24  7:00 ` [PATCH 2/2] mfd: da9063: Make vbcore " Andrej Picej
@ 2021-11-24  9:34   ` Adam Thomson
  2021-11-24 14:04     ` Andrej Picej
  0 siblings, 1 reply; 5+ messages in thread
From: Adam Thomson @ 2021-11-24  9:34 UTC (permalink / raw)
  To: Andrej Picej, Support Opensource, lee.jones; +Cc: linux-kernel, s.riedmueller

On 24 November 2021 07:00, Andrej Picej wrote:

> From: Stefan Riedmueller <s.riedmueller@phytec.de>
> 
> The VBCORE1_A and VBCORE2_A registers are used to set the desired output
> voltage of the BCORE 1 and 2 buck regulators. These values can be critical
> if used as input for core voltages. Thus make them volatile so they do not
> get cached.

I don't understand the need for this change. What is this fixing? As I
understand it the registers in question aren't volatile so should persist.

> Signed-off-by: Stefan Riedmueller <s.riedmueller@phytec.de>
> Signed-off-by: Andrej Picej <andrej.picej@norik.com>
> ---
>  drivers/mfd/da9063-i2c.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/mfd/da9063-i2c.c b/drivers/mfd/da9063-i2c.c
> index 343ed6e96d87..8a3629c30382 100644
> --- a/drivers/mfd/da9063-i2c.c
> +++ b/drivers/mfd/da9063-i2c.c
> @@ -161,6 +161,7 @@ static const struct regmap_range
> da9063_ad_volatile_ranges[] = {
>  	regmap_reg_range(DA9063_REG_ADC_RES_L,
> DA9063_AD_REG_SECOND_D),
>  	regmap_reg_range(DA9063_REG_SEQ, DA9063_REG_SEQ),
>  	regmap_reg_range(DA9063_REG_EN_32K, DA9063_REG_EN_32K),
> +	regmap_reg_range(DA9063_REG_VBCORE2_A,
> DA9063_REG_VBCORE2_A),
>  	regmap_reg_range(DA9063_AD_REG_MON_REG_5,
> DA9063_AD_REG_MON_REG_6),
>  };
> 
> @@ -206,6 +207,7 @@ static const struct regmap_range
> da9063_bb_da_volatile_ranges[] = {
>  	regmap_reg_range(DA9063_REG_ADC_RES_L,
> DA9063_BB_REG_SECOND_D),
>  	regmap_reg_range(DA9063_REG_SEQ, DA9063_REG_SEQ),
>  	regmap_reg_range(DA9063_REG_EN_32K, DA9063_REG_EN_32K),
> +	regmap_reg_range(DA9063_REG_VBCORE2_A,
> DA9063_REG_VBCORE2_A),
>  	regmap_reg_range(DA9063_BB_REG_MON_REG_5,
> DA9063_BB_REG_MON_REG_6),
>  };
> 
> --
> 2.25.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] mfd: da9063: Make vbcore registers volatile
  2021-11-24  9:34   ` Adam Thomson
@ 2021-11-24 14:04     ` Andrej Picej
  2021-11-24 14:47       ` Adam Thomson
  0 siblings, 1 reply; 5+ messages in thread
From: Andrej Picej @ 2021-11-24 14:04 UTC (permalink / raw)
  To: Adam Thomson, Support Opensource, lee.jones; +Cc: linux-kernel, s.riedmueller

Hi Adam,

On 24. 11. 21 10:34, Adam Thomson wrote:
> On 24 November 2021 07:00, Andrej Picej wrote:
> 
>> From: Stefan Riedmueller <s.riedmueller@phytec.de>
>>
>> The VBCORE1_A and VBCORE2_A registers are used to set the desired output
>> voltage of the BCORE 1 and 2 buck regulators. These values can be critical
>> if used as input for core voltages. Thus make them volatile so they do not
>> get cached.
> 
> I don't understand the need for this change. What is this fixing? As I
> understand it the registers in question aren't volatile so should persist.

So basically this two patches were needed because we needed to enable 
internal LDOs bypass mode on the imx6 and in the process this PMICs regs 
needed to be somehow adjusted, which only worked if this regs were 
marked as volatile. Long story short, this method was only introduced in 
Phytec's version so upstreaming really doesn't make much sense.

I apologize for any inconvenience, but this two patches somehow slipped 
through the process and landed on the "send-to-upstream" list. I also 
talked with @Stefan Rieadmueller and he agreed that this two patches can 
be dropped.

Thanks for your time.

> 
>> Signed-off-by: Stefan Riedmueller <s.riedmueller@phytec.de>
>> Signed-off-by: Andrej Picej <andrej.picej@norik.com>
>> ---
>>   drivers/mfd/da9063-i2c.c | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/mfd/da9063-i2c.c b/drivers/mfd/da9063-i2c.c
>> index 343ed6e96d87..8a3629c30382 100644
>> --- a/drivers/mfd/da9063-i2c.c
>> +++ b/drivers/mfd/da9063-i2c.c
>> @@ -161,6 +161,7 @@ static const struct regmap_range
>> da9063_ad_volatile_ranges[] = {
>>   	regmap_reg_range(DA9063_REG_ADC_RES_L,
>> DA9063_AD_REG_SECOND_D),
>>   	regmap_reg_range(DA9063_REG_SEQ, DA9063_REG_SEQ),
>>   	regmap_reg_range(DA9063_REG_EN_32K, DA9063_REG_EN_32K),
>> +	regmap_reg_range(DA9063_REG_VBCORE2_A,
>> DA9063_REG_VBCORE2_A),
>>   	regmap_reg_range(DA9063_AD_REG_MON_REG_5,
>> DA9063_AD_REG_MON_REG_6),
>>   };
>>
>> @@ -206,6 +207,7 @@ static const struct regmap_range
>> da9063_bb_da_volatile_ranges[] = {
>>   	regmap_reg_range(DA9063_REG_ADC_RES_L,
>> DA9063_BB_REG_SECOND_D),
>>   	regmap_reg_range(DA9063_REG_SEQ, DA9063_REG_SEQ),
>>   	regmap_reg_range(DA9063_REG_EN_32K, DA9063_REG_EN_32K),
>> +	regmap_reg_range(DA9063_REG_VBCORE2_A,
>> DA9063_REG_VBCORE2_A),
>>   	regmap_reg_range(DA9063_BB_REG_MON_REG_5,
>> DA9063_BB_REG_MON_REG_6),
>>   };
>>
>> --
>> 2.25.1
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH 2/2] mfd: da9063: Make vbcore registers volatile
  2021-11-24 14:04     ` Andrej Picej
@ 2021-11-24 14:47       ` Adam Thomson
  0 siblings, 0 replies; 5+ messages in thread
From: Adam Thomson @ 2021-11-24 14:47 UTC (permalink / raw)
  To: Andrej Picej, Adam Thomson, Support Opensource, lee.jones
  Cc: linux-kernel, s.riedmueller

On 24 November 2021 14:05, Andrej Picej wrote:

> > I don't understand the need for this change. What is this fixing? As I
> > understand it the registers in question aren't volatile so should persist.
> 
> So basically this two patches were needed because we needed to enable
> internal LDOs bypass mode on the imx6 and in the process this PMICs regs
> needed to be somehow adjusted, which only worked if this regs were
> marked as volatile. Long story short, this method was only introduced in
> Phytec's version so upstreaming really doesn't make much sense.
> 
> I apologize for any inconvenience, but this two patches somehow slipped
> through the process and landed on the "send-to-upstream" list. I also
> talked with @Stefan Rieadmueller and he agreed that this two patches can
> be dropped.
> 
> Thanks for your time.

That's no problem and thanks for clarifying. With regmap writes, unless the
value you're writing is the same as is in the cache or is outside of the valid
range, the write should go through. Obviously something else at play in that
platform though. :)

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-11-24 14:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-24  7:00 [PATCH 1/2] mfd: da9062: Make vbuck_a registers volatile Andrej Picej
2021-11-24  7:00 ` [PATCH 2/2] mfd: da9063: Make vbcore " Andrej Picej
2021-11-24  9:34   ` Adam Thomson
2021-11-24 14:04     ` Andrej Picej
2021-11-24 14:47       ` Adam Thomson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).