* [PATCH v2 1/3] ARM: i.MX51: Remove _MX51 references
@ 2011-08-11 1:31 Troy Kisky
2011-08-11 1:31 ` [PATCH v2 2/3] ARM: i.MX51: clean up iomux-mx51.h Troy Kisky
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Troy Kisky @ 2011-08-11 1:31 UTC (permalink / raw)
To: linux-arm-kernel
Use new macro NEW_PAD_CTRL to remove _MX51 references
Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
---
arch/arm/mach-mx5/board-cpuimx51sd.c | 2 +-
arch/arm/mach-mx5/board-mx51_babbage.c | 4 ++--
arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c | 4 ++--
arch/arm/plat-mxc/include/mach/iomux-v3.h | 1 +
4 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/arch/arm/mach-mx5/board-cpuimx51sd.c b/arch/arm/mach-mx5/board-cpuimx51sd.c
index ff096d5..040c5c3 100644
--- a/arch/arm/mach-mx5/board-cpuimx51sd.c
+++ b/arch/arm/mach-mx5/board-cpuimx51sd.c
@@ -108,7 +108,7 @@ static iomux_v3_cfg_t eukrea_cpuimx51sd_pads[] = {
/* Touchscreen */
/* IRQ */
- _MX51_PAD_GPIO_NAND__GPIO_NAND | MUX_PAD_CTRL(PAD_CTL_PUS_22K_UP |
+ NEW_PAD_CTRL(MX51_PAD_GPIO_NAND__GPIO_NAND, PAD_CTL_PUS_22K_UP |
PAD_CTL_PKE | PAD_CTL_SRE_FAST |
PAD_CTL_DSE_HIGH | PAD_CTL_PUE | PAD_CTL_HYS),
};
diff --git a/arch/arm/mach-mx5/board-mx51_babbage.c b/arch/arm/mach-mx5/board-mx51_babbage.c
index e400b09..5a578f9 100644
--- a/arch/arm/mach-mx5/board-mx51_babbage.c
+++ b/arch/arm/mach-mx5/board-mx51_babbage.c
@@ -357,8 +357,8 @@ static const struct esdhc_platform_data mx51_babbage_sd2_data __initconst = {
static void __init mx51_babbage_init(void)
{
iomux_v3_cfg_t usbh1stp = MX51_PAD_USBH1_STP__USBH1_STP;
- iomux_v3_cfg_t power_key = _MX51_PAD_EIM_A27__GPIO2_21 |
- MUX_PAD_CTRL(PAD_CTL_SRE_FAST | PAD_CTL_DSE_HIGH | PAD_CTL_PUS_100K_UP);
+ iomux_v3_cfg_t power_key = NEW_PAD_CTRL(MX51_PAD_EIM_A27__GPIO2_21,
+ PAD_CTL_SRE_FAST | PAD_CTL_DSE_HIGH | PAD_CTL_PUS_100K_UP);
imx51_soc_init();
diff --git a/arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c b/arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c
index 2619239..f046d4b 100644
--- a/arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c
+++ b/arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c
@@ -47,7 +47,7 @@ static iomux_v3_cfg_t eukrea_mbimxsd_pads[] = {
/* LED */
MX51_PAD_NANDF_D10__GPIO3_30,
/* SWITCH */
- _MX51_PAD_NANDF_D9__GPIO3_31 | MUX_PAD_CTRL(PAD_CTL_PUS_22K_UP |
+ NEW_PAD_CTRL(MX51_PAD_NANDF_D9__GPIO3_31, PAD_CTL_PUS_22K_UP |
PAD_CTL_PKE | PAD_CTL_SRE_FAST |
PAD_CTL_DSE_HIGH | PAD_CTL_PUE | PAD_CTL_HYS),
/* UART2 */
@@ -66,7 +66,7 @@ static iomux_v3_cfg_t eukrea_mbimxsd_pads[] = {
MX51_PAD_SD1_DATA2__SD1_DATA2,
MX51_PAD_SD1_DATA3__SD1_DATA3,
/* SD1 CD */
- _MX51_PAD_GPIO1_0__SD1_CD | MUX_PAD_CTRL(PAD_CTL_PUS_22K_UP |
+ NEW_PAD_CTRL(MX51_PAD_GPIO1_0__SD1_CD, PAD_CTL_PUS_22K_UP |
PAD_CTL_PKE | PAD_CTL_SRE_FAST |
PAD_CTL_DSE_HIGH | PAD_CTL_PUE | PAD_CTL_HYS),
};
diff --git a/arch/arm/plat-mxc/include/mach/iomux-v3.h b/arch/arm/plat-mxc/include/mach/iomux-v3.h
index ebbce33..376ba92 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-v3.h
+++ b/arch/arm/plat-mxc/include/mach/iomux-v3.h
@@ -80,6 +80,7 @@ typedef u64 iomux_v3_cfg_t;
((iomux_v3_cfg_t)(_sel_input_ofs) << MUX_SEL_INPUT_OFS_SHIFT) | \
((iomux_v3_cfg_t)(_sel_input) << MUX_SEL_INPUT_SHIFT))
+#define NEW_PAD_CTRL(cfg, pad) ((cfg & ~MUX_PAD_CTRL_MASK) | MUX_PAD_CTRL(pad))
/*
* Use to set PAD control
*/
--
1.7.0.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v2 2/3] ARM: i.MX51: clean up iomux-mx51.h
2011-08-11 1:31 [PATCH v2 1/3] ARM: i.MX51: Remove _MX51 references Troy Kisky
@ 2011-08-11 1:31 ` Troy Kisky
2011-08-11 14:53 ` Fabio Estevam
2011-08-11 1:31 ` [PATCH v2 3/3] ARM: i.MX53: clean up iomux-mx53.h Troy Kisky
2011-08-11 16:52 ` [PATCH v2 1/3] ARM: i.MX51: Remove _MX51 references Sascha Hauer
2 siblings, 1 reply; 7+ messages in thread
From: Troy Kisky @ 2011-08-11 1:31 UTC (permalink / raw)
To: linux-arm-kernel
Delete about 700 used only once symbols.
I used the following script to clean up the file,
iomux-mx51.h.
cp iomux-mx51.h iomux-mx51.h.cpy
sed -n iomux-mx51.h.cpy \
-e 's/#define[ \x09]\+\(_MX5[0-9a-zA-Z_]*\)[ \x09]\+\(.\+\)/s@\1@\2 at g/p' >t.tmp
sed iomux-mx51.h.cpy \
-e '/define[ \x09]\+_MX5/d' \
-f t.tmp \
-e 's/,[ \x09]*\([^,]\+\)/, \1/g' \
-e 's/, 0)[ \x09]*|[ \x09]*MUX_PAD_CTRL(/, /' \
-e 's/(IOMUX_PAD(\(.*\)))/IOMUX_PAD(\1)/' \
-e 's/0x\([0-9a-fA-F]\{2\}\)[ \x09]*,/0x0\1,/' \
-e 's/0x0\([0-9a-fA-F]\{3\}\)[ \x09]*,/0x\1,/' \
-e '/#include <mach\/iomux-v3.h/ a#define __NA_\x090x000\n' \
-e 's/0x[0]\{1,3\},/__NA_,/' \
-e 's/#define[ \x09]\+\(MX5[0-9a-zA-Z_]*\)[ \x09]\+\(IOMUX_PAD.\+\)/#define \1\x09\2/' \
-e 's/\(#define MX5[^\x09]\{5,12\}\)\x09\(IOMUX_PAD.\+\)/\1\x09\x09\x09\x09\2/' \
-e 's/\(#define MX5[^\x09]\{13,20\}\)\x09\(IOMUX_PAD.\+\)/\1\x09\x09\x09\2/' \
-e 's/\(#define MX5[^\x09]\{21,28\}\)\x09\(IOMUX_PAD.\+\)/\1\x09\x09\2/' \
-e 's/\(#define MX5[^\x09]\{29,36\}\)\x09\(IOMUX_PAD.\+\)/\1\x09\2/' \
-e 's/\(#define MX5[^\x09]\{45,\}\)\x09\(IOMUX_PAD.\+\)/\1\x09\\\n\x09\x09\x09\x09\x09\x09\2/' \
-e 's/, IOMUX_CONFIG_SION,/, 0 | IOMUX_CONFIG_SION,/' \
-e 's/\((0x[0-9a-fA-F]*, 0x[0-9a-fA-F]*, \)0x0\([0-9a-fA-F]\{2\},\)/\10x\2/' >iomux-mx51.h
Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
---
arch/arm/plat-mxc/include/mach/iomux-mx51.h | 2270 +++++++++------------------
1 files changed, 758 insertions(+), 1512 deletions(-)
I didn't include the entire patch because it is too big for the mailing list.
Beside, you'll probably want to run the above script last thing before sending a pull
for a clean up branch to avoid conflicts.
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx51.h b/arch/arm/plat-mxc/include/mach/iomux-mx51.h
index df6acc0..c7f5169 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-mx51.h
+++ b/arch/arm/plat-mxc/include/mach/iomux-mx51.h
@@ -14,6 +14,8 @@
#define __MACH_IOMUX_MX51_H__
#include <mach/iomux-v3.h>
+#define __NA_ 0x000
+
/* Pad control groupings */
#define MX51_UART_PAD_CTRL (PAD_CTL_PKE | PAD_CTL_PUE | PAD_CTL_DSE_HIGH | \
@@ -47,1521 +49,765 @@
/* Raw pin modes without pad control */
/* PAD MUX ALT INPSE PATH PADCTRL */
-#define _MX51_PAD_EIM_D16__AUD4_RXFS IOMUX_PAD(0x3f0, 0x5c, 5, 0x0000, 0, 0)
-#define _MX51_PAD_EIM_D16__AUD5_TXD IOMUX_PAD(0x3f0, 0x5c, 7, 0x08d8, 0, 0)
-#define _MX51_PAD_EIM_D16__EIM_D16 IOMUX_PAD(0x3f0, 0x5c, 0, 0x0000, 0, 0)
-#define _MX51_PAD_EIM_D16__GPIO2_0 IOMUX_PAD(0x3f0, 0x5c, 1, 0x0000, 0, 0)
-#define _MX51_PAD_EIM_D16__I2C1_SDA IOMUX_PAD(0x3f0, 0x5c, 0x14, 0x09b4, 0, 0)
-#define _MX51_PAD_EIM_D16__UART2_CTS IOMUX_PAD(0x3f0, 0x5c, 3, 0x0000, 0, 0)
-#define _MX51_PAD_EIM_D16__USBH2_DATA0 IOMUX_PAD(0x3f0, 0x5c, 2, 0x0000, 0, 0)
-#define _MX51_PAD_EIM_D17__AUD5_RXD IOMUX_PAD(0x3f4, 0x60, 7, 0x08d4, 0, 0)
.........
.........
/* The same pins as above but with the default pad control values applied */
-#define MX51_PAD_EIM_D16__AUD4_RXFS (_MX51_PAD_EIM_D16__AUD4_RXFS | MUX_PAD_CTRL(NO_PAD_CTRL))
-#define MX51_PAD_EIM_D16__AUD5_TXD (_MX51_PAD_EIM_D16__AUD5_TXD | MUX_PAD_CTRL(NO_PAD_CTRL))
-#define MX51_PAD_EIM_D16__EIM_D16 (_MX51_PAD_EIM_D16__EIM_D16 | MUX_PAD_CTRL(NO_PAD_CTRL))
-#define MX51_PAD_EIM_D16__GPIO2_0 (_MX51_PAD_EIM_D16__GPIO2_0 | MUX_PAD_CTRL(MX51_GPIO_PAD_CTRL))
-#define MX51_PAD_EIM_D16__I2C1_SDA (_MX51_PAD_EIM_D16__I2C1_SDA | MUX_PAD_CTRL(MX51_I2C_PAD_CTRL))
-#define MX51_PAD_EIM_D16__UART2_CTS (_MX51_PAD_EIM_D16__UART2_CTS | MUX_PAD_CTRL(MX51_UART_PAD_CTRL))
-#define MX51_PAD_EIM_D16__USBH2_DATA0 (_MX51_PAD_EIM_D16__USBH2_DATA0 | MUX_PAD_CTRL(NO_PAD_CTRL))
-#define MX51_PAD_EIM_D17__AUD5_RXD (_MX51_PAD_EIM_D17__AUD5_RXD | MUX_PAD_CTRL(NO_PAD_CTRL))
.........
.........
+#define MX51_PAD_EIM_D16__AUD4_RXFS IOMUX_PAD(0x3f0, 0x05c, 5, __NA_, 0, NO_PAD_CTRL)
+#define MX51_PAD_EIM_D16__AUD5_TXD IOMUX_PAD(0x3f0, 0x05c, 7, 0x8d8, 0, NO_PAD_CTRL)
+#define MX51_PAD_EIM_D16__EIM_D16 IOMUX_PAD(0x3f0, 0x05c, 0, __NA_, 0, NO_PAD_CTRL)
+#define MX51_PAD_EIM_D16__GPIO2_0 IOMUX_PAD(0x3f0, 0x05c, 1, __NA_, 0, MX51_GPIO_PAD_CTRL)
+#define MX51_PAD_EIM_D16__I2C1_SDA IOMUX_PAD(0x3f0, 0x05c, 0x14, 0x9b4, 0, MX51_I2C_PAD_CTRL)
+#define MX51_PAD_EIM_D16__UART2_CTS IOMUX_PAD(0x3f0, 0x05c, 3, __NA_, 0, MX51_UART_PAD_CTRL)
+#define MX51_PAD_EIM_D16__USBH2_DATA0 IOMUX_PAD(0x3f0, 0x05c, 2, __NA_, 0, NO_PAD_CTRL)
+#define MX51_PAD_EIM_D17__AUD5_RXD IOMUX_PAD(0x3f4, 0x060, 7, 0x8d4, 0, NO_PAD_CTRL)
.........
.........
#endif /* __MACH_IOMUX_MX51_H__ */
--
1.7.0.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v2 3/3] ARM: i.MX53: clean up iomux-mx53.h
2011-08-11 1:31 [PATCH v2 1/3] ARM: i.MX51: Remove _MX51 references Troy Kisky
2011-08-11 1:31 ` [PATCH v2 2/3] ARM: i.MX51: clean up iomux-mx51.h Troy Kisky
@ 2011-08-11 1:31 ` Troy Kisky
2011-08-11 16:52 ` [PATCH v2 1/3] ARM: i.MX51: Remove _MX51 references Sascha Hauer
2 siblings, 0 replies; 7+ messages in thread
From: Troy Kisky @ 2011-08-11 1:31 UTC (permalink / raw)
To: linux-arm-kernel
Delete about 1,000 symbols used only once
I used the following script to clean up the file.
cp iomux-mx53.h iomux-mx53.h.cpy
sed -n iomux-mx53.h.cpy \
-e 's/#define[ \x09]\+\(_MX5[0-9a-zA-Z_]*\)[ \x09]\+\(.\+\)/s@\1@\2 at g/p' >t.tmp
sed iomux-mx53.h.cpy \
-e '/define[ \x09]\+_MX5/d' \
-f t.tmp \
-e 's/,[ \x09]*\([^,]\+\)/, \1/g' \
-e 's/, 0)[ \x09]*|[ \x09]*MUX_PAD_CTRL(/, /' \
-e 's/(IOMUX_PAD(\(.*\)))/IOMUX_PAD(\1)/' \
-e 's/0x\([0-9a-fA-F]\{2\}\)[ \x09]*,/0x0\1,/' \
-e 's/NON_PAD_I/__NA_/' \
-e 's/0x0,/__NA_,/' \
-e 's/#define[ \x09]\+\(MX5[0-9a-zA-Z_]*\)[ \x09]\+\(IOMUX_PAD.\+\)/#define \1\x09\2/' \
-e 's/\(#define MX5[^\x09]\{5,12\}\)\x09\(IOMUX_PAD.\+\)/\1\x09\x09\x09\x09\x09\2/' \
-e 's/\(#define MX5[^\x09]\{13,20\}\)\x09\(IOMUX_PAD.\+\)/\1\x09\x09\x09\x09\2/' \
-e 's/\(#define MX5[^\x09]\{21,28\}\)\x09\(IOMUX_PAD.\+\)/\1\x09\x09\x09\2/' \
-e 's/\(#define MX5[^\x09]\{29,36\}\)\x09\(IOMUX_PAD.\+\)/\1\x09\x09\2/' \
-e 's/\(#define MX5[^\x09]\{45,\}\)\x09\(IOMUX_PAD.\+\)/\1\x09\\\n\x09\x09\x09\x09\x09\x09\x09\2/' \
-e 's/, IOMUX_CONFIG_SION,/, 0 | IOMUX_CONFIG_SION,/' >iomux-mx53.h
Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
---
arch/arm/plat-mxc/include/mach/iomux-mx53.h | 3527 +++++++++------------------
1 files changed, 1184 insertions(+), 2343 deletions(-)
I didn't include the entire patch because it is too big for the mailing list.
Beside, you'll probably want to run the above script last thing before sending a pull
for a clean up branch to avoid conflicts.
diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx53.h b/arch/arm/plat-mxc/include/mach/iomux-mx53.h
index 9440b9e..4558484 100644
--- a/arch/arm/plat-mxc/include/mach/iomux-mx53.h
+++ b/arch/arm/plat-mxc/include/mach/iomux-mx53.h
@@ -23,7 +23,7 @@
/* These 2 defines are for pins that may not have a mux register, but could
* have a pad setting register, and vice-versa. */
-#define NON_PAD_I 0x00
+#define __NA_ 0x00
#define MX53_UART_PAD_CTRL (PAD_CTL_PKE | PAD_CTL_PUE | \
PAD_CTL_DSE_HIGH | PAD_CTL_SRE_FAST | PAD_CTL_HYS)
@@ -31,2348 +31,1189 @@
PAD_CTL_PUS_47K_UP | PAD_CTL_DSE_HIGH | \
PAD_CTL_SRE_FAST)
-#define _MX53_PAD_GPIO_19__KPP_COL_5 IOMUX_PAD(0x348, 0x20, 0, 0x840, 0, 0)
-#define _MX53_PAD_GPIO_19__GPIO4_5 IOMUX_PAD(0x348, 0x20, 1, 0x0, 0, 0)
-#define _MX53_PAD_GPIO_19__CCM_CLKO IOMUX_PAD(0x348, 0x20, 2, 0x0, 0, 0)
-#define _MX53_PAD_GPIO_19__SPDIF_OUT1 IOMUX_PAD(0x348, 0x20, 3, 0x0, 0, 0)
-#define _MX53_PAD_GPIO_19__RTC_CE_RTC_EXT_TRIG2 IOMUX_PAD(0x348, 0x20, 4, 0x0, 0, 0)
-#define _MX53_PAD_GPIO_19__ECSPI1_RDY IOMUX_PAD(0x348, 0x20, 5, 0x0, 0, 0)
-#define _MX53_PAD_GPIO_19__FEC_TDATA_3 IOMUX_PAD(0x348, 0x20, 6, 0x0, 0, 0)
-#define _MX53_PAD_GPIO_19__SRC_INT_BOOT IOMUX_PAD(0x348, 0x20,7, 0x0, 0, 0)
-#define _MX53_PAD_KEY_COL0__KPP_COL_0 IOMUX_PAD(0x34C, 0x24, 0, 0x0, 0, 0)
.........
.........
-#define MX53_PAD_GPIO_19__KPP_COL_5 (_MX53_PAD_GPIO_19__KPP_COL_5 | MUX_PAD_CTRL(NO_PAD_CTRL))
-#define MX53_PAD_GPIO_19__GPIO4_5 (_MX53_PAD_GPIO_19__GPIO4_5 | MUX_PAD_CTRL(NO_PAD_CTRL))
-#define MX53_PAD_GPIO_19__CCM_CLKO (_MX53_PAD_GPIO_19__CCM_CLKO | MUX_PAD_CTRL(NO_PAD_CTRL))
-#define MX53_PAD_GPIO_19__SPDIF_OUT1 (_MX53_PAD_GPIO_19__SPDIF_OUT1 | MUX_PAD_CTRL(NO_PAD_CTRL))
-#define MX53_PAD_GPIO_19__RTC_CE_RTC_EXT_TRIG2 (_MX53_PAD_GPIO_19__RTC_CE_RTC_EXT_TRIG2 | MUX_PAD_CTRL(NO_PAD_CTRL))
-#define MX53_PAD_GPIO_19__ECSPI1_RDY (_MX53_PAD_GPIO_19__ECSPI1_RDY | MUX_PAD_CTRL(NO_PAD_CTRL))
-#define MX53_PAD_GPIO_19__FEC_TDATA_3 (_MX53_PAD_GPIO_19__FEC_TDATA_3 | MUX_PAD_CTRL(NO_PAD_CTRL))
-#define MX53_PAD_GPIO_19__SRC_INT_BOOT (_MX53_PAD_GPIO_19__SRC_INT_BOOT | MUX_PAD_CTRL(NO_PAD_CTRL))
-#define MX53_PAD_KEY_COL0__KPP_COL_0 (_MX53_PAD_KEY_COL0__KPP_COL_0 | MUX_PAD_CTRL(NO_PAD_CTRL))
.........
.........
+#define MX53_PAD_GPIO_19__KPP_COL_5 IOMUX_PAD(0x348, 0x020, 0, 0x840, 0, NO_PAD_CTRL)
+#define MX53_PAD_GPIO_19__GPIO4_5 IOMUX_PAD(0x348, 0x020, 1, __NA_, 0, NO_PAD_CTRL)
+#define MX53_PAD_GPIO_19__CCM_CLKO IOMUX_PAD(0x348, 0x020, 2, __NA_, 0, NO_PAD_CTRL)
+#define MX53_PAD_GPIO_19__SPDIF_OUT1 IOMUX_PAD(0x348, 0x020, 3, __NA_, 0, NO_PAD_CTRL)
+#define MX53_PAD_GPIO_19__RTC_CE_RTC_EXT_TRIG2 IOMUX_PAD(0x348, 0x020, 4, __NA_, 0, NO_PAD_CTRL)
+#define MX53_PAD_GPIO_19__ECSPI1_RDY IOMUX_PAD(0x348, 0x020, 5, __NA_, 0, NO_PAD_CTRL)
+#define MX53_PAD_GPIO_19__FEC_TDATA_3 IOMUX_PAD(0x348, 0x020, 6, __NA_, 0, NO_PAD_CTRL)
+#define MX53_PAD_GPIO_19__SRC_INT_BOOT IOMUX_PAD(0x348, 0x020, 7, __NA_, 0, NO_PAD_CTRL)
+#define MX53_PAD_KEY_COL0__KPP_COL_0 IOMUX_PAD(0x34C, 0x024, 0, __NA_, 0, NO_PAD_CTRL)
.........
.........
#endif /* __MACH_IOMUX_MX53_H__ */
--
1.7.0.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v2 2/3] ARM: i.MX51: clean up iomux-mx51.h
2011-08-11 1:31 ` [PATCH v2 2/3] ARM: i.MX51: clean up iomux-mx51.h Troy Kisky
@ 2011-08-11 14:53 ` Fabio Estevam
2011-08-11 18:43 ` Troy Kisky
0 siblings, 1 reply; 7+ messages in thread
From: Fabio Estevam @ 2011-08-11 14:53 UTC (permalink / raw)
To: linux-arm-kernel
Hi Troy,
On Wed, Aug 10, 2011 at 10:31 PM, Troy Kisky
<troy.kisky@boundarydevices.com> wrote:
...
> diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx51.h b/arch/arm/plat-mxc/include/mach/iomux-mx51.h
> index df6acc0..c7f5169 100644
> --- a/arch/arm/plat-mxc/include/mach/iomux-mx51.h
> +++ b/arch/arm/plat-mxc/include/mach/iomux-mx51.h
> @@ -14,6 +14,8 @@
> ?#define __MACH_IOMUX_MX51_H__
>
> ?#include <mach/iomux-v3.h>
> +#define __NA_ ?0x000
> +
Do we really need this __NA_ define? Can?t we continue just writing 0
in the macro?
Regards,
Fabio Estevam
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2 1/3] ARM: i.MX51: Remove _MX51 references
2011-08-11 1:31 [PATCH v2 1/3] ARM: i.MX51: Remove _MX51 references Troy Kisky
2011-08-11 1:31 ` [PATCH v2 2/3] ARM: i.MX51: clean up iomux-mx51.h Troy Kisky
2011-08-11 1:31 ` [PATCH v2 3/3] ARM: i.MX53: clean up iomux-mx53.h Troy Kisky
@ 2011-08-11 16:52 ` Sascha Hauer
2 siblings, 0 replies; 7+ messages in thread
From: Sascha Hauer @ 2011-08-11 16:52 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Aug 10, 2011 at 06:31:30PM -0700, Troy Kisky wrote:
> Use new macro NEW_PAD_CTRL to remove _MX51 references
>
> Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
> ---
> arch/arm/mach-mx5/board-cpuimx51sd.c | 2 +-
> arch/arm/mach-mx5/board-mx51_babbage.c | 4 ++--
> arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c | 4 ++--
> arch/arm/plat-mxc/include/mach/iomux-v3.h | 1 +
> 4 files changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/arch/arm/mach-mx5/board-cpuimx51sd.c b/arch/arm/mach-mx5/board-cpuimx51sd.c
> index ff096d5..040c5c3 100644
> --- a/arch/arm/mach-mx5/board-cpuimx51sd.c
> +++ b/arch/arm/mach-mx5/board-cpuimx51sd.c
> @@ -108,7 +108,7 @@ static iomux_v3_cfg_t eukrea_cpuimx51sd_pads[] = {
>
> /* Touchscreen */
> /* IRQ */
> - _MX51_PAD_GPIO_NAND__GPIO_NAND | MUX_PAD_CTRL(PAD_CTL_PUS_22K_UP |
> + NEW_PAD_CTRL(MX51_PAD_GPIO_NAND__GPIO_NAND, PAD_CTL_PUS_22K_UP |
> PAD_CTL_PKE | PAD_CTL_SRE_FAST |
> PAD_CTL_DSE_HIGH | PAD_CTL_PUE | PAD_CTL_HYS),
> };
> diff --git a/arch/arm/mach-mx5/board-mx51_babbage.c b/arch/arm/mach-mx5/board-mx51_babbage.c
> index e400b09..5a578f9 100644
> --- a/arch/arm/mach-mx5/board-mx51_babbage.c
> +++ b/arch/arm/mach-mx5/board-mx51_babbage.c
> @@ -357,8 +357,8 @@ static const struct esdhc_platform_data mx51_babbage_sd2_data __initconst = {
> static void __init mx51_babbage_init(void)
> {
> iomux_v3_cfg_t usbh1stp = MX51_PAD_USBH1_STP__USBH1_STP;
> - iomux_v3_cfg_t power_key = _MX51_PAD_EIM_A27__GPIO2_21 |
> - MUX_PAD_CTRL(PAD_CTL_SRE_FAST | PAD_CTL_DSE_HIGH | PAD_CTL_PUS_100K_UP);
> + iomux_v3_cfg_t power_key = NEW_PAD_CTRL(MX51_PAD_EIM_A27__GPIO2_21,
> + PAD_CTL_SRE_FAST | PAD_CTL_DSE_HIGH | PAD_CTL_PUS_100K_UP);
>
> imx51_soc_init();
>
> diff --git a/arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c b/arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c
> index 2619239..f046d4b 100644
> --- a/arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c
> +++ b/arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c
> @@ -47,7 +47,7 @@ static iomux_v3_cfg_t eukrea_mbimxsd_pads[] = {
> /* LED */
> MX51_PAD_NANDF_D10__GPIO3_30,
> /* SWITCH */
> - _MX51_PAD_NANDF_D9__GPIO3_31 | MUX_PAD_CTRL(PAD_CTL_PUS_22K_UP |
> + NEW_PAD_CTRL(MX51_PAD_NANDF_D9__GPIO3_31, PAD_CTL_PUS_22K_UP |
> PAD_CTL_PKE | PAD_CTL_SRE_FAST |
> PAD_CTL_DSE_HIGH | PAD_CTL_PUE | PAD_CTL_HYS),
> /* UART2 */
> @@ -66,7 +66,7 @@ static iomux_v3_cfg_t eukrea_mbimxsd_pads[] = {
> MX51_PAD_SD1_DATA2__SD1_DATA2,
> MX51_PAD_SD1_DATA3__SD1_DATA3,
> /* SD1 CD */
> - _MX51_PAD_GPIO1_0__SD1_CD | MUX_PAD_CTRL(PAD_CTL_PUS_22K_UP |
> + NEW_PAD_CTRL(MX51_PAD_GPIO1_0__SD1_CD, PAD_CTL_PUS_22K_UP |
> PAD_CTL_PKE | PAD_CTL_SRE_FAST |
> PAD_CTL_DSE_HIGH | PAD_CTL_PUE | PAD_CTL_HYS),
> };
> diff --git a/arch/arm/plat-mxc/include/mach/iomux-v3.h b/arch/arm/plat-mxc/include/mach/iomux-v3.h
> index ebbce33..376ba92 100644
> --- a/arch/arm/plat-mxc/include/mach/iomux-v3.h
> +++ b/arch/arm/plat-mxc/include/mach/iomux-v3.h
> @@ -80,6 +80,7 @@ typedef u64 iomux_v3_cfg_t;
> ((iomux_v3_cfg_t)(_sel_input_ofs) << MUX_SEL_INPUT_OFS_SHIFT) | \
> ((iomux_v3_cfg_t)(_sel_input) << MUX_SEL_INPUT_SHIFT))
>
> +#define NEW_PAD_CTRL(cfg, pad) ((cfg & ~MUX_PAD_CTRL_MASK) | MUX_PAD_CTRL(pad))
You have to protect cfg with ().
Otherwise I like the idea.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2 2/3] ARM: i.MX51: clean up iomux-mx51.h
2011-08-11 14:53 ` Fabio Estevam
@ 2011-08-11 18:43 ` Troy Kisky
2011-08-12 7:07 ` Sascha Hauer
0 siblings, 1 reply; 7+ messages in thread
From: Troy Kisky @ 2011-08-11 18:43 UTC (permalink / raw)
To: linux-arm-kernel
On 8/11/2011 7:53 AM, Fabio Estevam wrote:
> Hi Troy,
>
> On Wed, Aug 10, 2011 at 10:31 PM, Troy Kisky
> <troy.kisky@boundarydevices.com> wrote:
> ...
>> diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx51.h b/arch/arm/plat-mxc/include/mach/iomux-mx51.h
>> index df6acc0..c7f5169 100644
>> --- a/arch/arm/plat-mxc/include/mach/iomux-mx51.h
>> +++ b/arch/arm/plat-mxc/include/mach/iomux-mx51.h
>> @@ -14,6 +14,8 @@
>> #define __MACH_IOMUX_MX51_H__
>>
>> #include <mach/iomux-v3.h>
>> +#define __NA_ 0x000
>> +
>
> Do we really need this __NA_ define? Can?t we continue just writing 0
> in the macro?
>
> Regards,
>
> Fabio Estevam
First, welcome back from vacation and thanks for taking the time to review.
I like the __NA_ macro for a couple of reasons.
1. It keeps the macro arguments aligned from line to line. 5 character
name so that a line that uses 0xnnn instead, usually has its arguments
aligned with a line that uses __NA_.
2. It makes it more obvious that this field is "not applicable" to this
setting.
3. NON_PAD_I is replaced with __NA_ as it has the same use, and keeps
alignment.
But if Sascha agrees with you, I will change it as it is not really
important to me. Sascha, if you do agree, please also tell me what you
want done with NON_PAD_I.
Thanks
Troy
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2 2/3] ARM: i.MX51: clean up iomux-mx51.h
2011-08-11 18:43 ` Troy Kisky
@ 2011-08-12 7:07 ` Sascha Hauer
0 siblings, 0 replies; 7+ messages in thread
From: Sascha Hauer @ 2011-08-12 7:07 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Aug 11, 2011 at 11:43:02AM -0700, Troy Kisky wrote:
> On 8/11/2011 7:53 AM, Fabio Estevam wrote:
> > Hi Troy,
> >
> > On Wed, Aug 10, 2011 at 10:31 PM, Troy Kisky
> > <troy.kisky@boundarydevices.com> wrote:
> > ...
> >> diff --git a/arch/arm/plat-mxc/include/mach/iomux-mx51.h b/arch/arm/plat-mxc/include/mach/iomux-mx51.h
> >> index df6acc0..c7f5169 100644
> >> --- a/arch/arm/plat-mxc/include/mach/iomux-mx51.h
> >> +++ b/arch/arm/plat-mxc/include/mach/iomux-mx51.h
> >> @@ -14,6 +14,8 @@
> >> #define __MACH_IOMUX_MX51_H__
> >>
> >> #include <mach/iomux-v3.h>
> >> +#define __NA_ 0x000
> >> +
> >
> > Do we really need this __NA_ define? Can?t we continue just writing 0
> > in the macro?
> >
> > Regards,
> >
> > Fabio Estevam
>
> First, welcome back from vacation and thanks for taking the time to review.
>
> I like the __NA_ macro for a couple of reasons.
>
>
> 1. It keeps the macro arguments aligned from line to line. 5 character
> name so that a line that uses 0xnnn instead, usually has its arguments
> aligned with a line that uses __NA_.
>
> 2. It makes it more obvious that this field is "not applicable" to this
> setting.
>
> 3. NON_PAD_I is replaced with __NA_ as it has the same use, and keeps
> alignment.
I'm fine with the __NA_ macro.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2011-08-12 7:07 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-11 1:31 [PATCH v2 1/3] ARM: i.MX51: Remove _MX51 references Troy Kisky
2011-08-11 1:31 ` [PATCH v2 2/3] ARM: i.MX51: clean up iomux-mx51.h Troy Kisky
2011-08-11 14:53 ` Fabio Estevam
2011-08-11 18:43 ` Troy Kisky
2011-08-12 7:07 ` Sascha Hauer
2011-08-11 1:31 ` [PATCH v2 3/3] ARM: i.MX53: clean up iomux-mx53.h Troy Kisky
2011-08-11 16:52 ` [PATCH v2 1/3] ARM: i.MX51: Remove _MX51 references Sascha Hauer
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.