From: Joe Perches <joe@perches.com>
To: Jimmy RUBIN <jimmy.rubin@stericsson.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
Dan JOHANSSON <dan.johansson@stericsson.com>,
"linux-fbdev@vger.kernel.org" <linux-fbdev@vger.kernel.org>,
Linus WALLEIJ <linus.walleij@stericsson.com>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>
Subject: RE: [PATCH 01/10] MCDE: Add hardware abstraction layer
Date: Tue, 16 Nov 2010 11:46:12 -0800 [thread overview]
Message-ID: <1289936772.28741.188.camel@Joe-Laptop> (raw)
In-Reply-To: <F45880696056844FA6A73F415B568C6953604E7D94@EXDCVYMBSTM006.EQ1STM.local>
On Tue, 2010-11-16 at 16:29 +0100, Jimmy RUBIN wrote:
> > > +/* Channel path */
> > > +#define MCDE_CHNLPATH(__chnl, __fifo, __type, __ifc, __link) \
> > > + (((__chnl) << 16) | ((__fifo) << 12) | \
> > > + ((__type) << 8) | ((__ifc) << 4) | ((__link) << 0))
> > > +enum mcde_chnl_path {
> > > + /* Channel A */
> > > + MCDE_CHNLPATH_CHNLA_FIFOA_DPI_0 = MCDE_CHNLPATH(MCDE_CHNL_A,
> > > + MCDE_FIFO_A, MCDE_PORTTYPE_DPI, 0, 0),
> > > + MCDE_CHNLPATH_CHNLA_FIFOA_DSI_IFC0_0 =
> > MCDE_CHNLPATH(MCDE_CHNL_A,
> > > + MCDE_FIFO_A, MCDE_PORTTYPE_DSI, 0, 0),
> > > + MCDE_CHNLPATH_CHNLA_FIFOA_DSI_IFC0_1 =
> > MCDE_CHNLPATH(MCDE_CHNL_A,
> > > + MCDE_FIFO_A, MCDE_PORTTYPE_DSI, 0, 1),
> >
> > A table like this would become more readable by making each entry a
> > single line, even if that goes beyond the 80-character limit.
> Good point, we will fix this
Or the #define could be changed to do something like:
static inline u32 MCDE_channel_path(u32 chnl, u32 fifo, u32 type, u32 ifc, u32 link)
{
return ((chnl << 16) |
(fifo << 12) |
(type << 8) |
(ifc << 4) |
(link << 0));
}
#define SET_ENUM_MCDE_CHNLPATH(chnl, fifo, var, type, ifc, link) \
MCDE_CHNLPATH_CHNL##chnl##_FIFO##fifo##_##var = \
MCDE_channel_path(MCDE_CHNL_##chnl, \
MCDE_FIFO_##fifo, \
MCDE_PORTTYPE_##type, \
ifc, \
link)
enum mcde_chnl_path {
/* Channel A */
SET_ENUM_MCDE_CHNLPATH(A, A, DPI_0, DPI, 0, 0),
SET_ENUM_MCDE_CHNLPATH(A, A, DSI_IFC0_0, DSI, 0, 0),
SET_ENUM_MCDE_CHNLPATH(A, A, DSI_IFC0_1, DSI, 0, 1),
SET_ENUM_MCDE_CHNLPATH(A, C, DSI_IFC0_2, DSI, 0, 2),
SET_ENUM_MCDE_CHNLPATH(A, C, DSI_IFC1_0, DSI, 1, 0),
SET_ENUM_MCDE_CHNLPATH(A, C, DSI_IFC1_1, DSI, 1, 1),
SET_ENUM_MCDE_CHNLPATH(A, A, DSI_IFC1_2, DSI, 1, 2),
/* Channel B */
SET_ENUM_MCDE_CHNLPATH(B, B, DPI_1, DPI, 0, 1),
SET_ENUM_MCDE_CHNLPATH(B, B, DSI_IFC0_0, DSI, 0, 0),
SET_ENUM_MCDE_CHNLPATH(B, B, DSI_IFC0_1, DSI, 0, 1),
SET_ENUM_MCDE_CHNLPATH(B, C, DSI_IFC0_2, DSI, 0, 2),
SET_ENUM_MCDE_CHNLPATH(B, C, DSI_IFC1_0, DSI, 1, 0),
SET_ENUM_MCDE_CHNLPATH(B, C, DSI_IFC1_1, DSI, 1, 1),
SET_ENUM_MCDE_CHNLPATH(B, B, DSI_IFC1_2, DSI, 1, 2),
/* Channel C0 */
SET_ENUM_MCDE_CHNLPATH(C0, A, DSI_IFC0_0, DSI, 0, 0),
SET_ENUM_MCDE_CHNLPATH(C0, A, DSI_IFC0_1, DSI, 0, 1),
SET_ENUM_MCDE_CHNLPATH(C0, C0, DSI_IFC0_2, DSI, 0, 2),
SET_ENUM_MCDE_CHNLPATH(C0, C0, DSI_IFC1_0, DSI, 1, 0),
SET_ENUM_MCDE_CHNLPATH(C0, C0, DSI_IFC1_1, DSI, 1, 1),
SET_ENUM_MCDE_CHNLPATH(C0, A, DSI_IFC1_2, DSI, 1, 2),
/* Channel C1 */
SET_ENUM_MCDE_CHNLPATH(C1, B, DSI_IFC0_0, DSI, 0, 0),
SET_ENUM_MCDE_CHNLPATH(C1, B, DSI_IFC0_1, DSI, 0, 1),
SET_ENUM_MCDE_CHNLPATH(C1, C1, DSI_IFC0_2, DSI, 0, 2),
SET_ENUM_MCDE_CHNLPATH(C1, C1, DSI_IFC1_0, DSI, 1, 0),
SET_ENUM_MCDE_CHNLPATH(C1, C1, DSI_IFC1_1, DSI, 1, 1),
SET_ENUM_MCDE_CHNLPATH(C1, B, DSI_IFC1_2, DSI, 1, 2),
};
It seems that long blocks of upper case make my eyes glaze
over and that many of your #defines are indistinguishable.
next prev parent reply other threads:[~2010-11-16 19:46 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-10 12:04 [PATCH 00/10] MCDE: Add frame buffer device driver Jimmy Rubin
2010-11-10 12:04 ` [PATCH 01/10] MCDE: Add hardware abstraction layer Jimmy Rubin
2010-11-10 12:04 ` [PATCH 02/10] MCDE: Add configuration registers Jimmy Rubin
2010-11-10 12:04 ` [PATCH 03/10] MCDE: Add pixel processing registers Jimmy Rubin
2010-11-10 12:04 ` [PATCH 04/10] MCDE: Add formatter registers Jimmy Rubin
2010-11-10 12:04 ` [PATCH 05/10] MCDE: Add dsi link registers Jimmy Rubin
2010-11-10 12:04 ` [PATCH 06/10] MCDE: Add generic display Jimmy Rubin
2010-11-10 12:04 ` [PATCH 07/10] MCDE: Add display subsystem framework Jimmy Rubin
2010-11-10 12:04 ` [PATCH 08/10] MCDE: Add frame buffer device Jimmy Rubin
2010-11-10 12:04 ` [PATCH 09/10] MCDE: Add build files and bus Jimmy Rubin
2010-11-10 12:04 ` [PATCH 10/10] ux500: MCDE: Add platform specific data Jimmy Rubin
2010-11-12 16:03 ` Arnd Bergmann
2010-11-12 16:23 ` [PATCH 09/10] MCDE: Add build files and bus Arnd Bergmann
2010-11-12 16:29 ` [PATCH 08/10] MCDE: Add frame buffer device Arnd Bergmann
2010-11-12 16:38 ` [PATCH 07/10] MCDE: Add display subsystem framework Arnd Bergmann
2010-11-12 15:46 ` [PATCH 03/10] MCDE: Add pixel processing registers Arnd Bergmann
2010-11-12 15:14 ` [PATCH 02/10] MCDE: Add configuration registers Arnd Bergmann
2010-11-12 15:34 ` Russell King - ARM Linux
2010-11-15 14:25 ` Arnd Bergmann
2010-11-15 14:59 ` Russell King - ARM Linux
2010-11-15 18:24 ` Geert Uytterhoeven
2010-11-10 17:14 ` [PATCH 01/10] MCDE: Add hardware abstraction layer Joe Perches
2010-11-15 9:52 ` Jimmy RUBIN
2010-11-15 16:30 ` Joe Perches
2010-11-12 15:43 ` Arnd Bergmann
2010-11-16 15:29 ` Jimmy RUBIN
2010-11-16 16:12 ` Arnd Bergmann
2010-11-16 16:16 ` Arnd Bergmann
2010-11-16 19:46 ` Joe Perches [this message]
2010-11-17 9:55 ` Arnd Bergmann
2010-11-17 16:01 ` Joe Perches
2010-11-10 14:42 ` [PATCH 00/10] MCDE: Add frame buffer device driver Alex Deucher
2010-11-12 13:18 ` Jimmy RUBIN
2010-11-12 15:52 ` Alex Deucher
2010-11-12 16:46 ` Marcus LORENTZON
2010-11-12 17:22 ` Alex Deucher
2010-11-15 11:05 ` Michel Dänzer
2010-11-13 11:54 ` Hans Verkuil
2010-11-13 17:26 ` Marcus LORENTZON
2010-11-13 17:57 ` Hans Verkuil
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=1289936772.28741.188.camel@Joe-Laptop \
--to=joe@perches.com \
--cc=arnd@arndb.de \
--cc=dan.johansson@stericsson.com \
--cc=jimmy.rubin@stericsson.com \
--cc=linus.walleij@stericsson.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-media@vger.kernel.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