[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZsilJZS2_Kvyhs1S@smile.fi.intel.com>
Date: Fri, 23 Aug 2024 18:05:09 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Ye Zhang <ye.zhang@...k-chips.com>
Cc: linus.walleij@...aro.org, brgl@...ev.pl, heiko@...ech.de,
linux-gpio@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-rockchip@...ts.infradead.org, linux-kernel@...r.kernel.org,
mika.westerberg@...ux.intel.com, tao.huang@...k-chips.com,
finley.xiao@...k-chips.com, tim.chen@...k-chips.com,
elaine.zhang@...k-chips.com
Subject: Re: [PATCH v2] gpio: rockchip: support new version gpio
On Fri, Aug 23, 2024 at 11:43:11AM +0800, Ye Zhang wrote:
> The next version gpio controller on SoCs like rk3576 which support four
> OS operation and four interrupts
...
> #define GPIO_TYPE_V2 (0x01000C2B) /* GPIO Version ID 0x01000C2B */
> #define GPIO_TYPE_V2_1 (0x0101157C) /* GPIO Version ID 0x0101157C */
> +#define GPIO_TYPE_V2_2 (0x010219C8) /* GPIO Version ID 0x010219C8 */
These needs a bit of decoding. As far as I can decipher these it's something like
0x01 00 00 00 ???
0x00 xx 00 00 // seems like a subversion, 2.xx
0x00 00 xx xx // seems like a release which is
3115
5500
6600
in decimal representation.
But again, can you make the comments better explaining these cryptic 4-byte
values?
With that done it might be better approach to check the version of the IP.
...
> + switch (id) {
> + case GPIO_TYPE_V2:
> + case GPIO_TYPE_V2_1:
> bank->gpio_regs = &gpio_regs_v2;
> bank->gpio_type = GPIO_TYPE_V2;
> - } else {
> + break;
> + case GPIO_TYPE_V2_2:
> + bank->gpio_regs = &gpio_regs_v2;
> + bank->gpio_type = GPIO_TYPE_V2_2;
> + break;
> + default:
> bank->gpio_regs = &gpio_regs_v1;
> bank->gpio_type = GPIO_TYPE_V1;
> + pr_info("Note: Use default GPIO_TYPE_V1!\n");
Missed break;
> }
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists