[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 05 May 2023 13:31:21 +0200
From: Michael Walle <michael@...le.cc>
To: Linus Walleij <linus.walleij@...aro.org>
Cc: Esteban Blanc <eblanc@...libre.com>, lgirdwood@...il.com,
broonie@...nel.org, a.zummo@...ertech.it,
alexandre.belloni@...tlin.com, linux-kernel@...r.kernel.org,
linux-gpio@...r.kernel.org, linux-rtc@...r.kernel.org,
jpanis@...libre.com, jneanne@...libre.com, aseketeli@...libre.com,
sterzik@...com, u-kumar1@...com
Subject: Re: [PATCH v3 2/3] pinctrl: tps6594: add for TPS6594 PMIC
Hi,
>> I noticed that I could override reg_mask_xlate, so I should be able to
>> "just" match on the base address given as argument to perform a
>> different computation depending on whether we are using reg_mask_xlate
>> in
>> a "direction change" or not, but somehow this feels a bit wrong.
>>
>> Is this the correct solution?
>> Am I missing something?
No you don't miss anything. This is the actual use case for the base
parameter. If you need your own .xlate you can match on the base address
to do the translation based on wether it is used for .direction, .set
or .get.
I.e.
switch (base) {
case REG_IO_CTRL:
do_something_with_reg_and_mask;
case REG_DAT:
do_something_different_with_reg_and_mask;
default:
error;
}
-michael
Powered by blists - more mailing lists