Skip to content

Commit

Permalink
leds: Add pca9532 platform data for Thecus N2100
Browse files Browse the repository at this point in the history
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>
Acked-by: Lennert Buytenhek <buytenh@wantstofly.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
  • Loading branch information
Riku Voipio authored and Richard Purdie committed Jul 23, 2008
1 parent e14fa82 commit 30be048
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions arch/arm/mach-iop32x/n2100.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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("rs5c372b", 0x32),
Expand All @@ -214,6 +262,10 @@ static struct i2c_board_info __initdata n2100_i2c_devices[] = {
I2C_BOARD_INFO("f75375", 0x2e),
.platform_data = &n2100_f75375s,
},
{
I2C_BOARD_INFO("pca9532", 0x60),
.platform_data = &n2100_leds,
},
};

/*
Expand Down

0 comments on commit 30be048

Please sign in to comment.