lkml.org 
[lkml]   [2013]   [Dec]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
Subject[PATCH 03/05 v2] pinctrl: sh-pfc: r7s72100 single pin macros
From: Magnus Damm <damm@opensource.se>

Introduce macros that allow description of one pin per line.
Compared to the other ways of doing this, using this style
we can compresses the description of each pin from 9 to 1 line.

Signed-off-by: Magnus Damm <damm@opensource.se>
---

This patch uses RZ_PMX_GROUP and RZ_GROUPS, thanks Laurent!

drivers/pinctrl/sh-pfc/pfc-r7s72100.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)

--- 0003/drivers/pinctrl/sh-pfc/pfc-r7s72100.c
+++ work/drivers/pinctrl/sh-pfc/pfc-r7s72100.c 2013-12-16 19:14:30.000000000 +0900
@@ -98,9 +98,30 @@ static struct sh_pfc_pin pinmux_pins[] =

#define RZ_PORT_PIN(bank, pin) (((bank) * 16) + (pin))

+#define __RZ_STR(pfx, hw, bank, pin, sfx) \
+ pfx##_##hw##_p##bank##_##pin####sfx
+
+#define RZ_PIN_AND_MUX(pfx, hw, bank, pin, fn) \
+static const unsigned int __RZ_STR(pfx, hw, bank, pin, _pins)[] = { \
+ RZ_PORT_PIN(bank, pin), \
+}; \
+static const unsigned int __RZ_STR(pfx, hw, bank, pin, _mux)[] = { \
+ P_##bank##_##pin##_MARK_FN##fn, \
+};
+
+#define RZ_PMX_GROUP(pfx, hw, bank, pin, fn) \
+ SH_PFC_PIN_GROUP(pfx##_##hw##_p##bank##_##pin),
+
+#define __RZ_GROUPS(x) #x
+
+#define RZ_GROUPS(pfx, hw, bank, pin, fn) \
+ __RZ_GROUPS(pfx##_##hw##_p##bank##_##pin),
+
static const struct sh_pfc_pin_group pinmux_groups[] = {
};

+static const char * const scif2_groups[] = {
+};
static const struct sh_pfc_function pinmux_functions[] = {
};


\
 
 \ /
  Last update: 2013-12-17 04:01    [W:0.089 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site