Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 303516
b: refs/heads/master
c: ff3e660
h: refs/heads/master
v: v3
  • Loading branch information
Arnaud Patard (Rtp) authored and Jason Cooper committed May 15, 2012
1 parent 6d6fc4e commit b46c03e
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 24 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: 92a486eabefadca1169fbf15d737feeaf2bda844
refs/heads/master: ff3e660b5a881b401b2b6735aa5334f433237dcb
25 changes: 2 additions & 23 deletions trunk/arch/arm/mach-orion5x/dns323-setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,27 +253,6 @@ static int __init dns323_read_mac_addr(void)
* GPIO LEDs (simple - doesn't use hardware blinking support)
*/

#define ORION_BLINK_HALF_PERIOD 100 /* ms */

static int dns323_gpio_blink_set(unsigned gpio, int state,
unsigned long *delay_on, unsigned long *delay_off)
{

if (delay_on && delay_off && !*delay_on && !*delay_off)
*delay_on = *delay_off = ORION_BLINK_HALF_PERIOD;

switch(state) {
case GPIO_LED_NO_BLINK_LOW:
case GPIO_LED_NO_BLINK_HIGH:
orion_gpio_set_blink(gpio, 0);
gpio_set_value(gpio, state);
break;
case GPIO_LED_BLINK:
orion_gpio_set_blink(gpio, 1);
}
return 0;
}

static struct gpio_led dns323ab_leds[] = {
{
.name = "power:blue",
Expand Down Expand Up @@ -312,13 +291,13 @@ static struct gpio_led dns323c_leds[] = {
static struct gpio_led_platform_data dns323ab_led_data = {
.num_leds = ARRAY_SIZE(dns323ab_leds),
.leds = dns323ab_leds,
.gpio_blink_set = dns323_gpio_blink_set,
.gpio_blink_set = orion_gpio_led_blink_set,
};

static struct gpio_led_platform_data dns323c_led_data = {
.num_leds = ARRAY_SIZE(dns323c_leds),
.leds = dns323c_leds,
.gpio_blink_set = dns323_gpio_blink_set,
.gpio_blink_set = orion_gpio_led_blink_set,
};

static struct platform_device dns323_gpio_leds = {
Expand Down
23 changes: 23 additions & 0 deletions trunk/arch/arm/plat-orion/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <linux/bitops.h>
#include <linux/io.h>
#include <linux/gpio.h>
#include <linux/leds.h>

/*
* GPIO unit register offsets.
Expand Down Expand Up @@ -295,6 +296,28 @@ void orion_gpio_set_blink(unsigned pin, int blink)
}
EXPORT_SYMBOL(orion_gpio_set_blink);

#define ORION_BLINK_HALF_PERIOD 100 /* ms */

int orion_gpio_led_blink_set(unsigned gpio, int state,
unsigned long *delay_on, unsigned long *delay_off)
{

if (delay_on && delay_off && !*delay_on && !*delay_off)
*delay_on = *delay_off = ORION_BLINK_HALF_PERIOD;

switch (state) {
case GPIO_LED_NO_BLINK_LOW:
case GPIO_LED_NO_BLINK_HIGH:
orion_gpio_set_blink(gpio, 0);
gpio_set_value(gpio, state);
break;
case GPIO_LED_BLINK:
orion_gpio_set_blink(gpio, 1);
}
return 0;
}
EXPORT_SYMBOL_GPL(orion_gpio_led_blink_set);


/*****************************************************************************
* Orion GPIO IRQ
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/arm/plat-orion/include/plat/gpio.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
*/
void orion_gpio_set_unused(unsigned pin);
void orion_gpio_set_blink(unsigned pin, int blink);
int orion_gpio_led_blink_set(unsigned gpio, int state,
unsigned long *delay_on, unsigned long *delay_off);

#define GPIO_INPUT_OK (1 << 0)
#define GPIO_OUTPUT_OK (1 << 1)
Expand Down

0 comments on commit b46c03e

Please sign in to comment.