Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 326980
b: refs/heads/master
c: 8ee8ef2
h: refs/heads/master
v: v3
  • Loading branch information
Bryan Wu committed Aug 1, 2012
1 parent 6369dff commit 11b378f
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 67 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 95f4965cf8a7cb7cdd987359cf48162f37bdd2d3
refs/heads/master: 8ee8ef2996df477aa1623bd213b1548ab1b9c07c
2 changes: 0 additions & 2 deletions trunk/arch/arm/mach-clps711x/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,3 @@ obj-$(CONFIG_ARCH_CLEP7312) += clep7312.o
obj-$(CONFIG_ARCH_EDB7211) += edb7211-arch.o edb7211-mm.o
obj-$(CONFIG_ARCH_FORTUNET) += fortunet.o
obj-$(CONFIG_ARCH_P720T) += p720t.o
leds-$(CONFIG_ARCH_P720T) += p720t-leds.o
obj-$(CONFIG_LEDS) += $(leds-y)
1 change: 0 additions & 1 deletion trunk/arch/arm/mach-clps711x/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
#include <asm/sizes.h>
#include <mach/hardware.h>
#include <asm/irq.h>
#include <asm/leds.h>
#include <asm/pgtable.h>
#include <asm/page.h>
#include <asm/mach/map.h>
Expand Down
63 changes: 0 additions & 63 deletions trunk/arch/arm/mach-clps711x/p720t-leds.c

This file was deleted.

61 changes: 61 additions & 0 deletions trunk/arch/arm/mach-clps711x/p720t.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
#include <linux/string.h>
#include <linux/mm.h>
#include <linux/io.h>
#include <linux/slab.h>
#include <linux/leds.h>

#include <mach/hardware.h>
#include <asm/pgtable.h>
Expand All @@ -34,6 +36,8 @@
#include <asm/mach/map.h>
#include <mach/syspld.h>

#include <asm/hardware/clps7111.h>

#include "common.h"

/*
Expand Down Expand Up @@ -121,3 +125,60 @@ static int p720t_hw_init(void)

__initcall(p720t_hw_init);

/*
* LED controled by CPLD
*/
#if defined(CONFIG_NEW_LEDS) && defined(CONFIG_LEDS_CLASS)
static void p720t_led_set(struct led_classdev *cdev,
enum led_brightness b)
{
u8 reg = clps_readb(PDDR);

if (b != LED_OFF)
reg |= 0x1;
else
reg &= ~0x1;

clps_writeb(reg, PDDR);
}

static enum led_brightness p720t_led_get(struct led_classdev *cdev)
{
u8 reg = clps_readb(PDDR);

return (reg & 0x1) ? LED_FULL : LED_OFF;
}

static int __init p720t_leds_init(void)
{

struct led_classdev *cdev;
int ret;

if (!machine_is_p720t())
return -ENODEV;

cdev = kzalloc(sizeof(*cdev), GFP_KERNEL);
if (!cdev)
return -ENOMEM;

cdev->name = "p720t:0";
cdev->brightness_set = p720t_led_set;
cdev->brightness_get = p720t_led_get;
cdev->default_trigger = "heartbeat";

ret = led_classdev_register(NULL, cdev);
if (ret < 0) {
kfree(cdev);
return ret;
}

return 0;
}

/*
* Since we may have triggers on any subsystem, defer registration
* until after subsystem_init.
*/
fs_initcall(p720t_leds_init);
#endif

0 comments on commit 11b378f

Please sign in to comment.