1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2025-04-21 12:27:27 +03:00

[ubicom32]: move new files out from platform support patch

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@19815 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
kaloz
2010-02-22 13:54:47 +00:00
parent fdcca1ea95
commit 1a29ef8e97
279 changed files with 56440 additions and 57274 deletions

View File

@@ -0,0 +1,28 @@
config IP5170DPF
bool "IP5170DPF"
select UBICOM32_V3
select I2C
select I2C_GPIO
select FB
select FB_UBICOM32
select BACKLIGHT_LCD_SUPPORT
select BACKLIGHT_CLASS_DEVICE
select UBICOM_HID
select NEW_LEDS
select LEDS_CLASS
select LEDS_GPIO
help
IP5170 Digital Picture Frame board, 8005-1113, IP5K-BEV-0011-13 v1.3
config IP5160DEV
bool "IP5160Dev_Ver1Dot1"
select UBICOM32_V3
help
Ubicom StreamEngine 5000 Development Board, IP5K-BDV-0004-11 v1.1
config IP5160EVAL
bool "IP5160RGWEval_Ver2Rev2"
select UBICOM32_V3
help
Ubicom StreamEngine 5000 RGW Evaluation Board, IP5K-RGW-0004-11 v2.2

View File

@@ -0,0 +1,31 @@
#
# arch/ubicom32/mach-ip5k/Makefile
# Makefile for boards which have an ip5k on them.
#
# (C) Copyright 2009, Ubicom, Inc.
#
# This file is part of the Ubicom32 Linux Kernel Port.
#
# The Ubicom32 Linux Kernel Port is free software: you can redistribute
# it and/or modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation, either version 2 of the
# License, or (at your option) any later version.
#
# The Ubicom32 Linux Kernel Port is distributed in the hope that it
# will be useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
# the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with the Ubicom32 Linux Kernel Port. If not,
# see <http://www.gnu.org/licenses/>.
#
# Ubicom32 implementation derived from (with many thanks):
# arch/m68knommu
# arch/blackfin
# arch/parisc
#
obj-$(CONFIG_IP5170DPF) += board-ip5170dpf.o
obj-$(CONFIG_IP5160DEV) += board-ip5160dev.o
obj-$(CONFIG_IP5160EVAL) += board-ip5160rgw.o

View File

@@ -0,0 +1,109 @@
/*
* arch/ubicom32/mach-ip5k/board-ip5160dev.c
* Platform initialization for ip5160dev board.
*
* (C) Copyright 2009, Ubicom, Inc.
*
* This file is part of the Ubicom32 Linux Kernel Port.
*
* The Ubicom32 Linux Kernel Port is free software: you can redistribute
* it and/or modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation, either version 2 of the
* License, or (at your option) any later version.
*
* The Ubicom32 Linux Kernel Port is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
* the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the Ubicom32 Linux Kernel Port. If not,
* see <http://www.gnu.org/licenses/>.
*
* Ubicom32 implementation derived from (with many thanks):
* arch/m68knommu
* arch/blackfin
* arch/parisc
*/
#include <linux/device.h>
#include <linux/platform_device.h>
#include <linux/gpio.h>
#include <asm/board.h>
#include <asm/machdep.h>
#ifdef CONFIG_SERIAL_UBI32_SERDES
#include <asm/ubicom32suart.h>
#endif
/*
* Factory Default Button on the board at PXn
* TODO: This is just a placeholder and it needs to include proper header files
*/
struct ubicom32fdb_platform_data {
int fdb_gpio;
bool fdb_polarity;
};
static struct ubicom32fdb_platform_data ip5160dev_fdb_data = {
.fdb_gpio = 0,
.fdb_polarity = true,
};
static struct platform_device ip5160dev_fdb_device = {
.name = "ubicom32fdb",
.id = -1,
.dev = {
.platform_data = &ip5160dev_fdb_data,
},
};
#ifdef CONFIG_SERIAL_UBI32_SERDES
static struct resource ip5160dev_ubicom32_suart_resources[] = {
{
.start = RD,
.end = RD,
.flags = IORESOURCE_MEM,
},
{
.start = PORT_OTHER_INT(RD),
.end = PORT_OTHER_INT(RD),
.flags = IORESOURCE_IRQ,
},
{
.start = 240000000,
.end = 240000000,
.flags = UBICOM32_SUART_IORESOURCE_CLOCK,
},
};
static struct platform_device ip5160dev_ubicom32_suart_device = {
.name = "ubicom32suart",
.id = -1,
.num_resources = ARRAY_SIZE(ip5160dev_ubicom32_suart_resources),
.resource = ip5160dev_ubicom32_suart_resources,
};
#endif
/*
* List of all devices in our system
*/
static struct platform_device *ip5160dev_devices[] __initdata = {
#ifdef CONFIG_SERIAL_UBI32_SERDES
&ip5160dev_ubicom32_suart_device,
#endif
&ip5160dev_fdb_device,
};
/*
* ip5160dev_init
* Called to add the devices which we have on this board
*/
static int __init ip5160dev_init(void)
{
ubi_gpio_init();
printk(KERN_INFO "%s: registering device resources\n", __FUNCTION__);
platform_add_devices(ip5160dev_devices, ARRAY_SIZE(ip5160dev_devices));
return 0;
}
arch_initcall(ip5160dev_init);

