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


Groups > linux.kernel > #1320233 > unrolled thread

Re: [PATCH V4 09/11] soc: mediatek: PMIC wrap: add a slave specific struct

Started byHenry Chen <henryc.chen@mediatek.com>
First post2016-01-28 03:40 +0100
Last post2016-02-01 09:40 +0100
Articles 3 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH V4 09/11] soc: mediatek: PMIC wrap: add a slave specific  struct Henry Chen <henryc.chen@mediatek.com> - 2016-01-28 03:40 +0100
    Re: [PATCH V4 09/11] soc: mediatek: PMIC wrap: add a slave specific  struct John Crispin <blogic@openwrt.org> - 2016-02-01 09:30 +0100
      Re: [PATCH V4 09/11] soc: mediatek: PMIC wrap: add a slave specific  struct Henry Chen <henryc.chen@mediatek.com> - 2016-02-01 09:40 +0100

#1320233 — Re: [PATCH V4 09/11] soc: mediatek: PMIC wrap: add a slave specific struct

FromHenry Chen <henryc.chen@mediatek.com>
Date2016-01-28 03:40 +0100
SubjectRe: [PATCH V4 09/11] soc: mediatek: PMIC wrap: add a slave specific struct
Message-ID<qVKF4-4Q6-7@gated-at.bofh.it>
Hi John,

On Wed, 2016-01-27 at 12:29 +0100, John Crispin wrote:

