From: stillcompiling@gmail.com (Joshua Clayton)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] ARM: dts: imx6: Add support for Toradex Apalis SoM
Date: Fri, 20 Nov 2015 09:09:01 -0800 [thread overview]
Message-ID: <20151120090901.40da06aa@jclayton-pc> (raw)
In-Reply-To: <20151120104017.GK19674@ibawizard.net>
On Fri, 20 Nov 2015 11:40:17 +0100
Petr ?tetiar <ynezz@true.cz> wrote:
> Joshua Clayton <stillcompiling@gmail.com> [2015-11-19 08:59:34]:
>
> > On Thursday, November 19, 2015 03:12:05 PM Lucas Stach wrote:
> > > > +
> > > > +/* (PAD_CTL_PUS_22K_UP | PAD_CTL_PUE | PAD_CTL_PKE |
> > > > PAD_CTL_SPEED_LOW | PAD_CTL_DSE_80ohm) */ +#define
> > > > PAD_CTRL_PU_22k 0x0f058 +
> > > I don't particularly like those defines. Maybe just replace by
> > > the hex values?
> >
> > Seems like a genuine improvement to me,
> > except that they should not be in the dts itself.
> > Rather in arch/arm/boot/dts/imx6<num>-pinfunc.h, or another include
> > file
>
> Ok, so how should it look like? Define bit fields and then register
> content? Something like:
>
> #define PAD_CTL_PUS_22K_UP (3 << 14)
> #define PAD_CTL_PUE (1 << 13)
> #define PAD_CTL_PKE (1 << 12)
> #define PAD_CTL_SPEED_LOW (1 << 6)
> #define PAD_CTL_DSE_80ohm (3 << 3)
>
Just noticed that these bits are already defined in
arch/arm/mach-imx/iomux-v3.h I'm not super familiar with dts.
Is there a good place for
them that is acceptable for both devicetree and other kernel
use?
Something like include/dt-bindings/pinctrl/iomux-v3.h ?
> #define PAD_CTRL_PU_22k PAD_CTL_PUS_22K_UP | PAD_CTL_PUE |
> PAD_CTL_PKE | PAD_CTL_SPEED_LOW | PAD_CTL_DSE_80ohm
>
This one.
Its almost always better to convey the meaning in the data
than with a separate comment.
> or just register value with a comment:
>
> /* (PAD_CTL_PUS_22K_UP | PAD_CTL_PUE | PAD_CTL_PKE |
> PAD_CTL_SPEED_LOW | PAD_CTL_DSE_80ohm) */ #define PAD_CTRL_PU_22k
> 0x0f058
>
> -- ynezz
next prev parent reply other threads:[~2015-11-20 17:09 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-19 12:24 [PATCH 0/2] ARM: dts: imx6: Add support for Toradex Apalis SoM/Ixora Petr Štetiar
2015-11-19 12:24 ` [PATCH 1/2] ARM: dts: imx6: Add support for Toradex Apalis SoM Petr Štetiar
2015-11-19 14:12 ` Lucas Stach
2015-11-19 16:59 ` Joshua Clayton
2015-11-19 17:03 ` Fabio Estevam
2015-11-20 10:40 ` Petr Štetiar
2015-11-20 17:09 ` Joshua Clayton [this message]
2015-11-26 10:17 ` Petr Štetiar
2015-11-27 20:02 ` Stefan Agner
2015-11-28 19:38 ` Petr Štetiar
2015-11-27 19:38 ` Stefan Agner
2015-11-28 19:47 ` Petr Štetiar
2015-11-30 10:16 ` Lucas Stach
2015-11-19 12:25 ` [PATCH 2/2] ARM: dts: imx6: Add support for Toradex Apalis Ixora board Petr Štetiar
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=20151120090901.40da06aa@jclayton-pc \
--to=stillcompiling@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).