Re: [U-Boot] [PATCH v3 08/10] pinctrl: rockchip: Special treatment for RK3288 gpio0 pins' pull【请注意,邮件由u-boot-boun...@lists.denx.de代发】

2019-05-08 Thread Kever Yang


On 05/07/2019 11:44 AM, Kever Yang wrote:
>
> On 04/16/2019 09:57 PM, David Wu wrote:
>> RK3288 pmu_gpio0 pull setting have no higher 16 writing corresponding
>> bits, need to read before write the register.
>>
>> Signed-off-by: David Wu 
> Reviewed-by: Kever Yang 

Applied to u-boot-rockchip, thanks!

>
> Thanks,
> - Kever
>> ---
>>
>> Change in v3:
>> - None
>>
>>  drivers/pinctrl/rockchip/pinctrl-rk3288.c | 11 +--
>>  1 file changed, 9 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/pinctrl/rockchip/pinctrl-rk3288.c 
>> b/drivers/pinctrl/rockchip/pinctrl-rk3288.c
>> index 9192aa3949..24af3597ec 100644
>> --- a/drivers/pinctrl/rockchip/pinctrl-rk3288.c
>> +++ b/drivers/pinctrl/rockchip/pinctrl-rk3288.c
>> @@ -116,8 +116,15 @@ static int rk3288_set_pull(struct rockchip_pin_bank 
>> *bank,
>>  return ret;
>>  }
>>  
>> -/* enable the write to the equivalent lower bits */
>> -data = ((1 << ROCKCHIP_PULL_BITS_PER_PIN) - 1) << (bit + 16);
>> +/* bank0 is special, there are no higher 16 bit writing bits */
>> +if (bank->bank_num == 0) {
>> +regmap_read(regmap, reg, );
>> +data &= ~(((1 << ROCKCHIP_PULL_BITS_PER_PIN) - 1) << bit);
>> +} else {
>> +/* enable the write to the equivalent lower bits */
>> +data = ((1 << ROCKCHIP_PULL_BITS_PER_PIN) - 1) << (bit + 16);
>> +}
>> +
>>  data |= (ret << bit);
>>  ret = regmap_write(regmap, reg, data);
>>  
>
>
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> https://lists.denx.de/listinfo/u-boot



___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v3 08/10] pinctrl: rockchip: Special treatment for RK3288 gpio0 pins' pull

2019-05-06 Thread Kever Yang


On 04/16/2019 09:57 PM, David Wu wrote:
> RK3288 pmu_gpio0 pull setting have no higher 16 writing corresponding
> bits, need to read before write the register.
>
> Signed-off-by: David Wu 

Reviewed-by: Kever Yang 

Thanks,
- Kever
> ---
>
> Change in v3:
> - None
>
>  drivers/pinctrl/rockchip/pinctrl-rk3288.c | 11 +--
>  1 file changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pinctrl/rockchip/pinctrl-rk3288.c 
> b/drivers/pinctrl/rockchip/pinctrl-rk3288.c
> index 9192aa3949..24af3597ec 100644
> --- a/drivers/pinctrl/rockchip/pinctrl-rk3288.c
> +++ b/drivers/pinctrl/rockchip/pinctrl-rk3288.c
> @@ -116,8 +116,15 @@ static int rk3288_set_pull(struct rockchip_pin_bank 
> *bank,
>   return ret;
>   }
>  
> - /* enable the write to the equivalent lower bits */
> - data = ((1 << ROCKCHIP_PULL_BITS_PER_PIN) - 1) << (bit + 16);
> + /* bank0 is special, there are no higher 16 bit writing bits */
> + if (bank->bank_num == 0) {
> + regmap_read(regmap, reg, );
> + data &= ~(((1 << ROCKCHIP_PULL_BITS_PER_PIN) - 1) << bit);
> + } else {
> + /* enable the write to the equivalent lower bits */
> + data = ((1 << ROCKCHIP_PULL_BITS_PER_PIN) - 1) << (bit + 16);
> + }
> +
>   data |= (ret << bit);
>   ret = regmap_write(regmap, reg, data);
>  



___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


[U-Boot] [PATCH v3 08/10] pinctrl: rockchip: Special treatment for RK3288 gpio0 pins' pull

2019-04-16 Thread David Wu
RK3288 pmu_gpio0 pull setting have no higher 16 writing corresponding
bits, need to read before write the register.

Signed-off-by: David Wu 
---

Change in v3:
- None

 drivers/pinctrl/rockchip/pinctrl-rk3288.c | 11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/pinctrl/rockchip/pinctrl-rk3288.c 
b/drivers/pinctrl/rockchip/pinctrl-rk3288.c
index 9192aa3949..24af3597ec 100644
--- a/drivers/pinctrl/rockchip/pinctrl-rk3288.c
+++ b/drivers/pinctrl/rockchip/pinctrl-rk3288.c
@@ -116,8 +116,15 @@ static int rk3288_set_pull(struct rockchip_pin_bank *bank,
return ret;
}
 
-   /* enable the write to the equivalent lower bits */
-   data = ((1 << ROCKCHIP_PULL_BITS_PER_PIN) - 1) << (bit + 16);
+   /* bank0 is special, there are no higher 16 bit writing bits */
+   if (bank->bank_num == 0) {
+   regmap_read(regmap, reg, );
+   data &= ~(((1 << ROCKCHIP_PULL_BITS_PER_PIN) - 1) << bit);
+   } else {
+   /* enable the write to the equivalent lower bits */
+   data = ((1 << ROCKCHIP_PULL_BITS_PER_PIN) - 1) << (bit + 16);
+   }
+
data |= (ret << bit);
ret = regmap_write(regmap, reg, data);
 
-- 
2.19.1



___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot