[v2 1/3] pinctrl: cix: Add pin-controller support for sky1
Linus Walleij
linus.walleij at linaro.org
Tue Sep 30 05:34:46 PDT 2025
Hi Gary,
thanks for your efforts!
Sorry for taking so much time to respond. I was coding.
On Thu, Sep 18, 2025 at 8:17 AM Gary Yang <gary.yang at cixtech.com> wrote:
> New scheme with macros has verified ok. I just want to confirm with you before submit codes
No need to confirm with me just post it!
Better one post too much than one too little.
> > But I think you can still use a macro to define the long pin tables?
> > Albeit macros with flexible arguments is a bit hard to write.
> > Save it until everything else is working.
> >
> In header file:
>
> struct sky1_pin_desc {
> const struct pinctrl_pin_desc pin;
> const char **func_group;
> unsigned int nfunc;
> };
>
> #define SKY_PINFUNCTION(_pin, _func) \
> (struct sky1_pin_desc) { \
> .pin = _pin, \
> .func_group = _func##_group, \
> .nfunc = ARRAY_SIZE(_func##_group), \
> }
>
> In C file:
>
> static const char *gpio1_group[] = {"GPIO1"};
> static const char *gpio2_group[] = {"GPIO2"};
>
> static const struct sky1_pin_desc sky1_pinctrl_s5_pads[] = {
> SKY_PINFUNCTION(PINCTRL_PIN(0, "GPIO1"), gpio1),
> SKY_PINFUNCTION(PINCTRL_PIN(1, "GPIO2"), gpio2),
> .......
> };
>
> What's your suggestion? Thanks
It's OK as-is if this is how you want to structure things!
Yours,
Linus Walleij
More information about the linux-arm-kernel
mailing list