From: Linus Walleij <linus.walleij@linaro.org> To: Alexandre Belloni <alexandre.belloni@bootlin.com> Cc: Ludovic Desroches <ludovic.desroches@microchip.com>, Nicolas Ferre <nicolas.ferre@microchip.com>, "open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>, Linux ARM <linux-arm-kernel@lists.infradead.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org> Subject: Re: [PATCH] pinctrl: at91-pio4: implement .get_multiple and .set_multiple Date: Wed, 11 Sep 2019 01:27:10 +0100 [thread overview] Message-ID: <CACRpkdbVC6DLHWftpL1wfkx_kWyfE=LpCQWZw=cv=RMVxDBm_g@mail.gmail.com> (raw) In-Reply-To: <20190905141304.22005-1-alexandre.belloni@bootlin.com> On Thu, Sep 5, 2019 at 3:13 PM Alexandre Belloni <alexandre.belloni@bootlin.com> wrote: > > Implement .get_multiple and .set_multiple to allow reading or setting > multiple pins simultaneously. Pins in the same bank will all be switched at > the same time, improving synchronization and performances. > > Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Good initiative! > + for (bank = 0; bank < atmel_pioctrl->nbanks; bank++) {> + unsigned int word = bank; > + unsigned int offset = 0; > + unsigned int reg; > + > +#if ATMEL_PIO_NPINS_PER_BANK != BITS_PER_LONG Should it not be > rather than != ? > + word = BIT_WORD(bank * ATMEL_PIO_NPINS_PER_BANK); > + offset = bank * ATMEL_PIO_NPINS_PER_BANK % BITS_PER_LONG; > +#endif This doesn't look good for multiplatform kernels. We need to get rid of any compiletime constants like this. Not your fault I suppose it is already there, but this really need to be fixed. Any ideas? Yours, Linus Walleij
WARNING: multiple messages have this Message-ID (diff)
From: Linus Walleij <linus.walleij@linaro.org> To: Alexandre Belloni <alexandre.belloni@bootlin.com> Cc: "open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>, Ludovic Desroches <ludovic.desroches@microchip.com>, Linux ARM <linux-arm-kernel@lists.infradead.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org> Subject: Re: [PATCH] pinctrl: at91-pio4: implement .get_multiple and .set_multiple Date: Wed, 11 Sep 2019 01:27:10 +0100 [thread overview] Message-ID: <CACRpkdbVC6DLHWftpL1wfkx_kWyfE=LpCQWZw=cv=RMVxDBm_g@mail.gmail.com> (raw) In-Reply-To: <20190905141304.22005-1-alexandre.belloni@bootlin.com> On Thu, Sep 5, 2019 at 3:13 PM Alexandre Belloni <alexandre.belloni@bootlin.com> wrote: > > Implement .get_multiple and .set_multiple to allow reading or setting > multiple pins simultaneously. Pins in the same bank will all be switched at > the same time, improving synchronization and performances. > > Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Good initiative! > + for (bank = 0; bank < atmel_pioctrl->nbanks; bank++) {> + unsigned int word = bank; > + unsigned int offset = 0; > + unsigned int reg; > + > +#if ATMEL_PIO_NPINS_PER_BANK != BITS_PER_LONG Should it not be > rather than != ? > + word = BIT_WORD(bank * ATMEL_PIO_NPINS_PER_BANK); > + offset = bank * ATMEL_PIO_NPINS_PER_BANK % BITS_PER_LONG; > +#endif This doesn't look good for multiplatform kernels. We need to get rid of any compiletime constants like this. Not your fault I suppose it is already there, but this really need to be fixed. Any ideas? Yours, Linus Walleij _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2019-09-11 0:27 UTC|newest] Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-09-05 14:13 [PATCH] pinctrl: at91-pio4: implement .get_multiple and .set_multiple Alexandre Belloni 2019-09-05 14:13 ` Alexandre Belloni 2019-09-05 14:33 ` Claudiu.Beznea 2019-09-05 14:33 ` Claudiu.Beznea 2019-09-11 0:27 ` Linus Walleij [this message] 2019-09-11 0:27 ` Linus Walleij 2019-09-11 9:11 ` Alexandre Belloni 2019-09-11 9:11 ` Alexandre Belloni 2019-09-12 13:46 ` Linus Walleij 2019-09-12 13:46 ` Linus Walleij 2019-09-14 19:36 ` Ludovic Desroches 2019-09-14 19:36 ` Ludovic Desroches
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to='CACRpkdbVC6DLHWftpL1wfkx_kWyfE=LpCQWZw=cv=RMVxDBm_g@mail.gmail.com' \ --to=linus.walleij@linaro.org \ --cc=alexandre.belloni@bootlin.com \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-gpio@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=ludovic.desroches@microchip.com \ --cc=nicolas.ferre@microchip.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.