View File

@@ -0,0 +1,75 @@
/*
* arch/ubicom32/mach-ip5k/board-ip5160rgw.c
* Platform initialization for ip5160rgw board.
*
* (C) Copyright 2009, Ubicom, Inc.
*
* This file is part of the Ubicom32 Linux Kernel Port.
*
* The Ubicom32 Linux Kernel Port is free software: you can redistribute
* it and/or modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation, either version 2 of the
* License, or (at your option) any later version.
*
* The Ubicom32 Linux Kernel Port is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
* the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the Ubicom32 Linux Kernel Port. If not,
* see <http://www.gnu.org/licenses/>.
*
* Ubicom32 implementation derived from (with many thanks):
* arch/m68knommu
* arch/blackfin
* arch/parisc
*/
#include <linux/device.h>
#include <linux/platform_device.h>
#include <linux/gpio.h>
#include <asm/board.h>
#include <asm/machdep.h>
/*
* Factory Default Button on the board at PXn
* TODO: This is just a placeholder and it needs to include proper header files
*/
struct ubicom32fdb_platform_data {
int fdb_gpio;
bool fdb_polarity;
};
static struct ubicom32fdb_platform_data ip5160rgw_fdb_data = {
.fdb_gpio = 0,
.fdb_polarity = true,
};
static struct platform_device ip5160rgw_fdb_device = {
.name = "ubicom32fdb",
.id = -1,
.dev = {
.platform_data = &ip5160rgw_fdb_data,
},
};
/*
* List of all devices in our system
*/
static struct platform_device *ip5160rgw_devices[] __initdata = {
&ip5160rgw_fdb_device,
};
/*
* ip5160rgw_init
* Called to add the devices which we have on this board
*/
static int __init ip5160rgw_init(void)
{
ubi_gpio_init();
printk(KERN_INFO "%s: registering device resources\n", __FUNCTION__);
platform_add_devices(ip5160rgw_devices, ARRAY_SIZE(ip5160rgw_devices));
return 0;
}
arch_initcall(ip5160rgw_init);

View File

