/*
* linux/arch/arm/mach-omap2/board-rx51-peripherals.c
*
* Copyright (C) 2008-2009 Nokia
*
* 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/kernel.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/input.h>
#include <linux/input/matrix_keypad.h>
#include <linux/spi/spi.h>
#include <linux/wl12xx.h>
#include <linux/spi/tsc2005.h>
#include <linux/i2c.h>
#include <linux/i2c/twl.h>
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/regulator/machine.h>
#include <linux/gpio.h>
#include <linux/gpio_keys.h>
#include <linux/mmc/host.h>
#include <linux/power/isp1704_charger.h>
#include <asm/system_info.h>
#include <plat/mcspi.h>
#include "common.h"
#include <plat/dma.h>
#include <plat/gpmc.h>
#include <plat/onenand.h>
#include <plat/gpmc-smc91x.h>
#include <mach/board-rx51.h>
#include <sound/tlv320aic3x.h>
#include <sound/tpa6130a2-plat.h>
#include <media/radio-si4713.h>
#include <media/si4713.h>
#include <linux/leds-lp5523.h>
#include <../drivers/staging/iio/light/tsl2563.h>
#include <linux/lis3lv02d.h>
#include "mux.h"
#include "hsmmc.h"
#include "common-board-devices.h"
#define SYSTEM_REV_B_USES_VAUX3 0x1699
#define SYSTEM_REV_S_USES_VAUX3 0x8
#define RX51_WL1251_POWER_GPIO 87
#define RX51_WL1251_IRQ_GPIO 42
#define RX51_FMTX_RESET_GPIO 163
#define RX51_FMTX_IRQ 53
#define RX51_LP5523_CHIP_EN_GPIO 41
#define RX51_USB_TRANSCEIVER_RST_GPIO 67
#define RX51_TSC2005_RESET_GPIO 104
#define RX51_TSC2005_IRQ_GPIO 100
#define LIS302_IRQ1_GPIO 181
#define LIS302_IRQ2_GPIO 180 /* Not yet in use */
/* list all spi devices here */
enum {
RX51_SPI_WL1251,
RX51_SPI_MIPID, /* LCD panel */
RX51_SPI_TSC2005, /* Touch Controller */
};
static struct wl12xx_platform_data wl1251_pdata;
static struct tsc2005_platform_data tsc2005_pdata;
#if defined(CONFIG_SENSORS_LIS3_I2C) || defined(CONFIG_SENSORS_LIS3_I2C_MODULE)
static int lis302_setup(void)
{
int err;
int irq1 = LIS302_IRQ1_GPIO;
int irq2 = LIS302_IRQ2_GPIO;
/* gpio for interrupt pin 1 */
err = gpio_request(irq1, "lis3lv02dl_irq1");
if (err) {
printk(KERN_ERR "lis3lv02dl: gpio request failed\n");
goto out;
}
/* gpio for interrupt pin 2 */
err = gpio_request(irq2, "lis3lv02dl_irq2");
if (err) {
gpio_free(irq1);
printk(KERN_ERR "lis3lv02dl: gpio request failed\n");
goto out;
}
gpio_direction_input(irq1);
gpio_direction_input(irq2);
out:
return err;
}
static int lis302_release(void)
{
gpio_free(LIS302_IRQ1_GPIO);
gpio_free(LIS302_IRQ2_GPIO);
return 0;
}
static struct lis3lv02d_platform_data rx51_lis3lv02d_data = {
.click_flags = LIS3_CLICK_SINGLE_X | LIS3_CLICK_SINGLE_Y |
LIS3_CLICK_SINGLE_Z,
/* Limits are 0.5g * value */
.click_thresh_x = 8,
.click_thresh_y = 8,
.click_thresh_z = 10,
/* Click must be longer than time limit */
.click_time_limit = 9,
/* Kind of debounce filter */
.click_latency = 50,
/* Limits for all axis. millig-value / 18 to get HW values */
.wakeup_flags = LIS3_WAKEUP_X_HI | LIS3_WAKEUP_Y_HI,
.wakeup_thresh = 800 / 18,
.wakeup_flags2 = LIS3_WAKEUP_Z_HI ,
.wakeup_thresh2 = 900 / 18,
.hipass_ctrl = LIS3_HIPASS1_DISABLE | LIS3_HIPASS2_DIS