回复: [v2 1/3] pinctrl: cix: Add pin-controller support for sky1
From: Gary Yang
Date: Thu Oct 09 2025 - 07:03:14 EST
Hi Linus:
I'm glad to receive your reply.
> EXTERNAL EMAIL
>
> 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@xxxxxxxxxxx> 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.
>
Ok, We will post the next version as soon as possible.
> > > 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!
>
Thanks for your understanding. We will adopt this scheme in next version.
> Yours,
> Linus Walleij
Best wishes
Gary