@@ -0,0 +1,279 @@
/*
* arch/ubicom32/mach-ip5k/board-ip5170dpf.c
* Platform initialization for ip5160dpf board.
*
* (C) Copyright 2009, Ubicom, Inc.
*
* This file is part of the Ubicom32 Linux Kernel Port.
*
* The Ubicom32 Linux Kernel Port is free software: you can redistribute
* it and/or modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation, either version 2 of the
* License, or (at your option) any later version.
*
* The Ubicom32 Linux Kernel Port is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
* the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the Ubicom32 Linux Kernel Port. If not,
* see <http://www.gnu.org/licenses/>.
*
* Ubicom32 implementation derived from (with many thanks):
* arch/m68knommu
* arch/blackfin
* arch/parisc
*/
#include <linux/device.h>
#include <linux/platform_device.h>
#include <linux/gpio.h>
#include <linux/leds.h>
#include <linux/i2c.h>
#include <linux/i2c-gpio.h>
#include <linux/input.h>
#include <asm/board.h>
#include <asm/machdep.h>
#include <asm/ubicom32hid.h>
#include <asm/vdc_tio.h>
/*
* LEDs
*
* WLAN PD9 (Note this is shared with MISO, but we don't use it)
* WPS PD8
*
* TODO: check triggers, are they generic?
*/
static struct gpio_led ip5170dpf_gpio_leds[] = {
{
.name = "d31:green:WLAN1",
.default_trigger = "WLAN1",
.gpio = GPIO_RD_9,
.active_low = 1,
},
{
.name = "d30:green:WPS",
.default_trigger = "WPS",
.gpio = GPIO_RD_8,
.active_low = 1,
},
};
static struct gpio_led_platform_data ip5170dpf_gpio_led_platform_data = {
.num_leds = 2,
.leds = ip5170dpf_gpio_leds,
};
static struct platform_device ip5170dpf_gpio_leds_device = {
.name = "leds-gpio",
.id = -1,
.dev = {
.platform_data = &ip5170dpf_gpio_led_platform_data,
},
};
/*
* Backlight on the board PD0, hardware PWM
*/
static const struct ubicom32hid_button ip5170dpf_ubicom32hid_buttons[] = {
{
.type = EV_KEY,
.code = KEY_UP,
.bit = 0,
},
{
.type = EV_KEY,
.code = KEY_LEFT,
.bit = 1,
},
{
.type = EV_KEY,
.code = KEY_RIGHT,
.bit = 2,
},
{
.type = EV_KEY,
.code = KEY_DOWN,
.bit = 3,
},
{
.type = EV_KEY,
.code = KEY_ENTER,
.bit = 4,
},
{
.type = EV_KEY,
.code = KEY_MENU,
.bit = 5,
},
{
.type = EV_KEY,
.code = KEY_ESC,
.bit = 7,
},
};
static const struct ubicom32hid_ir ip5170dpf_ubicom32hid_ircodes[] = {
{
.type = EV_KEY,
.code = KEY_UP,
.ir_code = 0xF807916E
},
{
.type = EV_KEY,
.code = KEY_DOWN,
.ir_code = 0xF20D916E
},
{
.type = EV_KEY,
.code = KEY_LEFT,
.ir_code = 0xF609916E
},
{
.type = EV_KEY,
.code = KEY_RIGHT,
.ir_code = 0xF40B916E
},
{
.type = EV_KEY,
.code = KEY_ENTER,
.ir_code = 0xF50A916E
},
{ /* rotate */
.type = EV_KEY,
.code = KEY_FN_F1,
.ir_code = 0xF906916E
},
{
.type = EV_KEY,
.code = KEY_MENU,
.ir_code = 0xF708916E
},
{ /* font size */
.type = EV_KEY,
.code = KEY_FN_F2,
.ir_code = 0xF30C916E
},
{
.type = EV_KEY,
.code = KEY_ESC,
.ir_code = 0xF10E916E
},
{
.type = EV_KEY,
.code = KEY_VOLUMEUP,
.ir_code = 0xF00F916E
},
{
.type = EV_KEY,
.code = KEY_VOLUMEDOWN,
.ir_code = 0xED12916E
},
{
.type = EV_KEY,
.code = KEY_MUTE,
.ir_code = 0xEA15916E
},
{
.type = EV_KEY,
.code = KEY_INFO,
.ir_code = 0xEF10916E
},
{ /* Like */
.type = EV_KEY,
.code = KEY_FN_F3,
.ir_code = 0xEE11916E
},
{ /* Dislike */
.type = EV_KEY,
.code = KEY_FN_F4,
.ir_code = 0xEB14916E
},
{
.type = EV_KEY,
.code = KEY_POWER,
.ir_code = 0xFD02916E
},
};
static struct ubicom32hid_platform_data ip5170dpf_ubicom32hid_platform_data = {
.gpio_reset = GPIO_RA_4,
.gpio_reset_polarity = 0,
.type = UBICOM32HID_BL_TYPE_BINARY,
.invert = 0,
.default_intensity = 1,
.buttons = ip5170dpf_ubicom32hid_buttons,
.nbuttons = ARRAY_SIZE(ip5170dpf_ubicom32hid_buttons),
.ircodes = ip5170dpf_ubicom32hid_ircodes,
.nircodes = ARRAY_SIZE(ip5170dpf_ubicom32hid_ircodes),
};
/*
* Devices on the I2C bus
*/
static struct i2c_board_info __initdata ip5170dpf_i2c_board_info[] = {
/*
* U24, ubicom32hid
*/
{
.type = "ubicom32hid",
.addr = 0x08,
.platform_data = &ip5170dpf_ubicom32hid_platform_data,
},
/*
* U14, CS4350 DAC, address 0x4B
*/
};
/*
* I2C bus on the board, SDA PF13, SCL PF14
*/
static struct i2c_gpio_platform_data ip5170dpf_i2c_data = {
.sda_pin = GPIO_RF_13,
.scl_pin = GPIO_RF_14,
.sda_is_open_drain = 0,
.scl_is_open_drain = 0,
.scl_is_output_only = 1,
.udelay = 5,
};
static struct platform_device ip5170dpf_i2c_device = {
.name = "i2c-gpio",
.id = 0,
.dev = {
.platform_data = &ip5170dpf_i2c_data,
},
};
/*
* List of all devices in our system
*/
static struct platform_device *ip5170dpf_devices[] __initdata = {
&ip5170dpf_i2c_device,
&ip5170dpf_gpio_leds_device,
};
/*
* ip5170dpf_init
* Called to add the devices which we have on this board
*/
static int __init ip5170dpf_init(void)
{
ubi_gpio_init();
vdc_tio_init();
printk(KERN_INFO "%s: registering device resources\n", __FUNCTION__);
platform_add_devices(ip5170dpf_devices, ARRAY_SIZE(ip5170dpf_devices));
printk(KERN_INFO "%s: registering i2c resources\n", __FUNCTION__);
i2c_register_board_info(0, ip5170dpf_i2c_board_info, ARRAY_SIZE(ip5170dpf_i2c_board_info));
return 0;
}
arch_initcall(ip5170dpf_init);