Re: [PATCH v2 1/1] gpio: mpfs: add polarfire soc gpio support

From: Conor.Dooley
Date: Wed Jul 13 2022 - 13:44:35 EST


On 13/07/2022 12:59, Andy Shevchenko wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>
>
> Below my comments, I have tried hard not to duplicate what Conor
> already mentioned. So consider this as additional part.
>

>> +#define NUM_GPIO 32
>> +#define BYTE_BOUNDARY 0x04
>
> Without namespace?

Does byte_boundary even need to be defined?
is incrementing an address by 0x4 not kinda obvious on its own
as to what it is doing?

>> + if (gpio_cfg & MPFS_GPIO_EN_IN)
>> + return 1;
>> +
>> + return 0;
>
> Don't we have specific definitions for the directions?

FWIW Lewis, they're GPIO_LINE_DIRECTION_IN & GPIO_LINE_DIRECTION_OUT
I thought something like this would surely exist but wasn't sure.
Thanks for pointing it out Andy.

Conor.