Add remaining LEDs
authorandy
Fri, 06 Sep 2013 15:28:49 +0200
changeset 3 f2f1be1cc4ba
parent 2 459c75093fd1
child 4 1b9d05c730cb
Add remaining LEDs
Add remaining Buttons
Fix display of CPU identification
add_88f6702a_cpu.diff
dns320l-setup.c
--- a/add_88f6702a_cpu.diff	Fri Sep 06 00:08:26 2013 +0200
+++ b/add_88f6702a_cpu.diff	Fri Sep 06 15:28:49 2013 +0200
@@ -6,7 +6,7 @@
  			return "MV88F6282-Rev-Unsupported";
 +    } else if (dev == MV88F6702_DEV_ID) {
 +        if (rev == MV88F6702_REV_A1)
-+            return "MV88F67-2-Rev-A1";
++            return "MV88F6702-Rev-A1";
 +        else
 +            return "MV88F6702-Rev-Unsupported";
  	} else {
--- a/dns320l-setup.c	Fri Sep 06 00:08:26 2013 +0200
+++ b/dns320l-setup.c	Fri Sep 06 15:28:49 2013 +0200
@@ -29,12 +29,16 @@
 #include <linux/gpio-fan.h>
 #include <linux/input.h>
 
-#define DNS320L_GPIO_LED_SATA1          20
-#define DNS320L_GPIO_LED_SATA0          21
+#define DNS320L_GPIO_LED_SATA1_BLUE     20
+#define DNS320L_GPIO_LED_SATA0_BLUE     21
+#define DNS320L_GPIO_LED_SATA1_RED      22
+#define DNS320L_GPIO_LED_SATA0_RED      23
 #define DNS320L_GPIO_POWER_SATA         24
 #define DNS320L_GPIO_LED_USB_BLUE       25
 #define DNS320L_GPIO_LED_USB_ORANGE     26
 #define DNS320L_GPIO_BUTTON_USB         27
+#define DNS320L_GPIO_BUTTON_RESET       28
+#define DNS320L_GPIO_BUTTON_POWER       29
 
 static struct mtd_partition dns320l_nand_parts[] = {
 	{
@@ -94,11 +98,29 @@
 
 static struct gpio_keys_button dns320l_button_pins[] = {
 	{
-		.code		= KEY_EJECTCD,
+		.code		= KEY_COPY,
+		.type       = EV_KEY,
 		.gpio		= DNS320L_GPIO_BUTTON_USB,
-		.desc		= "USB unmount button",
+		.desc		= "USB Copy button",
 		.active_low	= 1,
-	}
+		.debounce_interval = 1000,
+	},
+	{ // This button does not (yet) work...
+	    .code       = KEY_POWER,
+        .type       = EV_KEY,
+	    .gpio       = DNS320L_GPIO_BUTTON_POWER,
+	    .desc       = "Power Button",
+        .active_low = 1,
+        .debounce_interval = 1000,
+	},
+	{
+	    .code       = KEY_OPTION,
+	    .type       = EV_KEY,
+	    .gpio       = DNS320L_GPIO_BUTTON_RESET,
+	    .desc       = "Reset Button",
+	    .active_low = 1,
+	    .debounce_interval = 1000,
+	},
 };
 
 static struct gpio_keys_platform_data dns320l_button_data = {
@@ -109,7 +131,6 @@
 static struct platform_device dns320l_button_device = {
 	.name		= "gpio-keys",
 	.id		= -1,
-	.num_resources	= 0,
 	.dev		= {
 		.platform_data	= &dns320l_button_data,
 	}
@@ -131,19 +152,22 @@
 	},
 	{
 	    .name   = "dns320l:blue:sata0",
-	    .gpio   = DNS320L_GPIO_LED_SATA0,
+	    .gpio   = DNS320L_GPIO_LED_SATA0_BLUE,
 	    .default_trigger = "ide-disk"
 	},
 	{
 	    .name   = "dns320l:blue:sata1",
-	    .gpio   = DNS320L_GPIO_LED_SATA1,
+	    .gpio   = DNS320L_GPIO_LED_SATA1_BLUE,
 	    .default_trigger = "ide-disk"
 	},
-//	{
-//	    .name   = "dns320l:blue:power",
-//	    .gpio   = DNS320L_GPIO_LED_POWER,
-//	},
-	
+	{
+	    .name   = "dns320l:red:sata0",
+	    .gpio   = DNS320L_GPIO_LED_SATA0_RED,
+	},
+	{
+	    .name   = "dns320l:red:sata1",
+	    .gpio   = DNS320L_GPIO_LED_SATA1_RED,
+	},
 };
 
 static struct gpio_led_platform_data dns320l_led_data = {
@@ -166,18 +190,16 @@
 static unsigned int dns320l_mpp_config[] __initdata = {
     MPP13_UART1_TXD,
 	MPP14_UART1_RXD,
-	MPP16_GPIO,
-	MPP17_GPIO,
-	MPP18_GPO,
-	MPP19_GPO,
-	MPP20_GPIO,    // SATA LED
-	MPP21_GPIO,    // SATA LED
+	MPP20_GPIO,    // SATA LED BLUE
+	MPP21_GPIO,    // SATA LED BLUE
+	MPP22_GPIO,    // SATA LED RED
+	MPP23_GPIO,    // SATA LED RED
 	MPP24_GPIO,    // SATA Power
 	MPP25_GPIO,    // USB LED Blue
 	MPP26_GPIO,	   // USB LED Orange
 	MPP27_GPIO,	   // Button USB Copy
-	MPP28_GPIO,	
-	MPP29_GPIO,	 
+	MPP28_GPIO,	   // Button Reset
+	MPP29_GPIO,	   // Button Power
 	MPP30_GPIO,
 	MPP31_GPIO,
 	MPP32_GPIO,
@@ -212,7 +234,7 @@
     kirkwood_mpp_conf(dns320l_mpp_config);
     kirkwood_uart0_init();
     kirkwood_uart1_init();
-    kirkwood_nand_init(ARRAY_AND_SIZE(dns320l_nand_parts), 60);
+    kirkwood_nand_init(ARRAY_AND_SIZE(dns320l_nand_parts), 40);
 
     kirkwood_ehci_init();
     kirkwood_i2c_init();