mirror of
https://github.com/suyu-emu/horinux.git
synced 2026-09-21 14:15:21 -07:00
Merge branch 'devel' of git://git.kernel.org/pub/scm/linux/kernel/git/ycmiao/pxa-linux-2.6 into devel
This commit is contained in:
+6
-2
@@ -738,18 +738,22 @@ M: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
|
||||
M: Dirk Opfer <dirk@opfer-online.de>
|
||||
S: Maintained
|
||||
|
||||
ARM/PALMTX,PALMT5,PALMLD,PALMTE2 SUPPORT
|
||||
M: Marek Vasut <marek.vasut@gmail.com>
|
||||
ARM/PALMTX,PALMT5,PALMLD,PALMTE2,PALMTC SUPPORT
|
||||
P: Marek Vasut
|
||||
M: marek.vasut@gmail.com
|
||||
L: linux-arm-kernel@lists.infradead.org
|
||||
W: http://hackndev.com
|
||||
S: Maintained
|
||||
|
||||
ARM/PALM TREO 680 SUPPORT
|
||||
M: Tomas Cech <sleep_walker@suse.cz>
|
||||
L: linux-arm-kernel@lists.infradead.org
|
||||
W: http://hackndev.com
|
||||
S: Maintained
|
||||
|
||||
ARM/PALMZ72 SUPPORT
|
||||
M: Sergey Lapin <slapin@ossfans.org>
|
||||
L: linux-arm-kernel@lists.infradead.org
|
||||
W: http://hackndev.com
|
||||
S: Maintained
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -78,7 +78,10 @@ static inline unsigned int __attribute_const__ read_cpuid_tcmstatus(void)
|
||||
#else
|
||||
static inline int cpu_is_xsc3(void)
|
||||
{
|
||||
if ((read_cpuid_id() & 0xffffe000) == 0x69056000)
|
||||
unsigned int id;
|
||||
id = read_cpuid_id() & 0xffffe000;
|
||||
/* It covers both Intel ID and Marvell ID */
|
||||
if ((id == 0x69056000) || (id == 0x56056000))
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -21,6 +21,11 @@ config CPU_PXA930
|
||||
|
||||
config CPU_PXA935
|
||||
bool "PXA935 (codename Tavor-P65)"
|
||||
select CPU_PXA930
|
||||
|
||||
config CPU_PXA950
|
||||
bool "PXA950 (codename Tavor-PV2)"
|
||||
select CPU_PXA930
|
||||
|
||||
endmenu
|
||||
|
||||
@@ -79,6 +84,12 @@ config MACH_MP900C
|
||||
bool "Nec Mobilepro 900/c"
|
||||
select PXA25x
|
||||
|
||||
config MACH_BALLOON3
|
||||
bool "Balloon 3 board"
|
||||
select PXA27x
|
||||
select IWMMXT
|
||||
select PXA_HAVE_BOARD_IRQS
|
||||
|
||||
config ARCH_PXA_IDP
|
||||
bool "Accelent Xscale IDP"
|
||||
select PXA25x
|
||||
@@ -371,6 +382,15 @@ config MACH_PALMTE2
|
||||
Say Y here if you intend to run this kernel on a Palm Tungsten|E2
|
||||
handheld computer.
|
||||
|
||||
config MACH_PALMTC
|
||||
bool "Palm Tungsten|C"
|
||||
default y
|
||||
depends on ARCH_PXA_PALM
|
||||
select PXA25x
|
||||
help
|
||||
Say Y here if you intend to run this kernel on a Palm Tungsten|C
|
||||
handheld computer.
|
||||
|
||||
config MACH_PALMT5
|
||||
bool "Palm Tungsten|T5"
|
||||
default y
|
||||
@@ -458,6 +478,7 @@ config PXA_EZX
|
||||
select PXA27x
|
||||
select IWMMXT
|
||||
select HAVE_PWM
|
||||
select PXA_HAVE_BOARD_IRQS
|
||||
|
||||
config MACH_EZX_A780
|
||||
bool "Motorola EZX A780"
|
||||
@@ -489,6 +510,21 @@ config MACH_EZX_E2
|
||||
default y
|
||||
depends on PXA_EZX
|
||||
|
||||
config MACH_XCEP
|
||||
bool "Iskratel Electronics XCEP"
|
||||
select PXA25x
|
||||
select MTD
|
||||
select MTD_PARTITIONS
|
||||
select MTD_PHYSMAP
|
||||
select MTD_CFI_INTELEXT
|
||||
select MTD_CFI
|
||||
select MTD_CHAR
|
||||
select SMC91X
|
||||
select PXA_SSP
|
||||
help
|
||||
PXA255 based Single Board Computer with SMC 91C111 ethernet chip and 64 MB of flash.
|
||||
Tuned for usage in Libera instruments for particle accelerators.
|
||||
|
||||
endmenu
|
||||
|
||||
config PXA25x
|
||||
|
||||
@@ -31,6 +31,7 @@ obj-$(CONFIG_GUMSTIX_AM300EPD) += am300epd.o
|
||||
obj-$(CONFIG_ARCH_LUBBOCK) += lubbock.o
|
||||
obj-$(CONFIG_MACH_LOGICPD_PXA270) += lpd270.o
|
||||
obj-$(CONFIG_MACH_MAINSTONE) += mainstone.o
|
||||
obj-$(CONFIG_MACH_BALLOON3) += balloon3.o
|
||||
obj-$(CONFIG_MACH_MP900C) += mp900.o
|
||||
obj-$(CONFIG_ARCH_PXA_IDP) += idp.o
|
||||
obj-$(CONFIG_MACH_TRIZEPS4) += trizeps4.o
|
||||
@@ -58,6 +59,7 @@ obj-$(CONFIG_MACH_E750) += e750.o
|
||||
obj-$(CONFIG_MACH_E400) += e400.o
|
||||
obj-$(CONFIG_MACH_E800) += e800.o
|
||||
obj-$(CONFIG_MACH_PALMTE2) += palmte2.o
|
||||
obj-$(CONFIG_MACH_PALMTC) += palmtc.o
|
||||
obj-$(CONFIG_MACH_PALMT5) += palmt5.o
|
||||
obj-$(CONFIG_MACH_PALMTX) += palmtx.o
|
||||
obj-$(CONFIG_MACH_PALMLD) += palmld.o
|
||||
@@ -78,6 +80,8 @@ obj-$(CONFIG_MACH_ARMCORE) += cm-x2xx.o cm-x255.o cm-x270.o
|
||||
obj-$(CONFIG_MACH_CM_X300) += cm-x300.o
|
||||
obj-$(CONFIG_PXA_EZX) += ezx.o
|
||||
|
||||
obj-$(CONFIG_MACH_XCEP) += xcep.o
|
||||
|
||||
obj-$(CONFIG_MACH_INTELMOTE2) += imote2.o
|
||||
obj-$(CONFIG_MACH_STARGATE2) += stargate2.o
|
||||
obj-$(CONFIG_MACH_CSB726) += csb726.o
|
||||
|
||||
@@ -0,0 +1,361 @@
|
||||
/*
|
||||
* linux/arch/arm/mach-pxa/balloon3.c
|
||||
*
|
||||
* Support for Balloonboard.org Balloon3 board.
|
||||
*
|
||||
* Author: Nick Bane, Wookey, Jonathan McDowell
|
||||
* Created: June, 2006
|
||||
* Copyright: Toby Churchill Ltd
|
||||
* Derived from mainstone.c, by Nico Pitre
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*/
|
||||
|
||||
#include <linux/init.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/sysdev.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/bitops.h>
|
||||
#include <linux/fb.h>
|
||||
#include <linux/gpio.h>
|
||||
#include <linux/ioport.h>
|
||||
#include <linux/mtd/mtd.h>
|
||||
#include <linux/mtd/partitions.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
#include <asm/setup.h>
|
||||
#include <asm/mach-types.h>
|
||||
#include <asm/irq.h>
|
||||
#include <asm/sizes.h>
|
||||
|
||||
#include <asm/mach/arch.h>
|
||||
#include <asm/mach/map.h>
|
||||
#include <asm/mach/irq.h>
|
||||
#include <asm/mach/flash.h>
|
||||
|
||||
#include <mach/pxa27x.h>
|
||||
#include <mach/balloon3.h>
|
||||
#include <mach/audio.h>
|
||||
#include <mach/pxafb.h>
|
||||
#include <mach/mmc.h>
|
||||
#include <mach/udc.h>
|
||||
#include <mach/pxa27x-udc.h>
|
||||
#include <mach/irda.h>
|
||||
#include <mach/ohci.h>
|
||||
|
||||
#include <plat/i2c.h>
|
||||
|
||||
#include "generic.h"
|
||||
#include "devices.h"
|
||||
|
||||
static unsigned long balloon3_irq_enabled;
|
||||
|
||||
static unsigned long balloon3_features_present =
|
||||
(1 << BALLOON3_FEATURE_OHCI) | (1 << BALLOON3_FEATURE_CF) |
|
||||
(1 << BALLOON3_FEATURE_AUDIO) |
|
||||
(1 << BALLOON3_FEATURE_TOPPOLY);
|
||||
|
||||
int balloon3_has(enum balloon3_features feature)
|
||||
{
|
||||
return (balloon3_features_present & (1 << feature)) ? 1 : 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(balloon3_has);
|
||||
|
||||
int __init parse_balloon3_features(char *arg)
|
||||
{
|
||||
if (!arg)
|
||||
return 0;
|
||||
|
||||
return strict_strtoul(arg, 0, &balloon3_features_present);
|
||||
}
|
||||
early_param("balloon3_features", parse_balloon3_features);
|
||||
|
||||
static void balloon3_mask_irq(unsigned int irq)
|
||||
{
|
||||
int balloon3_irq = (irq - BALLOON3_IRQ(0));
|
||||
balloon3_irq_enabled &= ~(1 << balloon3_irq);
|
||||
__raw_writel(~balloon3_irq_enabled, BALLOON3_INT_CONTROL_REG);
|
||||
}
|
||||
|
||||
static void balloon3_unmask_irq(unsigned int irq)
|
||||
{
|
||||
int balloon3_irq = (irq - BALLOON3_IRQ(0));
|
||||
balloon3_irq_enabled |= (1 << balloon3_irq);
|
||||
__raw_writel(~balloon3_irq_enabled, BALLOON3_INT_CONTROL_REG);
|
||||
}
|
||||
|
||||
static struct irq_chip balloon3_irq_chip = {
|
||||
.name = "FPGA",
|
||||
.ack = balloon3_mask_irq,
|
||||
.mask = balloon3_mask_irq,
|
||||
.unmask = balloon3_unmask_irq,
|
||||
};
|
||||
|
||||
static void balloon3_irq_handler(unsigned int irq, struct irq_desc *desc)
|
||||
{
|
||||
unsigned long pending = __raw_readl(BALLOON3_INT_CONTROL_REG) &
|
||||
balloon3_irq_enabled;
|
||||
|
||||
do {
|
||||
/* clear useless edge notification */
|
||||
if (desc->chip->ack)
|
||||
desc->chip->ack(BALLOON3_AUX_NIRQ);
|
||||
while (pending) {
|
||||
irq = BALLOON3_IRQ(0) + __ffs(pending);
|
||||
generic_handle_irq(irq);
|
||||
pending &= pending - 1;
|
||||
}
|
||||
pending = __raw_readl(BALLOON3_INT_CONTROL_REG) &
|
||||
balloon3_irq_enabled;
|
||||
} while (pending);
|
||||
}
|
||||
|
||||
static void __init balloon3_init_irq(void)
|
||||
{
|
||||
int irq;
|
||||
|
||||
pxa27x_init_irq();
|
||||
/* setup extra Balloon3 irqs */
|
||||
for (irq = BALLOON3_IRQ(0); irq <= BALLOON3_IRQ(7); irq++) {
|
||||
set_irq_chip(irq, &balloon3_irq_chip);
|
||||
set_irq_handler(irq, handle_level_irq);
|
||||
set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
|
||||
}
|
||||
|
||||
set_irq_chained_handler(BALLOON3_AUX_NIRQ, balloon3_irq_handler);
|
||||
set_irq_type(BALLOON3_AUX_NIRQ, IRQ_TYPE_EDGE_FALLING);
|
||||
|
||||
pr_debug("%s: chained handler installed - irq %d automatically "
|
||||
"enabled\n", __func__, BALLOON3_AUX_NIRQ);
|
||||
}
|
||||
|
||||
static void balloon3_backlight_power(int on)
|
||||
{
|
||||
pr_debug("%s: power is %s\n", __func__, on ? "on" : "off");
|
||||
gpio_set_value(BALLOON3_GPIO_RUN_BACKLIGHT, on);
|
||||
}
|
||||
|
||||
static unsigned long balloon3_lcd_pin_config[] = {
|
||||
/* LCD - 16bpp Active TFT */
|
||||
GPIO58_LCD_LDD_0,
|
||||
GPIO59_LCD_LDD_1,
|
||||
GPIO60_LCD_LDD_2,
|
||||
GPIO61_LCD_LDD_3,
|
||||
GPIO62_LCD_LDD_4,
|
||||
GPIO63_LCD_LDD_5,
|
||||
GPIO64_LCD_LDD_6,
|
||||
GPIO65_LCD_LDD_7,
|
||||
GPIO66_LCD_LDD_8,
|
||||
GPIO67_LCD_LDD_9,
|
||||
GPIO68_LCD_LDD_10,
|
||||
GPIO69_LCD_LDD_11,
|
||||
GPIO70_LCD_LDD_12,
|
||||
GPIO71_LCD_LDD_13,
|
||||
GPIO72_LCD_LDD_14,
|
||||
GPIO73_LCD_LDD_15,
|
||||
GPIO74_LCD_FCLK,
|
||||
GPIO75_LCD_LCLK,
|
||||
GPIO76_LCD_PCLK,
|
||||
GPIO77_LCD_BIAS,
|
||||
|
||||
GPIO99_GPIO, /* Backlight */
|
||||
};
|
||||
|
||||
static struct pxafb_mode_info balloon3_lcd_modes[] = {
|
||||
{
|
||||
.pixclock = 38000,
|
||||
.xres = 480,
|
||||
.yres = 640,
|
||||
.bpp = 16,
|
||||
.hsync_len = 8,
|
||||
.left_margin = 8,
|
||||
.right_margin = 8,
|
||||
.vsync_len = 2,
|
||||
.upper_margin = 4,
|
||||
.lower_margin = 5,
|
||||
.sync = 0,
|
||||
},
|
||||
};
|
||||
|
||||
static struct pxafb_mach_info balloon3_pxafb_info = {
|
||||
.modes = balloon3_lcd_modes,
|
||||
.num_modes = ARRAY_SIZE(balloon3_lcd_modes),
|
||||
.lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL,
|
||||
.pxafb_backlight_power = balloon3_backlight_power,
|
||||
};
|
||||
|
||||
static unsigned long balloon3_mmc_pin_config[] = {
|
||||
GPIO32_MMC_CLK,
|
||||
GPIO92_MMC_DAT_0,
|
||||
GPIO109_MMC_DAT_1,
|
||||
GPIO110_MMC_DAT_2,
|
||||
GPIO111_MMC_DAT_3,
|
||||
GPIO112_MMC_CMD,
|
||||
};
|
||||
|
||||
static void balloon3_mci_setpower(struct device *dev, unsigned int vdd)
|
||||
{
|
||||
struct pxamci_platform_data *p_d = dev->platform_data;
|
||||
|
||||
if ((1 << vdd) & p_d->ocr_mask) {
|
||||
pr_debug("%s: on\n", __func__);
|
||||
/* FIXME something to prod here? */
|
||||
} else {
|
||||
pr_debug("%s: off\n", __func__);
|
||||
/* FIXME something to prod here? */
|
||||
}
|
||||
}
|
||||
|
||||
static struct pxamci_platform_data balloon3_mci_platform_data = {
|
||||
.ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
|
||||
.setpower = balloon3_mci_setpower,
|
||||
};
|
||||
|
||||
static int balloon3_udc_is_connected(void)
|
||||
{
|
||||
pr_debug("%s: udc connected\n", __func__);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void balloon3_udc_command(int cmd)
|
||||
{
|
||||
switch (cmd) {
|
||||
case PXA2XX_UDC_CMD_CONNECT:
|
||||
UP2OCR |= (UP2OCR_DPPUE + UP2OCR_DPPUBE);
|
||||
pr_debug("%s: connect\n", __func__);
|
||||
break;
|
||||
case PXA2XX_UDC_CMD_DISCONNECT:
|
||||
UP2OCR &= ~UP2OCR_DPPUE;
|
||||
pr_debug("%s: disconnect\n", __func__);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static struct pxa2xx_udc_mach_info balloon3_udc_info = {
|
||||
.udc_is_connected = balloon3_udc_is_connected,
|
||||
.udc_command = balloon3_udc_command,
|
||||
};
|
||||
|
||||
static struct pxaficp_platform_data balloon3_ficp_platform_data = {
|
||||
.transceiver_cap = IR_SIRMODE | IR_FIRMODE | IR_OFF,
|
||||
};
|
||||
|
||||
static unsigned long balloon3_ohci_pin_config[] = {
|
||||
GPIO88_USBH1_PWR,
|
||||
GPIO89_USBH1_PEN,
|
||||
};
|
||||
|
||||
static struct pxaohci_platform_data balloon3_ohci_platform_data = {
|
||||
.port_mode = PMM_PERPORT_MODE,
|
||||
.flags = ENABLE_PORT_ALL | POWER_CONTROL_LOW | POWER_SENSE_LOW,
|
||||
};
|
||||
|
||||
static unsigned long balloon3_pin_config[] __initdata = {
|
||||
/* Select BTUART 'COM1/ttyS0' as IO option for pins 42/43/44/45 */
|
||||
GPIO42_BTUART_RXD,
|
||||
GPIO43_BTUART_TXD,
|
||||
GPIO44_BTUART_CTS,
|
||||
GPIO45_BTUART_RTS,
|
||||
|
||||
/* Wakeup GPIO */
|
||||
GPIO1_GPIO | WAKEUP_ON_EDGE_BOTH,
|
||||
|
||||
/* NAND & IDLE LED GPIOs */
|
||||
GPIO9_GPIO,
|
||||
GPIO10_GPIO,
|
||||
};
|
||||
|
||||
static struct gpio_led balloon3_gpio_leds[] = {
|
||||
{
|
||||
.name = "balloon3:green:idle",
|
||||
.default_trigger = "heartbeat",
|
||||
.gpio = BALLOON3_GPIO_LED_IDLE,
|
||||
.active_low = 1,
|
||||
},
|
||||
{
|
||||
.name = "balloon3:green:nand",
|
||||
.default_trigger = "nand-disk",
|
||||
.gpio = BALLOON3_GPIO_LED_NAND,
|
||||
.active_low = 1,
|
||||
},
|
||||
};
|
||||
|
||||
static struct gpio_led_platform_data balloon3_gpio_leds_platform_data = {
|
||||
.leds = balloon3_gpio_leds,
|
||||
.num_leds = ARRAY_SIZE(balloon3_gpio_leds),
|
||||
};
|
||||
|
||||
static struct platform_device balloon3led_device = {
|
||||
.name = "leds-gpio",
|
||||
.id = -1,
|
||||
.dev = {
|
||||
.platform_data = &balloon3_gpio_leds_platform_data,
|
||||
},
|
||||
};
|
||||
|
||||
static void __init balloon3_init(void)
|
||||
{
|
||||
pr_info("Initialising Balloon3\n");
|
||||
|
||||
/* system bus arbiter setting
|
||||
* - Core_Park
|
||||
* - LCD_wt:DMA_wt:CORE_Wt = 2:3:4
|
||||
*/
|
||||
ARB_CNTRL = ARB_CORE_PARK | 0x234;
|
||||
|
||||
pxa_set_i2c_info(NULL);
|
||||
if (balloon3_has(BALLOON3_FEATURE_AUDIO))
|
||||
pxa_set_ac97_info(NULL);
|
||||
|
||||
if (balloon3_has(BALLOON3_FEATURE_TOPPOLY)) {
|
||||
pxa2xx_mfp_config(ARRAY_AND_SIZE(balloon3_lcd_pin_config));
|
||||
gpio_request(BALLOON3_GPIO_RUN_BACKLIGHT,
|
||||
"LCD Backlight Power");
|
||||
gpio_direction_output(BALLOON3_GPIO_RUN_BACKLIGHT, 1);
|
||||
set_pxa_fb_info(&balloon3_pxafb_info);
|
||||
}
|
||||
|
||||
if (balloon3_has(BALLOON3_FEATURE_MMC)) {
|
||||
pxa2xx_mfp_config(ARRAY_AND_SIZE(balloon3_mmc_pin_config));
|
||||
pxa_set_mci_info(&balloon3_mci_platform_data);
|
||||
}
|
||||
pxa_set_ficp_info(&balloon3_ficp_platform_data);
|
||||
if (balloon3_has(BALLOON3_FEATURE_OHCI)) {
|
||||
pxa2xx_mfp_config(ARRAY_AND_SIZE(balloon3_ohci_pin_config));
|
||||
pxa_set_ohci_info(&balloon3_ohci_platform_data);
|
||||
}
|
||||
pxa_set_udc_info(&balloon3_udc_info);
|
||||
|
||||
pxa2xx_mfp_config(ARRAY_AND_SIZE(balloon3_pin_config));
|
||||
|
||||
platform_device_register(&balloon3led_device);
|
||||
}
|
||||
|
||||
static struct map_desc balloon3_io_desc[] __initdata = {
|
||||
{ /* CPLD/FPGA */
|
||||
.virtual = BALLOON3_FPGA_VIRT,
|
||||
.pfn = __phys_to_pfn(BALLOON3_FPGA_PHYS),
|
||||
.length = BALLOON3_FPGA_LENGTH,
|
||||
.type = MT_DEVICE,
|
||||
},
|
||||
};
|
||||
|
||||
static void __init balloon3_map_io(void)
|
||||
{
|
||||
pxa_map_io();
|
||||
iotable_init(balloon3_io_desc, ARRAY_SIZE(balloon3_io_desc));
|
||||
}
|
||||
|
||||
MACHINE_START(BALLOON3, "Balloon3")
|
||||
/* Maintainer: Nick Bane. */
|
||||
.phys_io = 0x40000000,
|
||||
.io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
|
||||
.map_io = balloon3_map_io,
|
||||
.init_irq = balloon3_init_irq,
|
||||
.timer = &pxa_timer,
|
||||
.init_machine = balloon3_init,
|
||||
.boot_params = PHYS_OFFSET + 0x100,
|
||||
MACHINE_END
|
||||
@@ -12,7 +12,6 @@ struct clk {
|
||||
unsigned int cken;
|
||||
unsigned int delay;
|
||||
unsigned int enabled;
|
||||
struct clk *other;
|
||||
};
|
||||
|
||||
#define INIT_CLKREG(_clk,_devname,_conname) \
|
||||
|
||||
+113
-51
@@ -13,13 +13,18 @@
|
||||
#include <linux/sysdev.h>
|
||||
#include <linux/irq.h>
|
||||
#include <linux/gpio.h>
|
||||
#include <linux/delay.h>
|
||||
|
||||
#include <linux/rtc-v3020.h>
|
||||
#include <video/mbxfb.h>
|
||||
|
||||
#include <linux/spi/spi.h>
|
||||
#include <linux/spi/libertas_spi.h>
|
||||
|
||||
#include <mach/pxa27x.h>
|
||||
#include <mach/ohci.h>
|
||||
#include <mach/mmc.h>
|
||||
#include <mach/pxa2xx_spi.h>
|
||||
|
||||
#include "generic.h"
|
||||
|
||||
@@ -34,6 +39,10 @@
|
||||
/* MMC power enable */
|
||||
#define GPIO105_MMC_POWER (105)
|
||||
|
||||
/* WLAN GPIOS */
|
||||
#define GPIO19_WLAN_STRAP (19)
|
||||
#define GPIO102_WLAN_RST (102)
|
||||
|
||||
static unsigned long cmx270_pin_config[] = {
|
||||
/* AC'97 */
|
||||
GPIO28_AC97_BITCLK,
|
||||
@@ -94,8 +103,8 @@ static unsigned long cmx270_pin_config[] = {
|
||||
GPIO26_SSP1_RXD,
|
||||
|
||||
/* SSP2 */
|
||||
GPIO19_SSP2_SCLK,
|
||||
GPIO14_SSP2_SFRM,
|
||||
GPIO19_GPIO, /* SSP2 clock is used as GPIO for Libertas pin-strap */
|
||||
GPIO14_GPIO,
|
||||
GPIO87_SSP2_TXD,
|
||||
GPIO88_SSP2_RXD,
|
||||
|
||||
@@ -123,6 +132,7 @@ static unsigned long cmx270_pin_config[] = {
|
||||
GPIO0_GPIO | WAKEUP_ON_EDGE_BOTH,
|
||||
GPIO105_GPIO | MFP_LPM_DRIVE_HIGH, /* MMC/SD power */
|
||||
GPIO53_GPIO, /* PC card reset */
|
||||
GPIO102_GPIO, /* WLAN reset */
|
||||
|
||||
/* NAND controls */
|
||||
GPIO11_GPIO | MFP_LPM_DRIVE_HIGH, /* NAND CE# */
|
||||
@@ -131,6 +141,7 @@ static unsigned long cmx270_pin_config[] = {
|
||||
/* interrupts */
|
||||
GPIO10_GPIO, /* DM9000 interrupt */
|
||||
GPIO83_GPIO, /* MMC card detect */
|
||||
GPIO95_GPIO, /* WLAN interrupt */
|
||||
};
|
||||
|
||||
/* V3020 RTC */
|
||||
@@ -271,56 +282,12 @@ static inline void cmx270_init_ohci(void) {}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_MMC) || defined(CONFIG_MMC_MODULE)
|
||||
static int cmx270_mci_init(struct device *dev,
|
||||
irq_handler_t cmx270_detect_int,
|
||||
void *data)
|
||||
{
|
||||
int err;
|
||||
|
||||
err = gpio_request(GPIO105_MMC_POWER, "MMC/SD power");
|
||||
if (err) {
|
||||
dev_warn(dev, "power gpio unavailable\n");
|
||||
return err;
|
||||
}
|
||||
|
||||
gpio_direction_output(GPIO105_MMC_POWER, 0);
|
||||
|
||||
err = request_irq(CMX270_MMC_IRQ, cmx270_detect_int,
|
||||
IRQF_DISABLED | IRQF_TRIGGER_FALLING,
|
||||
"MMC card detect", data);
|
||||
if (err) {
|
||||
gpio_free(GPIO105_MMC_POWER);
|
||||
dev_err(dev, "cmx270_mci_init: MMC/SD: can't"
|
||||
" request MMC card detect IRQ\n");
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
static void cmx270_mci_setpower(struct device *dev, unsigned int vdd)
|
||||
{
|
||||
struct pxamci_platform_data *p_d = dev->platform_data;
|
||||
|
||||
if ((1 << vdd) & p_d->ocr_mask) {
|
||||
dev_dbg(dev, "power on\n");
|
||||
gpio_set_value(GPIO105_MMC_POWER, 0);
|
||||
} else {
|
||||
gpio_set_value(GPIO105_MMC_POWER, 1);
|
||||
dev_dbg(dev, "power off\n");
|
||||
}
|
||||
}
|
||||
|
||||
static void cmx270_mci_exit(struct device *dev, void *data)
|
||||
{
|
||||
free_irq(CMX270_MMC_IRQ, data);
|
||||
gpio_free(GPIO105_MMC_POWER);
|
||||
}
|
||||
|
||||
static struct pxamci_platform_data cmx270_mci_platform_data = {
|
||||
.ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
|
||||
.init = cmx270_mci_init,
|
||||
.setpower = cmx270_mci_setpower,
|
||||
.exit = cmx270_mci_exit,
|
||||
.ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
|
||||
.gpio_card_detect = GPIO83_MMC_IRQ,
|
||||
.gpio_card_ro = -1,
|
||||
.gpio_power = GPIO105_MMC_POWER,
|
||||
.gpio_power_invert = 1,
|
||||
};
|
||||
|
||||
static void __init cmx270_init_mmc(void)
|
||||
@@ -331,6 +298,100 @@ static void __init cmx270_init_mmc(void)
|
||||
static inline void cmx270_init_mmc(void) {}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_SPI_PXA2XX) || defined(CONFIG_SPI_PXA2XX_MODULE)
|
||||
static struct pxa2xx_spi_master cm_x270_spi_info = {
|
||||
.num_chipselect = 1,
|
||||
.enable_dma = 1,
|
||||
};
|
||||
|
||||
static struct pxa2xx_spi_chip cm_x270_libertas_chip = {
|
||||
.rx_threshold = 1,
|
||||
.tx_threshold = 1,
|
||||
.timeout = 1000,
|
||||
.gpio_cs = 14,
|
||||
};
|
||||
|
||||
static unsigned long cm_x270_libertas_pin_config[] = {
|
||||
/* SSP2 */
|
||||
GPIO19_SSP2_SCLK,
|
||||
GPIO14_GPIO,
|
||||
GPIO87_SSP2_TXD,
|
||||
GPIO88_SSP2_RXD,
|
||||
|
||||
};
|
||||
|
||||
static int cm_x270_libertas_setup(struct spi_device *spi)
|
||||
{
|
||||
int err = gpio_request(GPIO19_WLAN_STRAP, "WLAN STRAP");
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
err = gpio_request(GPIO102_WLAN_RST, "WLAN RST");
|
||||
if (err)
|
||||
goto err_free_strap;
|
||||
|
||||
err = gpio_direction_output(GPIO102_WLAN_RST, 0);
|
||||
if (err)
|
||||
goto err_free_strap;
|
||||
msleep(100);
|
||||
|
||||
err = gpio_direction_output(GPIO19_WLAN_STRAP, 1);
|
||||
if (err)
|
||||
goto err_free_strap;
|
||||
msleep(100);
|
||||
|
||||
pxa2xx_mfp_config(ARRAY_AND_SIZE(cm_x270_libertas_pin_config));
|
||||
|
||||
gpio_set_value(GPIO102_WLAN_RST, 1);
|
||||
msleep(100);
|
||||
|
||||
spi->bits_per_word = 16;
|
||||
spi_setup(spi);
|
||||
|
||||
return 0;
|
||||
|
||||
err_free_strap:
|
||||
gpio_free(GPIO19_WLAN_STRAP);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
static int cm_x270_libertas_teardown(struct spi_device *spi)
|
||||
{
|
||||
gpio_set_value(GPIO102_WLAN_RST, 0);
|
||||
gpio_free(GPIO102_WLAN_RST);
|
||||
gpio_free(GPIO19_WLAN_STRAP);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct libertas_spi_platform_data cm_x270_libertas_pdata = {
|
||||
.use_dummy_writes = 1,
|
||||
.setup = cm_x270_libertas_setup,
|
||||
.teardown = cm_x270_libertas_teardown,
|
||||
};
|
||||
|
||||
static struct spi_board_info cm_x270_spi_devices[] __initdata = {
|
||||
{
|
||||
.modalias = "libertas_spi",
|
||||
.max_speed_hz = 13000000,
|
||||
.bus_num = 2,
|
||||
.irq = gpio_to_irq(95),
|
||||
.chip_select = 0,
|
||||
.controller_data = &cm_x270_libertas_chip,
|
||||
.platform_data = &cm_x270_libertas_pdata,
|
||||
},
|
||||
};
|
||||
|
||||
static void __init cmx270_init_spi(void)
|
||||
{
|
||||
pxa2xx_set_spi_info(2, &cm_x270_spi_info);
|
||||
spi_register_board_info(ARRAY_AND_SIZE(cm_x270_spi_devices));
|
||||
}
|
||||
#else
|
||||
static inline void cmx270_init_spi(void) {}
|
||||
#endif
|
||||
|
||||
void __init cmx270_init(void)
|
||||
{
|
||||
pxa2xx_mfp_config(ARRAY_AND_SIZE(cmx270_pin_config));
|
||||
@@ -343,4 +404,5 @@ void __init cmx270_init(void)
|
||||
cmx270_init_mmc();
|
||||
cmx270_init_ohci();
|
||||
cmx270_init_2700G();
|
||||
cmx270_init_spi();
|
||||
}
|
||||
|
||||
+12
-59
@@ -306,68 +306,21 @@ static void cm_x300_mci_exit(struct device *dev, void *data)
|
||||
}
|
||||
|
||||
static struct pxamci_platform_data cm_x300_mci_platform_data = {
|
||||
.detect_delay = 20,
|
||||
.ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
|
||||
.init = cm_x300_mci_init,
|
||||
.exit = cm_x300_mci_exit,
|
||||
.detect_delay = 20,
|
||||
.ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
|
||||
.init = cm_x300_mci_init,
|
||||
.exit = cm_x300_mci_exit,
|
||||
.gpio_card_detect = -1,
|
||||
.gpio_card_ro = -1,
|
||||
.gpio_power = -1,
|
||||
};
|
||||
|
||||
static int cm_x300_mci2_ro(struct device *dev)
|
||||
{
|
||||
return gpio_get_value(GPIO85_MMC2_WP);
|
||||
}
|
||||
|
||||
static int cm_x300_mci2_init(struct device *dev,
|
||||
irq_handler_t cm_x300_detect_int,
|
||||
void *data)
|
||||
{
|
||||
int err;
|
||||
|
||||
/*
|
||||
* setup GPIO for CM-X300 MMC controller
|
||||
*/
|
||||
err = gpio_request(GPIO82_MMC2_IRQ, "mmc card detect");
|
||||
if (err)
|
||||
goto err_request_cd;
|
||||
gpio_direction_input(GPIO82_MMC2_IRQ);
|
||||
|
||||
err = gpio_request(GPIO85_MMC2_WP, "mmc write protect");
|
||||
if (err)
|
||||
goto err_request_wp;
|
||||
gpio_direction_input(GPIO85_MMC2_WP);
|
||||
|
||||
err = request_irq(CM_X300_MMC2_IRQ, cm_x300_detect_int,
|
||||
IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
|
||||
"MMC card detect", data);
|
||||
if (err) {
|
||||
printk(KERN_ERR "%s: MMC/SD/SDIO: "
|
||||
"can't request card detect IRQ\n", __func__);
|
||||
goto err_request_irq;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
err_request_irq:
|
||||
gpio_free(GPIO85_MMC2_WP);
|
||||
err_request_wp:
|
||||
gpio_free(GPIO82_MMC2_IRQ);
|
||||
err_request_cd:
|
||||
return err;
|
||||
}
|
||||
|
||||
static void cm_x300_mci2_exit(struct device *dev, void *data)
|
||||
{
|
||||
free_irq(CM_X300_MMC2_IRQ, data);
|
||||
gpio_free(GPIO82_MMC2_IRQ);
|
||||
gpio_free(GPIO85_MMC2_WP);
|
||||
}
|
||||
|
||||
static struct pxamci_platform_data cm_x300_mci2_platform_data = {
|
||||
.detect_delay = 20,
|
||||
.ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
|
||||
.init = cm_x300_mci2_init,
|
||||
.exit = cm_x300_mci2_exit,
|
||||
.get_ro = cm_x300_mci2_ro,
|
||||
.detect_delay = 20,
|
||||
.ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
|
||||
.gpio_card_detect = GPIO82_MMC2_IRQ,
|
||||
.gpio_card_ro = GPIO85_MMC2_WP,
|
||||
.gpio_power = -1,
|
||||
};
|
||||
|
||||
static void __init cm_x300_init_mmc(void)
|
||||
|
||||
@@ -172,6 +172,7 @@ void __init colibri_pxa300_init(void)
|
||||
{
|
||||
colibri_pxa300_init_eth();
|
||||
colibri_pxa300_init_ohci();
|
||||
colibri_pxa3xx_init_nand();
|
||||
colibri_pxa300_init_lcd();
|
||||
colibri_pxa3xx_init_lcd(mfp_to_gpio(GPIO39_GPIO));
|
||||
colibri_pxa310_init_ac97();
|
||||
|
||||
@@ -164,15 +164,48 @@ static inline void __init colibri_pxa320_init_ac97(void)
|
||||
static inline void colibri_pxa320_init_ac97(void) {}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The following configuration is verified to work with the Toradex Orchid
|
||||
* carrier board
|
||||
*/
|
||||
static mfp_cfg_t colibri_pxa320_uart_pin_config[] __initdata = {
|
||||
/* UART 1 configuration (may be set by bootloader) */
|
||||
GPIO99_UART1_CTS,
|
||||
GPIO104_UART1_RTS,
|
||||
GPIO97_UART1_RXD,
|
||||
GPIO98_UART1_TXD,
|
||||
GPIO101_UART1_DTR,
|
||||
GPIO103_UART1_DSR,
|
||||
GPIO100_UART1_DCD,
|
||||
GPIO102_UART1_RI,
|
||||
|
||||
/* UART 2 configuration */
|
||||
GPIO109_UART2_CTS,
|
||||
GPIO112_UART2_RTS,
|
||||
GPIO110_UART2_RXD,
|
||||
GPIO111_UART2_TXD,
|
||||
|
||||
/* UART 3 configuration */
|
||||
GPIO30_UART3_RXD,
|
||||
GPIO31_UART3_TXD,
|
||||
};
|
||||
|
||||
static void __init colibri_pxa320_init_uart(void)
|
||||
{
|
||||
pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa320_uart_pin_config));
|
||||
}
|
||||
|
||||
void __init colibri_pxa320_init(void)
|
||||
{
|
||||
colibri_pxa320_init_eth();
|
||||
colibri_pxa320_init_ohci();
|
||||
colibri_pxa3xx_init_nand();
|
||||
colibri_pxa320_init_lcd();
|
||||
colibri_pxa3xx_init_lcd(mfp_to_gpio(GPIO49_GPIO));
|
||||
colibri_pxa320_init_ac97();
|
||||
colibri_pxa3xx_init_mmc(ARRAY_AND_SIZE(colibri_pxa320_mmc_pin_config),
|
||||
mfp_to_gpio(MFP_PIN_GPIO28));
|
||||
colibri_pxa320_init_uart();
|
||||
}
|
||||
|
||||
MACHINE_START(COLIBRI320, "Toradex Colibri PXA320")
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <mach/colibri.h>
|
||||
#include <mach/mmc.h>
|
||||
#include <mach/pxafb.h>
|
||||
#include <mach/pxa3xx_nand.h>
|
||||
|
||||
#include "generic.h"
|
||||
#include "devices.h"
|
||||
@@ -95,10 +96,13 @@ static void colibri_pxa3xx_mci_exit(struct device *dev, void *data)
|
||||
}
|
||||
|
||||
static struct pxamci_platform_data colibri_pxa3xx_mci_platform_data = {
|
||||
.detect_delay = 20,
|
||||
.ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
|
||||
.init = colibri_pxa3xx_mci_init,
|
||||
.exit = colibri_pxa3xx_mci_exit,
|
||||
.detect_delay = 20,
|
||||
.ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
|
||||
.init = colibri_pxa3xx_mci_init,
|
||||
.exit = colibri_pxa3xx_mci_exit,
|
||||
.gpio_card_detect = -1,
|
||||
.gpio_card_ro = -1,
|
||||
.gpio_power = -1,
|
||||
};
|
||||
|
||||
void __init colibri_pxa3xx_init_mmc(mfp_cfg_t *pins, int len, int detect_pin)
|
||||
@@ -154,3 +158,43 @@ void __init colibri_pxa3xx_init_lcd(int bl_pin)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_MTD_NAND_PXA3xx) || defined(CONFIG_MTD_NAND_PXA3xx_MODULE)
|
||||
static struct mtd_partition colibri_nand_partitions[] = {
|
||||
{
|
||||
.name = "bootloader",
|
||||
.offset = 0,
|
||||
.size = SZ_512K,
|
||||
.mask_flags = MTD_WRITEABLE, /* force read-only */
|
||||
},
|
||||
{
|
||||
.name = "kernel",
|
||||
.offset = MTDPART_OFS_APPEND,
|
||||
.size = SZ_4M,
|
||||
.mask_flags = MTD_WRITEABLE, /* force read-only */
|
||||
},
|
||||
{
|
||||
.name = "reserved",
|
||||
.offset = MTDPART_OFS_APPEND,
|
||||
.size = SZ_1M,
|
||||
.mask_flags = MTD_WRITEABLE, /* force read-only */
|
||||
},
|
||||
{
|
||||
.name = "fs",
|
||||
.offset = MTDPART_OFS_APPEND,
|
||||
.size = MTDPART_SIZ_FULL,
|
||||
},
|
||||
};
|
||||
|
||||
static struct pxa3xx_nand_platform_data colibri_nand_info = {
|
||||
.enable_arbiter = 1,
|
||||
.keep_config = 1,
|
||||
.parts = colibri_nand_partitions,
|
||||
.nr_parts = ARRAY_SIZE(colibri_nand_partitions),
|
||||
};
|
||||
|
||||
void __init colibri_pxa3xx_init_nand(void)
|
||||
{
|
||||
pxa3xx_set_nand_info(&colibri_nand_info);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
+136
-97
@@ -29,6 +29,7 @@
|
||||
#include <linux/spi/ads7846.h>
|
||||
#include <linux/spi/corgi_lcd.h>
|
||||
#include <linux/mtd/sharpsl.h>
|
||||
#include <linux/input/matrix_keypad.h>
|
||||
#include <video/w100fb.h>
|
||||
|
||||
#include <asm/setup.h>
|
||||
@@ -104,6 +105,28 @@ static unsigned long corgi_pin_config[] __initdata = {
|
||||
GPIO6_MMC_CLK,
|
||||
GPIO8_MMC_CS0,
|
||||
|
||||
/* GPIO Matrix Keypad */
|
||||
GPIO66_GPIO, /* column 0 */
|
||||
GPIO67_GPIO, /* column 1 */
|
||||
GPIO68_GPIO, /* column 2 */
|
||||
GPIO69_GPIO, /* column 3 */
|
||||
GPIO70_GPIO, /* column 4 */
|
||||
GPIO71_GPIO, /* column 5 */
|
||||
GPIO72_GPIO, /* column 6 */
|
||||
GPIO73_GPIO, /* column 7 */
|
||||
GPIO74_GPIO, /* column 8 */
|
||||
GPIO75_GPIO, /* column 9 */
|
||||
GPIO76_GPIO, /* column 10 */
|
||||
GPIO77_GPIO, /* column 11 */
|
||||
GPIO58_GPIO, /* row 0 */
|
||||
GPIO59_GPIO, /* row 1 */
|
||||
GPIO60_GPIO, /* row 2 */
|
||||
GPIO61_GPIO, /* row 3 */
|
||||
GPIO62_GPIO, /* row 4 */
|
||||
GPIO63_GPIO, /* row 5 */
|
||||
GPIO64_GPIO, /* row 6 */
|
||||
GPIO65_GPIO, /* row 7 */
|
||||
|
||||
/* GPIO */
|
||||
GPIO9_GPIO, /* CORGI_GPIO_nSD_DETECT */
|
||||
GPIO7_GPIO, /* CORGI_GPIO_nSD_WP */
|
||||
@@ -267,9 +290,115 @@ static struct platform_device corgifb_device = {
|
||||
/*
|
||||
* Corgi Keyboard Device
|
||||
*/
|
||||
#define CORGI_KEY_CALENDER KEY_F1
|
||||
#define CORGI_KEY_ADDRESS KEY_F2
|
||||
#define CORGI_KEY_FN KEY_F3
|
||||
#define CORGI_KEY_CANCEL KEY_F4
|
||||
#define CORGI_KEY_OFF KEY_SUSPEND
|
||||
#define CORGI_KEY_EXOK KEY_F5
|
||||
#define CORGI_KEY_EXCANCEL KEY_F6
|
||||
#define CORGI_KEY_EXJOGDOWN KEY_F7
|
||||
#define CORGI_KEY_EXJOGUP KEY_F8
|
||||
#define CORGI_KEY_JAP1 KEY_LEFTCTRL
|
||||
#define CORGI_KEY_JAP2 KEY_LEFTALT
|
||||
#define CORGI_KEY_MAIL KEY_F10
|
||||
#define CORGI_KEY_OK KEY_F11
|
||||
#define CORGI_KEY_MENU KEY_F12
|
||||
|
||||
static const uint32_t corgikbd_keymap[] = {
|
||||
KEY(0, 1, KEY_1),
|
||||
KEY(0, 2, KEY_3),
|
||||
KEY(0, 3, KEY_5),
|
||||
KEY(0, 4, KEY_6),
|
||||
KEY(0, 5, KEY_7),
|
||||
KEY(0, 6, KEY_9),
|
||||
KEY(0, 7, KEY_0),
|
||||
KEY(0, 8, KEY_BACKSPACE),
|
||||
KEY(1, 1, KEY_2),
|
||||
KEY(1, 2, KEY_4),
|
||||
KEY(1, 3, KEY_R),
|
||||
KEY(1, 4, KEY_Y),
|
||||
KEY(1, 5, KEY_8),
|
||||
KEY(1, 6, KEY_I),
|
||||
KEY(1, 7, KEY_O),
|
||||
KEY(1, 8, KEY_P),
|
||||
KEY(2, 0, KEY_TAB),
|
||||
KEY(2, 1, KEY_Q),
|
||||
KEY(2, 2, KEY_E),
|
||||
KEY(2, 3, KEY_T),
|
||||
KEY(2, 4, KEY_G),
|
||||
KEY(2, 5, KEY_U),
|
||||
KEY(2, 6, KEY_J),
|
||||
KEY(2, 7, KEY_K),
|
||||
KEY(3, 0, CORGI_KEY_CALENDER),
|
||||
KEY(3, 1, KEY_W),
|
||||
KEY(3, 2, KEY_S),
|
||||
KEY(3, 3, KEY_F),
|
||||
KEY(3, 4, KEY_V),
|
||||
KEY(3, 5, KEY_H),
|
||||
KEY(3, 6, KEY_M),
|
||||
KEY(3, 7, KEY_L),
|
||||
KEY(3, 9, KEY_RIGHTSHIFT),
|
||||
KEY(4, 0, CORGI_KEY_ADDRESS),
|
||||
KEY(4, 1, KEY_A),
|
||||
KEY(4, 2, KEY_D),
|
||||
KEY(4, 3, KEY_C),
|
||||
KEY(4, 4, KEY_B),
|
||||
KEY(4, 5, KEY_N),
|
||||
KEY(4, 6, KEY_DOT),
|
||||
KEY(4, 8, KEY_ENTER),
|
||||
KEY(4, 10, KEY_LEFTSHIFT),
|
||||
KEY(5, 0, CORGI_KEY_MAIL),
|
||||
KEY(5, 1, KEY_Z),
|
||||
KEY(5, 2, KEY_X),
|
||||
KEY(5, 3, KEY_MINUS),
|
||||
KEY(5, 4, KEY_SPACE),
|
||||
KEY(5, 5, KEY_COMMA),
|
||||
KEY(5, 7, KEY_UP),
|
||||
KEY(5, 11, CORGI_KEY_FN),
|
||||
KEY(6, 0, KEY_SYSRQ),
|
||||
KEY(6, 1, CORGI_KEY_JAP1),
|
||||
KEY(6, 2, CORGI_KEY_JAP2),
|
||||
KEY(6, 3, CORGI_KEY_CANCEL),
|
||||
KEY(6, 4, CORGI_KEY_OK),
|
||||
KEY(6, 5, CORGI_KEY_MENU),
|
||||
KEY(6, 6, KEY_LEFT),
|
||||
KEY(6, 7, KEY_DOWN),
|
||||
KEY(6, 8, KEY_RIGHT),
|
||||
KEY(7, 0, CORGI_KEY_OFF),
|
||||
KEY(7, 1, CORGI_KEY_EXOK),
|
||||
KEY(7, 2, CORGI_KEY_EXCANCEL),
|
||||
KEY(7, 3, CORGI_KEY_EXJOGDOWN),
|
||||
KEY(7, 4, CORGI_KEY_EXJOGUP),
|
||||
};
|
||||
|
||||
static struct matrix_keymap_data corgikbd_keymap_data = {
|
||||
.keymap = corgikbd_keymap,
|
||||
.keymap_size = ARRAY_SIZE(corgikbd_keymap),
|
||||
};
|
||||
|
||||
static const int corgikbd_row_gpios[] =
|
||||
{ 58, 59, 60, 61, 62, 63, 64, 65 };
|
||||
static const int corgikbd_col_gpios[] =
|
||||
{ 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77 };
|
||||
|
||||
static struct matrix_keypad_platform_data corgikbd_pdata = {
|
||||
.keymap_data = &corgikbd_keymap_data,
|
||||
.row_gpios = corgikbd_row_gpios,
|
||||
.col_gpios = corgikbd_col_gpios,
|
||||
.num_row_gpios = ARRAY_SIZE(corgikbd_row_gpios),
|
||||
.num_col_gpios = ARRAY_SIZE(corgikbd_col_gpios),
|
||||
.col_scan_delay_us = 10,
|
||||
.debounce_ms = 10,
|
||||
.wakeup = 1,
|
||||
};
|
||||
|
||||
static struct platform_device corgikbd_device = {
|
||||
.name = "corgi-keyboard",
|
||||
.name = "matrix-keypad",
|
||||
.id = -1,
|
||||
.dev = {
|
||||
.platform_data = &corgikbd_pdata,
|
||||
},
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -307,111 +436,20 @@ static struct platform_device corgiled_device = {
|
||||
* The card detect interrupt isn't debounced so we delay it by 250ms
|
||||
* to give the card a chance to fully insert/eject.
|
||||
*/
|
||||
static struct pxamci_platform_data corgi_mci_platform_data;
|
||||
|
||||
static int corgi_mci_init(struct device *dev, irq_handler_t corgi_detect_int, void *data)
|
||||
{
|
||||
int err;
|
||||
|
||||
err = gpio_request(CORGI_GPIO_nSD_DETECT, "nSD_DETECT");
|
||||
if (err)
|
||||
goto err_out;
|
||||
|
||||
err = gpio_request(CORGI_GPIO_nSD_WP, "nSD_WP");
|
||||
if (err)
|
||||
goto err_free_1;
|
||||
|
||||
err = gpio_request(CORGI_GPIO_SD_PWR, "SD_PWR");
|
||||
if (err)
|
||||
goto err_free_2;
|
||||
|
||||
gpio_direction_input(CORGI_GPIO_nSD_DETECT);
|
||||
gpio_direction_input(CORGI_GPIO_nSD_WP);
|
||||
gpio_direction_output(CORGI_GPIO_SD_PWR, 0);
|
||||
|
||||
corgi_mci_platform_data.detect_delay = msecs_to_jiffies(250);
|
||||
|
||||
err = request_irq(CORGI_IRQ_GPIO_nSD_DETECT, corgi_detect_int,
|
||||
IRQF_DISABLED | IRQF_TRIGGER_RISING |
|
||||
IRQF_TRIGGER_FALLING,
|
||||
"MMC card detect", data);
|
||||
if (err) {
|
||||
pr_err("%s: MMC/SD: can't request MMC card detect IRQ\n",
|
||||
__func__);
|
||||
goto err_free_3;
|
||||
}
|
||||
return 0;
|
||||
|
||||
err_free_3:
|
||||
gpio_free(CORGI_GPIO_SD_PWR);
|
||||
err_free_2:
|
||||
gpio_free(CORGI_GPIO_nSD_WP);
|
||||
err_free_1:
|
||||
gpio_free(CORGI_GPIO_nSD_DETECT);
|
||||
err_out:
|
||||
return err;
|
||||
}
|
||||
|
||||
static void corgi_mci_setpower(struct device *dev, unsigned int vdd)
|
||||
{
|
||||
struct pxamci_platform_data* p_d = dev->platform_data;
|
||||
|
||||
gpio_set_value(CORGI_GPIO_SD_PWR, ((1 << vdd) & p_d->ocr_mask));
|
||||
}
|
||||
|
||||
static int corgi_mci_get_ro(struct device *dev)
|
||||
{
|
||||
return gpio_get_value(CORGI_GPIO_nSD_WP);
|
||||
}
|
||||
|
||||
static void corgi_mci_exit(struct device *dev, void *data)
|
||||
{
|
||||
free_irq(CORGI_IRQ_GPIO_nSD_DETECT, data);
|
||||
gpio_free(CORGI_GPIO_SD_PWR);
|
||||
gpio_free(CORGI_GPIO_nSD_WP);
|
||||
gpio_free(CORGI_GPIO_nSD_DETECT);
|
||||
}
|
||||
|
||||
static struct pxamci_platform_data corgi_mci_platform_data = {
|
||||
.ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
|
||||
.init = corgi_mci_init,
|
||||
.get_ro = corgi_mci_get_ro,
|
||||
.setpower = corgi_mci_setpower,
|
||||
.exit = corgi_mci_exit,
|
||||
.ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
|
||||
.gpio_card_detect = -1,
|
||||
.gpio_card_ro = CORGI_GPIO_nSD_WP,
|
||||
.gpio_power = CORGI_GPIO_SD_PWR,
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Irda
|
||||
*/
|
||||
static void corgi_irda_transceiver_mode(struct device *dev, int mode)
|
||||
{
|
||||
gpio_set_value(CORGI_GPIO_IR_ON, mode & IR_OFF);
|
||||
pxa2xx_transceiver_mode(dev, mode);
|
||||
}
|
||||
|
||||
static int corgi_irda_startup(struct device *dev)
|
||||
{
|
||||
int err;
|
||||
|
||||
err = gpio_request(CORGI_GPIO_IR_ON, "IR_ON");
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
gpio_direction_output(CORGI_GPIO_IR_ON, 1);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void corgi_irda_shutdown(struct device *dev)
|
||||
{
|
||||
gpio_free(CORGI_GPIO_IR_ON);
|
||||
}
|
||||
|
||||
static struct pxaficp_platform_data corgi_ficp_platform_data = {
|
||||
.gpio_pwdown = CORGI_GPIO_IR_ON,
|
||||
.transceiver_cap = IR_SIRMODE | IR_OFF,
|
||||
.transceiver_mode = corgi_irda_transceiver_mode,
|
||||
.startup = corgi_irda_startup,
|
||||
.shutdown = corgi_irda_shutdown,
|
||||
};
|
||||
|
||||
|
||||
@@ -636,6 +674,7 @@ static void __init corgi_init(void)
|
||||
corgi_init_spi();
|
||||
|
||||
pxa_set_udc_info(&udc_info);
|
||||
corgi_mci_platform_data.detect_delay = msecs_to_jiffies(250);
|
||||
pxa_set_mci_info(&corgi_mci_platform_data);
|
||||
pxa_set_ficp_info(&corgi_ficp_platform_data);
|
||||
pxa_set_i2c_info(NULL);
|
||||
|
||||
@@ -130,61 +130,17 @@ static struct pxamci_platform_data csb726_mci_data;
|
||||
static int csb726_mci_init(struct device *dev,
|
||||
irq_handler_t detect, void *data)
|
||||
{
|
||||
int err;
|
||||
|
||||
csb726_mci_data.detect_delay = msecs_to_jiffies(500);
|
||||
|
||||
err = gpio_request(CSB726_GPIO_MMC_DETECT, "MMC detect");
|
||||
if (err)
|
||||
goto err_det_req;
|
||||
|
||||
err = gpio_direction_input(CSB726_GPIO_MMC_DETECT);
|
||||
if (err)
|
||||
goto err_det_dir;
|
||||
|
||||
err = gpio_request(CSB726_GPIO_MMC_RO, "MMC ro");
|
||||
if (err)
|
||||
goto err_ro_req;
|
||||
|
||||
err = gpio_direction_input(CSB726_GPIO_MMC_RO);
|
||||
if (err)
|
||||
goto err_ro_dir;
|
||||
|
||||
err = request_irq(gpio_to_irq(CSB726_GPIO_MMC_DETECT), detect,
|
||||
IRQF_DISABLED, "MMC card detect", data);
|
||||
if (err)
|
||||
goto err_irq;
|
||||
|
||||
return 0;
|
||||
|
||||
err_irq:
|
||||
err_ro_dir:
|
||||
gpio_free(CSB726_GPIO_MMC_RO);
|
||||
err_ro_req:
|
||||
err_det_dir:
|
||||
gpio_free(CSB726_GPIO_MMC_DETECT);
|
||||
err_det_req:
|
||||
return err;
|
||||
}
|
||||
|
||||
static int csb726_mci_get_ro(struct device *dev)
|
||||
{
|
||||
return gpio_get_value(CSB726_GPIO_MMC_RO);
|
||||
}
|
||||
|
||||
static void csb726_mci_exit(struct device *dev, void *data)
|
||||
{
|
||||
free_irq(gpio_to_irq(CSB726_GPIO_MMC_DETECT), data);
|
||||
gpio_free(CSB726_GPIO_MMC_RO);
|
||||
gpio_free(CSB726_GPIO_MMC_DETECT);
|
||||
}
|
||||
|
||||
static struct pxamci_platform_data csb726_mci = {
|
||||
.ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
|
||||
.init = csb726_mci_init,
|
||||
.get_ro = csb726_mci_get_ro,
|
||||
.ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
|
||||
.init = csb726_mci_init,
|
||||
/* FIXME setpower */
|
||||
.exit = csb726_mci_exit,
|
||||
.gpio_card_detect = CSB726_GPIO_MMC_DETECT,
|
||||
.gpio_card_ro = CSB726_GPIO_MMC_RO,
|
||||
.gpio_power = -1,
|
||||
};
|
||||
|
||||
static struct pxaohci_platform_data csb726_ohci_platform_data = {
|
||||
|
||||
@@ -935,6 +935,33 @@ void __init pxa3xx_set_nand_info(struct pxa3xx_nand_platform_data *info)
|
||||
{
|
||||
pxa_register_device(&pxa3xx_device_nand, info);
|
||||
}
|
||||
|
||||
static struct resource pxa3xx_resources_gcu[] = {
|
||||
{
|
||||
.start = 0x54000000,
|
||||
.end = 0x54000fff,
|
||||
.flags = IORESOURCE_MEM,
|
||||
},
|
||||
{
|
||||
.start = IRQ_GCU,
|
||||
.end = IRQ_GCU,
|
||||
.flags = IORESOURCE_IRQ,
|
||||
},
|
||||
};
|
||||
|
||||
static u64 pxa3xx_gcu_dmamask = DMA_BIT_MASK(32);
|
||||
|
||||
struct platform_device pxa3xx_device_gcu = {
|
||||
.name = "pxa3xx-gcu",
|
||||
.id = -1,
|
||||
.num_resources = ARRAY_SIZE(pxa3xx_resources_gcu),
|
||||
.resource = pxa3xx_resources_gcu,
|
||||
.dev = {
|
||||
.dma_mask = &pxa3xx_gcu_dmamask,
|
||||
.coherent_dma_mask = 0xffffffff,
|
||||
},
|
||||
};
|
||||
|
||||
#endif /* CONFIG_PXA3xx */
|
||||
|
||||
/* pxa2xx-spi platform-device ID equals respective SSP platform-device ID + 1.
|
||||
|
||||
@@ -35,4 +35,6 @@ extern struct platform_device pxa27x_device_pwm1;
|
||||
extern struct platform_device pxa3xx_device_nand;
|
||||
extern struct platform_device pxa3xx_device_i2c_power;
|
||||
|
||||
extern struct platform_device pxa3xx_device_gcu;
|
||||
|
||||
void __init pxa_register_device(struct platform_device *dev, void *data);
|
||||
|
||||
@@ -199,7 +199,6 @@ static void __init e740_init(void)
|
||||
platform_add_devices(devices, ARRAY_SIZE(devices));
|
||||
pxa_set_udc_info(&e7xx_udc_mach_info);
|
||||
pxa_set_ac97_info(NULL);
|
||||
e7xx_irda_init();
|
||||
pxa_set_ficp_info(&e7xx_ficp_platform_data);
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user