> @@ -746,7 +786,7 @@ static int pwrap_init(struct pmic_wrapper *wrp)
>  	pwrap_writel(wrp, 1, PWRAP_DIO_EN);
>  
>  	/* Read Test */
> -	pwrap_read(wrp, PWRAP_DEW_READ_TEST, &rdata);
> +	pwrap_dew_read(wrp, PWRAP_DEW_READ_TEST, &rdata);
>  	if (rdata != PWRAP_DEW_READ_TEST_VAL) {
>  		dev_err(wrp->dev, "Read test failed after switch to DIO mode: 0x%04x != 0x%04x\n",
>  				PWRAP_DEW_READ_TEST_VAL, rdata);
> @@ -759,12 +799,13 @@ static int pwrap_init(struct pmic_wrapper *wrp)
>  		return ret;
>  
>  	/* Signature checking - using CRC */
> -	if (pwrap_write(wrp, PWRAP_DEW_CRC_EN, 0x1))
> +	if (pwrap_dew_write(wrp, PWRAP_DEW_CRC_EN, 0x1))
>  		return -EFAULT;
>  
>  	pwrap_writel(wrp, 0x1, PWRAP_CRC_EN);
>  	pwrap_writel(wrp, 0x0, PWRAP_SIG_MODE);
> -	pwrap_writel(wrp, PWRAP_DEW_CRC_VAL, PWRAP_SIG_ADR);
> +	pwrap_writel(wrp, wrp->slave->dew_regs[PWRAP_DEW_CRC_VAL],
> +		     PWRAP_SIG_ADR);

It should be "pwrap_dew_write(wrp, PWRAP_DEW_CRC_VAL, PWRAP_SIG_ADR);",
right?

Henry

>  	pwrap_writel(wrp, wrp->master->arb_en_all, PWRAP_HIPRIO_ARB_EN);
>  
>  	if (wrp->master->type == PWRAP_MT8135)

[toc] | [next] | [standalone]


#1322885

FromJohn Crispin <blogic@openwrt.org>
Date2016-02-01 09:30 +0100
Message-ID<qXi1Y-8lp-3@gated-at.bofh.it>
In reply to#1320233

On 28/01/2016 03:37, Henry Chen wrote:
> Hi John,
> 
> On Wed, 2016-01-27 at 12:29 +0100, John Crispin wrote:
> 
>> @@ -746,7 +786,7 @@ static int pwrap_init(struct pmic_wrapper *wrp)
>>  	pwrap_writel(wrp, 1, PWRAP_DIO_EN);
>>  
>>  	/* Read Test */
>> -	pwrap_read(wrp, PWRAP_DEW_READ_TEST, &rdata);
>> +	pwrap_dew_read(wrp, PWRAP_DEW_READ_TEST, &rdata);
>>  	if (rdata != PWRAP_DEW_READ_TEST_VAL) {
>>  		dev_err(wrp->dev, "Read test failed after switch to DIO mode: 0x%04x != 0x%04x\n",
>>  				PWRAP_DEW_READ_TEST_VAL, rdata);
>> @@ -759,12 +799,13 @@ static int pwrap_init(struct pmic_wrapper *wrp)
>>  		return ret;
>>  
>>  	/* Signature checking - using CRC */
>> -	if (pwrap_write(wrp, PWRAP_DEW_CRC_EN, 0x1))
>> +	if (pwrap_dew_write(wrp, PWRAP_DEW_CRC_EN, 0x1))
>>  		return -EFAULT;
>>  
>>  	pwrap_writel(wrp, 0x1, PWRAP_CRC_EN);
>>  	pwrap_writel(wrp, 0x0, PWRAP_SIG_MODE);
>> -	pwrap_writel(wrp, PWRAP_DEW_CRC_VAL, PWRAP_SIG_ADR);
>> +	pwrap_writel(wrp, wrp->slave->dew_regs[PWRAP_DEW_CRC_VAL],
>> +		     PWRAP_SIG_ADR);
> 
> It should be "pwrap_dew_write(wrp, PWRAP_DEW_CRC_VAL, PWRAP_SIG_ADR);",
> right?
> 
> Henry
> 

Hi Henry,

i stumbled across this aswell. however this DEW access is direct using
pwrap_writel() and not indirect pwrap_write(). hence this is correct.
the DEW wrapper only exists for pwrap_write() style access. this might
have been a bug in the original commit.

this patch however keeps the functionality as is.

	John

[toc] | [prev] | [next] | [standalone]


#1322906

FromHenry Chen <henryc.chen@mediatek.com>
Date2016-02-01 09:40 +0100
Message-ID<qXibE-8pb-11@gated-at.bofh.it>
In reply to#1322885
On Mon, 2016-02-01 at 09:25 +0100, John Crispin wrote:
> 
> On 28/01/2016 03:37, Henry Chen wrote:
> > Hi John,
> > 
> > On Wed, 2016-01-27 at 12:29 +0100, John Crispin wrote:
> > 
> >> @@ -746,7 +786,7 @@ static int pwrap_init(struct pmic_wrapper *wrp)
> >>  	pwrap_writel(wrp, 1, PWRAP_DIO_EN);
> >>  
> >>  	/* Read Test */
> >> -	pwrap_read(wrp, PWRAP_DEW_READ_TEST, &rdata);
> >> +	pwrap_dew_read(wrp, PWRAP_DEW_READ_TEST, &rdata);
> >>  	if (rdata != PWRAP_DEW_READ_TEST_VAL) {
> >>  		dev_err(wrp->dev, "Read test failed after switch to DIO mode: 0x%04x != 0x%04x\n",
> >>  				PWRAP_DEW_READ_TEST_VAL, rdata);
> >> @@ -759,12 +799,13 @@ static int pwrap_init(struct pmic_wrapper *wrp)
> >>  		return ret;
> >>  
> >>  	/* Signature checking - using CRC */
> >> -	if (pwrap_write(wrp, PWRAP_DEW_CRC_EN, 0x1))
> >> +	if (pwrap_dew_write(wrp, PWRAP_DEW_CRC_EN, 0x1))
> >>  		return -EFAULT;
> >>  
> >>  	pwrap_writel(wrp, 0x1, PWRAP_CRC_EN);
> >>  	pwrap_writel(wrp, 0x0, PWRAP_SIG_MODE);
> >> -	pwrap_writel(wrp, PWRAP_DEW_CRC_VAL, PWRAP_SIG_ADR);
> >> +	pwrap_writel(wrp, wrp->slave->dew_regs[PWRAP_DEW_CRC_VAL],
> >> +		     PWRAP_SIG_ADR);
> > 
> > It should be "pwrap_dew_write(wrp, PWRAP_DEW_CRC_VAL, PWRAP_SIG_ADR);",
> > right?
> > 
> > Henry
> > 
> 
> Hi Henry,
> 
> i stumbled across this aswell. however this DEW access is direct using
> pwrap_writel() and not indirect pwrap_write(). hence this is correct.
> the DEW wrapper only exists for pwrap_write() style access. this might
> have been a bug in the original commit.
> 
> this patch however keeps the functionality as is.
> 
> 	John

Hi John,

Oh. Sorry, there is no need to change, I just mixed up the parameter
val/reg of pwrap_writel() of this line.
Please keep original code, thanks.

Henry

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web