Re: [PATCH 2/2] pinctrl: tegra: Add bitmask support for parked bits

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



20.06.2019 20:41, Sowjanya Komatineni пишет:
> 
> On 6/20/19 10:03 AM, Thierry Reding wrote:
>> From: Thierry Reding <treding@xxxxxxxxxx>
>>
>> Some pin groups have park bits for multiple pins in one register.
>> Support this by turning the parked bit field into a parked bitmask
>> field. If no parked bits are supported, the bitmask can be 0.
>>
>> Update the pingroup table on Tegra210, which is the only generation
>> where this is supported, with the parked bitmask.
>>
>> Signed-off-by: Thierry Reding <treding@xxxxxxxxxx>
>> ---
>>   drivers/pinctrl/tegra/pinctrl-tegra.c    |  4 +-
>>   drivers/pinctrl/tegra/pinctrl-tegra.h    |  4 +-
>>   drivers/pinctrl/tegra/pinctrl-tegra114.c |  4 +-
>>   drivers/pinctrl/tegra/pinctrl-tegra124.c |  4 +-
>>   drivers/pinctrl/tegra/pinctrl-tegra194.c |  4 +-
>>   drivers/pinctrl/tegra/pinctrl-tegra20.c  |  6 +--
>>   drivers/pinctrl/tegra/pinctrl-tegra210.c | 60 ++++++++++++------------
>>   drivers/pinctrl/tegra/pinctrl-tegra30.c  |  4 +-
>>   8 files changed, 45 insertions(+), 45 deletions(-)
>>
>> diff --git a/drivers/pinctrl/tegra/pinctrl-tegra.c
>> b/drivers/pinctrl/tegra/pinctrl-tegra.c
>> index 34596b246578..9df30809aaf6 100644
>> --- a/drivers/pinctrl/tegra/pinctrl-tegra.c
>> +++ b/drivers/pinctrl/tegra/pinctrl-tegra.c
>> @@ -613,9 +613,9 @@ static void tegra_pinctrl_clear_parked_bits(struct
>> tegra_pmx *pmx)
>>         for (i = 0; i < pmx->soc->ngroups; ++i) {
>>           g = &pmx->soc->groups[i];
>> -        if (g->parked_bit >= 0) {
>> +        if (g->parked_bitmask > 0) {
>>               val = pmx_readl(pmx, g->mux_bank, g->mux_reg);
>> -            val &= ~(1 << g->parked_bit);
>> +            val &= ~g->parked_bitmask;
>>               pmx_writel(pmx, val, g->mux_bank, g->mux_reg);
>>           }
> 
> As parked_bit is now supported with DRV_PINGROUP, need to add check if
> name preceeds with drive_ and should use drv_bank/drv_reg OR
> 
> mux_bank/mux_reg. Otherwise this will cause a crash.

Yes, you should check whether mux_reg == -1.



[Index of Archives]     [ARM Kernel]     [Linux ARM]     [Linux ARM MSM]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux