summaryrefslogtreecommitdiff
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)
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