mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2024-08-20 16:58:59 +03:00
[rdc] improve sitecom device support
Add support for the 3 GPIO LEDs, reset button and switch to the gpio-buttons driver. Patch by Bernhard Loos. git-svn-id: svn://svn.openwrt.org/openwrt/trunk@19974 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
5571a3d454
commit
23e003c5bf
@ -29,15 +29,13 @@
|
|||||||
#include <linux/platform_device.h>
|
#include <linux/platform_device.h>
|
||||||
#include <linux/version.h>
|
#include <linux/version.h>
|
||||||
#include <linux/leds.h>
|
#include <linux/leds.h>
|
||||||
#include <linux/gpio_keys.h>
|
#include <linux/gpio_buttons.h>
|
||||||
#include <linux/input.h>
|
#include <linux/input.h>
|
||||||
#include <linux/mtd/map.h>
|
#include <linux/mtd/map.h>
|
||||||
#include <linux/mtd/mtd.h>
|
#include <linux/mtd/mtd.h>
|
||||||
#include <linux/mtd/physmap.h>
|
#include <linux/mtd/physmap.h>
|
||||||
#include <linux/root_dev.h>
|
#include <linux/root_dev.h>
|
||||||
|
|
||||||
#include <asm/rdc321x_gpio.h>
|
|
||||||
|
|
||||||
/* Flash */
|
/* Flash */
|
||||||
#ifdef CONFIG_MTD_R8610
|
#ifdef CONFIG_MTD_R8610
|
||||||
#define CONFIG_MTD_RDC3210 1
|
#define CONFIG_MTD_RDC3210 1
|
||||||
@ -82,6 +80,12 @@ static struct gpio_led default_leds[] = {
|
|||||||
{ .name = "rdc321x:dmz", .gpio = 1, .active_low = 1},
|
{ .name = "rdc321x:dmz", .gpio = 1, .active_low = 1},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static struct gpio_led sitecom_leds[] = {
|
||||||
|
{ .name = "rdc321x:power", .gpio = 15, .active_low = 1},
|
||||||
|
{ .name = "rdc321x:usb0", .gpio = 0, .active_low = 1},
|
||||||
|
{ .name = "rdc321x:usb1", .gpio = 1, .active_low = 1},
|
||||||
|
};
|
||||||
|
|
||||||
static struct gpio_led_platform_data rdc321x_led_data = {
|
static struct gpio_led_platform_data rdc321x_led_data = {
|
||||||
.num_leds = ARRAY_SIZE(default_leds),
|
.num_leds = ARRAY_SIZE(default_leds),
|
||||||
.leds = default_leds,
|
.leds = default_leds,
|
||||||
@ -96,22 +100,22 @@ static struct platform_device rdc321x_leds = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* Button */
|
/* Button */
|
||||||
static struct gpio_keys_button rdc321x_gpio_btn[] = {
|
static struct gpio_button rdc321x_gpio_btn[] = {
|
||||||
{
|
{
|
||||||
.gpio = 0,
|
.gpio = 6,
|
||||||
.code = BTN_0,
|
.code = BTN_0,
|
||||||
.desc = "Reset",
|
.desc = "Reset",
|
||||||
.active_low = 1,
|
.active_low = 1,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct gpio_keys_platform_data rdc321x_gpio_btn_data = {
|
static struct gpio_buttons_platform_data rdc321x_gpio_btn_data = {
|
||||||
.buttons = rdc321x_gpio_btn,
|
.buttons = rdc321x_gpio_btn,
|
||||||
.nbuttons = ARRAY_SIZE(rdc321x_gpio_btn),
|
.nbuttons = ARRAY_SIZE(rdc321x_gpio_btn),
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct platform_device rdc321x_button = {
|
static struct platform_device rdc321x_button = {
|
||||||
.name = "gpio-keys",
|
.name = "gpio-buttons",
|
||||||
.id = -1,
|
.id = -1,
|
||||||
.dev = {
|
.dev = {
|
||||||
.platform_data = &rdc321x_gpio_btn_data,
|
.platform_data = &rdc321x_gpio_btn_data,
|
||||||
@ -203,6 +207,9 @@ static int __init rdc_board_setup(void)
|
|||||||
rdc_flash_parts[5].offset = rdc_flash_parts[0].size;
|
rdc_flash_parts[5].offset = rdc_flash_parts[0].size;
|
||||||
rdc_flash_parts[5].size = 0x10000;
|
rdc_flash_parts[5].size = 0x10000;
|
||||||
rdc_flash_data.nr_parts = 6;
|
rdc_flash_data.nr_parts = 6;
|
||||||
|
|
||||||
|
rdc321x_led_data.num_leds = ARRAY_SIZE(sitecom_leds);
|
||||||
|
rdc321x_led_data.leds = sitecom_leds;
|
||||||
} else if (!memcmp(((u8 *)the_header) + 14, "Li", 2)) { /* AMIT */
|
} else if (!memcmp(((u8 *)the_header) + 14, "Li", 2)) { /* AMIT */
|
||||||
rdc_flash_parts[0].name = "kernel_parthdr";
|
rdc_flash_parts[0].name = "kernel_parthdr";
|
||||||
rdc_flash_parts[0].offset = 0;
|
rdc_flash_parts[0].offset = 0;
|
||||||
|
@ -1,2 +0,0 @@
|
|||||||
# CONFIG_MTD_R8610 is not set
|
|
||||||
# CONFIG_MTD_RDC3210 is not set
|
|
Loading…
Reference in New Issue
Block a user