Thread (18 messages) 18 messages, 4 authors, 2021-06-09

Re: [PATCH v3 3/5] gpio: gpio-aspeed-sgpio: Add AST2600 sgpio support

From: Steven Lee <hidden>
Date: 2021-06-04 02:15:04
Also in: linux-aspeed, linux-devicetree, linux-gpio, lkml

The 06/03/2021 19:05, Andy Shevchenko wrote:
On Thu, Jun 3, 2021 at 1:19 PM Steven Lee [off-list ref] wrote:
quoted
AST2600 SoC has 2 SGPIO master interfaces one with 128 pins another one
with 80 pins.
In the current driver, the maximum number of gpio pins of SoC is hardcoded
as 80 and the gpio pin count mask for GPIO Configuration register is
hardcode as GENMASK(9,6). In addition, some functions uses the hardcoded
use
quoted
value to calculate the gpio offset.
The patch adds ast2600 compatibles and platform data that includes the
max number of gpio pins supported by ast2600 and gpio pin count mask for
GPIO Configuration register.
The patch also modifies some functions to pass aspeed_sgpio struct for
calculating gpio offset wihtout using the hardcoded value.
without

...
quoted
+#include <linux/of_device.h>
Why?

...
I will remove it as of_device_get_match_data() will be replaced
to device_get_match_data()
quoted
+#define GPIO_OFFSET(x)        ((x) & 0x1f)
GENMASK()

...
Do you mean the macro should be modified as follows?
#define GPIO_OFFSET(x)        ((x) & GENMASK(4, 0))
quoted
+       pdata = of_device_get_match_data(&pdev->dev);
device_get_match_data()

I guess you may replace all those of_*() to the corresponding
device_*() or fwnode_*() calls.
Thanks for the reviews, I will add a new patch for replacing all
of_*() to device_*().
-- 
With Best Regards,
Andy Shevchenko
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help