[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CACRpkdaQYb+tB+a9Q6j3xPq=BHbQV5-3hu3XiJkSU9CGtcHpiA@mail.gmail.com>
Date: Tue, 30 Sep 2025 14:34:46 +0200
From: Linus Walleij <linus.walleij@...aro.org>
To: Gary Yang <gary.yang@...tech.com>
Cc: "robh@...nel.org" <robh@...nel.org>, "krzk+dt@...nel.org" <krzk+dt@...nel.org>,
"conor+dt@...nel.org" <conor+dt@...nel.org>,
"linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-arm-kernel@...ts.infradead.org" <linux-arm-kernel@...ts.infradead.org>,
cix-kernel-upstream <cix-kernel-upstream@...tech.com>
Subject: Re: [v2 1/3] pinctrl: cix: Add pin-controller support for sky1
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@...tech.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
Powered by blists - more mailing lists