lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <4A881D08.4020202@gmail.com>
Date:	Sun, 16 Aug 2009 22:51:52 +0800
From:	Wan ZongShun <mcuos.com@...il.com>
To:	linux-arm-kernel <linux-arm-kernel@...ts.arm.linux.org.uk>,
	linux-kernel <linux-kernel@...r.kernel.org>,
	Russell King <linux@....linux.org.uk>
Subject: [PATCH] ARM: modify mfp-w90p910.c and add mfp.h to w90x900 platform

Dear Russell,

To rename, modify mfp-w90p910.c and add mfp.h for
'extern', duo to some drivers need the functions of
mfp.c frequently, so it is better that inlcuding
this header file in driver c file directly rather
than for the 'extern' to have to create specific
driver header file.

Signed-off-by: Wan ZongShun <mcuos.com@...il.com>

---
 arch/arm/mach-w90x900/Makefile                 |    4 +-
 arch/arm/mach-w90x900/include/mach/mfp.h       |   19 ++++++++++++
 arch/arm/mach-w90x900/{mfp-w90p910.c => mfp.c} |   38 ++++++++++++------------
 3 files changed, 40 insertions(+), 21 deletions(-)
 create mode 100644 arch/arm/mach-w90x900/include/mach/mfp.h
 rename arch/arm/mach-w90x900/{mfp-w90p910.c => mfp.c} (77%)

diff --git a/arch/arm/mach-w90x900/Makefile b/arch/arm/mach-w90x900/Makefile
index 093c5da..4591bb4 100644
--- a/arch/arm/mach-w90x900/Makefile
+++ b/arch/arm/mach-w90x900/Makefile
@@ -5,10 +5,10 @@
 # Object file lists.
 
 obj-y				:= irq.o time.o gpio.o clock.o cpu.o dev.o
-obj-y				+= clksel.o
+obj-y				+= clksel.o mfp.o
 # W90X900 CPU support files
 
-obj-$(CONFIG_CPU_W90P910)	+= w90p910.o mfp-w90p910.o
+obj-$(CONFIG_CPU_W90P910)	+= w90p910.o
 obj-$(CONFIG_CPU_NUC950)	+= nuc950.o
 obj-$(CONFIG_CPU_NUC960)	+= nuc960.o
 
diff --git a/arch/arm/mach-w90x900/include/mach/mfp.h b/arch/arm/mach-w90x900/include/mach/mfp.h
new file mode 100644
index 0000000..6d47d53
--- /dev/null
+++ b/arch/arm/mach-w90x900/include/mach/mfp.h
@@ -0,0 +1,19 @@
+/*
+ * arch/arm/mach-w90x900/include/mach/mfp.h
+ *
+ * Copyright (c) 2009 Nuvoton corporation
+ *
+ * Wan ZongShun <mcuos.com@...il.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+/* extern function from mfp.c */
+
+extern void mfp_set_groupf(struct device *dev);
+extern void mfp_set_groupc(struct device *dev);
+extern void mfp_set_groupi(struct device *dev);
+extern void mfp_set_groupg(struct device *dev);
diff --git a/arch/arm/mach-w90x900/mfp-w90p910.c b/arch/arm/mach-w90x900/mfp.c
similarity index 77%
rename from arch/arm/mach-w90x900/mfp-w90p910.c
rename to arch/arm/mach-w90x900/mfp.c
index 4533098..a47dc9a 100644
--- a/arch/arm/mach-w90x900/mfp-w90p910.c
+++ b/arch/arm/mach-w90x900/mfp.c
@@ -1,5 +1,5 @@
 /*
- * linux/arch/arm/mach-w90x900/mfp-w90p910.c
+ * linux/arch/arm/mach-w90x900/mfp.c
  *
  * Copyright (c) 2008 Nuvoton technology corporation
  *
@@ -55,7 +55,7 @@ void mfp_set_groupf(struct device *dev)
 
 	mfpen = __raw_readl(REG_MFSEL);
 
-	if (strcmp(dev_id, "w90p910-emc") == 0)
+	if (strcmp(dev_id, "nuc900-emc") == 0)
 		mfpen |= GPSELF;/*enable mac*/
 	else
 		mfpen &= ~GPSELF;/*GPIOF[9:0]*/
@@ -79,16 +79,16 @@ void mfp_set_groupc(struct device *dev)
 
 	mfpen = __raw_readl(REG_MFSEL);
 
-	if (strcmp(dev_id, "w90p910-lcd") == 0)
+	if (strcmp(dev_id, "nuc900-lcd") == 0)
 		mfpen |= GPSELC;/*enable lcd*/
-	else if (strcmp(dev_id, "w90p910-kpi") == 0) {
-			mfpen &= (~GPSELC);/*enable kpi*/
-			mfpen |= ENKPI;
-		} else if (strcmp(dev_id, "w90p910-nand") == 0) {
-				mfpen &= (~GPSELC);/*enable nand*/
-				mfpen |= ENNAND;
-			} else
-				mfpen &= (~GPSELC);/*GPIOC[14:0]*/
+	else if (strcmp(dev_id, "nuc900-kpi") == 0) {
+		mfpen &= (~GPSELC);/*enable kpi*/
+		mfpen |= ENKPI;
+	} else if (strcmp(dev_id, "nuc900-nand") == 0) {
+		mfpen &= (~GPSELC);/*enable nand*/
+		mfpen |= ENNAND;
+	} else
+		mfpen &= (~GPSELC);/*GPIOC[14:0]*/
 
 	__raw_writel(mfpen, REG_MFSEL);
 
@@ -111,12 +111,12 @@ void mfp_set_groupi(struct device *dev)
 
 	mfpen &= ~GPSELEI1;/*default gpio16*/
 
-	if (strcmp(dev_id, "w90p910-wdog") == 0)
+	if (strcmp(dev_id, "nuc900-wdog") == 0)
 		mfpen |= GPSELEI1;/*enable wdog*/
-		else if (strcmp(dev_id, "w90p910-atapi") == 0)
-			mfpen |= GPSELEI0;/*enable atapi*/
-			else if (strcmp(dev_id, "w90p910-keypad") == 0)
-				mfpen &= ~GPSELEI0;/*enable keypad*/
+	else if (strcmp(dev_id, "nuc900-atapi") == 0)
+		mfpen |= GPSELEI0;/*enable atapi*/
+	else if (strcmp(dev_id, "nuc900-keypad") == 0)
+		mfpen &= ~GPSELEI0;/*enable keypad*/
 
 	__raw_writel(mfpen, REG_MFSEL);
 
@@ -137,13 +137,13 @@ void mfp_set_groupg(struct device *dev)
 
 	mfpen = __raw_readl(REG_MFSEL);
 
-	if (strcmp(dev_id, "w90p910-spi") == 0) {
+	if (strcmp(dev_id, "nuc900-spi") == 0) {
 		mfpen &= ~(GPIOG0TO1 | GPIOG2TO3);
 		mfpen |= ENSPI;/*enable spi*/
-	} else if (strcmp(dev_id, "w90p910-i2c0") == 0) {
+	} else if (strcmp(dev_id, "nuc900-i2c0") == 0) {
 		mfpen &= ~(GPIOG0TO1);
 		mfpen |= ENI2C0;/*enable i2c0*/
-	} else if (strcmp(dev_id, "w90p910-i2c1") == 0) {
+	} else if (strcmp(dev_id, "nuc900-i2c1") == 0) {
 		mfpen &= ~(GPIOG2TO3);
 		mfpen |= ENI2C1;/*enable i2c1*/
 	} else {
-- 
1.5.6.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