lkml.org 
[lkml]   [2023]   [May]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v2 1/2] gpio: tps65219: add GPIO support for TPS65219 PMIC
From


On 11/05/2023 22:57, Linus Walleij wrote:
>> + /* Documentation is stating that GPIO0 direction must not be changed in Linux:
>> + * Table 8-34. MFP_1_CONFIG(3): MULTI_DEVICE_ENABLE,
>> + * Should only be changed in INITIALIZE state (prior to ON Request).
>> + * Set statically by NVM, changing direction in application can cause a hang.
>> + * Below can be used for test purpose only:
>> + */
>> +
>> +#if 0
>> + int ret = regmap_update_bits(gpio->tps->regmap, TPS65219_REG_MFP_1_CONFIG,
>> + TPS65219_GPIO0_DIR_MASK, direction);
>> + if (ret)
>> + return ret;
>> +#endif
>> + dev_err(gpio->tps->dev,
>> + "GPIO%d direction set by NVM, change to %u failed, not allowed by specification\n",
>> + offset, direction);
>> + return -EOPNOTSUPP;
>> +}
>
> Normally people would complain about #if 0 code.
>
> But this is a special case!
>
> I definitely want the code to be in there somehow.
>
> What about:
>
> if (IS_ENABLED(DEBUG))?
>
> If someone enables debug with an explicit -DDEBUG to the compiler
> this could be allowed.
I'm fine with your proposal. Will wait few days just in case anyone
wants to add any comment then go for this.

\
 
 \ /
  Last update: 2023-05-12 09:16    [W:0.214 / U:0.188 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site