[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZOiAOqpJsd7ljyal@smile.fi.intel.com>
Date: Fri, 25 Aug 2023 13:19:38 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Linhua Xu <Linhua.xu@...soc.com>
Cc: Linus Walleij <linus.walleij@...aro.org>,
Orson Zhai <orsonzhai@...il.com>,
Baolin Wang <baolin.wang@...ux.alibaba.com>,
Chunyan Zhang <zhang.lyra@...il.com>,
linux-kernel@...r.kernel.org, linux-gpio@...r.kernel.org,
lh xu <xulh0829@...il.com>,
Xiongpeng Wu <xiongpeng.wu@...soc.com>
Subject: Re: [PATCH 5/6] pinctrl: sprd: Increase the range of register values
On Fri, Aug 25, 2023 at 11:18:25AM +0800, Linhua Xu wrote:
> From: Linhua Xu <Linhua.Xu@...soc.com>
>
> As the UNISOC pin controller version iterates, more registers are required
> to meet new functional requirements. Thus modify them.
...
+ bits.h and...
> +#define NUM_OFFSET (22)
> +#define TYPE_OFFSET (18)
> +#define BIT_OFFSET (10)
> +#define WIDTH_OFFSET (6)
Why do you need parentheses? Also what do these represent
(since they are decimal numbers)?
...
> #define SPRD_PIN_INFO(num, type, offset, width, reg) \
> (((num) & 0xFFF) << NUM_OFFSET | \
> ((type) & 0xF) << TYPE_OFFSET | \
> ((offset) & 0xFF) << BIT_OFFSET | \
> ((width) & 0xF) << WIDTH_OFFSET | \
> - ((reg) & 0xF))
> + ((reg) & 0x1F))
...use GENMASK() everywhere above.
...
> .type = (((a) >> TYPE_OFFSET) & 0xf), \
> .bit_offset = (((a) >> BIT_OFFSET) & 0xff), \
> .bit_width = ((a) >> WIDTH_OFFSET & 0xf), \
> - .reg = ((a) & 0xf) \
> + .reg = ((a) & 0x1f) \
Ditto.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists