[4/5] ASoC: rockchip-i2s: fix registers' property of rockchip i2s controller
diff mbox

Message ID 1410568932-21823-1-git-send-email-jay.xu@rock-chips.com
State New, archived
Headers show

Commit Message

Jianqun Xu Sept. 13, 2014, 12:42 a.m. UTC
Reference rockchip I2S controller TRM, modify some registers' property
I2S_FIFOLR: read / write, but not volatile, not precious
I2S_INTSR: read / write
I2S_CLR: volatile, register value will be cleared by read

Test on RK3288 with max98090.

Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
---
 sound/soc/rockchip/rockchip_i2s.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Mark Brown Sept. 13, 2014, 4:36 p.m. UTC | #1
On Sat, Sep 13, 2014 at 08:42:12AM +0800, Jianqun wrote:
> Reference rockchip I2S controller TRM, modify some registers' property
> I2S_FIFOLR: read / write, but not volatile, not precious
> I2S_INTSR: read / write
> I2S_CLR: volatile, register value will be cleared by read

Applied, again this is a bug fix (volatile and precious being wrong seem
like bugs) so should have been earlier in the series.
Sergei Shtylyov Sept. 13, 2014, 8:57 p.m. UTC | #2
Hello.

On 9/13/2014 3:42 AM, Jianqun wrote:

> Reference rockchip I2S controller TRM, modify some registers' property
> I2S_FIFOLR: read / write, but not volatile, not precious
> I2S_INTSR: read / write
> I2S_CLR: volatile, register value will be cleared by read

> Test on RK3288 with max98090.

> Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
> ---
>   sound/soc/rockchip/rockchip_i2s.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)

> diff --git a/sound/soc/rockchip/rockchip_i2s.c b/sound/soc/rockchip/rockchip_i2s.c
> index 1b9b404..6595383 100644
> --- a/sound/soc/rockchip/rockchip_i2s.c
> +++ b/sound/soc/rockchip/rockchip_i2s.c
[...]
> @@ -385,8 +387,6 @@ static bool rockchip_i2s_volatile_reg(struct device *dev, unsigned int reg)
>   static bool rockchip_i2s_precious_reg(struct device *dev, unsigned int reg)
>   {
>   	switch (reg) {
> -	case I2S_FIFOLR:
> -		return true;
>   	default:
>   		return false;
>   	}

    Shouldn't this be folded into simple *return* false now?

WBR, Sergei
jianqun Sept. 14, 2014, 2:20 a.m. UTC | #3
? 09/14/2014 12:36 AM, Mark Brown ??:
> On Sat, Sep 13, 2014 at 08:42:12AM +0800, Jianqun wrote:
>> Reference rockchip I2S controller TRM, modify some registers' property
>> I2S_FIFOLR: read / write, but not volatile, not precious
>> I2S_INTSR: read / write
>> I2S_CLR: volatile, register value will be cleared by read
> 
> Applied, again this is a bug fix (volatile and precious being wrong seem
> like bugs) so should have been earlier in the series.
> 
ok, I'll re-order the patches
jianqun Sept. 14, 2014, 2:29 a.m. UTC | #4
? 09/14/2014 04:57 AM, Sergei Shtylyov ??:
> Hello.
> 
> On 9/13/2014 3:42 AM, Jianqun wrote:
> 
>> Reference rockchip I2S controller TRM, modify some registers' property
>> I2S_FIFOLR: read / write, but not volatile, not precious
>> I2S_INTSR: read / write
>> I2S_CLR: volatile, register value will be cleared by read
> 
>> Test on RK3288 with max98090.
> 
>> Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
>> ---
>>   sound/soc/rockchip/rockchip_i2s.c | 6 +++---
>>   1 file changed, 3 insertions(+), 3 deletions(-)
> 
>> diff --git a/sound/soc/rockchip/rockchip_i2s.c b/sound/soc/rockchip/rockchip_i2s.c
>> index 1b9b404..6595383 100644
>> --- a/sound/soc/rockchip/rockchip_i2s.c
>> +++ b/sound/soc/rockchip/rockchip_i2s.c
> [...]
>> @@ -385,8 +387,6 @@ static bool rockchip_i2s_volatile_reg(struct device *dev, unsigned int reg)
>>   static bool rockchip_i2s_precious_reg(struct device *dev, unsigned int reg)
>>   {
>>       switch (reg) {
>> -    case I2S_FIFOLR:
>> -        return true;
>>       default:
>>           return false;
>>       }
> 
>    Shouldn't this be folded into simple *return* false now?
That is more reasonable, thank you.
> 
> WBR, Sergei
> 
> 
> 
> 
>
Sergei Shtylyov Sept. 14, 2014, 6:53 p.m. UTC | #5
Hello.

On 09/14/2014 06:29 AM, Jianqun wrote:

>>> Reference rockchip I2S controller TRM, modify some registers' property
>>> I2S_FIFOLR: read / write, but not volatile, not precious
>>> I2S_INTSR: read / write
>>> I2S_CLR: volatile, register value will be cleared by read

>>> Test on RK3288 with max98090.

>>> Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
>>> ---
>>>    sound/soc/rockchip/rockchip_i2s.c | 6 +++---
>>>    1 file changed, 3 insertions(+), 3 deletions(-)

>>> diff --git a/sound/soc/rockchip/rockchip_i2s.c b/sound/soc/rockchip/rockchip_i2s.c
>>> index 1b9b404..6595383 100644
>>> --- a/sound/soc/rockchip/rockchip_i2s.c
>>> +++ b/sound/soc/rockchip/rockchip_i2s.c
>> [...]
>>> @@ -385,8 +387,6 @@ static bool rockchip_i2s_volatile_reg(struct device *dev, unsigned int reg)
>>>    static bool rockchip_i2s_precious_reg(struct device *dev, unsigned int reg)
>>>    {
>>>        switch (reg) {
>>> -    case I2S_FIFOLR:
>>> -        return true;
>>>        default:
>>>            return false;
>>>        }

>>     Shouldn't this be folded into simple *return* false now?

> That is more reasonable, thank you.

    Moreover, this function may be completely eliminated.

WBR, Sergei

Patch
diff mbox

diff --git a/sound/soc/rockchip/rockchip_i2s.c b/sound/soc/rockchip/rockchip_i2s.c
index 1b9b404..6595383 100644
--- a/sound/soc/rockchip/rockchip_i2s.c
+++ b/sound/soc/rockchip/rockchip_i2s.c
@@ -365,6 +365,8 @@  static bool rockchip_i2s_rd_reg(struct device *dev, unsigned int reg)
 	case I2S_XFER:
 	case I2S_CLR:
 	case I2S_RXDR:
+	case I2S_FIFOLR:
+	case I2S_INTSR:
 		return true;
 	default:
 		return false;
@@ -374,8 +376,8 @@  static bool rockchip_i2s_rd_reg(struct device *dev, unsigned int reg)
 static bool rockchip_i2s_volatile_reg(struct device *dev, unsigned int reg)
 {
 	switch (reg) {
-	case I2S_FIFOLR:
 	case I2S_INTSR:
+	case I2S_CLR:
 		return true;
 	default:
 		return false;
@@ -385,8 +387,6 @@  static bool rockchip_i2s_volatile_reg(struct device *dev, unsigned int reg)
 static bool rockchip_i2s_precious_reg(struct device *dev, unsigned int reg)
 {
 	switch (reg) {
-	case I2S_FIFOLR:
-		return true;
 	default:
 		return false;
 	}