Re: [PATCH 2/6] pinctrl: sprd: Fix the incorrect mask and shift definition

Andy Shevchenko
2023-08-25T10:11:56Z

On Fri, Aug 25, 2023 at 11:18:22AM +0800, Linhua Xu wrote:
> From: Linhua Xu <Linhua.Xu@unisoc.com>
>
> Pull-up and pull-down are mutually exclusive. When setting one of them,
> the bit of the other needs to be clear. Now, there are cases where pull-up
> and pull-down are set at the same time in the code, thus fix them.

...

> -#define SLEEP_PULL_DOWN_MASK 0x1
> +#define SLEEP_PULL_DOWN_MASK 0x3

GENMASK()

...

> -#define PULL_DOWN_MASK 0x1
> +#define PULL_DOWN_MASK 0x3

GENMASK()

...

> -#define SLEEP_PULL_UP_MASK 0x1
> +#define SLEEP_PULL_UP_MASK 0x3

GENMASK()

...

> -#define PULL_UP_MASK 0x21
> +#define PULL_UP_MASK 0x43

GENMASK() + BIT()?

--
With Best Regards,
Andy Shevchenko