[PATCH] Add pca9532 platform data for Thecus N2100

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <rpurdie@...>, <linux-kernel@...>, <akpm@...>, <buytenh@...>, <tbm@...>
Date: Tuesday, April 29, 2008 - 4:08 pm

Thecus N2100 has leds and a buzzer attached to a pca9532
controller. Attach the driver to the i2c bus and define
the pca9532 pin coniguration for this platform in n2100_leds.

With this patch, support for N2100 should be complete in mainline
Linux.

Signed-off-by: Riku Voipio <riku.voipio@iki.fi>
---
 arch/arm/mach-iop32x/n2100.c |   52 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 52 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-iop32x/n2100.c b/arch/arm/mach-iop32x/n2100.c
index bc91d6e..029d234 100644
--- a/arch/arm/mach-iop32x/n2100.c
+++ b/arch/arm/mach-iop32x/n2100.c
@@ -17,6 +17,7 @@
 #include <linux/mm.h>
 #include <linux/init.h>
 #include <linux/f75375s.h>
+#include <linux/leds-pca9532.h>
 #include <linux/delay.h>
 #include <linux/kernel.h>
 #include <linux/pci.h>
@@ -206,6 +207,53 @@ static struct f75375s_platform_data n2100_f75375s = {
 	.pwm_enable = { 0, 0 },
 };
 
+static struct pca9532_platform_data n2100_leds = {
+	.leds = {
+	{	.name = "n2100:red:satafail0",
+		.state = PCA9532_OFF,
+		.type = PCA9532_TYPE_LED,
+	},
+	{	.name = "n2100:red:satafail1",
+		.state = PCA9532_OFF,
+		.type = PCA9532_TYPE_LED,
+	},
+	{	.name = "n2100:blue:usb",
+		.state = PCA9532_OFF,
+		.type = PCA9532_TYPE_LED,
+	},
+	{ 	.type = PCA9532_TYPE_NONE },
+
+	{ 	.type = PCA9532_TYPE_NONE },
+	{ 	.type = PCA9532_TYPE_NONE },
+	{ 	.type = PCA9532_TYPE_NONE },
+	{	.name = "n2100:red:usb",
+		.state = PCA9532_OFF,
+		.type = PCA9532_TYPE_LED,
+	},
+
+	{	.type = PCA9532_TYPE_NONE }, /* power OFF gpio */
+	{	.type = PCA9532_TYPE_NONE }, /* reset gpio */
+	{	.type = PCA9532_TYPE_NONE },
+	{	.type = PCA9532_TYPE_NONE },
+
+	{	.type = PCA9532_TYPE_NONE },
+	{	.name = "n2100:orange:system",
+		.state = PCA9532_OFF,
+		.type = PCA9532_TYPE_LED,
+	},
+	{	.name = "n2100:red:system",
+		.state = PCA9532_OFF,
+		.type = PCA9532_TYPE_LED,
+	},
+	{	.name = "N2100 beeper"  ,
+		.state =  PCA9532_OFF,
+		.type = PCA9532_TYPE_N2100_BEEP,
+	},
+	},
+	.psc = { 0, 0 },
+	.pwm = { 0, 0 },
+};
+
 static struct i2c_board_info __initdata n2100_i2c_devices[] = {
 	{
 		I2C_BOARD_INFO("rtc-rs5c372", 0x32),
@@ -216,6 +264,10 @@ static struct i2c_board_info __initdata n2100_i2c_devices[] = {
 		.type = "f75375",
 		.platform_data = &n2100_f75375s,
 	},
+	{
+		I2C_BOARD_INFO("pca9532", 0x60),
+		.platform_data = &n2100_leds,
+	},
 };
 
 /*
-- 
1.5.4.5


-- 
"rm -rf" only sounds scary if you don't have backups
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] Add pca9532 platform data for Thecus N2100, Riku Voipio, (Tue Apr 29, 4:08 pm)
Re: [PATCH] Add pca9532 platform data for Thecus N2100, Mikael Pettersson, (Wed Apr 30, 3:50 am)
Re: [PATCH] Add pca9532 platform data for Thecus N2100, Lennert Buytenhek, (Wed Apr 30, 2:26 am)
Re: [PATCH] Add pca9532 platform data for Thecus N2100, Andrew Morton, (Tue Apr 29, 4:26 pm)
Re: [PATCH] Add pca9532 platform data for Thecus N2100, Riku Voipio, (Tue Apr 29, 4:46 pm)
Re: [PATCH] Add pca9532 platform data for Thecus N2100, Russell King, (Tue Apr 29, 4:56 pm)
Re: [PATCH] Add pca9532 platform data for Thecus N2100, Richard Purdie, (Tue Apr 29, 5:16 pm)
Re: [PATCH] Add pca9532 platform data for Thecus N2100, Richard Purdie, (Tue Apr 29, 4:45 pm)
Re: [PATCH] Add pca9532 platform data for Thecus N2100, Russell King, (Tue Apr 29, 4:55 pm)