aboutsummaryrefslogtreecommitdiffstats
path: root/recipes
diff options
context:
space:
mode:
authorKoen Kooi <k-kooi@ti.com>2010-03-22 14:56:07 +0100
committerKoen Kooi <koen@openembedded.org>2010-04-12 19:43:29 +0200
commit9e23b335a207f9aa3f92514454e8a6316402c951 (patch)
tree509a1187889f14453d93e537b2d31ba8790788ff /recipes
parent61a1a74b0e71bb40c336cd974c933d3534849957 (diff)
downloadopenembedded-9e23b335a207f9aa3f92514454e8a6316402c951.tar.gz
openembedded-9e23b335a207f9aa3f92514454e8a6316402c951.tar.bz2
openembedded-9e23b335a207f9aa3f92514454e8a6316402c951.zip
linux-omap-psp 2.6.32: update to latest 3.00.00.05 tag
* add patches for omap3-touchbook support and make this the default kernel for it
Diffstat (limited to 'recipes')
-rw-r--r--recipes/linux/linux-omap-psp-2.6.32/omap3-touchbook/0001-ARM-OMAP-add-spi-platform-devices.patch62
-rw-r--r--recipes/linux/linux-omap-psp-2.6.32/omap3-touchbook/0002-MMA7455L-accelerometer-driver.patch682
-rw-r--r--recipes/linux/linux-omap-psp-2.6.32/omap3-touchbook/0003-bq27x00_battery-remove-error-message-output.patch53
-rw-r--r--recipes/linux/linux-omap-psp-2.6.32/omap3-touchbook/0004-bq27x00_battery-add-charged-gpio.patch65
-rw-r--r--recipes/linux/linux-omap-psp-2.6.32/omap3-touchbook/0005-ARM-OMAP-Hack-beagle-asoc-driver-to-support-touchboo.patch85
-rw-r--r--recipes/linux/linux-omap-psp-2.6.32/omap3-touchbook/0006-ARM-OMAP-omap3-touchbook-update-boardfile.patch571
-rw-r--r--recipes/linux/linux-omap-psp-2.6.32/omap3-touchbook/0007-adf7846-add-more-debugging.patch99
-rw-r--r--recipes/linux/linux-omap-psp-2.6.32/omap3-touchbook/0008-ads7846-read-max-mix-x-y-from-pdata.patch35
-rw-r--r--recipes/linux/linux-omap-psp-2.6.32/omap3-touchbook/0009-ads7846-add-settling-delay-to-pdata.patch59
-rw-r--r--recipes/linux/linux-omap-psp-2.6.32/omap3-touchbook/0010-Touch-Book-turn-on-off-the-class-D-amplifier-dependi.patch95
-rw-r--r--recipes/linux/linux-omap-psp-2.6.32/omap3-touchbook/0011-DSS2-Fix-scaling-checks-when-rotation-is-90-or-270-d.patch52
-rw-r--r--recipes/linux/linux-omap-psp-2.6.32/omap3-touchbook/0012-add-touchbook-hid-driver.patch339
-rw-r--r--recipes/linux/linux-omap-psp-2.6.32/omap3-touchbook/0013-Make-backlight-controls-accessible-to-users.patch25
-rw-r--r--recipes/linux/linux-omap-psp-2.6.32/omap3-touchbook/0014-ads7846-don-t-error-out-when-there-s-no-pendown-gpio.patch30
-rw-r--r--recipes/linux/linux-omap-psp-2.6.32/omap3-touchbook/defconfig66
-rw-r--r--recipes/linux/linux-omap-psp_2.6.32.bb19
16 files changed, 2324 insertions, 13 deletions
diff --git a/recipes/linux/linux-omap-psp-2.6.32/omap3-touchbook/0001-ARM-OMAP-add-spi-platform-devices.patch b/recipes/linux/linux-omap-psp-2.6.32/omap3-touchbook/0001-ARM-OMAP-add-spi-platform-devices.patch
new file mode 100644
index 0000000000..ddc1cf3e58
--- /dev/null
+++ b/recipes/linux/linux-omap-psp-2.6.32/omap3-touchbook/0001-ARM-OMAP-add-spi-platform-devices.patch
@@ -0,0 +1,62 @@
+From e17eb2539ff4bcd3704fcdf3f9a950706adee769 Mon Sep 17 00:00:00 2001
+From: Tim Yamin <plasm@roo.me.uk>
+Date: Sat, 11 Apr 2009 13:05:21 -0700
+Subject: [PATCH 01/14] ARM: OMAP: add spi platform devices
+
+---
+ arch/arm/mach-omap2/devices.c | 32 ++++++++++++++++++++++++++++++++
+ 1 files changed, 32 insertions(+), 0 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
+index 18ad931..ae67ada 100644
+--- a/arch/arm/mach-omap2/devices.c
++++ b/arch/arm/mach-omap2/devices.c
+@@ -15,6 +15,7 @@
+ #include <linux/platform_device.h>
+ #include <linux/io.h>
+ #include <linux/clk.h>
++#include <linux/spi/spi_gpio.h>
+
+ #include <mach/hardware.h>
+ #include <asm/mach-types.h>
+@@ -373,6 +374,37 @@ static struct platform_device omap2_mcspi4 = {
+ .platform_data = &omap2_mcspi4_config,
+ },
+ };
++
++static struct spi_gpio_platform_data spi3_gpio_platform_data = {
++ .miso = 132,
++ .mosi = 131,
++ .sck = 130,
++ .num_chipselect = 1,
++};
++
++static struct platform_device spi3_gpio = {
++ .name = "spi_gpio",
++ .id = 3,
++ .dev = {
++ .platform_data = &spi3_gpio_platform_data,
++ },
++};
++
++static struct spi_gpio_platform_data spi4_gpio_platform_data = {
++ .miso = 159,
++ .mosi = 158,
++ .sck = 156,
++ .num_chipselect = 1,
++};
++
++static struct platform_device spi4_gpio = {
++ .name = "spi_gpio",
++ .id = 4,
++ .dev = {
++ .platform_data = &spi4_gpio_platform_data,
++ },
++};
++
+ #endif
+
+ #ifdef CONFIG_ARCH_OMAP4
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-psp-2.6.32/omap3-touchbook/0002-MMA7455L-accelerometer-driver.patch b/recipes/linux/linux-omap-psp-2.6.32/omap3-touchbook/0002-MMA7455L-accelerometer-driver.patch
new file mode 100644
index 0000000000..e6f6769799
--- /dev/null
+++ b/recipes/linux/linux-omap-psp-2.6.32/omap3-touchbook/0002-MMA7455L-accelerometer-driver.patch
@@ -0,0 +1,682 @@
+From cf0a1f6cecfb04240c284012a29c479adc39bbf6 Mon Sep 17 00:00:00 2001
+From: Tim Yamin <plasm@roo.me.uk>
+Date: Fri, 12 Mar 2010 11:39:01 +0100
+Subject: [PATCH 02/14] MMA7455L accelerometer driver
+
+---
+ drivers/input/misc/Kconfig | 9 +
+ drivers/input/misc/Makefile | 1 +
+ drivers/input/misc/mma7455l.c | 614 +++++++++++++++++++++++++++++++++++++++++
+ include/linux/mma7455l.h | 11 +
+ 4 files changed, 635 insertions(+), 0 deletions(-)
+ create mode 100644 drivers/input/misc/mma7455l.c
+ create mode 100644 include/linux/mma7455l.h
+
+diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig
+index 16ec523..d35ae19 100644
+--- a/drivers/input/misc/Kconfig
++++ b/drivers/input/misc/Kconfig
+@@ -319,4 +319,13 @@ config INPUT_PCAP
+ To compile this driver as a module, choose M here: the
+ module will be called pcap_keys.
+
++config INPUT_MMA7455L
++ tristate "Freescale MMA7455L 3-axis accelerometer"
++ depends on SPI_MASTER
++ help
++ SPI driver for the Freescale MMA7455L 3-axis accelerometer.
++
++ The userspace interface is a 3-axis (X/Y/Z) relative movement
++ Linux input device, reporting REL_[XYZ] events.
++
+ endif
+diff --git a/drivers/input/misc/Makefile b/drivers/input/misc/Makefile
+index a8b8485..75b8baa 100644
+--- a/drivers/input/misc/Makefile
++++ b/drivers/input/misc/Makefile
+@@ -30,4 +30,5 @@ obj-$(CONFIG_INPUT_WINBOND_CIR) += winbond-cir.o
+ obj-$(CONFIG_INPUT_WISTRON_BTNS) += wistron_btns.o
+ obj-$(CONFIG_INPUT_WM831X_ON) += wm831x-on.o
+ obj-$(CONFIG_INPUT_YEALINK) += yealink.o
++obj-$(CONFIG_INPUT_MMA7455L) += mma7455l.o
+
+diff --git a/drivers/input/misc/mma7455l.c b/drivers/input/misc/mma7455l.c
+new file mode 100644
+index 0000000..3ca29ff
+--- /dev/null
++++ b/drivers/input/misc/mma7455l.c
+@@ -0,0 +1,614 @@
++/* Linux kernel driver for the Freescale MMA7455L 3-axis accelerometer
++ *
++ * Copyright (C) 2009 by Always Innovating, Inc.
++ * Author: Gregoire Gentil <gregoire@gentil.com>
++ * Author: Tim Yamin <plasm@roo.me.uk>
++ * All rights reserved.
++ *
++ * This program 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.
++ *
++ * This program 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 this program; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
++ * MA 02111-1307 USA
++ *
++ */
++
++/*
++ * What this driver doesn't yet support:
++ *
++ * - I2C
++ * - INT2 handling
++ * - Pulse detection (and the sysctls to control it)
++ * - 10-bit measurement
++ */
++
++#include <linux/kernel.h>
++#include <linux/types.h>
++#include <linux/module.h>
++#include <linux/device.h>
++#include <linux/platform_device.h>
++#include <linux/delay.h>
++#include <linux/input.h>
++#include <linux/irq.h>
++#include <linux/interrupt.h>
++#include <linux/sysfs.h>
++#include <linux/gpio.h>
++
++#include <linux/mma7455l.h>
++#include <linux/spi/spi.h>
++
++#define MMA7455L_WHOAMI_MAGIC 0x55
++
++enum mma7455l_reg {
++ MMA7455L_REG_XOUTL = 0x00,
++ MMA7455L_REG_XOUTH = 0x01,
++ MMA7455L_REG_YOUTL = 0x02,
++ MMA7455L_REG_YOUTH = 0x03,
++ MMA7455L_REG_ZOUTL = 0x04,
++ MMA7455L_REG_ZOUTH = 0x05,
++ MMA7455L_REG_XOUT8 = 0x06,
++ MMA7455L_REG_YOUT8 = 0x07,
++ MMA7455L_REG_ZOUT8 = 0x08,
++ MMA7455L_REG_STATUS = 0x09,
++ MMA7455L_REG_DETSRC = 0x0a,
++ MMA7455L_REG_TOUT = 0x0b,
++ MMA7455L_REG_RESERVED1 = 0x0c,
++ MMA7455L_REG_I2CAD = 0x0d,
++ MMA7455L_REG_USRINF = 0x0e,
++ MMA7455L_REG_WHOAMI = 0x0f,
++ MMA7455L_REG_XOFFL = 0x10,
++ MMA7455L_REG_XOFFH = 0x11,
++ MMA7455L_REG_YOFFL = 0x12,
++ MMA7455L_REG_YOFFH = 0x13,
++ MMA7455L_REG_ZOFFL = 0x14,
++ MMA7455L_REG_ZOFFH = 0x15,
++ MMA7455L_REG_MCTL = 0x16,
++ MMA7455L_REG_INTRST = 0x17,
++ MMA7455L_REG_CTL1 = 0x18,
++ MMA7455L_REG_CTL2 = 0x19,
++ MMA7455L_REG_LDTH = 0x1a,
++ MMA7455L_REG_PDTH = 0x1b,
++ MMA7455L_REG_PW = 0x1c,
++ MMA7455L_REG_LT = 0x1d,
++ MMA7455L_REG_TW = 0x1e,
++ MMA7455L_REG_RESERVED2 = 0x1f,
++};
++
++enum mma7455l_reg_status {
++ MMA7455L_STATUS_XDA = 0x08,
++ MMA7455L_STATUS_YDA = 0x10,
++ MMA7455L_STATUS_ZDA = 0x20,
++};
++
++enum mma7455l_mode {
++ MMA7455L_MODE_STANDBY = 0,
++ MMA7455L_MODE_MEASUREMENT = 1,
++ MMA7455L_MODE_LEVELDETECTION = 0x42, /* Set DRPD to on */
++ MMA7455L_MODE_PULSEDETECTION = 0x43, /* Set DRPD to on */
++ MMA7455L_MODE_MASK = 0x43,
++};
++
++enum mma7455l_gselect {
++ MMA7455L_GSELECT_8 = 0x0,
++ MMA7455L_GSELECT_2 = 0x4,
++ MMA7455L_GSELECT_4 = 0x8,
++ MMA7455L_GSELECT_MASK = 0xC,
++};
++
++/* FIXME */
++#define MMA7455L_F_FS 0x0020 /* ADC full scale */
++
++struct mma7455l_info {
++ struct spi_device *spi_dev;
++ struct input_dev *input_dev;
++ struct mutex lock;
++ struct delayed_work work;
++
++ u8 mode;
++ u8 gSelect;
++
++ u8 flags;
++ u8 working;
++};
++
++/* lowlevel register access functions */
++
++#define WRITE_BIT (1 << 7)
++#define ADDR_SHIFT 1
++
++static inline u_int8_t __reg_read(struct mma7455l_info *mma, u_int8_t reg)
++{
++ int rc;
++ u_int8_t cmd;
++
++ cmd = ((reg & 0x3f) << ADDR_SHIFT);
++ rc = spi_w8r8(mma->spi_dev, cmd);
++
++ return rc;
++}
++
++static u_int8_t reg_read(struct mma7455l_info *mma, u_int8_t reg)
++{
++ u_int8_t ret;
++
++ mutex_lock(&mma->lock);
++ ret = __reg_read(mma, reg);
++ mutex_unlock(&mma->lock);
++
++ return ret;
++}
++
++static s16 __reg_read_10(struct mma7455l_info *mma, u8 reg1, u8 reg2)
++{
++ u8 v1, v2;
++
++ v1 = __reg_read(mma, reg1);
++ v2 = __reg_read(mma, reg2);
++
++ return (v2 & 0x4) << 13 | (v2 & 0x3) << 8 | v1;
++}
++
++static inline int __reg_write(struct mma7455l_info *mma, u_int8_t reg, u_int8_t val)
++{
++ u_int8_t buf[2];
++
++ buf[0] = ((reg & 0x3f) << ADDR_SHIFT) | WRITE_BIT;
++ buf[1] = val;
++
++ return spi_write(mma->spi_dev, buf, sizeof(buf));
++}
++
++static int reg_write(struct mma7455l_info *mma, u_int8_t reg, u_int8_t val)
++{
++ int ret;
++
++ mutex_lock(&mma->lock);
++ ret = __reg_write(mma, reg, val);
++ mutex_unlock(&mma->lock);
++
++ return ret;
++}
++
++static s16 __reg_write_10(struct mma7455l_info *mma, u8 reg1, u8 reg2, s16 value)
++{
++ int ret;
++ u8 v1, v2;
++
++ v1 = value & 0xFF;
++ if(value < 0)
++ v2 = ((value >> 8) & 0x3) | 0x4;
++ else
++ v2 = 0;
++
++ ret = __reg_write(mma, reg1, v1);
++ ret = __reg_write(mma, reg2, v2);
++ return ret;
++}
++
++static void mma7455l_work(struct work_struct *work)
++{
++ struct mma7455l_info *mma =
++ container_of(work, struct mma7455l_info, work.work);
++
++ s8 val;
++ mma->working = 1;
++
++ /* FIXME: 10 bit accuracy? */
++ if (!(mma->flags & MMA7455L_STATUS_XDA)) {
++ val = reg_read(mma, MMA7455L_REG_XOUT8);
++ input_report_abs(mma->input_dev, ABS_X, val);
++ }
++ if (!(mma->flags & MMA7455L_STATUS_YDA)) {
++ val = reg_read(mma, MMA7455L_REG_YOUT8);
++ input_report_abs(mma->input_dev, ABS_Y, val);
++ }
++ if (!(mma->flags & MMA7455L_STATUS_ZDA)) {
++ val = reg_read(mma, MMA7455L_REG_ZOUT8);
++ input_report_abs(mma->input_dev, ABS_Z, val);
++ }
++
++ mma->working = 0;
++ input_sync(mma->input_dev);
++ put_device(&mma->spi_dev->dev);
++
++ /* Enable IRQ and clear out interrupt */
++ reg_write(mma, MMA7455L_REG_INTRST, 0x3);
++ reg_write(mma, MMA7455L_REG_INTRST, 0x0);
++ enable_irq(mma->spi_dev->irq);
++}
++
++static void mma7455l_schedule_work(struct mma7455l_info *mma)
++{
++ int status;
++
++ get_device(&mma->spi_dev->dev);
++ status = schedule_delayed_work(&mma->work, HZ / 10);
++}
++
++static irqreturn_t mma7455l_interrupt(int irq, void *_mma)
++{
++ struct mma7455l_info *mma = _mma;
++ mma7455l_schedule_work(mma);
++
++ /* Disable any further interrupts until we have processed
++ * the current one */
++ disable_irq_nosync(mma->spi_dev->irq);
++ return IRQ_HANDLED;
++}
++
++/* sysfs */
++
++static void get_mode(struct mma7455l_info *mma, u8 *mode, u8 *gSelect)
++{
++ u8 tmp = reg_read(mma, MMA7455L_REG_MCTL);
++
++ *mode = tmp & MMA7455L_MODE_MASK;
++ *gSelect = tmp & MMA7455L_GSELECT_MASK;
++}
++
++static void set_mode(struct mma7455l_info *mma, u8 mode, u8 gSelect)
++{
++ reg_write(mma, MMA7455L_REG_MCTL, mode | gSelect);
++}
++
++static void update_mode(struct mma7455l_info *mma, u8 mode, u8 gSelect)
++{
++ mma->mode = mode;
++ mma->gSelect = gSelect;
++
++ reg_write(mma, MMA7455L_REG_MCTL, mma->mode | mma->gSelect);
++}
++
++static ssize_t show_measure(struct device *dev, struct device_attribute *attr, char *buf)
++{
++ struct mma7455l_info *mma = dev_get_drvdata(dev);
++ s8 x, y, z;
++ u8 old_Mode, old_gSelect;
++
++ get_mode(mma, &old_Mode, &old_gSelect);
++ set_mode(mma, MMA7455L_MODE_MEASUREMENT, MMA7455L_GSELECT_2);
++
++ while (reg_read(mma, MMA7455L_REG_STATUS) == 0) {
++ msleep(10);
++ }
++
++ x = reg_read(mma, MMA7455L_REG_XOUT8);
++ y = reg_read(mma, MMA7455L_REG_YOUT8);
++ z = reg_read(mma, MMA7455L_REG_ZOUT8);
++
++ set_mode(mma, old_Mode, old_gSelect);
++ return sprintf(buf, "%d %d %d\n", x, y, z);
++}
++
++static ssize_t show_mode(struct device *dev, struct device_attribute *attr, char *buf)
++{
++ struct mma7455l_info *mma = dev_get_drvdata(dev);
++
++ switch(mma->mode)
++ {
++ case MMA7455L_MODE_STANDBY:
++ return sprintf(buf, "Standby\n");
++ break;
++ case MMA7455L_MODE_MEASUREMENT:
++ return sprintf(buf, "Measurement\n");
++ break;
++ case MMA7455L_MODE_LEVELDETECTION:
++ return sprintf(buf, "Level Detection\n");
++ break;
++ case MMA7455L_MODE_PULSEDETECTION:
++ return sprintf(buf, "Pulse Detection\n");
++ break;
++ }
++
++ return sprintf(buf, "Unknown mode!\n");
++}
++
++static ssize_t show_gSelect(struct device *dev, struct device_attribute *attr, char *buf)
++{
++ struct mma7455l_info *mma = dev_get_drvdata(dev);
++
++ switch(mma->gSelect)
++ {
++ case MMA7455L_GSELECT_8:
++ return sprintf(buf, "8\n");
++ break;
++ case MMA7455L_GSELECT_4:
++ return sprintf(buf, "4\n");
++ break;
++ case MMA7455L_GSELECT_2:
++ return sprintf(buf, "2\n");
++ break;
++ }
++
++ return sprintf(buf, "Unknown gSelect!\n");
++}
++
++static ssize_t show_level_threshold(struct device *dev, struct device_attribute *attr, char *buf)
++{
++ struct mma7455l_info *mma = dev_get_drvdata(dev);
++ return sprintf(buf, "%u\n", reg_read(mma, MMA7455L_REG_LDTH));
++}
++
++static ssize_t show_calibration(struct device *dev, struct device_attribute *attr, char *buf)
++{
++ s16 x, y, z;
++ struct mma7455l_info *mma = dev_get_drvdata(dev);
++
++ mutex_lock(&mma->lock);
++ x = __reg_read_10(mma, MMA7455L_REG_XOFFL, MMA7455L_REG_XOFFH);
++ y = __reg_read_10(mma, MMA7455L_REG_YOFFL, MMA7455L_REG_YOFFH);
++ z = __reg_read_10(mma, MMA7455L_REG_ZOFFL, MMA7455L_REG_ZOFFH);
++ mutex_unlock(&mma->lock);
++
++ return sprintf(buf, "%d %d %d\n", x, y, z);
++}
++
++static ssize_t write_mode(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
++{
++ struct mma7455l_info *mma = dev_get_drvdata(dev);
++
++ if (!strncmp(buf, "Standby", count))
++ update_mode(mma, MMA7455L_MODE_STANDBY, mma->gSelect);
++ else if (!strncmp(buf, "Measurement", count))
++ update_mode(mma, MMA7455L_MODE_MEASUREMENT, mma->gSelect);
++ else if (!strncmp(buf, "Level Detection", count))
++ update_mode(mma, MMA7455L_MODE_LEVELDETECTION, mma->gSelect);
++ else if (!strncmp(buf, "Pulse Detection", count))
++ update_mode(mma, MMA7455L_MODE_PULSEDETECTION, mma->gSelect);
++
++ return count;
++}
++
++static ssize_t write_gSelect(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
++{
++ unsigned long v;
++ struct mma7455l_info *mma = dev_get_drvdata(dev);
++
++ if(strict_strtoul(buf, 10, &v) == 0)
++ {
++ switch(v)
++ {
++ case 8:
++ update_mode(mma, mma->mode, MMA7455L_GSELECT_8);
++ break;
++ case 4:
++ update_mode(mma, mma->mode, MMA7455L_GSELECT_4);
++ break;
++ case 2:
++ update_mode(mma, mma->mode, MMA7455L_GSELECT_2);
++ break;
++ default:
++ return -EINVAL;
++ break;
++ }
++ return count;
++ }
++
++ return -EINVAL;
++}
++
++static ssize_t write_level_threshold(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
++{
++ unsigned long v;
++ struct mma7455l_info *mma = dev_get_drvdata(dev);
++
++ if(strict_strtoul(buf, 10, &v) == 0)
++ {
++ if(v <= 0xFF) {
++ reg_write(mma, MMA7455L_REG_LDTH, v);
++ return count;
++ } else
++ return -EINVAL;
++ }
++
++ return -EINVAL;
++}
++
++static ssize_t write_calibration(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
++{
++ int x, y, z;
++ struct mma7455l_info *mma = dev_get_drvdata(dev);
++
++ if (sscanf(buf, "%d %d %d", &x, &y, &z) == 3)
++ {
++ mutex_lock(&mma->lock);
++ __reg_write_10(mma, MMA7455L_REG_XOFFL, MMA7455L_REG_XOFFH, x);
++ __reg_write_10(mma, MMA7455L_REG_YOFFL, MMA7455L_REG_YOFFH, y);
++ __reg_write_10(mma, MMA7455L_REG_ZOFFL, MMA7455L_REG_ZOFFH, z);
++ mutex_unlock(&mma->lock);
++
++ return count;
++ }
++
++ return -EINVAL;
++}
++
++static DEVICE_ATTR(measure, S_IRUGO, show_measure, NULL);
++static DEVICE_ATTR(mode, S_IRUGO | S_IWUGO, show_mode, write_mode);
++static DEVICE_ATTR(gSelect, S_IRUGO | S_IWUGO, show_gSelect, write_gSelect);
++static DEVICE_ATTR(level_threshold, S_IRUGO | S_IWUGO, show_level_threshold, write_level_threshold);
++static DEVICE_ATTR(calibration, S_IRUGO | S_IWUGO, show_calibration, write_calibration);
++
++static struct attribute *mma7455l_sysfs_entries[] = {
++ &dev_attr_measure.attr,
++ &dev_attr_mode.attr,
++ &dev_attr_gSelect.attr,
++ &dev_attr_level_threshold.attr,
++ &dev_attr_calibration.attr,
++ NULL
++};
++
++static struct attribute_group mma7455l_attr_group = {
++ .attrs = mma7455l_sysfs_entries,
++};
++
++/* input device handling and driver core interaction */
++static int mma7455l_input_open(struct input_dev *inp)
++{
++ struct mma7455l_info *mma = input_get_drvdata(inp);
++ if(mma->mode == MMA7455L_MODE_STANDBY)
++ update_mode(mma, MMA7455L_MODE_MEASUREMENT, mma->gSelect);
++
++ return 0;
++}
++
++static void mma7455l_input_close(struct input_dev *inp)
++{
++ struct mma7455l_info *mma = input_get_drvdata(inp);
++ update_mode(mma, MMA7455L_MODE_STANDBY, MMA7455L_GSELECT_2);
++}
++
++static int __devinit mma7455l_probe(struct spi_device *spi)
++{
++ int rc;
++ struct mma7455l_info *mma;
++ struct mma7455l_platform_data *pdata = spi->dev.platform_data;
++ u_int8_t wai;
++
++ mma = kzalloc(sizeof(*mma), GFP_KERNEL);
++ if (!mma)
++ return -ENOMEM;
++
++ mutex_init(&mma->lock);
++ INIT_DELAYED_WORK(&mma->work, mma7455l_work);
++ mma->spi_dev = spi;
++ mma->flags = mma->working = 0;
++
++ spi_set_drvdata(spi, mma);
++
++ rc = spi_setup(spi);
++ if (rc < 0) {
++ printk(KERN_ERR "mma7455l error durign spi_setup of mma7455l driver\n");
++ dev_set_drvdata(&spi->dev, NULL);
++ kfree(mma);
++ return rc;
++ }
++
++ wai = reg_read(mma, MMA7455L_REG_WHOAMI);
++ if (wai != MMA7455L_WHOAMI_MAGIC) {
++ printk(KERN_ERR "mma7455l unknown whoami signature 0x%02x\n", wai);
++ dev_set_drvdata(&spi->dev, NULL);
++ kfree(mma);
++ return -ENODEV;
++ }
++
++ rc = request_irq(mma->spi_dev->irq, mma7455l_interrupt, IRQF_TRIGGER_HIGH,
++ "mma7455l", mma);
++ if (rc < 0) {
++ dev_err(&spi->dev, "mma7455l error requesting IRQ %d\n",
++ mma->spi_dev->irq);
++ /* FIXME */
++ return rc;
++ }
++
++ rc = sysfs_create_group(&spi->dev.kobj, &mma7455l_attr_group);
++ if (rc) {
++ dev_err(&spi->dev, "error creating sysfs group\n");
++ return rc;
++ }
++
++ /* initialize input layer details */
++ mma->input_dev = input_allocate_device();
++ if (!mma->input_dev) {
++ dev_err(&spi->dev, "mma7455l Unable to allocate input device\n");
++ /* FIXME */
++ }
++
++ set_bit(EV_ABS, mma->input_dev->evbit);
++ set_bit(ABS_X, mma->input_dev->absbit);
++ set_bit(ABS_Y, mma->input_dev->absbit);
++ set_bit(ABS_Z, mma->input_dev->absbit);
++
++ input_set_drvdata(mma->input_dev, mma);
++ mma->input_dev->name = "MMA7455L";
++ mma->input_dev->open = mma7455l_input_open;
++ mma->input_dev->close = mma7455l_input_close;
++
++ rc = input_register_device(mma->input_dev);
++ if(!rc)
++ {
++ update_mode(mma, MMA7455L_MODE_STANDBY, MMA7455L_GSELECT_2);
++
++ mutex_lock(&mma->lock);
++ __reg_write_10(mma, MMA7455L_REG_XOFFL, MMA7455L_REG_XOFFH, pdata->calibration_x);
++ __reg_write_10(mma, MMA7455L_REG_YOFFL, MMA7455L_REG_YOFFH, pdata->calibration_y);
++ __reg_write_10(mma, MMA7455L_REG_ZOFFL, MMA7455L_REG_ZOFFH, pdata->calibration_z);
++ mutex_unlock(&mma->lock);
++
++ return 0;
++ }
++
++ input_free_device(mma->input_dev);
++ return rc;
++}
++
++static int __devexit mma7455l_remove(struct spi_device *spi)
++{
++ struct mma7455l_info *mma = dev_get_drvdata(&spi->dev);
++
++ sysfs_remove_group(&spi->dev.kobj, &mma7455l_attr_group);
++ input_unregister_device(mma->input_dev);
++ dev_set_drvdata(&spi->dev, NULL);
++ kfree(mma);
++
++ return 0;
++}
++
++#ifdef CONFIG_PM
++static int mma7455l_suspend(struct spi_device *spi, pm_message_t message)
++{
++ struct mma7455l_info *mma = dev_get_drvdata(&spi->dev);
++ get_mode(mma, &mma->mode, &mma->gSelect);
++ set_mode(mma, MMA7455L_MODE_STANDBY, MMA7455L_GSELECT_2);
++
++ return 0;
++}
++
++static int mma7455l_resume(struct spi_device *spi)
++{
++ struct mma7455l_info *mma = dev_get_drvdata(&spi->dev);
++ update_mode(mma, mma->mode, mma->gSelect);
++
++ return 0;
++}
++#else
++#define mma7455l_suspend NULL
++#define mma7455l_resume NULL
++#endif
++
++static struct spi_driver mma7455l_driver = {
++ .driver = {
++ .name = "mma7455l",
++ .owner = THIS_MODULE,
++ },
++
++ .probe = mma7455l_probe,
++ .remove = __devexit_p(mma7455l_remove),
++ .suspend = mma7455l_suspend,
++ .resume = mma7455l_resume,
++};
++
++static int __init mma7455l_init(void)
++{
++ return spi_register_driver(&mma7455l_driver);
++}
++
++static void __exit mma7455l_exit(void)
++{
++ spi_unregister_driver(&mma7455l_driver);
++}
++
++MODULE_AUTHOR("Gregoire Gentil <gregoire@gentil.com>");
++MODULE_LICENSE("GPL");
++
++module_init(mma7455l_init);
++module_exit(mma7455l_exit);
+diff --git a/include/linux/mma7455l.h b/include/linux/mma7455l.h
+new file mode 100644
+index 0000000..12ab50a
+--- /dev/null
++++ b/include/linux/mma7455l.h
+@@ -0,0 +1,11 @@
++#ifndef _LINUX_MMA7455L_H
++#define _LINUX_MMA7455L_H
++
++struct mma7455l_platform_data {
++ /* Calibration offsets */
++ s16 calibration_x;
++ s16 calibration_y;
++ s16 calibration_z;
++};
++
++#endif /* _LINUX_MMA7455L_H */
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-psp-2.6.32/omap3-touchbook/0003-bq27x00_battery-remove-error-message-output.patch b/recipes/linux/linux-omap-psp-2.6.32/omap3-touchbook/0003-bq27x00_battery-remove-error-message-output.patch
new file mode 100644
index 0000000000..228f2aacbd
--- /dev/null
+++ b/recipes/linux/linux-omap-psp-2.6.32/omap3-touchbook/0003-bq27x00_battery-remove-error-message-output.patch
@@ -0,0 +1,53 @@
+From 914cf78bd36ac36b0f33ef4108a2bf68337a612c Mon Sep 17 00:00:00 2001
+From: Gregoire Gentil <gregoire@gentil.com>
+Date: Fri, 12 Mar 2010 11:41:17 +0100
+Subject: [PATCH 03/14] bq27x00_battery: remove error message output
+
+---
+ drivers/power/bq27x00_battery.c | 5 -----
+ 1 files changed, 0 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/power/bq27x00_battery.c b/drivers/power/bq27x00_battery.c
+index 62bb981..6935bb6 100644
+--- a/drivers/power/bq27x00_battery.c
++++ b/drivers/power/bq27x00_battery.c
+@@ -93,7 +93,6 @@ static int bq27x00_battery_temperature(struct bq27x00_device_info *di)
+
+ ret = bq27x00_read(BQ27x00_REG_TEMP, &temp, 0, di);
+ if (ret) {
+- dev_err(di->dev, "error reading temperature\n");
+ return ret;
+ }
+
+@@ -111,7 +110,6 @@ static int bq27x00_battery_voltage(struct bq27x00_device_info *di)
+
+ ret = bq27x00_read(BQ27x00_REG_VOLT, &volt, 0, di);
+ if (ret) {
+- dev_err(di->dev, "error reading voltage\n");
+ return ret;
+ }
+
+@@ -131,12 +129,10 @@ static int bq27x00_battery_current(struct bq27x00_device_info *di)
+
+ ret = bq27x00_read(BQ27x00_REG_AI, &curr, 0, di);
+ if (ret) {
+- dev_err(di->dev, "error reading current\n");
+ return 0;
+ }
+ ret = bq27x00_read(BQ27x00_REG_FLAGS, &flags, 0, di);
+ if (ret < 0) {
+- dev_err(di->dev, "error reading flags\n");
+ return 0;
+ }
+ if ((flags & (1 << 7)) != 0) {
+@@ -157,7 +153,6 @@ static int bq27x00_battery_rsoc(struct bq27x00_device_info *di)
+
+ ret = bq27x00_read(BQ27x00_REG_RSOC, &rsoc, 1, di);
+ if (ret) {
+- dev_err(di->dev, "error reading relative State-of-Charge\n");
+ return ret;
+ }
+
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-psp-2.6.32/omap3-touchbook/0004-bq27x00_battery-add-charged-gpio.patch b/recipes/linux/linux-omap-psp-2.6.32/omap3-touchbook/0004-bq27x00_battery-add-charged-gpio.patch
new file mode 100644
index 0000000000..670103287c
--- /dev/null
+++ b/recipes/linux/linux-omap-psp-2.6.32/omap3-touchbook/0004-bq27x00_battery-add-charged-gpio.patch
@@ -0,0 +1,65 @@
+From c72622f546557a12ba1c1a0d6d678cb8fb886039 Mon Sep 17 00:00:00 2001
+From: Gregoire Gentil <gregoire@gentil.com>
+Date: Fri, 12 Mar 2010 11:42:45 +0100
+Subject: [PATCH 04/14] bq27x00_battery: add charged gpio
+
+---
+ drivers/power/bq27x00_battery.c | 21 +++++++++++++++++++++
+ 1 files changed, 21 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/power/bq27x00_battery.c b/drivers/power/bq27x00_battery.c
+index 6935bb6..4b80f59 100644
+--- a/drivers/power/bq27x00_battery.c
++++ b/drivers/power/bq27x00_battery.c
+@@ -28,6 +28,7 @@
+
+ #define DRIVER_VERSION "1.0.0"
+
++#define BQ27x00_REG_MODE 0x00
+ #define BQ27x00_REG_TEMP 0x06
+ #define BQ27x00_REG_VOLT 0x08
+ #define BQ27x00_REG_RSOC 0x0B /* Relative State-of-Charge */
+@@ -65,6 +66,7 @@ static enum power_supply_property bq27x00_battery_props[] = {
+ POWER_SUPPLY_PROP_CURRENT_NOW,
+ POWER_SUPPLY_PROP_CAPACITY,
+ POWER_SUPPLY_PROP_TEMP,
++ POWER_SUPPLY_PROP_ONLINE,
+ };
+
+ /*
+@@ -83,6 +85,22 @@ static int bq27x00_read(u8 reg, int *rt_value, int b_single,
+ }
+
+ /*
++ * Return the GPIO status (0 or 1)
++ * Or < 0 if something fails.
++ */
++static int bq27x00_gpio(struct bq27x00_device_info *di)
++{
++ int ret;
++ int gpio = 0;
++
++ ret = bq27x00_read(BQ27x00_REG_MODE, &gpio, 0, di);
++ if (ret)
++ return ret;
++
++ return (gpio & 0x40) >> 6;
++}
++
++/*
+ * Return the battery temperature in Celsius degrees
+ * Or < 0 if something fails.
+ */
+@@ -184,6 +202,9 @@ static int bq27x00_battery_get_property(struct power_supply *psy,
+ case POWER_SUPPLY_PROP_TEMP:
+ val->intval = bq27x00_battery_temperature(di);
+ break;
++ case POWER_SUPPLY_PROP_ONLINE:
++ val->intval = bq27x00_gpio(di);
++ break;
+ default:
+ return -EINVAL;
+ }
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-psp-2.6.32/omap3-touchbook/0005-ARM-OMAP-Hack-beagle-asoc-driver-to-support-touchboo.patch b/recipes/linux/linux-omap-psp-2.6.32/omap3-touchbook/0005-ARM-OMAP-Hack-beagle-asoc-driver-to-support-touchboo.patch
new file mode 100644
index 0000000000..8d0cb2913e
--- /dev/null
+++ b/recipes/linux/linux-omap-psp-2.6.32/omap3-touchbook/0005-ARM-OMAP-Hack-beagle-asoc-driver-to-support-touchboo.patch
@@ -0,0 +1,85 @@
+From 3937249a21d70f55b5f8a5d2a94e28bac588c09f Mon Sep 17 00:00:00 2001
+From: Gregoire Gentil <gregoire@gentil.com>
+Date: Fri, 12 Mar 2010 11:47:59 +0100
+Subject: [PATCH 05/14] ARM: OMAP: Hack beagle asoc driver to support touchbook, tweak touchbook KConfig
+
+---
+ arch/arm/mach-omap2/Kconfig | 1 +
+ sound/soc/omap/Kconfig | 8 ++++++++
+ sound/soc/omap/Makefile | 2 ++
+ sound/soc/omap/omap3beagle.c | 4 ++--
+ 4 files changed, 13 insertions(+), 2 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
+index b72ae06..6f2bf4e 100644
+--- a/arch/arm/mach-omap2/Kconfig
++++ b/arch/arm/mach-omap2/Kconfig
+@@ -113,6 +113,7 @@ config MACH_OMAP3_PANDORA
+ config MACH_OMAP3_TOUCHBOOK
+ bool "OMAP3 Touch Book"
+ depends on ARCH_OMAP3 && ARCH_OMAP34XX
++ select OMAP_PACKAGE_CBB
+ select BACKLIGHT_CLASS_DEVICE
+
+ config MACH_OMAP_3430SDP
+diff --git a/sound/soc/omap/Kconfig b/sound/soc/omap/Kconfig
+index 61952aa..a7c06ab 100644
+--- a/sound/soc/omap/Kconfig
++++ b/sound/soc/omap/Kconfig
+@@ -101,6 +101,14 @@ config SND_OMAP_SOC_OMAP3_BEAGLE
+ help
+ Say Y if you want to add support for SoC audio on the Beagleboard.
+
++config SND_OMAP_SOC_OMAP3_TOUCHBOOK
++ tristate "SoC Audio support for OMAP3 Touch Book"
++ depends on TWL4030_CORE && SND_OMAP_SOC && MACH_OMAP3_TOUCHBOOK
++ select SND_OMAP_SOC_MCBSP
++ select SND_SOC_TWL4030
++ help
++ Say Y if you want to add support for SoC audio on the Touch Book.
++
+ config SND_OMAP_SOC_ZOOM2
+ tristate "SoC Audio support for Zoom2"
+ depends on TWL4030_CORE && SND_OMAP_SOC && MACH_OMAP_ZOOM2
+diff --git a/sound/soc/omap/Makefile b/sound/soc/omap/Makefile
+index 19283e5..9c972d6 100644
+--- a/sound/soc/omap/Makefile
++++ b/sound/soc/omap/Makefile
+@@ -16,6 +16,7 @@ snd-soc-am3517evm-objs := am3517evm.o
+ snd-soc-sdp3430-objs := sdp3430.o
+ snd-soc-omap3pandora-objs := omap3pandora.o
+ snd-soc-omap3beagle-objs := omap3beagle.o
++snd-soc-omap3touchbook-objs := omap3beagle.o
+ snd-soc-zoom2-objs := zoom2.o
+ snd-soc-igep0020-objs := igep0020.o
+
+@@ -29,5 +30,6 @@ obj-$(CONFIG_SND_OMAP_SOC_AM3517EVM) += snd-soc-am3517evm.o
+ obj-$(CONFIG_SND_OMAP_SOC_SDP3430) += snd-soc-sdp3430.o
+ obj-$(CONFIG_SND_OMAP_SOC_OMAP3_PANDORA) += snd-soc-omap3pandora.o
+ obj-$(CONFIG_SND_OMAP_SOC_OMAP3_BEAGLE) += snd-soc-omap3beagle.o
++obj-$(CONFIG_SND_OMAP_SOC_OMAP3_TOUCHBOOK) += snd-soc-omap3beagle.o
+ obj-$(CONFIG_SND_OMAP_SOC_ZOOM2) += snd-soc-zoom2.o
+ obj-$(CONFIG_SND_OMAP_SOC_IGEP0020) += snd-soc-igep0020.o
+diff --git a/sound/soc/omap/omap3beagle.c b/sound/soc/omap/omap3beagle.c
+index d88ad5c..248b789 100644
+--- a/sound/soc/omap/omap3beagle.c
++++ b/sound/soc/omap/omap3beagle.c
+@@ -116,13 +116,13 @@ static struct platform_device *omap3beagle_snd_device;
+ static int __init omap3beagle_soc_init(void)
+ {
+ int ret;
+-
++/*
+ if (!machine_is_omap3_beagle()) {
+ pr_debug("Not OMAP3 Beagle!\n");
+ return -ENODEV;
+ }
+ pr_info("OMAP3 Beagle SoC init\n");
+-
++*/
+ omap3beagle_snd_device = platform_device_alloc("soc-audio", -1);
+ if (!omap3beagle_snd_device) {
+ printk(KERN_ERR "Platform device allocation failed\n");
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-psp-2.6.32/omap3-touchbook/0006-ARM-OMAP-omap3-touchbook-update-boardfile.patch b/recipes/linux/linux-omap-psp-2.6.32/omap3-touchbook/0006-ARM-OMAP-omap3-touchbook-update-boardfile.patch
new file mode 100644
index 0000000000..46669fda33
--- /dev/null
+++ b/recipes/linux/linux-omap-psp-2.6.32/omap3-touchbook/0006-ARM-OMAP-omap3-touchbook-update-boardfile.patch
@@ -0,0 +1,571 @@
+From d732dfd967b870ea5effa599d501996b620a1f60 Mon Sep 17 00:00:00 2001
+From: Gregoire Gentil <gregoire@gentil.com>
+Date: Fri, 12 Mar 2010 11:49:16 +0100
+Subject: [PATCH 06/14] ARM: OMAP: omap3-touchbook: update boardfile
+
+---
+ arch/arm/mach-omap2/board-omap3touchbook.c | 390 +++++++++++++++++++++-------
+ 1 files changed, 301 insertions(+), 89 deletions(-)
+
+diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c
+index fc3e03c..4f89cf3 100644
+--- a/arch/arm/mach-omap2/board-omap3touchbook.c
++++ b/arch/arm/mach-omap2/board-omap3touchbook.c
+@@ -33,6 +33,7 @@
+ #include <linux/spi/spi.h>
+
+ #include <linux/spi/ads7846.h>
++#include <linux/mma7455l.h>
+
+ #include <linux/regulator/machine.h>
+ #include <linux/i2c/twl.h>
+@@ -45,6 +46,7 @@
+
+ #include <plat/board.h>
+ #include <plat/common.h>
++#include <plat/display.h>
+ #include <plat/gpmc.h>
+ #include <plat/nand.h>
+ #include <plat/usb.h>
+@@ -60,6 +62,8 @@
+
+ #include <asm/setup.h>
+
++#include <plat/dmtimer.h>
++#include <linux/backlight.h>
+
+ #define GPMC_CS0_BASE 0x60
+ #define GPMC_CS_SIZE 0x30
+@@ -68,10 +72,11 @@
+
+ #define OMAP3_AC_GPIO 136
+ #define OMAP3_TS_GPIO 162
++#define OMAP3_CHACHA_GPIO 154
+ #define TB_BL_PWM_TIMER 9
+ #define TB_KILL_POWER_GPIO 168
+
+-unsigned long touchbook_revision;
++unsigned long ai_revision = 2;
+
+ static struct mtd_partition omap3touchbook_nand_partitions[] = {
+ /* All the partition sizes are listed in terms of NAND block size */
+@@ -126,6 +131,103 @@ static struct platform_device omap3touchbook_nand_device = {
+ .resource = &omap3touchbook_nand_resource,
+ };
+
++static int touchbook_enable_dvi(struct omap_dss_device *dssdev)
++{
++ if (dssdev->reset_gpio != -1)
++ gpio_set_value(dssdev->reset_gpio, 1);
++
++ return 0;
++}
++
++static void touchbook_disable_dvi(struct omap_dss_device *dssdev)
++{
++ if (dssdev->reset_gpio != -1)
++ gpio_set_value(dssdev->reset_gpio, 0);
++}
++
++static struct omap_dss_device touchbook_dvi_device = {
++ .type = OMAP_DISPLAY_TYPE_DPI,
++ .name = "dvi",
++ .driver_name = "generic_panel",
++ .phy.dpi.data_lines = 24,
++ .reset_gpio = 176,
++ .platform_enable = touchbook_enable_dvi,
++ .platform_disable = touchbook_disable_dvi,
++};
++
++static int touchbook_panel_enable_tv(struct omap_dss_device *dssdev)
++{
++#define ENABLE_VDAC_DEDICATED 0x03
++#define ENABLE_VDAC_DEV_GRP 0x20
++
++ twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
++ ENABLE_VDAC_DEDICATED,
++ TWL4030_VDAC_DEDICATED);
++ twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER,
++ ENABLE_VDAC_DEV_GRP, TWL4030_VDAC_DEV_GRP);
++
++ return 0;
++}
++
++static void touchbook_panel_disable_tv(struct omap_dss_device *dssdev)
++{
++ twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0x00,
++ TWL4030_VDAC_DEDICATED);
++ twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, 0x00,
++ TWL4030_VDAC_DEV_GRP);
++}
++
++static struct omap_dss_device touchbook_tv_device = {
++ .name = "tv",
++ .driver_name = "venc",
++ .type = OMAP_DISPLAY_TYPE_VENC,
++ .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO,
++ .platform_enable = touchbook_panel_enable_tv,
++ .platform_disable = touchbook_panel_disable_tv,
++};
++
++static struct omap_dss_device *touchbook_dss_devices[] = {
++ &touchbook_dvi_device,
++ &touchbook_tv_device,
++};
++
++static struct omap_dss_board_info touchbook_dss_data = {
++ .num_devices = ARRAY_SIZE(touchbook_dss_devices),
++ .devices = touchbook_dss_devices,
++ .default_device = &touchbook_dvi_device,
++};
++
++static struct platform_device touchbook_dss_device = {
++ .name = "omapdss",
++ .id = -1,
++ .dev = {
++ .platform_data = &touchbook_dss_data,
++ },
++};
++
++static struct regulator_consumer_supply touchbook_vdac_supply = {
++ .supply = "vdda_dac",
++ .dev = &touchbook_dss_device.dev,
++};
++
++static struct regulator_consumer_supply touchbook_vdvi_supply = {
++ .supply = "vdds_dsi",
++ .dev = &touchbook_dss_device.dev,
++};
++
++static void __init touchbook_display_init(void)
++{
++ int r;
++
++ r = gpio_request(touchbook_dvi_device.reset_gpio, "DVI reset");
++ if (r < 0) {
++ printk(KERN_ERR "Unable to get DVI reset GPIO\n");
++ return;
++ }
++
++ gpio_direction_output(touchbook_dvi_device.reset_gpio, 0);
++}
++
+ #include "sdram-micron-mt46h32m32lf-6.h"
+
+ static struct twl4030_hsmmc_info mmc[] = {
+@@ -137,15 +239,6 @@ static struct twl4030_hsmmc_info mmc[] = {
+ {} /* Terminator */
+ };
+
+-static struct platform_device omap3_touchbook_lcd_device = {
+- .name = "omap3touchbook_lcd",
+- .id = -1,
+-};
+-
+-static struct omap_lcd_config omap3_touchbook_lcd_config __initdata = {
+- .ctrl_name = "internal",
+-};
+-
+ static struct regulator_consumer_supply touchbook_vmmc1_supply = {
+ .supply = "vmmc",
+ };
+@@ -177,6 +270,7 @@ static int touchbook_twl_gpio_setup(struct device *dev,
+ * power switch and overcurrent detect
+ */
+
++#if 0
+ gpio_request(gpio + 1, "EHCI_nOC");
+ gpio_direction_input(gpio + 1);
+
+@@ -187,6 +281,7 @@ static int touchbook_twl_gpio_setup(struct device *dev,
+ /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */
+ gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1;
+
++#endif
+ return 0;
+ }
+
+@@ -201,16 +296,6 @@ static struct twl4030_gpio_platform_data touchbook_gpio_data = {
+ .setup = touchbook_twl_gpio_setup,
+ };
+
+-static struct regulator_consumer_supply touchbook_vdac_supply = {
+- .supply = "vdac",
+- .dev = &omap3_touchbook_lcd_device.dev,
+-};
+-
+-static struct regulator_consumer_supply touchbook_vdvi_supply = {
+- .supply = "vdvi",
+- .dev = &omap3_touchbook_lcd_device.dev,
+-};
+-
+ /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */
+ static struct regulator_init_data touchbook_vmmc1 = {
+ .constraints = {
+@@ -283,6 +368,10 @@ static struct twl4030_codec_data touchbook_codec_data = {
+ .audio = &touchbook_audio_data,
+ };
+
++static struct twl4030_madc_platform_data touchbook_madc_data = {
++ .irq_line = 1,
++};
++
+ static struct twl4030_platform_data touchbook_twldata = {
+ .irq_base = TWL4030_IRQ_BASE,
+ .irq_end = TWL4030_IRQ_END,
+@@ -291,6 +380,7 @@ static struct twl4030_platform_data touchbook_twldata = {
+ .usb = &touchbook_usb_data,
+ .gpio = &touchbook_gpio_data,
+ .codec = &touchbook_codec_data,
++ .madc = &touchbook_madc_data,
+ .vmmc1 = &touchbook_vmmc1,
+ .vsim = &touchbook_vsim,
+ .vdac = &touchbook_vdac,
+@@ -310,10 +400,18 @@ static struct i2c_board_info __initdata touchBook_i2c_boardinfo[] = {
+ {
+ I2C_BOARD_INFO("bq27200", 0x55),
+ },
++ {
++ I2C_BOARD_INFO("chacha", 0x40),
++ .irq = OMAP_GPIO_IRQ(OMAP3_CHACHA_GPIO),
++ },
++ {
++ I2C_BOARD_INFO("ds1307", 0x68),
++ },
+ };
+
+ static int __init omap3_touchbook_i2c_init(void)
+ {
++ int ret;
+ /* Standard TouchBook bus */
+ omap_register_i2c_bus(1, 2600, touchbook_i2c_boardinfo,
+ ARRAY_SIZE(touchbook_i2c_boardinfo));
+@@ -322,53 +420,16 @@ static int __init omap3_touchbook_i2c_init(void)
+ omap_register_i2c_bus(3, 100, touchBook_i2c_boardinfo,
+ ARRAY_SIZE(touchBook_i2c_boardinfo));
+
+- return 0;
+-}
+-
+-static void __init omap3_ads7846_init(void)
+-{
+- if (gpio_request(OMAP3_TS_GPIO, "ads7846_pen_down")) {
+- printk(KERN_ERR "Failed to request GPIO %d for "
+- "ads7846 pen down IRQ\n", OMAP3_TS_GPIO);
+- return;
++ ret = gpio_request(OMAP3_CHACHA_GPIO, "chacha");
++ if (ret < 0) {
++ printk(KERN_ERR "Failed to request GPIO %d for chacha IRQ\n", OMAP3_CHACHA_GPIO);
++ return 0;
+ }
++ gpio_direction_input(OMAP3_CHACHA_GPIO);
+
+- gpio_direction_input(OMAP3_TS_GPIO);
+- omap_set_gpio_debounce(OMAP3_TS_GPIO, 1);
+- omap_set_gpio_debounce_time(OMAP3_TS_GPIO, 0xa);
++ return 0;
+ }
+
+-static struct ads7846_platform_data ads7846_config = {
+- .x_min = 100,
+- .y_min = 265,
+- .x_max = 3950,
+- .y_max = 3750,
+- .x_plate_ohms = 40,
+- .pressure_max = 255,
+- .debounce_max = 10,
+- .debounce_tol = 5,
+- .debounce_rep = 1,
+- .gpio_pendown = OMAP3_TS_GPIO,
+- .keep_vref_on = 1,
+-};
+-
+-static struct omap2_mcspi_device_config ads7846_mcspi_config = {
+- .turbo_mode = 0,
+- .single_channel = 1, /* 0: slave, 1: master */
+-};
+-
+-static struct spi_board_info omap3_ads7846_spi_board_info[] __initdata = {
+- {
+- .modalias = "ads7846",
+- .bus_num = 4,
+- .chip_select = 0,
+- .max_speed_hz = 1500000,
+- .controller_data = &ads7846_mcspi_config,
+- .irq = OMAP_GPIO_IRQ(OMAP3_TS_GPIO),
+- .platform_data = &ads7846_config,
+- }
+-};
+-
+ static struct gpio_led gpio_leds[] = {
+ {
+ .name = "touchbook::usr0",
+@@ -412,6 +473,7 @@ static struct gpio_keys_button gpio_buttons[] = {
+ .gpio = 183,
+ .desc = "power",
+ .wakeup = 1,
++ .active_low = 1,
+ },
+ };
+
+@@ -428,23 +490,8 @@ static struct platform_device keys_gpio = {
+ },
+ };
+
+-static struct omap_board_config_kernel omap3_touchbook_config[] __initdata = {
+- { OMAP_TAG_LCD, &omap3_touchbook_lcd_config },
+-};
+-
+-#ifdef CONFIG_OMAP_MUX
+-static struct omap_board_mux board_mux[] __initdata = {
+- { .reg_offset = OMAP_MUX_TERMINATOR },
+-};
+-#else
+-#define board_mux NULL
+-#endif
+-
+ static void __init omap3_touchbook_init_irq(void)
+ {
+- omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
+- omap_board_config = omap3_touchbook_config;
+- omap_board_config_size = ARRAY_SIZE(omap3_touchbook_config);
+ omap2_init_common_hw(mt46h32m32lf6_sdrc_params,
+ mt46h32m32lf6_sdrc_params, omap35x_mpu_rate_table,
+ omap35x_dsp_rate_table, omap35x_l3_rate_table);
+@@ -456,9 +503,9 @@ static void __init omap3_touchbook_init_irq(void)
+ }
+
+ static struct platform_device *omap3_touchbook_devices[] __initdata = {
+- &omap3_touchbook_lcd_device,
+ &leds_gpio,
+ &keys_gpio,
++ &touchbook_dss_device,
+ };
+
+ static void __init omap3touchbook_flash_init(void)
+@@ -512,6 +559,166 @@ static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
+ .reset_gpio_port[2] = -EINVAL
+ };
+
++#ifdef CONFIG_OMAP_MUX
++static struct omap_board_mux board_mux[] __initdata = {
++ { .reg_offset = OMAP_MUX_TERMINATOR },
++};
++#else
++#define board_mux NULL
++#endif
++
++static struct ads7846_platform_data ads7846_config = {
++ .x_min = 100,
++ .y_min = 265,
++ .x_max = 3950,
++ .y_max = 3750,
++ .x_plate_ohms = 40,
++ .pressure_max = 255,
++ .debounce_max = 10,
++ .debounce_tol = 5,
++ .debounce_rep = 1,
++ .gpio_pendown = OMAP3_TS_GPIO,
++ .keep_vref_on = 1,
++};
++
++static struct omap2_mcspi_device_config ads7846_mcspi_config = {
++ .turbo_mode = 0,
++ .single_channel = 1, /* 0: slave, 1: master */
++};
++
++static struct spi_board_info omap3_ads7846_spi_board_info[] __initdata = {
++ {
++ .modalias = "ads7846",
++ .bus_num = 4,
++ .chip_select = 0,
++ .max_speed_hz = 1500000,
++ .controller_data = &ads7846_mcspi_config,
++ .irq = OMAP_GPIO_IRQ(OMAP3_TS_GPIO),
++ .platform_data = &ads7846_config,
++ }
++};
++
++static void __init omap3_ads7846_init(void)
++{
++ if (gpio_request(OMAP3_TS_GPIO, "ads7846_pen_down")) {
++ printk(KERN_ERR "Failed to request GPIO %d for "
++ "ads7846 pen down IRQ\n", OMAP3_TS_GPIO);
++ return;
++ }
++
++ gpio_direction_input(OMAP3_TS_GPIO);
++ omap_set_gpio_debounce(OMAP3_TS_GPIO, 1);
++ omap_set_gpio_debounce_time(OMAP3_TS_GPIO, 0xa);
++}
++
++static struct mma7455l_platform_data mma7455l_config = {
++ .calibration_x = -4,
++ .calibration_y = 28,
++ .calibration_z = -28,
++};
++
++static struct omap2_mcspi_device_config mma7455l_mcspi_config = {
++ .turbo_mode = 0,
++ .single_channel = 1, /* 0: slave, 1: master */
++};
++
++static struct spi_board_info omap3_mma7455l_spi_board_info[] __initdata = {
++ {
++ .modalias = "mma7455l",
++ .bus_num = 3,
++ .chip_select = 0,
++ .max_speed_hz = 200000,
++ .irq = OMAP_GPIO_IRQ(OMAP3_AC_GPIO),
++ .controller_data = &mma7455l_mcspi_config, //(void *) 135,
++ .platform_data = &mma7455l_config,
++ }
++};
++
++static void __init omap3_mma7455l_init(void)
++{
++ int ret;
++
++ ret = gpio_request(OMAP3_AC_GPIO, "mma7455l");
++ if (ret < 0) {
++ printk(KERN_ERR "Failed to request GPIO %d for mma7455l IRQ\n", OMAP3_AC_GPIO);
++ return;
++ }
++
++ gpio_direction_input(OMAP3_AC_GPIO);
++}
++
++static int touchbook_backlight_brightness = 50;
++static struct omap_dm_timer *touchbook_backlight_pwm;
++
++static int touchbook_backlight_read(struct backlight_device *bd)
++{
++ return touchbook_backlight_brightness;
++}
++
++static int touchbook_backlight_update(struct backlight_device *bd)
++{
++ int value = bd->props.brightness;
++ touchbook_backlight_brightness = value;
++
++ /* Frequency calculation:
++ - For 200Hz PWM, you want to load -164 (=> -32768Hz / 200Hz).
++ - Minimum duty cycle for the backlight is 15%.
++ - You have (164*0.85) => ~140 levels of brightness.
++ */
++
++ /* Halve input brightness */
++ value /= 2;
++
++ /* For maximum brightness, just stop the timer... */
++ if(value != bd->props.max_brightness)
++ {
++ /* Load the appropriate value for 200Hz PWM */
++ u32 period = clk_get_rate(omap_dm_timer_get_fclk(touchbook_backlight_pwm)) / 200;
++
++ /* Minimum duty cycle is 15% */
++ u32 minimum = (period * 3) / 20;
++ u32 maximum = (period * 17) / 20;
++
++ /* Work out match value */
++ u32 match = (maximum * value) / 100;
++
++ /* Start... */
++ omap_dm_timer_set_load(touchbook_backlight_pwm, 1, 0xFFFFFFFF - period - 1);
++ omap_dm_timer_set_match(touchbook_backlight_pwm, 1, 0xFFFFFFFF - minimum - match);
++ omap_dm_timer_write_counter(touchbook_backlight_pwm, -1);
++ omap_dm_timer_start(touchbook_backlight_pwm);
++ }
++ else
++ omap_dm_timer_stop(touchbook_backlight_pwm);
++
++
++ return 0;
++}
++
++static struct backlight_ops touchbook_backlight_properties = {
++ .get_brightness = touchbook_backlight_read,
++ .update_status = touchbook_backlight_update,
++};
++
++static void __init omap3_touchbook_backlight_init(void)
++{
++ static struct backlight_device *bd;
++ bd = backlight_device_register("touchbook", NULL, NULL, &touchbook_backlight_properties);
++
++ if(bd)
++ {
++ touchbook_backlight_pwm = omap_dm_timer_request_specific(TB_BL_PWM_TIMER);
++ omap_dm_timer_enable(touchbook_backlight_pwm);
++ omap_dm_timer_set_source(touchbook_backlight_pwm, OMAP_TIMER_SRC_SYS_CLK);
++ omap_dm_timer_set_pwm(touchbook_backlight_pwm, 1, 1, OMAP_TIMER_TRIGGER_OVERFLOW_AND_COMPARE);
++
++ bd->props.max_brightness = 100;
++ bd->props.brightness = touchbook_backlight_brightness;
++ }
++
++ touchbook_backlight_update(bd);
++}
++
+ static void omap3_touchbook_poweroff(void)
+ {
+ int r;
+@@ -525,33 +732,27 @@ static void omap3_touchbook_poweroff(void)
+ gpio_direction_output(TB_KILL_POWER_GPIO, 0);
+ }
+
+-static void __init early_touchbook_revision(char **p)
++static void __init early_ai_revision(char **p)
+ {
+ if (!*p)
+ return;
+
+- strict_strtoul(*p, 10, &touchbook_revision);
++ strict_strtoul(*p, 10, &ai_revision);
+ }
+-__early_param("tbr=", early_touchbook_revision);
++__early_param("air=", early_ai_revision);
+
+ static void __init omap3_touchbook_init(void)
+ {
+ pm_power_off = omap3_touchbook_poweroff;
+
++ omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
+ omap3_touchbook_i2c_init();
+ platform_add_devices(omap3_touchbook_devices,
+ ARRAY_SIZE(omap3_touchbook_devices));
+ omap_serial_init();
+
+- omap_mux_init_gpio(170, OMAP_PIN_INPUT);
+ gpio_request(176, "DVI_nPD");
+- /* REVISIT leave DVI powered down until it's needed ... */
+- gpio_direction_output(176, true);
+
+- /* Touchscreen and accelerometer */
+- spi_register_board_info(omap3_ads7846_spi_board_info,
+- ARRAY_SIZE(omap3_ads7846_spi_board_info));
+- omap3_ads7846_init();
+ usb_musb_init();
+ usb_ehci_init(&ehci_pdata);
+ omap3touchbook_flash_init();
+@@ -559,6 +760,17 @@ static void __init omap3_touchbook_init(void)
+ /* Ensure SDRC pins are mux'd for self-refresh */
+ omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);
+ omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT);
++
++ touchbook_display_init();
++ omap3_touchbook_backlight_init();
++
++ /* Touchscreen and accelerometer */
++ spi_register_board_info(omap3_ads7846_spi_board_info,
++ ARRAY_SIZE(omap3_ads7846_spi_board_info));
++ spi_register_board_info(omap3_mma7455l_spi_board_info,
++ ARRAY_SIZE(omap3_mma7455l_spi_board_info));
++ omap3_ads7846_init();
++ omap3_mma7455l_init();
+ }
+
+ static void __init omap3_touchbook_map_io(void)
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-psp-2.6.32/omap3-touchbook/0007-adf7846-add-more-debugging.patch b/recipes/linux/linux-omap-psp-2.6.32/omap3-touchbook/0007-adf7846-add-more-debugging.patch
new file mode 100644
index 0000000000..d5942c8996
--- /dev/null
+++ b/recipes/linux/linux-omap-psp-2.6.32/omap3-touchbook/0007-adf7846-add-more-debugging.patch
@@ -0,0 +1,99 @@
+From 1b90e477d484f666ba2224b950b2810fcaf53df2 Mon Sep 17 00:00:00 2001
+From: Gregoire Gentil <gregoire@gentil.com>
+Date: Fri, 12 Mar 2010 13:50:38 +0100
+Subject: [PATCH 07/14] adf7846: add more debugging
+
+---
+ drivers/input/touchscreen/ads7846.c | 73 +++++++++++++++++++++++++++++++++++
+ 1 files changed, 73 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
+index 45287ab..ebdeeeb 100644
+--- a/drivers/input/touchscreen/ads7846.c
++++ b/drivers/input/touchscreen/ads7846.c
+@@ -495,9 +495,82 @@ static ssize_t ads7846_disable_store(struct device *dev,
+
+ static DEVICE_ATTR(disable, 0664, ads7846_disable_show, ads7846_disable_store);
+
++static ssize_t show_debounce_max(struct device *dev, struct device_attribute *attr, char *buf) {
++ struct ads7846 *ts = dev_get_drvdata(dev);
++ return sprintf(buf, "%u\n", ts->debounce_max);
++}
++
++static ssize_t show_debounce_tol(struct device *dev, struct device_attribute *attr, char *buf) {
++ struct ads7846 *ts = dev_get_drvdata(dev);
++ return sprintf(buf, "%u\n", ts->debounce_tol);
++}
++
++static ssize_t show_debounce_rep(struct device *dev, struct device_attribute *attr, char *buf) {
++ struct ads7846 *ts = dev_get_drvdata(dev);
++ return sprintf(buf, "%u\n", ts->debounce_rep);
++}
++
++static ssize_t show_x_plate_ohms(struct device *dev, struct device_attribute *attr, char *buf) {
++ struct ads7846 *ts = dev_get_drvdata(dev);
++ return sprintf(buf, "%u\n", ts->x_plate_ohms);
++}
++
++static ssize_t write_debounce_max(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) {
++ struct ads7846 *ts = dev_get_drvdata(dev);
++ unsigned long i;
++
++ if (strict_strtoul(buf, 10, &i))
++ return -EINVAL;
++
++ ts->debounce_max = i;
++ return count;
++}
++
++static ssize_t write_debounce_tol(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) {
++ struct ads7846 *ts = dev_get_drvdata(dev);
++ unsigned long i;
++
++ if (strict_strtoul(buf, 10, &i))
++ return -EINVAL;
++
++ ts->debounce_tol = i;
++ return count;
++}
++
++static ssize_t write_debounce_rep(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) {
++ struct ads7846 *ts = dev_get_drvdata(dev);
++ unsigned long i;
++
++ if (strict_strtoul(buf, 10, &i))
++ return -EINVAL;
++
++ ts->debounce_rep = i;
++ return count;
++}
++
++static ssize_t write_x_plate_ohms(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) {
++ struct ads7846 *ts = dev_get_drvdata(dev);
++ unsigned long i;
++
++ if (strict_strtoul(buf, 10, &i))
++ return -EINVAL;
++
++ ts->x_plate_ohms = i;
++ return count;
++}
++
++static DEVICE_ATTR(debounce_max, S_IRUGO | S_IWUGO, show_debounce_max, write_debounce_max);
++static DEVICE_ATTR(debounce_tol, S_IRUGO | S_IWUGO, show_debounce_tol, write_debounce_tol);
++static DEVICE_ATTR(debounce_rep, S_IRUGO | S_IWUGO, show_debounce_rep, write_debounce_rep);
++static DEVICE_ATTR(x_plate_ohms, S_IRUGO | S_IWUGO, show_x_plate_ohms, write_x_plate_ohms);
++
+ static struct attribute *ads784x_attributes[] = {
+ &dev_attr_pen_down.attr,
+ &dev_attr_disable.attr,
++ &dev_attr_debounce_max.attr,
++ &dev_attr_debounce_tol.attr,
++ &dev_attr_debounce_rep.attr,
++ &dev_attr_x_plate_ohms.attr,
+ NULL,
+ };
+
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-psp-2.6.32/omap3-touchbook/0008-ads7846-read-max-mix-x-y-from-pdata.patch b/recipes/linux/linux-omap-psp-2.6.32/omap3-touchbook/0008-ads7846-read-max-mix-x-y-from-pdata.patch
new file mode 100644
index 0000000000..50c56fc1f7
--- /dev/null
+++ b/recipes/linux/linux-omap-psp-2.6.32/omap3-touchbook/0008-ads7846-read-max-mix-x-y-from-pdata.patch
@@ -0,0 +1,35 @@
+From 95fae00f5191e445a2192a85c73b02b287eb3db6 Mon Sep 17 00:00:00 2001
+From: Gregoire Gentil <gregoire@gentil.com>
+Date: Fri, 12 Mar 2010 13:50:45 +0100
+Subject: [PATCH 08/14] ads7846: read max/mix x/y from pdata
+
+---
+ drivers/input/touchscreen/ads7846.c | 5 +++--
+ 1 files changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
+index ebdeeeb..56b0ffd 100644
+--- a/drivers/input/touchscreen/ads7846.c
++++ b/drivers/input/touchscreen/ads7846.c
+@@ -604,6 +604,7 @@ static void ads7846_rx(void *ads)
+ {
+ struct ads7846 *ts = ads;
+ struct ads7846_packet *packet = ts->packet;
++ struct ads7846_platform_data *pdata = ts->spi->dev.platform_data;
+ unsigned Rt;
+ u16 x, y, z1, z2;
+
+@@ -674,8 +675,8 @@ static void ads7846_rx(void *ads)
+ if (ts->swap_xy)
+ swap(x, y);
+
+- input_report_abs(input, ABS_X, x);
+- input_report_abs(input, ABS_Y, y);
++ input_report_abs(input, ABS_X, pdata->x_max - x + pdata->x_min);
++ input_report_abs(input, ABS_Y, pdata->y_max - y + pdata->y_min);
+ input_report_abs(input, ABS_PRESSURE, ts->pressure_max - Rt);
+
+ input_sync(input);
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-psp-2.6.32/omap3-touchbook/0009-ads7846-add-settling-delay-to-pdata.patch b/recipes/linux/linux-omap-psp-2.6.32/omap3-touchbook/0009-ads7846-add-settling-delay-to-pdata.patch
new file mode 100644
index 0000000000..b60ab833f2
--- /dev/null
+++ b/recipes/linux/linux-omap-psp-2.6.32/omap3-touchbook/0009-ads7846-add-settling-delay-to-pdata.patch
@@ -0,0 +1,59 @@
+From dd9c33edf9c2734a7107c96c61d3ffcea90837f4 Mon Sep 17 00:00:00 2001
+From: Gregoire Gentil <gregoire@gentil.com>
+Date: Fri, 12 Mar 2010 13:50:52 +0100
+Subject: [PATCH 09/14] ads7846: add settling delay to pdata
+
+---
+ drivers/input/touchscreen/ads7846.c | 22 ++++++++++++++++++++++
+ 1 files changed, 22 insertions(+), 0 deletions(-)
+
+diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
+index 56b0ffd..1d9f97c 100644
+--- a/drivers/input/touchscreen/ads7846.c
++++ b/drivers/input/touchscreen/ads7846.c
+@@ -515,6 +515,26 @@ static ssize_t show_x_plate_ohms(struct device *dev, struct device_attribute *at
+ return sprintf(buf, "%u\n", ts->x_plate_ohms);
+ }
+
++static ssize_t show_settle_delay_usecs(struct device *dev, struct device_attribute *attr, char *buf) {
++ struct ads7846 *ts = dev_get_drvdata(dev);
++ struct ads7846_platform_data *pdata = ts->spi->dev.platform_data;
++
++ return sprintf(buf, "%u\n", pdata->settle_delay_usecs);
++}
++
++static ssize_t write_settle_delay_usecs(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) {
++ struct ads7846 *ts = dev_get_drvdata(dev);
++ struct ads7846_platform_data *pdata = ts->spi->dev.platform_data;
++
++ unsigned long i;
++
++ if (strict_strtoul(buf, 10, &i))
++ return -EINVAL;
++
++ pdata->settle_delay_usecs = i;
++ return count;
++}
++
+ static ssize_t write_debounce_max(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) {
+ struct ads7846 *ts = dev_get_drvdata(dev);
+ unsigned long i;
+@@ -563,6 +583,7 @@ static DEVICE_ATTR(debounce_max, S_IRUGO | S_IWUGO, show_debounce_max, write_deb
+ static DEVICE_ATTR(debounce_tol, S_IRUGO | S_IWUGO, show_debounce_tol, write_debounce_tol);
+ static DEVICE_ATTR(debounce_rep, S_IRUGO | S_IWUGO, show_debounce_rep, write_debounce_rep);
+ static DEVICE_ATTR(x_plate_ohms, S_IRUGO | S_IWUGO, show_x_plate_ohms, write_x_plate_ohms);
++static DEVICE_ATTR(settle_delay_usecs, S_IRUGO | S_IWUGO, show_settle_delay_usecs, write_settle_delay_usecs);
+
+ static struct attribute *ads784x_attributes[] = {
+ &dev_attr_pen_down.attr,
+@@ -571,6 +592,7 @@ static struct attribute *ads784x_attributes[] = {
+ &dev_attr_debounce_tol.attr,
+ &dev_attr_debounce_rep.attr,
+ &dev_attr_x_plate_ohms.attr,
++ &dev_attr_settle_delay_usecs.attr,
+ NULL,
+ };
+
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-psp-2.6.32/omap3-touchbook/0010-Touch-Book-turn-on-off-the-class-D-amplifier-dependi.patch b/recipes/linux/linux-omap-psp-2.6.32/omap3-touchbook/0010-Touch-Book-turn-on-off-the-class-D-amplifier-dependi.patch
new file mode 100644
index 0000000000..67d2b18907
--- /dev/null
+++ b/recipes/linux/linux-omap-psp-2.6.32/omap3-touchbook/0010-Touch-Book-turn-on-off-the-class-D-amplifier-dependi.patch
@@ -0,0 +1,95 @@
+From 98b1f1df855ead7eec5f8c9032736046752e5593 Mon Sep 17 00:00:00 2001
+From: Tim Yamin <plasm@roo.me.uk>
+Date: Wed, 29 Apr 2009 17:30:25 -0700
+Subject: [PATCH 10/14] Touch Book: turn on/off the class D amplifier depending on whether the headphones are plugged into the jack or not.
+
+Signed-off-by: Tim Yamin <plasm@roo.me.uk>
+---
+ sound/soc/omap/omap3beagle.c | 45 ++++++++++++++++++++++++++++++++++++++++++
+ 1 files changed, 45 insertions(+), 0 deletions(-)
+
+diff --git a/sound/soc/omap/omap3beagle.c b/sound/soc/omap/omap3beagle.c
+index 248b789..8b2d9e4 100644
+--- a/sound/soc/omap/omap3beagle.c
++++ b/sound/soc/omap/omap3beagle.c
+@@ -20,7 +20,10 @@
+ */
+
+ #include <linux/clk.h>
++#include <linux/irq.h>
++#include <linux/interrupt.h>
+ #include <linux/platform_device.h>
++
+ #include <sound/core.h>
+ #include <sound/pcm.h>
+ #include <sound/soc.h>
+@@ -35,6 +38,9 @@
+ #include "omap-pcm.h"
+ #include "../codecs/twl4030.h"
+
++#define TB_HEADPHONE_GPIO 56
++#define TB_HEADPHONE_IRQ OMAP_GPIO_IRQ(TB_HEADPHONE_GPIO)
++
+ static int omap3beagle_hw_params(struct snd_pcm_substream *substream,
+ struct snd_pcm_hw_params *params)
+ {
+@@ -113,6 +119,33 @@ static struct snd_soc_device omap3beagle_snd_devdata = {
+
+ static struct platform_device *omap3beagle_snd_device;
+
++static void jack_work_func(struct work_struct *wq)
++{
++ struct snd_soc_device *socdev = platform_get_drvdata(omap3beagle_snd_device);
++ struct snd_soc_codec *codec = socdev->card->codec;
++
++ snd_soc_dapm_sync(codec);
++}
++DECLARE_WORK(jack_work, jack_work_func);
++
++static irqreturn_t touchbook_headphone_event(int irq, void *snd)
++{
++ int status = gpio_get_value(TB_HEADPHONE_GPIO);
++ struct snd_soc_device *socdev = platform_get_drvdata(omap3beagle_snd_device);
++ struct snd_soc_codec *codec = socdev->card->codec;
++
++ if(status) {
++ snd_soc_dapm_disable_pin(codec, "HFL");
++ snd_soc_dapm_disable_pin(codec, "HFR");
++ } else {
++ snd_soc_dapm_enable_pin(codec, "HFL");
++ snd_soc_dapm_enable_pin(codec, "HFR");
++ }
++
++ schedule_work(&jack_work);
++ return IRQ_HANDLED;
++}
++
+ static int __init omap3beagle_soc_init(void)
+ {
+ int ret;
+@@ -133,10 +166,22 @@ static int __init omap3beagle_soc_init(void)
+ omap3beagle_snd_devdata.dev = &omap3beagle_snd_device->dev;
+ *(unsigned int *)omap3beagle_dai.cpu_dai->private_data = 1; /* McBSP2 */
+
++ /* Touch Book -- headphone jack sensor */
++ omap_set_gpio_debounce(TB_HEADPHONE_GPIO, 1);
++ omap_set_gpio_debounce_time(TB_HEADPHONE_GPIO, 0xff);
++
++ ret = request_irq(TB_HEADPHONE_IRQ, touchbook_headphone_event, IRQF_TRIGGER_RISING |
++ IRQF_TRIGGER_FALLING, "touchbook_headphone", omap3beagle_snd_device);
++ if (ret < 0)
++ goto err1;
++
+ ret = platform_device_add(omap3beagle_snd_device);
+ if (ret)
+ goto err1;
+
++ /* Detect headphone status */
++ touchbook_headphone_event(0, omap3beagle_snd_device);
++
+ return 0;
+
+ err1:
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-psp-2.6.32/omap3-touchbook/0011-DSS2-Fix-scaling-checks-when-rotation-is-90-or-270-d.patch b/recipes/linux/linux-omap-psp-2.6.32/omap3-touchbook/0011-DSS2-Fix-scaling-checks-when-rotation-is-90-or-270-d.patch
new file mode 100644
index 0000000000..5045500656
--- /dev/null
+++ b/recipes/linux/linux-omap-psp-2.6.32/omap3-touchbook/0011-DSS2-Fix-scaling-checks-when-rotation-is-90-or-270-d.patch
@@ -0,0 +1,52 @@
+From 0f0b6b8dbe24f34d0442a734302b0c406bad8f74 Mon Sep 17 00:00:00 2001
+From: Tim Yamin <plasm@roo.me.uk>
+Date: Fri, 12 Mar 2010 13:57:38 +0100
+Subject: [PATCH 11/14] DSS2: Fix scaling checks when rotation is 90 or 270 degrees.
+
+---
+ drivers/video/omap2/dss/dispc.c | 25 +++++++++++++++++++------
+ 1 files changed, 19 insertions(+), 6 deletions(-)
+
+diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
+index c6d5fc5..8da571e 100644
+--- a/drivers/video/omap2/dss/dispc.c
++++ b/drivers/video/omap2/dss/dispc.c
+@@ -1563,16 +1563,29 @@ static int _dispc_setup_plane(enum omap_plane plane,
+ }
+ } else {
+ /* video plane */
+-
++ u8 error = 0;
+ unsigned long fclk = 0;
+
+- if (out_width < width / maxdownscale ||
+- out_width > width * 8)
+- return -EINVAL;
++ if(rotation == 1 || rotation == 3)
++ {
++ if (out_width < height / maxdownscale || out_width > height * 8)
++ error = 1;
++
++ if (out_height < width / maxdownscale || out_height > width * 8)
++ error = 1;
++ } else {
++ if (out_width < width / maxdownscale || out_width > width * 8)
++ error = 1;
+
+- if (out_height < height / maxdownscale ||
+- out_height > height * 8)
++ if (out_height < height / maxdownscale || out_height > height * 8)
++ error = 1;
++ }
++
++ if(error != 0)
++ {
++ printk("DSS: Unable to down/up scale video plane\n");
+ return -EINVAL;
++ }
+
+ switch (color_mode) {
+ case OMAP_DSS_COLOR_RGBX32:
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-psp-2.6.32/omap3-touchbook/0012-add-touchbook-hid-driver.patch b/recipes/linux/linux-omap-psp-2.6.32/omap3-touchbook/0012-add-touchbook-hid-driver.patch
new file mode 100644
index 0000000000..d08cb45d3f
--- /dev/null
+++ b/recipes/linux/linux-omap-psp-2.6.32/omap3-touchbook/0012-add-touchbook-hid-driver.patch
@@ -0,0 +1,339 @@
+From b41b53e9a9dc56a75b548e1fa73570569fe12d7e Mon Sep 17 00:00:00 2001
+From: Gregoire Gentil <gregoire@gentil.com>
+Date: Fri, 12 Mar 2010 14:39:07 +0100
+Subject: [PATCH 12/14] add touchbook hid driver
+
+---
+ drivers/hid/Kconfig | 7 ++
+ drivers/hid/Makefile | 1 +
+ drivers/hid/hid-ai.c | 260 ++++++++++++++++++++++++++++++++++++++++++++++++
+ drivers/hid/hid-core.c | 1 +
+ drivers/hid/hid-ids.h | 3 +
+ 5 files changed, 272 insertions(+), 0 deletions(-)
+ create mode 100644 drivers/hid/hid-ai.c
+
+diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig
+index 24d90ea..3760565 100644
+--- a/drivers/hid/Kconfig
++++ b/drivers/hid/Kconfig
+@@ -62,6 +62,13 @@ config HID_A4TECH
+ ---help---
+ Support for A4 tech X5 and WOP-35 / Trust 450L mice.
+
++config HID_AI
++ tristate "Always Innovating" if EMBEDDED
++ depends on USB_HID
++ default !EMBEDDED
++ ---help---
++ Support for Always Innovating Touch Book.
++
+ config HID_APPLE
+ tristate "Apple" if EMBEDDED
+ depends on (USB_HID || BT_HIDP)
+diff --git a/drivers/hid/Makefile b/drivers/hid/Makefile
+index 0de2dff..1787952 100644
+--- a/drivers/hid/Makefile
++++ b/drivers/hid/Makefile
+@@ -20,6 +20,7 @@ ifdef CONFIG_LOGIRUMBLEPAD2_FF
+ endif
+
+ obj-$(CONFIG_HID_A4TECH) += hid-a4tech.o
++obj-$(CONFIG_HID_AI) += hid-ai.o
+ obj-$(CONFIG_HID_APPLE) += hid-apple.o
+ obj-$(CONFIG_HID_BELKIN) += hid-belkin.o
+ obj-$(CONFIG_HID_CHERRY) += hid-cherry.o
+diff --git a/drivers/hid/hid-ai.c b/drivers/hid/hid-ai.c
+new file mode 100644
+index 0000000..83aecaf
+--- /dev/null
++++ b/drivers/hid/hid-ai.c
+@@ -0,0 +1,260 @@
++/*
++ * USB HID quirks support for the Always Innovating Touch Book
++ * Code borrowed from hid-apple.c
++ *
++ * Copyright (c) 2009 Tim Yamin <plasm@roo.me.uk>
++ */
++
++/*
++ * This program 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.
++ */
++
++#include <linux/device.h>
++#include <linux/hid.h>
++#include <linux/module.h>
++#include <linux/usb.h>
++
++#include "hid-ids.h"
++
++struct ai_sc {
++ unsigned long quirks;
++ unsigned int fn_on;
++ DECLARE_BITMAP(pressed_fn, KEY_CNT);
++};
++
++struct ai_key_translation {
++ u16 from;
++ u16 to;
++ u8 flags;
++};
++
++static struct ai_key_translation ai_fn_keys[] = {
++ { KEY_F6, KEY_BRIGHTNESSDOWN },
++ { KEY_F7, KEY_BRIGHTNESSUP },
++
++ { KEY_F8, KEY_MUTE },
++ { KEY_F9, KEY_VOLUMEDOWN },
++ { KEY_F10, KEY_VOLUMEUP },
++
++ { KEY_UP, KEY_PAGEUP },
++ { KEY_DOWN, KEY_PAGEDOWN },
++ { }
++};
++
++extern unsigned int ai_revision;
++int swap_key = 0;
++
++static struct ai_key_translation *ai_find_translation(
++ struct ai_key_translation *table, u16 from)
++{
++ struct ai_key_translation *trans;
++
++ /* Look for the translation */
++ for (trans = table; trans->from; trans++)
++ if (trans->from == from)
++ return trans;
++
++ return NULL;
++}
++
++static int ai_event(struct hid_device *hid, struct hid_field *field,
++ struct hid_usage *usage, __s32 value)
++{
++ int do_translate;
++
++ struct input_dev *input = field->hidinput->input;
++ struct ai_sc *asc = hid_get_drvdata(hid);
++ struct ai_key_translation *trans;
++
++ if (swap_key && usage->code == KEY_RIGHTSHIFT) {
++ input_event(input, usage->type, KEY_END, value);
++ return 1;
++ }
++
++ if (swap_key && usage->code == KEY_END) {
++ input_event(input, usage->type, KEY_RIGHTSHIFT, value);
++ return 1;
++ }
++
++ if (usage->code == KEY_POWER) {
++ asc->fn_on = !!value;
++ input_event(input, usage->type, usage->code, value);
++ return 1;
++ }
++
++ trans = ai_find_translation(ai_fn_keys, usage->code);
++ if (trans) {
++ if (test_bit(usage->code, asc->pressed_fn))
++ do_translate = 1;
++ else
++ do_translate = asc->fn_on;
++
++ if (do_translate) {
++ if (value)
++ set_bit(usage->code, asc->pressed_fn);
++ else
++ clear_bit(usage->code, asc->pressed_fn);
++
++ input_event(input, usage->type, trans->to,
++ value);
++
++ return 1;
++ }
++ }
++
++ return 0;
++}
++
++static int ai_input_mapping(struct hid_device *hdev, struct hid_input *hi,
++ struct hid_field *field, struct hid_usage *usage,
++ unsigned long **bit, int *max)
++{
++ struct ai_key_translation *trans;
++
++ /* Enable all other keys */
++ for (trans = ai_fn_keys; trans->from; trans++)
++ set_bit(trans->to, hi->input->keybit);
++
++ return 0;
++}
++
++static ssize_t show_swap_key(struct device *dev,
++ struct device_attribute *attr, char *buf)
++{
++ return snprintf(buf, PAGE_SIZE, "%d\n", swap_key);
++}
++
++static ssize_t store_swap_key(struct device *dev,
++ struct device_attribute *attr,
++ const char *buf, size_t count)
++{
++ swap_key = simple_strtoul(buf, NULL, 0);
++
++ if (swap_key != 0 && swap_key != 1) {
++ swap_key = 0;
++ return -EINVAL;
++ }
++
++ return count;
++}
++
++static struct device_attribute ai_hid_attrs[] = {
++ __ATTR(swap_key, S_IRUGO | S_IWUGO, show_swap_key, store_swap_key),
++};
++
++int ai_create_sysfs(struct hid_device *hdev)
++{
++ int i;
++ int r;
++
++ for (i = 0; i < ARRAY_SIZE(ai_hid_attrs); i++) {
++ r = device_create_file(&hdev->dev,
++ &ai_hid_attrs[i]);
++
++ if (r) {
++ dev_err(&hdev->dev, "failed to create sysfs file\n");
++ return r;
++ }
++ }
++
++ return 0;
++}
++
++void ai_remove_sysfs(struct hid_device *hdev)
++{
++ int i;
++
++ for (i = 0; i < ARRAY_SIZE(ai_hid_attrs); i++)
++ device_remove_file(&hdev->dev,
++ &ai_hid_attrs[i]);
++}
++
++static int ai_probe(struct hid_device *hdev,
++ const struct hid_device_id *id)
++{
++ unsigned long quirks = id->driver_data;
++ struct ai_sc *asc;
++ unsigned int connect_mask = HID_CONNECT_DEFAULT;
++ int ret;
++
++ asc = kzalloc(sizeof(*asc), GFP_KERNEL);
++ if (asc == NULL) {
++ dev_err(&hdev->dev, "can't alloc ai descriptor\n");
++ return -ENOMEM;
++ }
++
++ asc->quirks = quirks;
++ hid_set_drvdata(hdev, asc);
++
++ ret = hid_parse(hdev);
++ if (ret) {
++ dev_err(&hdev->dev, "parse failed\n");
++ goto err_free;
++ }
++
++ ret = ai_create_sysfs(hdev);
++ if (ret) {
++ dev_err(&hdev->dev, "failed to create sysfs entries\n");
++ goto err_free;
++ }
++
++ swap_key = (ai_revision >= 4) ? 1 : 0;
++
++ ret = hid_hw_start(hdev, connect_mask);
++ if (ret) {
++ dev_err(&hdev->dev, "hw start failed\n");
++ goto err_free;
++ }
++
++ return 0;
++err_free:
++ kfree(asc);
++ return ret;
++}
++
++static void ai_remove(struct hid_device *hdev)
++{
++ hid_hw_stop(hdev);
++ kfree(hid_get_drvdata(hdev));
++ ai_remove_sysfs(hdev);
++}
++
++static const struct hid_device_id ai_devices[] = {
++ { HID_USB_DEVICE(USB_VENDOR_ID_AI, USB_DEVICE_ID_AI_TOUCH_BOOK) },
++ { }
++};
++
++MODULE_DEVICE_TABLE(hid, ai_devices);
++
++static struct hid_driver ai_driver = {
++ .name = "ai",
++ .id_table = ai_devices,
++ .probe = ai_probe,
++ .remove = ai_remove,
++ .event = ai_event,
++ .input_mapping = ai_input_mapping,
++};
++
++static int ai_init(void)
++{
++ int ret;
++
++ ret = hid_register_driver(&ai_driver);
++ if (ret)
++ printk(KERN_ERR "can't register ai driver\n");
++
++ return ret;
++}
++
++static void ai_exit(void)
++{
++ hid_unregister_driver(&ai_driver);
++}
++
++module_init(ai_init);
++module_exit(ai_exit);
++MODULE_LICENSE("GPL");
++HID_COMPAT_LOAD_DRIVER(ai);
+diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
+index 80792d3..f6b5960 100644
+--- a/drivers/hid/hid-core.c
++++ b/drivers/hid/hid-core.c
+@@ -1250,6 +1250,7 @@ EXPORT_SYMBOL_GPL(hid_disconnect);
+ static const struct hid_device_id hid_blacklist[] = {
+ { HID_USB_DEVICE(USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_WCP32PU) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_X5_005D) },
++ { HID_USB_DEVICE(USB_VENDOR_ID_AI, USB_DEVICE_ID_AI_TOUCH_BOOK) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ATV_IRCONTROL) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_IRCONTROL4) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MIGHTYMOUSE) },
+diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
+index 3839340..5a0127d 100644
+--- a/drivers/hid/hid-ids.h
++++ b/drivers/hid/hid-ids.h
+@@ -54,6 +54,9 @@
+ #define USB_VENDOR_ID_ALPS 0x0433
+ #define USB_DEVICE_ID_IBM_GAMEPAD 0x1101
+
++#define USB_VENDOR_ID_AI 0xa110
++#define USB_DEVICE_ID_AI_TOUCH_BOOK 0x0002
++
+ #define USB_VENDOR_ID_APPLE 0x05ac
+ #define USB_DEVICE_ID_APPLE_MIGHTYMOUSE 0x0304
+ #define USB_DEVICE_ID_APPLE_FOUNTAIN_ANSI 0x020e
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-psp-2.6.32/omap3-touchbook/0013-Make-backlight-controls-accessible-to-users.patch b/recipes/linux/linux-omap-psp-2.6.32/omap3-touchbook/0013-Make-backlight-controls-accessible-to-users.patch
new file mode 100644
index 0000000000..138de0b1b4
--- /dev/null
+++ b/recipes/linux/linux-omap-psp-2.6.32/omap3-touchbook/0013-Make-backlight-controls-accessible-to-users.patch
@@ -0,0 +1,25 @@
+From c109db2ee2bca2bdc3af243afda91a96bbd1726f Mon Sep 17 00:00:00 2001
+From: Gregoire Gentil <gregroire@gentil.com>
+Date: Fri, 12 Mar 2010 14:41:05 +0100
+Subject: [PATCH 13/14] Make backlight controls accessible to users
+
+---
+ drivers/video/backlight/backlight.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c
+index 6615ac7..7898707 100644
+--- a/drivers/video/backlight/backlight.c
++++ b/drivers/video/backlight/backlight.c
+@@ -228,7 +228,7 @@ static void bl_device_release(struct device *dev)
+
+ static struct device_attribute bl_device_attributes[] = {
+ __ATTR(bl_power, 0644, backlight_show_power, backlight_store_power),
+- __ATTR(brightness, 0644, backlight_show_brightness,
++ __ATTR(brightness, 0666, backlight_show_brightness,
+ backlight_store_brightness),
+ __ATTR(actual_brightness, 0444, backlight_show_actual_brightness,
+ NULL),
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-psp-2.6.32/omap3-touchbook/0014-ads7846-don-t-error-out-when-there-s-no-pendown-gpio.patch b/recipes/linux/linux-omap-psp-2.6.32/omap3-touchbook/0014-ads7846-don-t-error-out-when-there-s-no-pendown-gpio.patch
new file mode 100644
index 0000000000..84de1b7456
--- /dev/null
+++ b/recipes/linux/linux-omap-psp-2.6.32/omap3-touchbook/0014-ads7846-don-t-error-out-when-there-s-no-pendown-gpio.patch
@@ -0,0 +1,30 @@
+From 6506ac2dc19a3b010078fb6a36522aba0b82f28c Mon Sep 17 00:00:00 2001
+From: Gregoire Gentil <gregoire@gentil.com>
+Date: Fri, 12 Mar 2010 15:04:58 +0100
+Subject: [PATCH 14/14] ads7846: don't error out when there's no pendown gpio
+
+---
+ drivers/input/touchscreen/ads7846.c | 7 -------
+ 1 files changed, 0 insertions(+), 7 deletions(-)
+
+diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
+index 1d9f97c..c72c3ae 100644
+--- a/drivers/input/touchscreen/ads7846.c
++++ b/drivers/input/touchscreen/ads7846.c
+@@ -952,13 +952,6 @@ static int __devinit setup_pendown(struct spi_device *spi, struct ads7846 *ts)
+ return 0;
+ }
+
+- err = gpio_request(pdata->gpio_pendown, "ads7846_pendown");
+- if (err) {
+- dev_err(&spi->dev, "failed to request pendown GPIO%d\n",
+- pdata->gpio_pendown);
+- return err;
+- }
+-
+ ts->gpio_pendown = pdata->gpio_pendown;
+ return 0;
+ }
+--
+1.6.6.1
+
diff --git a/recipes/linux/linux-omap-psp-2.6.32/omap3-touchbook/defconfig b/recipes/linux/linux-omap-psp-2.6.32/omap3-touchbook/defconfig
index acb4a06f10..8efccecc11 100644
--- a/recipes/linux/linux-omap-psp-2.6.32/omap3-touchbook/defconfig
+++ b/recipes/linux/linux-omap-psp-2.6.32/omap3-touchbook/defconfig
@@ -57,7 +57,7 @@ CONFIG_RCU_FANOUT=32
# CONFIG_TREE_RCU_TRACE is not set
CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y
-CONFIG_LOG_BUF_SHIFT=14
+CONFIG_LOG_BUF_SHIFT=15
CONFIG_GROUP_SCHED=y
CONFIG_FAIR_GROUP_SCHED=y
# CONFIG_RT_GROUP_SCHED is not set
@@ -262,11 +262,10 @@ CONFIG_OMAP_PACKAGE_CBB=y
#
# OMAP Board Type
#
-CONFIG_MACH_OMAP3_BEAGLE=y
+# CONFIG_MACH_OMAP3_BEAGLE is not set
# CONFIG_MACH_OMAP_LDP is not set
# CONFIG_MACH_OVERO is not set
-CONFIG_MACH_OMAP3EVM=y
-CONFIG_PMIC_TWL4030=y
+# CONFIG_MACH_OMAP3EVM is not set
# CONFIG_MACH_OMAP3517EVM is not set
# CONFIG_MACH_OMAP3_PANDORA is not set
CONFIG_MACH_OMAP3_TOUCHBOOK=y
@@ -307,7 +306,7 @@ CONFIG_ARM_THUMBEE=y
# CONFIG_CPU_BPREDICT_DISABLE is not set
CONFIG_HAS_TLS_REG=y
CONFIG_ARM_L1_CACHE_SHIFT=6
-# CONFIG_ARM_ERRATA_430973 is not set
+CONFIG_ARM_ERRATA_430973=y
# CONFIG_ARM_ERRATA_458693 is not set
# CONFIG_ARM_ERRATA_460075 is not set
CONFIG_COMMON_CLKDEV=y
@@ -912,7 +911,8 @@ CONFIG_NET_9P=m
# Generic Driver Options
#
CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
-# CONFIG_DEVTMPFS is not set
+CONFIG_DEVTMPFS=y
+CONFIG_DEVTMPFS_MOUNT=y
CONFIG_STANDALONE=y
CONFIG_PREVENT_FIRMWARE_BUILD=y
CONFIG_FW_LOADER=y
@@ -1170,9 +1170,11 @@ CONFIG_P54_LEDS=y
CONFIG_RT2X00=y
CONFIG_RT2500USB=y
CONFIG_RT73USB=y
-# CONFIG_RT2800USB is not set
+CONFIG_RT2800USB=y
+CONFIG_RT2800_LIB=y
CONFIG_RT2X00_LIB_USB=y
CONFIG_RT2X00_LIB=y
+CONFIG_RT2X00_LIB_HT=y
CONFIG_RT2X00_LIB_FIRMWARE=y
CONFIG_RT2X00_LIB_CRYPTO=y
CONFIG_RT2X00_LIB_LEDS=y
@@ -1325,12 +1327,13 @@ CONFIG_INPUT_MISC=y
# CONFIG_INPUT_ATI_REMOTE is not set
# CONFIG_INPUT_ATI_REMOTE2 is not set
# CONFIG_INPUT_KEYSPAN_REMOTE is not set
-# CONFIG_INPUT_POWERMATE is not set
+CONFIG_INPUT_POWERMATE=m
# CONFIG_INPUT_YEALINK is not set
# CONFIG_INPUT_CM109 is not set
CONFIG_INPUT_TWL4030_PWRBUTTON=y
CONFIG_INPUT_UINPUT=y
# CONFIG_INPUT_GPIO_ROTARY_ENCODER is not set
+CONFIG_INPUT_MMA7455L=y
#
# Hardware I/O ports
@@ -1592,6 +1595,7 @@ CONFIG_MFD_CORE=y
CONFIG_TWL4030_CORE=y
# CONFIG_TWL4030_POWER is not set
CONFIG_TWL4030_CODEC=y
+# CONFIG_TWL4030_MADC is not set
# CONFIG_MFD_TMIO is not set
# CONFIG_MFD_T7L66XB is not set
# CONFIG_MFD_TC6387XB is not set
@@ -1708,6 +1712,7 @@ CONFIG_VIDEO_KS0127=m
CONFIG_VIDEO_MT9V011=m
CONFIG_VIDEO_TCM825X=m
CONFIG_VIDEO_MT9P012=m
+# CONFIG_VIDEO_MT9T111 is not set
CONFIG_VIDEO_DW9710=m
# CONFIG_VIDEO_OV3640 is not set
CONFIG_VIDEO_IMX046=m
@@ -1991,6 +1996,8 @@ CONFIG_FB_OMAP2_NUM_FBS=3
# OMAP2/3 Display Device Drivers
#
CONFIG_PANEL_GENERIC=y
+# CONFIG_PANEL_LGPHILIPS_LB035Q02 is not set
+# CONFIG_PANEL_SAMSUNG_LTE430WQ_F0C is not set
CONFIG_PANEL_SHARP_LS037V7DW01=y
CONFIG_PANEL_SHARP_LQ043T1DG01=y
# CONFIG_PANEL_TAAL is not set
@@ -2055,7 +2062,7 @@ CONFIG_SND_RAWMIDI_SEQ=m
# CONFIG_SND_EMU10K1_SEQ is not set
CONFIG_SND_DRIVERS=y
# CONFIG_SND_DUMMY is not set
-# CONFIG_SND_VIRMIDI is not set
+CONFIG_SND_VIRMIDI=m
# CONFIG_SND_MTPAV is not set
# CONFIG_SND_SERIAL_U16550 is not set
# CONFIG_SND_MPU401 is not set
@@ -2068,8 +2075,7 @@ CONFIG_SND_USB_CAIAQ_INPUT=y
CONFIG_SND_SOC=y
CONFIG_SND_OMAP_SOC=y
CONFIG_SND_OMAP_SOC_MCBSP=y
-CONFIG_SND_OMAP_SOC_OMAP3EVM=y
-CONFIG_SND_OMAP_SOC_OMAP3_BEAGLE=y
+CONFIG_SND_OMAP_SOC_OMAP3_TOUCHBOOK=y
CONFIG_SND_SOC_I2C_AND_SPI=y
# CONFIG_SND_SOC_ALL_CODECS is not set
CONFIG_SND_SOC_TWL4030=y
@@ -2089,6 +2095,7 @@ CONFIG_USB_HID=y
# Special HID drivers
#
CONFIG_HID_A4TECH=y
+CONFIG_HID_AI=y
CONFIG_HID_APPLE=y
CONFIG_HID_BELKIN=y
CONFIG_HID_CHERRY=y
@@ -2423,7 +2430,7 @@ CONFIG_RTC_INTF_DEV=y
#
# I2C RTC drivers
#
-# CONFIG_RTC_DRV_DS1307 is not set
+CONFIG_RTC_DRV_DS1307=y
# CONFIG_RTC_DRV_DS1374 is not set
# CONFIG_RTC_DRV_DS1672 is not set
# CONFIG_RTC_DRV_MAX6900 is not set
@@ -2489,12 +2496,23 @@ CONFIG_W35UND=m
CONFIG_PRISM2_USB=m
# CONFIG_ECHO is not set
CONFIG_OTUS=m
+CONFIG_RT2870=y
# CONFIG_COMEDI is not set
# CONFIG_ASUS_OLED is not set
# CONFIG_INPUT_MIMIO is not set
# CONFIG_TRANZPORT is not set
#
+# Android
+#
+CONFIG_ANDROID=y
+CONFIG_ANDROID_BINDER_IPC=y
+CONFIG_ANDROID_LOGGER=y
+# CONFIG_ANDROID_RAM_CONSOLE is not set
+# CONFIG_ANDROID_TIMED_OUTPUT is not set
+# CONFIG_ANDROID_LOW_MEMORY_KILLER is not set
+
+#
# Qualcomm MSM Camera And Video
#
@@ -2519,6 +2537,15 @@ CONFIG_OTUS=m
# CONFIG_RAMZSWAP is not set
# CONFIG_BATMAN_ADV is not set
# CONFIG_STRIP is not set
+CONFIG_MPU_BRIDGE=m
+# CONFIG_BRIDGE_DVFS is not set
+CONFIG_BRIDGE_MEMPOOL_SIZE=0x600000
+# CONFIG_BRIDGE_DEBUG is not set
+
+#
+# Bridge Notifications
+#
+# CONFIG_BRIDGE_NTFY_PWRERR is not set
#
# CBUS support
@@ -2680,6 +2707,21 @@ CONFIG_SYSV_FS=m
CONFIG_UFS_FS=m
# CONFIG_UFS_FS_WRITE is not set
# CONFIG_UFS_DEBUG is not set
+CONFIG_AUFS_FS=y
+CONFIG_AUFS_BRANCH_MAX_127=y
+# CONFIG_AUFS_BRANCH_MAX_511 is not set
+# CONFIG_AUFS_BRANCH_MAX_1023 is not set
+# CONFIG_AUFS_BRANCH_MAX_32767 is not set
+# CONFIG_AUFS_HINOTIFY is not set
+# CONFIG_AUFS_RDU is not set
+# CONFIG_AUFS_SP_IATTR is not set
+# CONFIG_AUFS_SHWH is not set
+# CONFIG_AUFS_BR_RAMFS is not set
+# CONFIG_AUFS_BR_FUSE is not set
+# CONFIG_AUFS_BR_HFSPLUS is not set
+CONFIG_AUFS_BDEV_LOOP=y
+CONFIG_AUFS_DEBUG=y
+CONFIG_AUFS_MAGIC_SYSRQ=y
CONFIG_NETWORK_FILESYSTEMS=y
CONFIG_NFS_FS=y
CONFIG_NFS_V3=y
diff --git a/recipes/linux/linux-omap-psp_2.6.32.bb b/recipes/linux/linux-omap-psp_2.6.32.bb
index 9aa981b822..27e40e06dc 100644
--- a/recipes/linux/linux-omap-psp_2.6.32.bb
+++ b/recipes/linux/linux-omap-psp_2.6.32.bb
@@ -6,7 +6,7 @@ KERNEL_IMAGETYPE = "uImage"
COMPATIBLE_MACHINE = "beagleboard|omap3evm|am3517-evm|omap3-touchbook|overo"
# This tag is v2.6.32_OMAPPSP_03.00.00.05
-SRCREV = "227037c2b6c28a632e0bffd2681445a61c7f84bc"
+SRCREV = "da0c86a8f3bd57fad0ccd05eb1b5e3326d7f36aa"
# The main PR is now using MACHINE_KERNEL_PR, for omap3 see conf/machine/include/omap3.inc
MACHINE_KERNEL_PR_append = "+gitr${SRCREV}"
@@ -51,6 +51,23 @@ SRC_URI = "git://arago-project.org/git/people/sriram/ti-psp-omap.git;protocol=gi
SRC_URI_append_beagleboard = " file://logo_linux_clut224.ppm \
"
+SRC_URI_append_omap3-touchbook = " \
+ file://0001-ARM-OMAP-add-spi-platform-devices.patch;patch=1 \
+ file://0002-MMA7455L-accelerometer-driver.patch;patch=1 \
+ file://0003-bq27x00_battery-remove-error-message-output.patch;patch=1 \
+ file://0004-bq27x00_battery-add-charged-gpio.patch;patch=1 \
+ file://0005-ARM-OMAP-Hack-beagle-asoc-driver-to-support-touchboo.patch;patch=1 \
+ file://0006-ARM-OMAP-omap3-touchbook-update-boardfile.patch;patch=1 \
+ file://0007-adf7846-add-more-debugging.patch;patch=1 \
+ file://0008-ads7846-read-max-mix-x-y-from-pdata.patch;patch=1 \
+ file://0009-ads7846-add-settling-delay-to-pdata.patch;patch=1 \
+ file://0010-Touch-Book-turn-on-off-the-class-D-amplifier-dependi.patch;patch=1 \
+ file://0011-DSS2-Fix-scaling-checks-when-rotation-is-90-or-270-d.patch;patch=1 \
+ file://0012-add-touchbook-hid-driver.patch;patch=1 \
+ file://0013-Make-backlight-controls-accessible-to-users.patch;patch=1 \
+ file://0014-ads7846-don-t-error-out-when-there-s-no-pendown-gpio.patch;patch=1 \
+"
+
addtask quiltfixup before do_patch after do_unpack
do_quiltfixup() {
rm ${S}/.pc -rf