omapzoom isn't working again

2008-08-30 Thread Felipe Balbi
Tried cloning right and it's not working again.

someone has to run git update-server-info.
chmod +x .git/hooks/post-update would be cooler though.

-- 
balbi
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RESEND][PATCH 2/2] BRIDGE checkpatch cleanup

2008-08-30 Thread Ramirez Luna, Omar
From: Omar Ramirez Luna [EMAIL PROTECTED]
Date: Fri, 29 Aug 2008 21:20:39 -0500
Subject: [PATCH] Bridge Checkpatch Cleanup

Deleted unused function typedefs and structures associated with them

Signed-off-by: Fernando Guzman Lugo [EMAIL PROTECTED]
Signed-off-by: Omar Ramirez Luna [EMAIL PROTECTED]
---
 arch/arm/plat-omap/include/mach/bridge/_chnl_sm.h  |2 -
 arch/arm/plat-omap/include/mach/bridge/cod.h   |   63 +
 arch/arm/plat-omap/include/mach/bridge/dbldefs.h   |  366 +---
 arch/arm/plat-omap/include/mach/bridge/dblldefs.h  |4 -
 arch/arm/plat-omap/include/mach/bridge/dev.h   |   21 +-
 arch/arm/plat-omap/include/mach/bridge/dldr.h  |   75 
 arch/arm/plat-omap/include/mach/bridge/dldrdefs.h  |  315 -
 .../arm/plat-omap/include/mach/bridge/getsection.h |5 +-
 arch/arm/plat-omap/include/mach/bridge/isr.h   |   65 
 arch/arm/plat-omap/include/mach/bridge/prcs.h  |   17 +-
 arch/arm/plat-omap/include/mach/bridge/rmstypes.h  |1 -
 drivers/dsp/bridge/hw/GlobalTypes.h|7 +-
 drivers/dsp/bridge/wmd/_msg_sm.h   |8 +-
 13 files changed, 11 insertions(+), 938 deletions(-)
 delete mode 100644 arch/arm/plat-omap/include/mach/bridge/dldr.h
 delete mode 100644 arch/arm/plat-omap/include/mach/bridge/dldrdefs.h

diff --git a/arch/arm/plat-omap/include/mach/bridge/_chnl_sm.h 
b/arch/arm/plat-omap/include/mach/bridge/_chnl_sm.h
index 4bc2633..f6a6c69 100644
--- a/arch/arm/plat-omap/include/mach/bridge/_chnl_sm.h
+++ b/arch/arm/plat-omap/include/mach/bridge/_chnl_sm.h
@@ -110,8 +110,6 @@ struct loadMonStruct {

 #endif

-   typedef u32 SMWORD;
-
enum SHM_DESCTYPE {
SHM_CURROPP = 0,
SHM_OPPINFO = 1,
diff --git a/arch/arm/plat-omap/include/mach/bridge/cod.h 
b/arch/arm/plat-omap/include/mach/bridge/cod.h
index 700efb6..6a37da7 100644
--- a/arch/arm/plat-omap/include/mach/bridge/cod.h
+++ b/arch/arm/plat-omap/include/mach/bridge/cod.h
@@ -105,27 +105,6 @@
 void *pBuf, u32 ulNumBytes,
 u32 nMemSpace);

-   typedef bool(CDECL *COD_ALLOCFXN) (void *pPrivRef, u32 space,
-   u32 ulNumBytes, u32 ulAlign,
-   u32 *ulDspAddr, bool fReserved);
-
-   typedef bool(CDECL *COD_FREEFXN) (void *pPrivReg, u32 ulDspAddr,
-  u32 space, u32 ulNumBytes,
-  bool fReserved);
-
-/*
- *   COD_LOADATTRS 
- *
- *  Attributes that specify alloc, free, and write functions when loading
- *  or unloading a section.
- */
-struct COD_LOADATTRS {
-   void *pWHandle; /* Handle to pass to write fxn */
-   void *pAHandle; /* Handle to pass to alloc/free fxns */
-   COD_WRITEFXN pfnWrite;
-   COD_ALLOCFXN pfnAlloc;
-   COD_FREEFXN pfnFree;
-   } ;

 /*
  *   COD_Close 
@@ -377,27 +356,6 @@
 COD_WRITEFXN pfnWrite, void *pArb,
 char *envp[]);

-/*
- *   COD_LoadSection 
- *  Purpose:
- *  Load a named section in the COFF file. (For overlay support).
- *  Parameters:
- *  hManager:   COD manager.
- *  pstrSect:   Name of the section, with or without leading .
- *  pAttrs: Specifies alloc, free, and write function.
- *  Returns:
- *  DSP_SOK:Success
- *  DSP_EFWRITE:Failed to write section to target.
- *  Requires:
- *  COD module initialized.
- *  valid hManager.
- *  pstrSect != NULL;
- *  Ensures:
- *
- */
-   extern DSP_STATUS CDECL COD_LoadSection(struct COD_MANAGER *hManager,
- IN char *pstrSect,
- IN struct COD_LOADATTRS *pAttrs);

 /*
  *   COD_Open 
@@ -470,25 +428,6 @@ extern DSP_STATUS COD_OpenBase(struct COD_MANAGER *hMgr, 
IN char *pszCoffPath,
OUT char *pstrContent,
IN u32 cContentSize);

-/*
- *   COD_UnloadSection 
- *  Purpose:
- *  Unload a named section in the COFF file. (For overlay support).
- *  Parameters:
- *  hManager:   COD manager.
- *  pstrSect:   name of the section, with or without leading .
- *  pAttrs: Specifies free function.
- *  Returns:
- *  DSP_SOK:Success.
- *  Requires:
- *  COD module initialized.
- *  valid hManager.
- *  pstrSect != NULL;
- *  Ensures:
- *
- */
-   extern DSP_STATUS CDECL COD_UnloadSection(struct COD_MANAGER *hManager,
- IN char *pstrSect,
- IN struct COD_LOADATTRS *pAttrs);
+

 

[PATCH] arm: omap: fix build for 2430sdp

2008-08-30 Thread Felipe Balbi
From: Felipe Balbi [EMAIL PROTECTED]

Missing include file broke compilation for 2430sdp.

Signed-off-by: Felipe Balbi [EMAIL PROTECTED]
---
 arch/arm/mach-omap2/board-2430sdp.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-2430sdp.c 
b/arch/arm/mach-omap2/board-2430sdp.c
index 64e76e8..94e202d 100644
--- a/arch/arm/mach-omap2/board-2430sdp.c
+++ b/arch/arm/mach-omap2/board-2430sdp.c
@@ -20,6 +20,7 @@
 #include linux/mtd/partitions.h
 #include linux/delay.h
 #include linux/input.h
+#include linux/i2c/twl4030.h
 #include linux/err.h
 #include linux/clk.h
 #include linux/spi/spi.h
-- 
1.6.0.1.141.g445ca

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 00/34] omap drivers going upstream

2008-08-30 Thread Felipe Balbi
From: Felipe Balbi [EMAIL PROTECTED]

The following drivers are going upstream for integration.
They have been sitting on linux-omap for quite a while just
increasing the diff against mainline and probability of
merge conflicts.

Idealy, we would have people maintaining those drivers
but unfortunately it looks like it won't happen soon.

linux-omap will be kept on the loop so we can comment
on the patches and see the comments coming for the
proper mailing lists.

If anyone has objections to the patches, please say now
before I send them to mainline. I'm planning to send them
on next 9/11.

Here's the dirstat between l-o and mainline tree before
and after the patches:

before:

$ git diff --dirstat linus | sort -n
   3.2% drivers/input/keyboard/
   4.2% arch/arm/plat-omap/
   4.2% drivers/cbus/
   4.2% drivers/spi/
   4.8% sound/oss/
   6.0% drivers/i2c/chips/
   7.0% sound/arm/omap/
   7.2% drivers/media/video/
   8.4% drivers/dsp/dspgateway/
   9.0% arch/arm/configs/
  15.6% arch/arm/mach-omap2/
  20.6% drivers/

after:

$ git diff --dirstat linus | sort -n
   4.8% drivers/bluetooth/
   7.0% arch/arm/plat-omap/
   7.7% drivers/
   7.9% sound/oss/
  11.6% sound/arm/omap/
  13.9% drivers/dsp/dspgateway/
  14.9% arch/arm/configs/
  25.7% arch/arm/mach-omap2/

Felipe Balbi (33):
  add lp5521 driver
  Add cbus driver
  add omap-sha1 driver
  add omap gpio expander driver
  add tlv320aic23 driver
  add tsl2563 driver
  add twl4030 drivers
  add innovator ps2 keypad driver
  add lm8323 keypad driver
  Add twl4030 keypad driver
  add tsc2301 keypad driver
  Add tsc2005 touchscreen driver
  Add omap touchscreen driver
  add tsc210x touchscreen driver
  add tsc2301 touchscreen driver
  add omap led drivers
  add tea5761 radio driver
  add ov9640 sensor driver
  add omap video drivers
  add omap Serial Trace Interface driver
  add OMAP HighSpeed mmc controller driver
  add omap nand drivers
  add omap irda driver
  add bq27x00 battery driver
  add TWL4030 Battery Charger Interface driver
  add TWL4030 RealTime Clock driver
  add tsc210x driver
  add tsc2301 driver
  add omap ehci bus glue
  add omap backlight support
  add several omap lcd drivers
  add omap 1-wire interface driver
  add bq27000 1-wire slave driver

 arch/arm/mach-omap2/board-2430sdp.c |   59 +
 arch/arm/plat-omap/include/mach/irqs.h  |2 +
 arch/arm/plat-omap/include/mach/keypad.h|1 +
 drivers/Makefile|2 +-
 drivers/cbus/Kconfig|   89 ++
 drivers/cbus/Makefile   |   14 +
 drivers/cbus/cbus.c |  293 
 drivers/cbus/cbus.h |   36 +
 drivers/cbus/retu-headset.c |  355 +
 drivers/cbus/retu-pwrbutton.c   |  118 ++
 drivers/cbus/retu-rtc.c |  477 +++
 drivers/cbus/retu-user.c|  423 ++
 drivers/cbus/retu-wdt.c |  202 +++
 drivers/cbus/retu.c |  466 +++
 drivers/cbus/retu.h |   77 ++
 drivers/cbus/tahvo-usb.c|  777 +++
 drivers/cbus/tahvo-user.c   |  405 ++
 drivers/cbus/tahvo.c|  441 ++
 drivers/cbus/tahvo.h|   61 +
 drivers/cbus/user_retu_tahvo.h  |   75 ++
 drivers/crypto/Kconfig  |7 +
 drivers/crypto/Makefile |1 +
 drivers/crypto/omap-sha1-md5.c  |  575 
 drivers/i2c/chips/Kconfig   |   90 ++
 drivers/i2c/chips/Makefile  |   11 +-
 drivers/i2c/chips/gpio_expander_omap.c  |   71 +
 drivers/i2c/chips/lp5521.c  |  585 
 drivers/i2c/chips/tlv320aic23.c |  675 ++
 drivers/i2c/chips/tsl2563.c |  739 +++
 drivers/i2c/chips/twl4030-core.c| 1006 ++
 drivers/i2c/chips/twl4030-gpio.c|  788 +++
 drivers/i2c/chips/twl4030-madc.c|  455 +++
 drivers/i2c/chips/twl4030-poweroff.c|   76 ++
 drivers/i2c/chips/twl4030-pwrbutton.c   |  163 +++
 drivers/i2c/chips/twl4030-pwrirq.c  |  226 
 drivers/i2c/chips/twl4030-usb.c |  779 +++
 drivers/input/keyboard/Kconfig  |   33 +
 drivers/input/keyboard/Makefile |4 +
 drivers/input/keyboard/innovator_ps2.c  | 1280 ++
 drivers/input/keyboard/lm8323.c |  925 +
 drivers/input/keyboard/omap-twl4030keypad.c |  415 ++
 drivers/input/keyboard/tsc2301_kp.c |  475 +++
 drivers/input/keyboard/twl4030-keypad.h |   82 ++
 drivers/input/touchscreen/Kconfig   |   25 +
 drivers/input/touchscreen/Makefile  |4 +
 drivers/input/touchscreen/omap/Makefile |   10 +
 drivers/input/touchscreen/omap/omap_ts.c|  267 
 

[PATCH 01/33] add lp5521 driver

2008-08-30 Thread Felipe Balbi
From: Felipe Balbi [EMAIL PROTECTED]

Signed-off-by: Felipe Balbi [EMAIL PROTECTED]
---
 drivers/i2c/chips/Kconfig  |7 +
 drivers/i2c/chips/Makefile |2 +-
 drivers/i2c/chips/lp5521.c |  585 
 3 files changed, 593 insertions(+), 1 deletions(-)
 create mode 100644 drivers/i2c/chips/lp5521.c

diff --git a/drivers/i2c/chips/Kconfig b/drivers/i2c/chips/Kconfig
index a95cb94..193c3ae 100644
--- a/drivers/i2c/chips/Kconfig
+++ b/drivers/i2c/chips/Kconfig
@@ -162,6 +162,13 @@ config SENSORS_TSL2550
  This driver can also be built as a module.  If so, the module
  will be called tsl2550.
 
+config LP5521
+   tristate LP5521 LED driver chip
+   depends on I2C
+   help
+ If you say yes here you get support for the National Semiconductor
+ LP5521 LED driver.
+
 config MENELAUS
bool TWL92330/Menelaus PM chip
depends on I2C=y  ARCH_OMAP24XX
diff --git a/drivers/i2c/chips/Makefile b/drivers/i2c/chips/Makefile
index 39e3e69..987f600 100644
--- a/drivers/i2c/chips/Makefile
+++ b/drivers/i2c/chips/Makefile
@@ -21,8 +21,8 @@ obj-$(CONFIG_ISP1301_OMAP)+= isp1301_omap.o
 obj-$(CONFIG_TPS65010) += tps65010.o
 obj-$(CONFIG_MENELAUS) += menelaus.o
 obj-$(CONFIG_SENSORS_TSL2550)  += tsl2550.o
+obj-$(CONFIG_LP5521)   += lp5521.o
 
 ifeq ($(CONFIG_I2C_DEBUG_CHIP),y)
 EXTRA_CFLAGS += -DDEBUG
 endif
-
diff --git a/drivers/i2c/chips/lp5521.c b/drivers/i2c/chips/lp5521.c
new file mode 100644
index 000..c0862d9
--- /dev/null
+++ b/drivers/i2c/chips/lp5521.c
@@ -0,0 +1,585 @@
+/*
+ * drivers/i2c/chips/lp5521.c
+ *
+ * Copyright (C) 2007 Nokia Corporation
+ *
+ * Written by Mathias Nyman [EMAIL PROTECTED]
+ *
+ * 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
+ */
+
+#include linux/module.h
+#include linux/init.h
+#include linux/i2c.h
+#include linux/mutex.h
+#include mach/gpio.h
+
+#define LP5521_DRIVER_NAME lp5521
+
+#ifdef LED_CONNECTED_WRONG
+#define LP5521_REG_R_PWM   0x04
+#define LP5521_REG_B_PWM   0x02
+#else
+#define LP5521_REG_R_PWM   0x02
+#define LP5521_REG_B_PWM   0x04
+#endif
+#define LP5521_REG_ENABLE  0x00
+#define LP5521_REG_OP_MODE 0x01
+#define LP5521_REG_G_PWM   0x03
+#define LP5521_REG_R_CNTRL 0x05
+#define LP5521_REG_G_CNTRL 0x06
+#define LP5521_REG_B_CNTRL 0x07
+#define LP5521_REG_MISC0x08
+#define LP5521_REG_R_CHANNEL_PC0x09
+#define LP5521_REG_G_CHANNEL_PC0x0a
+#define LP5521_REG_B_CHANNEL_PC0x0b
+#define LP5521_REG_STATUS  0x0c
+#define LP5521_REG_RESET   0x0d
+#define LP5521_REG_GPO 0x0e
+#define LP5521_REG_R_PROG_MEM  0x10
+#define LP5521_REG_G_PROG_MEM  0x30
+#define LP5521_REG_B_PROG_MEM  0x50
+
+#define LP5521_MODE_LOAD   load
+#define LP5521_MODE_RUNrun
+#define LP5521_MODE_DIRECT_CONTROL direct
+
+#define LP5521_CURRENT_1m5 0x0f
+#define LP5521_CURRENT_3m1 0x1f
+#define LP5521_CURRENT_4m7 0x2f
+#define LP5521_CURRENT_6m3 0x3f
+#define LP5521_CURRENT_7m9 0x4f
+#define LP5521_CURRENT_9m5 0x5f
+#define LP5521_CURRENT_11m10x6f
+#define LP5521_CURRENT_12m70x7f
+#define LP5521_CURRENT_14m30x8f
+#define LP5521_CURRENT_15m90x9f
+#define LP5521_CURRENT_17m50xaf
+#define LP5521_CURRENT_19m10xbf
+#define LP5521_CURRENT_20m70xcf
+#define LP5521_CURRENT_22m30xdf
+#define LP5521_CURRENT_23m90xef
+#define LP5521_CURRENT_25m50xff
+
+#define LP5521_PROGRAM_LENGTH  32  /* in bytes */
+
+struct lp5521_chip {
+   struct mutexlock;
+   struct i2c_client   *client;
+   char*mode;
+   int red;
+   int green;
+   int blue;
+};
+
+static int lp5521_set_mode(struct lp5521_chip *chip, char *mode);
+
+static int lp5521_write(struct i2c_client *client, u8 reg, u8 value)
+{
+   return 

[PATCH 05/33] add tlv320aic23 driver

2008-08-30 Thread Felipe Balbi
From: Felipe Balbi [EMAIL PROTECTED]

Signed-off-by: Felipe Balbi [EMAIL PROTECTED]
---
 drivers/i2c/chips/Kconfig   |7 +
 drivers/i2c/chips/Makefile  |1 +
 drivers/i2c/chips/tlv320aic23.c |  675 +++
 3 files changed, 683 insertions(+), 0 deletions(-)
 create mode 100644 drivers/i2c/chips/tlv320aic23.c

diff --git a/drivers/i2c/chips/Kconfig b/drivers/i2c/chips/Kconfig
index a6269c0..75d8a26 100644
--- a/drivers/i2c/chips/Kconfig
+++ b/drivers/i2c/chips/Kconfig
@@ -137,6 +137,13 @@ config TPS65010
  This driver can also be built as a module.  If so, the module
  will be called tps65010.
 
+config SENSORS_TLV320AIC23
+   tristate Texas Instruments TLV320AIC23 Codec
+   depends on I2C  I2C_OMAP
+   help
+ If you say yes here you get support for the I2C control
+ interface for Texas Instruments TLV320AIC23 audio codec.
+
 config GPIOEXPANDER_OMAP
bool GPIO Expander PCF8574PWR for OMAP
depends on I2C  (ARCH_OMAP16XX || ARCH_OMAP24XX)
diff --git a/drivers/i2c/chips/Makefile b/drivers/i2c/chips/Makefile
index 616b3f9..32096cb 100644
--- a/drivers/i2c/chips/Makefile
+++ b/drivers/i2c/chips/Makefile
@@ -19,6 +19,7 @@ obj-$(CONFIG_PCF8575) += pcf8575.o
 obj-$(CONFIG_SENSORS_PCF8591)  += pcf8591.o
 obj-$(CONFIG_ISP1301_OMAP) += isp1301_omap.o
 obj-$(CONFIG_TPS65010) += tps65010.o
+obj-$(CONFIG_SENSORS_TLV320AIC23) += tlv320aic23.o
 obj-$(CONFIG_GPIOEXPANDER_OMAP)+= gpio_expander_omap.o
 obj-$(CONFIG_MENELAUS) += menelaus.o
 obj-$(CONFIG_SENSORS_TSL2550)  += tsl2550.o
diff --git a/drivers/i2c/chips/tlv320aic23.c b/drivers/i2c/chips/tlv320aic23.c
new file mode 100644
index 000..10671e8
--- /dev/null
+++ b/drivers/i2c/chips/tlv320aic23.c
@@ -0,0 +1,675 @@
+/*
+ *   Texas Instrumens TLV320AIC23 audio codec's i2c interface.
+ *
+ *   Copyright (c) by Kai Svahn [EMAIL PROTECTED]
+ *   Copyright (c) by Jussi Laako [EMAIL PROTECTED]
+ *
+ *   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
+ *
+ */
+
+#include linux/module.h
+#include linux/init.h
+#include linux/i2c.h
+#include linux/slab.h
+#include linux/device.h
+#include linux/platform_device.h
+#include asm/io.h
+#include mach/aic23.h
+#include mach/mcbsp.h
+
+#define TLV320AIC23_VERSION1.8
+#define TLV320AIC23_DATE   10-Feb-2006
+#define MAX_VOL100
+#define MIN_VOL0
+#define MAX_GAIN   100
+#define MIN_GAIN   0
+#define OUTPUT_VOLUME_MIN   LHV_MIN
+#define OUTPUT_VOLUME_MAX   LHV_MAX
+#define OUTPUT_VOLUME_RANGE (OUTPUT_VOLUME_MAX - OUTPUT_VOLUME_MIN)
+#define INPUT_VOLUME_MIN   LIV_MIN
+#define INPUT_VOLUME_MAX   LIV_MAX
+#define INPUT_VOLUME_RANGE (INPUT_VOLUME_MAX - INPUT_VOLUME_MIN)
+
+/* I2C Addresses to scan */
+static unsigned short normal_i2c[] = { TLV320AIC23ID1, TLV320AIC23ID2, \
+  I2C_CLIENT_END };
+/*static unsigned short normal_i2c_range[] = { I2C_CLIENT_END };*/
+
+/* This makes all addr_data:s */
+I2C_CLIENT_INSMOD;
+
+static struct i2c_driver aic23_driver;
+static struct i2c_client *new_client;
+static int selftest;
+static struct platform_device audio_i2c_device;
+
+static struct aic23_info {
+   u16 volume_reg_left;
+   u16 volume_reg_right;
+   u16 input_gain_reg_left;
+   u16 input_gain_reg_right;
+   u16 power;  /* For POWER_DOWN_CONTROL_ADDR */
+   u16 mask;   /* For ANALOG_AUDIO_CONTROL_ADDR */
+   int mic_loopback;
+   int mic_enable;
+   int sta;
+   int power_down;
+   int initialized;
+} aic23_info_l;
+
+static int _aic23_write_value(struct i2c_client *client, u8 reg, u16 value)
+{
+   u8 val, wreg;
+
+   /* TLV320AIC23 has 7 bit address and 9 bits of data
+* so we need to switch one data bit into reg and rest
+* of data into val
+*/
+
+   wreg = (reg  1);
+   val = (0x01  (value  8));
+   wreg = (wreg | val);
+   val = (0x00ff  value);
+
+   return i2c_smbus_write_byte_data(client, wreg, val);
+}
+
+int aic23_write_value(u8 reg, u16 value)
+{
+   static struct i2c_client *client;
+   client = new_client;
+   

[PATCH 06/33] add tsl2563 driver

2008-08-30 Thread Felipe Balbi
From: Felipe Balbi [EMAIL PROTECTED]

Signed-off-by: Felipe Balbi [EMAIL PROTECTED]
---
 drivers/i2c/chips/Kconfig   |   10 +
 drivers/i2c/chips/Makefile  |1 +
 drivers/i2c/chips/tsl2563.c |  739 +++
 3 files changed, 750 insertions(+), 0 deletions(-)
 create mode 100644 drivers/i2c/chips/tsl2563.c

diff --git a/drivers/i2c/chips/Kconfig b/drivers/i2c/chips/Kconfig
index 75d8a26..bd2a3a5 100644
--- a/drivers/i2c/chips/Kconfig
+++ b/drivers/i2c/chips/Kconfig
@@ -176,6 +176,16 @@ config SENSORS_TSL2550
  This driver can also be built as a module.  If so, the module
  will be called tsl2550.
 
+config SENSORS_TSL2563
+   tristate Taos TSL2563 ambient light sensor
+   depends on I2C  HWMON
+   help
+ If you say yes here you get support for the Taos TSL2563
+ ambient light sensor.
+
+ This driver can also be built as a module.  If so, the module
+ will be called tsl2563.
+
 config LP5521
tristate LP5521 LED driver chip
depends on I2C
diff --git a/drivers/i2c/chips/Makefile b/drivers/i2c/chips/Makefile
index 32096cb..97e9acf 100644
--- a/drivers/i2c/chips/Makefile
+++ b/drivers/i2c/chips/Makefile
@@ -23,6 +23,7 @@ obj-$(CONFIG_SENSORS_TLV320AIC23) += tlv320aic23.o
 obj-$(CONFIG_GPIOEXPANDER_OMAP)+= gpio_expander_omap.o
 obj-$(CONFIG_MENELAUS) += menelaus.o
 obj-$(CONFIG_SENSORS_TSL2550)  += tsl2550.o
+obj-$(CONFIG_SENSORS_TSL2563)  += tsl2563.o
 obj-$(CONFIG_LP5521)   += lp5521.o
 
 ifeq ($(CONFIG_I2C_DEBUG_CHIP),y)
diff --git a/drivers/i2c/chips/tsl2563.c b/drivers/i2c/chips/tsl2563.c
new file mode 100644
index 000..e05b880
--- /dev/null
+++ b/drivers/i2c/chips/tsl2563.c
@@ -0,0 +1,739 @@
+/*
+ * drivers/i2c/chips/tsl2563.c
+ *
+ * Copyright (C) 2008 Nokia Corporation
+ *
+ * Written by Timo O. Karjalainen [EMAIL PROTECTED]
+ * Contact: Mathias Nyman [EMAIL PROTECTED]
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * 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., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#include linux/module.h
+#include linux/i2c.h
+#include linux/interrupt.h
+#include linux/sched.h
+#include linux/mutex.h
+#include linux/delay.h
+#include linux/platform_device.h
+#include linux/pm.h
+#include linux/hwmon.h
+#include linux/err.h
+#include mach/board.h
+
+#define DRIVER_NAME  tsl2563
+
+/* Use this many bits for fraction part. */
+#define ADC_FRAC_BITS  (14)
+
+/* Given number of 1/1's in ADC_FRAC_BITS precision. */
+#define FRAC10K(f) (((f) * (1L  (ADC_FRAC_BITS))) / (1))
+
+/* Bits used for fraction in calibration coefficients.*/
+#define CALIB_FRAC_BITS(10)
+/* 0.5 in CALIB_FRAC_BITS precision */
+#define CALIB_FRAC_HALF(1  (CALIB_FRAC_BITS - 1))
+/* Make a fraction from a number n that was multiplied with b. */
+#define CALIB_FRAC(n, b)   (((n)  CALIB_FRAC_BITS) / (b))
+/* Decimal 10^(digits in sysfs presentation) */
+#define CALIB_BASE_SYSFS   (1000)
+
+#define TSL2563_CMD(0x80)
+#define TSL2563_CLEARINT   (0x40)
+
+#define TSL2563_REG_CTRL   (0x00)
+#define TSL2563_REG_TIMING (0x01)
+#define TSL2563_REG_LOWLOW (0x02) /* data0 low threshold, 2 bytes */
+#define TSL2563_REG_LOWHIGH(0x03)
+#define TSL2563_REG_HIGHLOW(0x04) /* data0 high threshold, 2 bytes */
+#define TSL2563_REG_HIGHHIGH   (0x05)
+#define TSL2563_REG_INT(0x06)
+#define TSL2563_REG_ID (0x0a)
+#define TSL2563_REG_DATA0LOW   (0x0c) /* broadband sensor value, 2 bytes */
+#define TSL2563_REG_DATA0HIGH  (0x0d)
+#define TSL2563_REG_DATA1LOW   (0x0e) /* infrared sensor value, 2 bytes */
+#define TSL2563_REG_DATA1HIGH  (0x0f)
+
+#define TSL2563_CMD_POWER_ON   (0x03)
+#define TSL2563_CMD_POWER_OFF  (0x00)
+#define TSL2563_CTRL_POWER_MASK(0x03)
+
+#define TSL2563_TIMING_13MS(0x00)
+#define TSL2563_TIMING_100MS   (0x01)
+#define TSL2563_TIMING_400MS   (0x02)
+#define TSL2563_TIMING_MASK(0x03)
+#define TSL2563_TIMING_GAIN16  (0x10)
+#define TSL2563_TIMING_GAIN1   (0x00)
+
+#define TSL2563_INT_DISBLED(0x00)
+#define TSL2563_INT_LEVEL  (0x10)
+#define TSL2563_INT_PERSIST(n) ((n)  0x0F)
+
+struct tsl2563_gainlevel_coeff {
+   u8 gaintime;
+   u16 min;
+   u16 max;
+};
+
+static struct tsl2563_gainlevel_coeff tsl2563_gainlevel_table[] = {
+   {
+   .gaintime   = TSL2563_TIMING_400MS | 

[PATCH 08/33] add innovator ps2 keypad driver

2008-08-30 Thread Felipe Balbi
From: Felipe Balbi [EMAIL PROTECTED]

Signed-off-by: Felipe Balbi [EMAIL PROTECTED]
---
 drivers/input/keyboard/Kconfig |   10 +
 drivers/input/keyboard/Makefile|1 +
 drivers/input/keyboard/innovator_ps2.c | 1280 
 3 files changed, 1291 insertions(+), 0 deletions(-)
 create mode 100644 drivers/input/keyboard/innovator_ps2.c

diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig
index efd70a9..01d6421 100644
--- a/drivers/input/keyboard/Kconfig
+++ b/drivers/input/keyboard/Kconfig
@@ -259,6 +259,16 @@ config KEYBOARD_OMAP
  To compile this driver as a module, choose M here: the
  module will be called omap-keypad.
 
+config OMAP_PS2
+   tristate TI OMAP Innovator 1510 PS/2 keyboard  mouse support
+   depends on ARCH_OMAP15XX  MACH_OMAP_INNOVATOR
+   help
+ Say Y here if you want to use the OMAP Innovator 1510 PS/2
+ keyboard and mouse.
+
+ To compile this driver as a module, choose M here: the
+ module will be called innovator_ps2.
+
 config KEYBOARD_PXA27x
tristate PXA27x/PXA3xx keypad support
depends on PXA27x || PXA3xx
diff --git a/drivers/input/keyboard/Makefile b/drivers/input/keyboard/Makefile
index 0edc8f2..a48205b 100644
--- a/drivers/input/keyboard/Makefile
+++ b/drivers/input/keyboard/Makefile
@@ -19,6 +19,7 @@ obj-$(CONFIG_KEYBOARD_TOSA)   += tosakbd.o
 obj-$(CONFIG_KEYBOARD_HIL) += hil_kbd.o
 obj-$(CONFIG_KEYBOARD_HIL_OLD) += hilkbd.o
 obj-$(CONFIG_KEYBOARD_OMAP)+= omap-keypad.o
+obj-$(CONFIG_OMAP_PS2) += innovator_ps2.o
 obj-$(CONFIG_KEYBOARD_PXA27x)  += pxa27x_keypad.o
 obj-$(CONFIG_KEYBOARD_AAED2000)+= aaed2000_kbd.o
 obj-$(CONFIG_KEYBOARD_GPIO)+= gpio_keys.o
diff --git a/drivers/input/keyboard/innovator_ps2.c 
b/drivers/input/keyboard/innovator_ps2.c
new file mode 100644
index 000..b3c4a06
--- /dev/null
+++ b/drivers/input/keyboard/innovator_ps2.c
@@ -0,0 +1,1280 @@
+/*
+ * drivers/char/innovator_ps2.c
+ *
+ * Basic PS/2 keyboard/mouse driver for the Juno® USAR HID controller
+ * present on the TI Innovator/OMAP1510 Break-out-board.
+ *
+ *
+ * Author: MontaVista Software, Inc.
+ * [EMAIL PROTECTED] or [EMAIL PROTECTED]
+ *
+ *
+ * 2003 (c) MontaVista Software, Inc. This file is licensed under
+ * the terms of the GNU General Public License version 2. This program
+ * is licensed as is without any warranty of any kind, whether express
+ * or implied.
+ *
+ *
+ * REFERENCES:
+ *
+ * 1.  Technical Reference Manual
+ * Juno® 01
+ * Multi-function ICs family
+ * UR8HC007-001 HID  Power management controller
+ * Document Number: DOC8-007-001-TR-075
+ * Date: February 2002
+ * Copyright ©1998-2002 Semtech Corporation
+ * http://www.semtech.com/pdf/doc8-007-001-tr.pdf
+ *
+ * 2.  Juno® 01 UR8HC007-001 Data Sheet
+ * Extremely Low-power Input Device and Power Management IC
+ * Copyright ©1998-2002 Semtech Corporation
+ * DOC8-007-001-DS-112
+ * http://www.semtech.com/pdf/doc8-007-001-ds.pdf
+ *
+ *
+ * HISTORY:
+ *
+ * 20030626: George G. Davis [EMAIL PROTECTED]
+ *  Initially based on the following RidgeRun DSPlinux Version 1.6 files:
+ * linux-2.4.15-rmk1-dsplinux/arch/arm/dsplinux/hid/omap1510_hid.c
+ * linux-2.4.15-rmk1-dsplinux/arch/arm/dsplinux/hid/omap1510_hid.h
+ * linux-2.4.15-rmk1-dsplinux/arch/arm/dsplinux/hid/omap1510_ps2.c
+ * linux-2.4.15-rmk1-dsplinux/arch/arm/dsplinux/hid/omap1510_spi.c
+ * All original files above are
+ * Copyright (C) 2001 RidgeRun, Inc.
+ * Author: Alex McMains [EMAIL PROTECTED]
+ *
+ * 20040812: Thiago Radicchi [EMAIL PROTECTED]
+ *  Cleanup of old code from 2.4 driver and some debug code.
+ *  Minor changes in interrupt handling code.
+ *
+ * NOTES:
+ *
+ * 1. This driver does not provide support for setting keyboard/mouse
+ *configuration parameters. Both devices are managed directly by
+ *the Juno UR8HC007-001 on behalf of the host. This minimises the
+ *amount of host processing required to manage HID events and state
+ *changes, e.g. both keyboard and mouse devices are hot pluggable
+ *with no host intervention required. However, we cannot customise
+ *keyboard/mouse settings in this case. So we live with the defaults
+ *as setup by the Juno UR8HC007-001 whatever they may be.
+ * 2. Keyboard auto repeat does not work. See 1 above. : )
+ *
+ *
+ * TODO:
+ *
+ * 1. Complete DPM/LDM stubs and test.
+ * 2. Add SPI error handling support, i.e. resend, etc.,.
+ * 3. Determine why innovator_hid_interrupt() is called for every
+ *invocation of Innovator FPGA IRQ demux. It appears that the
+ *missed Innovator ethernet workaround may be to blame. However,
+ *it does not adversely affect operation of this driver since we
+ *check for assertion 

[PATCH 09/33] add lm8323 keypad driver

2008-08-30 Thread Felipe Balbi
From: Felipe Balbi [EMAIL PROTECTED]

Signed-off-by: Felipe Balbi [EMAIL PROTECTED]
---
 drivers/input/keyboard/Kconfig  |7 +
 drivers/input/keyboard/Makefile |1 +
 drivers/input/keyboard/lm8323.c |  925 +++
 include/linux/i2c/lm8323.h  |   37 ++
 4 files changed, 970 insertions(+), 0 deletions(-)
 create mode 100644 drivers/input/keyboard/lm8323.c
 create mode 100644 include/linux/i2c/lm8323.h

diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig
index 01d6421..53239cb 100644
--- a/drivers/input/keyboard/Kconfig
+++ b/drivers/input/keyboard/Kconfig
@@ -269,6 +269,13 @@ config OMAP_PS2
  To compile this driver as a module, choose M here: the
  module will be called innovator_ps2.
 
+config KEYBOARD_LM8323
+   tristate LM8323 keypad chip
+   depends on I2C
+   help
+ If you say yes here you get support for the National Semiconductor
+ LM8323 keypad controller.
+
 config KEYBOARD_PXA27x
tristate PXA27x/PXA3xx keypad support
depends on PXA27x || PXA3xx
diff --git a/drivers/input/keyboard/Makefile b/drivers/input/keyboard/Makefile
index a48205b..52e9b70 100644
--- a/drivers/input/keyboard/Makefile
+++ b/drivers/input/keyboard/Makefile
@@ -20,6 +20,7 @@ obj-$(CONFIG_KEYBOARD_HIL)+= hil_kbd.o
 obj-$(CONFIG_KEYBOARD_HIL_OLD) += hilkbd.o
 obj-$(CONFIG_KEYBOARD_OMAP)+= omap-keypad.o
 obj-$(CONFIG_OMAP_PS2) += innovator_ps2.o
+obj-$(CONFIG_KEYBOARD_LM8323)  += lm8323.o
 obj-$(CONFIG_KEYBOARD_PXA27x)  += pxa27x_keypad.o
 obj-$(CONFIG_KEYBOARD_AAED2000)+= aaed2000_kbd.o
 obj-$(CONFIG_KEYBOARD_GPIO)+= gpio_keys.o
diff --git a/drivers/input/keyboard/lm8323.c b/drivers/input/keyboard/lm8323.c
new file mode 100644
index 000..72bb587
--- /dev/null
+++ b/drivers/input/keyboard/lm8323.c
@@ -0,0 +1,925 @@
+/*
+ * drivers/i2c/chips/lm8323.c
+ *
+ * Copyright (C) 2007 Nokia Corporation
+ *
+ * Written by Daniel Stone [EMAIL PROTECTED]
+ *Timo O. Karjalainen [EMAIL PROTECTED]
+ *
+ * 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 (version 2 of the License only).
+ *
+ * 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
+ */
+
+#include linux/module.h
+#include linux/i2c.h
+#include linux/interrupt.h
+#include linux/sched.h
+#include linux/mutex.h
+#include linux/delay.h
+#include linux/input.h
+#include linux/leds.h
+#include linux/i2c/lm8323.h
+
+#include asm/mach-types.h
+#include asm/mach/irq.h
+
+#ifdef VERBOSE
+#define debug dev_dbg
+#else
+#define debug(...)
+#endif
+
+/* Commands to send to the chip. */
+#define LM8323_CMD_READ_ID 0x80 /* Read chip ID. */
+#define LM8323_CMD_WRITE_CFG   0x81 /* Set configuration item. */
+#define LM8323_CMD_READ_INT0x82 /* Get interrupt status. */
+#define LM8323_CMD_RESET   0x83 /* Reset, same as external one */
+#define LM8323_CMD_WRITE_PORT_SEL  0x85 /* Set GPIO in/out. */
+#define LM8323_CMD_WRITE_PORT_STATE0x86 /* Set GPIO pullup. */
+#define LM8323_CMD_READ_PORT_SEL   0x87 /* Get GPIO in/out. */
+#define LM8323_CMD_READ_PORT_STATE 0x88 /* Get GPIO pullup. */
+#define LM8323_CMD_READ_FIFO   0x89 /* Read byte from FIFO. */
+#define LM8323_CMD_RPT_READ_FIFO   0x8a /* Read FIFO (no increment). */
+#define LM8323_CMD_SET_ACTIVE  0x8b /* Set active time. */
+#define LM8323_CMD_READ_ERR0x8c /* Get error status. */
+#define LM8323_CMD_READ_ROTATOR0x8e /* Read rotator status. */
+#define LM8323_CMD_SET_DEBOUNCE0x8f /* Set debouncing time. */
+#define LM8323_CMD_SET_KEY_SIZE0x90 /* Set keypad size. */
+#define LM8323_CMD_READ_KEY_SIZE   0x91 /* Get keypad size. */
+#define LM8323_CMD_READ_CFG0x92 /* Get configuration item. */
+#define LM8323_CMD_WRITE_CLOCK 0x93 /* Set clock config. */
+#define LM8323_CMD_READ_CLOCK  0x94 /* Get clock config. */
+#define LM8323_CMD_PWM_WRITE   0x95 /* Write PWM script. */
+#define LM8323_CMD_START_PWM   0x96 /* Start PWM engine. */
+#define LM8323_CMD_STOP_PWM0x97 /* Stop PWM engine. */
+
+/* Interrupt status. */
+#define INT_KEYPAD 0x01 /* Key event. */
+#define INT_ROTATOR0x02 /* Rotator event. */
+#define INT_ERROR  0x08 /* Error: use 

[PATCH 14/33] add tsc210x touchscreen driver

2008-08-30 Thread Felipe Balbi
From: Felipe Balbi [EMAIL PROTECTED]

Signed-off-by: Felipe Balbi [EMAIL PROTECTED]
---
 drivers/input/touchscreen/Kconfig  |   14 ++
 drivers/input/touchscreen/Makefile |1 +
 drivers/input/touchscreen/tsc210x_ts.c |  160 ++
 include/linux/spi/tsc210x.h|  231 
 4 files changed, 406 insertions(+), 0 deletions(-)
 create mode 100644 drivers/input/touchscreen/tsc210x_ts.c
 create mode 100644 include/linux/spi/tsc210x.h

diff --git a/drivers/input/touchscreen/Kconfig 
b/drivers/input/touchscreen/Kconfig
index a115f38..f45cdac 100644
--- a/drivers/input/touchscreen/Kconfig
+++ b/drivers/input/touchscreen/Kconfig
@@ -222,6 +222,20 @@ config TOUCHSCREEN_TSC2005
help
  Say Y here for if you are using the touchscreen features of TSC2301.
 
+config TOUCHSCREEN_TSC210X
+   tristate TI TSC210x based touchscreens
+   depends on SPI_MASTER
+   select SPI_TSC210X
+   help
+ Say Y here if you have a touchscreen interface using a
+ TI TSC210x controller, and your board-specific initialisation
+ code includes that in its table of SPI devices.
+
+ If unsure, say N (but it's safe to say Y).
+
+ To compile this driver as a module, choose M here: the
+ module will be called tsc210x_ts.
+
 config TOUCHSCREEN_UCB1400
tristate Philips UCB1400 touchscreen
select AC97_BUS
diff --git a/drivers/input/touchscreen/Makefile 
b/drivers/input/touchscreen/Makefile
index e0bc8fb..411c44a 100644
--- a/drivers/input/touchscreen/Makefile
+++ b/drivers/input/touchscreen/Makefile
@@ -28,6 +28,7 @@ obj-$(CONFIG_TOUCHSCREEN_TOUCHWIN)+= touchwin.o
 obj-$(CONFIG_TOUCHSCREEN_UCB1400)  += ucb1400_ts.o
 obj-$(CONFIG_TOUCHSCREEN_TSC2005)  += tsc2005.o
 obj-$(CONFIG_TOUCHSCREEN_OMAP) += omap/
+obj-$(CONFIG_TOUCHSCREEN_TSC210X)  += tsc210x_ts.o
 obj-$(CONFIG_TOUCHSCREEN_WM97XX)   += wm97xx-ts.o
 wm97xx-ts-$(CONFIG_TOUCHSCREEN_WM9705) += wm9705.o
 wm97xx-ts-$(CONFIG_TOUCHSCREEN_WM9712) += wm9712.o
diff --git a/drivers/input/touchscreen/tsc210x_ts.c 
b/drivers/input/touchscreen/tsc210x_ts.c
new file mode 100644
index 000..5828b6d
--- /dev/null
+++ b/drivers/input/touchscreen/tsc210x_ts.c
@@ -0,0 +1,160 @@
+/*
+ * tsc210x_ts.c - touchscreen input device for TI TSC210x chips
+ *
+ * Copyright (c) 2006-2007 Andrzej Zaborowski  [EMAIL PROTECTED]
+ *
+ * This package 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 package 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 package; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include linux/errno.h
+#include linux/kernel.h
+#include linux/module.h
+#include linux/input.h
+#include linux/init.h
+#include linux/platform_device.h
+
+#include linux/spi/tsc210x.h
+
+
+/*
+ * The sensor ADC on tsc210x chips is most often used with the smart
+ * touchscreen controller.   Those controllers can be made to improve
+ * sample quality directly by multi-sampling and by taking the mean or
+ * median of various numbers of samples.  They also take X, Y, and
+ * pressure measurements automatically, so this driver has relatively
+ * little to do.
+ *
+ * There are a few chips in this family that don't have quite the same
+ * touchscreen interface, e.g. no median mode.
+ */
+
+static void tsc210x_touch(void *context, int touching)
+{
+   struct input_dev *dev = context;
+
+   if (!touching) {
+   input_report_abs(dev, ABS_X, 0);
+   input_report_abs(dev, ABS_Y, 0);
+   input_report_abs(dev, ABS_PRESSURE, 0);
+   input_sync(dev);
+   }
+
+   input_report_key(dev, BTN_TOUCH, touching);
+}
+
+static void tsc210x_coords(void *context, int x, int y, int z1, int z2)
+{
+   struct input_dev *dev = context;
+   int p;
+
+   /* Calculate the touch resistance a la equation #1 */
+   if (z1 != 0)
+   p = x * (z2 - z1) / (z1  4);
+   else
+   p = 1;
+
+   input_report_abs(dev, ABS_X, x);
+   input_report_abs(dev, ABS_Y, y);
+   input_report_abs(dev, ABS_PRESSURE, p);
+   input_sync(dev);
+}
+
+static int tsc210x_ts_probe(struct platform_device *pdev)
+{
+   int status;
+   struct input_dev *dev;
+
+   dev = input_allocate_device();
+   if (!dev)
+   return -ENOMEM;
+
+   status = tsc210x_touch_cb(pdev-dev.parent, tsc210x_touch, dev);
+   if 

[PATCH 15/33] add tsc2301 touchscreen driver

2008-08-30 Thread Felipe Balbi
From: Felipe Balbi [EMAIL PROTECTED]

Signed-off-by: Felipe Balbi [EMAIL PROTECTED]
---
 drivers/input/touchscreen/Kconfig  |6 +
 drivers/input/touchscreen/Makefile |1 +
 drivers/input/touchscreen/tsc2301_ts.c |  676 
 3 files changed, 683 insertions(+), 0 deletions(-)
 create mode 100644 drivers/input/touchscreen/tsc2301_ts.c

diff --git a/drivers/input/touchscreen/Kconfig 
b/drivers/input/touchscreen/Kconfig
index f45cdac..1bab54a 100644
--- a/drivers/input/touchscreen/Kconfig
+++ b/drivers/input/touchscreen/Kconfig
@@ -236,6 +236,12 @@ config TOUCHSCREEN_TSC210X
  To compile this driver as a module, choose M here: the
  module will be called tsc210x_ts.
 
+config TOUCHSCREEN_TSC2301
+   tristate TSC2301 touchscreen support
+   depends on SPI_TSC2301
+   help
+ Say Y here for if you are using the touchscreen features of TSC2301.
+
 config TOUCHSCREEN_UCB1400
tristate Philips UCB1400 touchscreen
select AC97_BUS
diff --git a/drivers/input/touchscreen/Makefile 
b/drivers/input/touchscreen/Makefile
index 411c44a..d14ed30 100644
--- a/drivers/input/touchscreen/Makefile
+++ b/drivers/input/touchscreen/Makefile
@@ -29,6 +29,7 @@ obj-$(CONFIG_TOUCHSCREEN_UCB1400) += ucb1400_ts.o
 obj-$(CONFIG_TOUCHSCREEN_TSC2005)  += tsc2005.o
 obj-$(CONFIG_TOUCHSCREEN_OMAP) += omap/
 obj-$(CONFIG_TOUCHSCREEN_TSC210X)  += tsc210x_ts.o
+obj-$(CONFIG_TOUCHSCREEN_TSC2301)  += tsc2301_ts.o
 obj-$(CONFIG_TOUCHSCREEN_WM97XX)   += wm97xx-ts.o
 wm97xx-ts-$(CONFIG_TOUCHSCREEN_WM9705) += wm9705.o
 wm97xx-ts-$(CONFIG_TOUCHSCREEN_WM9712) += wm9712.o
diff --git a/drivers/input/touchscreen/tsc2301_ts.c 
b/drivers/input/touchscreen/tsc2301_ts.c
new file mode 100644
index 000..6462cc2
--- /dev/null
+++ b/drivers/input/touchscreen/tsc2301_ts.c
@@ -0,0 +1,676 @@
+/*
+ * TSC2301 touchscreen driver
+ *
+ * Copyright (C) 2005-2008 Nokia Corporation
+ *
+ * Written by Jarkko Oikarinen, Imre Deak and Juha Yrjola
+ *
+ * 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
+ *
+ */
+
+#include linux/kernel.h
+#include linux/module.h
+#include linux/input.h
+#include linux/interrupt.h
+#include linux/delay.h
+#include linux/spi/spi.h
+
+#include linux/spi/tsc2301.h
+
+/**
+ * The touchscreen interface operates as follows:
+ *
+ * Initialize:
+ *Request access to GPIO103 (DAV)
+ *tsc2301_ts_irq_handler will trigger when DAV line goes down
+ *
+ *  1) Pen is pressed against touchscreeen
+ *  2) TSC2301 performs AD conversion
+ *  3) After the conversion is done TSC2301 drives DAV line down
+ *  4) GPIO IRQ is received and tsc2301_ts_irq_handler is called
+ *  5) tsc2301_ts_irq_handler queues up an spi transfer to fetch
+ * the x, y, z1, z2 values
+ *  6) SPI framework calls tsc2301_ts_rx after the coordinates are read
+ *  7) When the penup_timer expires, there have not been DAV interrupts
+ * during the last 20ms which means the pen has been lifted.
+ */
+
+
+#define TSC2301_TOUCHSCREEN_PRODUCT_ID 0x0052
+#define TSC2301_TOUCHSCREEN_PRODUCT_VERSION0x0001
+
+#define TSC2301_TS_PENUP_TIME  20
+
+#define TSC2301_ADCREG_CONVERSION_CTRL_BY_TSC2301  0x8000
+#define TSC2301_ADCREG_CONVERSION_CTRL_BY_HOST 0x
+
+#define TSC2301_ADCREG_FUNCTION_NONE   0x
+#define TSC2301_ADCREG_FUNCTION_XY 0x0400
+#define TSC2301_ADCREG_FUNCTION_XYZ0x0800
+#define TSC2301_ADCREG_FUNCTION_X  0x0C00
+#define TSC2301_ADCREG_FUNCTION_Y  0x1000
+#define TSC2301_ADCREG_FUNCTION_Z  0x1400
+#define TSC2301_ADCREG_FUNCTION_DAT1   0x1800
+#define TSC2301_ADCREG_FUNCTION_DAT2   0x1C00
+#define TSC2301_ADCREG_FUNCTION_AUX1   0x2000
+#define TSC2301_ADCREG_FUNCTION_AUX2   0x2400
+#define TSC2301_ADCREG_FUNCTION_TEMP   0x2800
+
+#define TSC2301_ADCREG_RESOLUTION_8BIT 0x0100
+#define TSC2301_ADCREG_RESOLUTION_10BIT0x0200
+#define TSC2301_ADCREG_RESOLUTION_12BIT0x0300
+
+#define TSC2301_ADCREG_AVERAGING_NONE  0x
+#define TSC2301_ADCREG_AVERAGING_4AVG   

[PATCH 16/33] add omap led drivers

2008-08-30 Thread Felipe Balbi
From: Felipe Balbi [EMAIL PROTECTED]

Signed-off-by: Felipe Balbi [EMAIL PROTECTED]
---
 drivers/leds/Kconfig |   21 +++
 drivers/leds/Makefile|2 +
 drivers/leds/leds-omap-pwm.c |  376 ++
 drivers/leds/leds-omap.c |  135 +++
 4 files changed, 534 insertions(+), 0 deletions(-)
 create mode 100644 drivers/leds/leds-omap-pwm.c
 create mode 100644 drivers/leds/leds-omap.c

diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
index 9556262..6a2f441 100644
--- a/drivers/leds/Kconfig
+++ b/drivers/leds/Kconfig
@@ -77,6 +77,27 @@ config LEDS_WRAP
help
  This option enables support for the PCEngines WRAP programmable LEDs.
 
+config LEDS_OMAP_DEBUG
+   boolean LED Support for OMAP debug board LEDs
+   depends on LEDS_CLASS=y  ARCH_OMAP
+   help
+ Enables support for the LEDs on the debug board used with OMAP
+ reference boards like H2/H3/H4 and Perseus2.  Up to six of these
+ may be claimed by the original ARM debug LED API.
+
+config LEDS_OMAP
+   tristate LED Support for OMAP GPIO LEDs
+   depends on LEDS_CLASS  ARCH_OMAP
+   help
+ This option enables support for the LEDs on OMAP processors.
+
+config LEDS_OMAP_PWM
+   tristate LED Support for OMAP PWM-controlled LEDs
+   depends on LEDS_CLASS  ARCH_OMAP  OMAP_DM_TIMER
+   help
+ This options enables support for LEDs connected to GPIO lines
+ controlled by a PWM timer on OMAP CPUs.
+
 config LEDS_H1940
tristate LED Support for iPAQ H1940 device
depends on LEDS_CLASS  ARCH_H1940
diff --git a/drivers/leds/Makefile b/drivers/leds/Makefile
index ff7982b..fd6316e 100644
--- a/drivers/leds/Makefile
+++ b/drivers/leds/Makefile
@@ -13,6 +13,8 @@ obj-$(CONFIG_LEDS_S3C24XX)+= leds-s3c24xx.o
 obj-$(CONFIG_LEDS_AMS_DELTA)   += leds-ams-delta.o
 obj-$(CONFIG_LEDS_NET48XX) += leds-net48xx.o
 obj-$(CONFIG_LEDS_WRAP)+= leds-wrap.o
+obj-$(CONFIG_LEDS_OMAP)+= leds-omap.o
+obj-$(CONFIG_LEDS_OMAP_PWM)+= leds-omap-pwm.o
 obj-$(CONFIG_LEDS_H1940)   += leds-h1940.o
 obj-$(CONFIG_LEDS_COBALT_QUBE) += leds-cobalt-qube.o
 obj-$(CONFIG_LEDS_COBALT_RAQ)  += leds-cobalt-raq.o
diff --git a/drivers/leds/leds-omap-pwm.c b/drivers/leds/leds-omap-pwm.c
new file mode 100644
index 000..57eb383
--- /dev/null
+++ b/drivers/leds/leds-omap-pwm.c
@@ -0,0 +1,376 @@
+/* drivers/leds/leds-omap_pwm.c
+ *
+ * Driver to blink LEDs using OMAP PWM timers
+ *
+ * Copyright (C) 2006 Nokia Corporation
+ * Author: Timo Teras
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+#include linux/kernel.h
+#include linux/init.h
+#include linux/err.h
+#include linux/platform_device.h
+#include linux/leds.h
+#include linux/ctype.h
+#include linux/sched.h
+#include asm/delay.h
+#include mach/board.h
+#include mach/dmtimer.h
+
+struct omap_pwm_led {
+   struct led_classdev cdev;
+   struct work_struct work;
+   struct omap_pwm_led_platform_data *pdata;
+   struct omap_dm_timer *intensity_timer;
+   struct omap_dm_timer *blink_timer;
+   int powered;
+   unsigned int on_period, off_period;
+   enum led_brightness brightness;
+};
+
+static inline struct omap_pwm_led *pdev_to_omap_pwm_led(struct platform_device 
*pdev)
+{
+   return platform_get_drvdata(pdev);
+}
+
+static inline struct omap_pwm_led *cdev_to_omap_pwm_led(struct led_classdev 
*led_cdev)
+{
+   return container_of(led_cdev, struct omap_pwm_led, cdev);
+}
+
+static inline struct omap_pwm_led *work_to_omap_pwm_led(struct work_struct 
*work)
+{
+   return container_of(work, struct omap_pwm_led, work);
+}
+
+static void omap_pwm_led_set_blink(struct omap_pwm_led *led)
+{
+   if (!led-powered)
+   return;
+
+   if (led-on_period != 0  led-off_period != 0) {
+   unsigned long load_reg, cmp_reg;
+
+   load_reg = 32768 * (led-on_period + led-off_period) / 1000;
+   cmp_reg = 32768 * led-on_period / 1000;
+
+   omap_dm_timer_stop(led-blink_timer);
+   omap_dm_timer_set_load(led-blink_timer, 1, -load_reg);
+   omap_dm_timer_set_match(led-blink_timer, 1, -cmp_reg);
+   omap_dm_timer_set_pwm(led-blink_timer, 1, 1,
+ OMAP_TIMER_TRIGGER_OVERFLOW_AND_COMPARE);
+   omap_dm_timer_write_counter(led-blink_timer, -2);
+   omap_dm_timer_start(led-blink_timer);
+   } else {
+   omap_dm_timer_set_pwm(led-blink_timer, 1, 1,
+ OMAP_TIMER_TRIGGER_OVERFLOW_AND_COMPARE);
+   omap_dm_timer_stop(led-blink_timer);
+   }
+}
+
+static void 

[PATCH 18/33] add ov9640 sensor driver

2008-08-30 Thread Felipe Balbi
From: Felipe Balbi [EMAIL PROTECTED]

Signed-off-by: Felipe Balbi [EMAIL PROTECTED]
---
 drivers/media/video/Kconfig  |8 +
 drivers/media/video/Makefile |1 +
 drivers/media/video/ov9640.c | 1279 ++
 drivers/media/video/ov9640.h |  194 +++
 4 files changed, 1482 insertions(+), 0 deletions(-)
 create mode 100644 drivers/media/video/ov9640.c
 create mode 100644 drivers/media/video/ov9640.h

diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig
index ecbfa1b..ec976f6 100644
--- a/drivers/media/video/Kconfig
+++ b/drivers/media/video/Kconfig
@@ -295,6 +295,14 @@ config VIDEO_TCM825X
  This is a driver for the Toshiba TCM825x VGA camera sensor.
  It is used for example in Nokia N800.
 
+config VIDEO_OV9640
+   tristate OmniVision OV9640 sensor support
+   depends on I2C  VIDEO_V4L2
+   ---help---
+ This is a Video4Linux2 sensor-level driver for the OmniVision
+ OV9640 camera.  It is currently working with the TI OMAP2
+ camera controller.
+
 config VIDEO_SAA7110
tristate Philips SAA7110 video decoder
depends on VIDEO_V4L1  I2C
diff --git a/drivers/media/video/Makefile b/drivers/media/video/Makefile
index bbc6f8b..0b529dd 100644
--- a/drivers/media/video/Makefile
+++ b/drivers/media/video/Makefile
@@ -106,6 +106,7 @@ obj-$(CONFIG_VIDEO_CAFE_CCIC) += cafe_ccic.o
 obj-$(CONFIG_VIDEO_OV7670) += ov7670.o
 
 obj-$(CONFIG_VIDEO_TCM825X) += tcm825x.o
+obj-$(CONFIG_VIDEO_OV9640) += ov9640.o
 
 obj-$(CONFIG_USB_DABUSB)+= dabusb.o
 obj-$(CONFIG_USB_OV511) += ov511.o
diff --git a/drivers/media/video/ov9640.c b/drivers/media/video/ov9640.c
new file mode 100644
index 000..a0f7406
--- /dev/null
+++ b/drivers/media/video/ov9640.c
@@ -0,0 +1,1279 @@
+/*
+ * drivers/media/video/ov9640.c
+ *
+ * OV9640 sensor driver
+ *
+ * Author: Andy Lowe ([EMAIL PROTECTED])
+ * Contact: Trilok Soni [EMAIL PROTECTED]
+ *
+ * Copyright (C) 2004 MontaVista Software, Inc.
+ * Copyright (C) 2004 Texas Instruments.
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2. This program is licensed as is without any warranty of any
+ * kind, whether express or implied.
+ */
+
+#include linux/i2c.h
+#include linux/delay.h
+#include media/v4l2-int-device.h
+
+#include ov9640.h
+
+#define DRIVER_NAME  ov9640
+
+struct ov9640_sensor {
+   const struct ov9640_platform_data *pdata;
+   struct v4l2_int_device *v4l2_int_device;
+   struct i2c_client *i2c_client;
+   struct v4l2_pix_format pix;
+   struct v4l2_fract timeperframe;
+   int ver;/*ov9640 chip version*/
+};
+
+static struct ov9640_sensor ov9640;
+static struct i2c_driver ov9640sensor_i2c_driver;
+
+/* list of image formats supported by OV9640 sensor */
+const static struct v4l2_fmtdesc ov9640_formats[] = {
+   {
+   /* Note:  V4L2 defines RGB565 as:
+*
+*  Byte 0Byte 1
+*  g2 g1 g0 r4 r3 r2 r1 r0   b4 b3 b2 b1 b0 g5 g4 g3
+*
+* We interpret RGB565 as:
+*
+*  Byte 0Byte 1
+*  g2 g1 g0 b4 b3 b2 b1 b0   r4 r3 r2 r1 r0 g5 g4 g3
+*/
+   .description= RGB565, le,
+   .pixelformat= V4L2_PIX_FMT_RGB565,
+   },
+   {
+   /* Note:  V4L2 defines RGB565X as:
+*
+*  Byte 0Byte 1
+*  b4 b3 b2 b1 b0 g5 g4 g3   g2 g1 g0 r4 r3 r2 r1 r0
+*
+* We interpret RGB565X as:
+*
+*  Byte 0Byte 1
+*  r4 r3 r2 r1 r0 g5 g4 g3   g2 g1 g0 b4 b3 b2 b1 b0
+*/
+   .description= RGB565, be,
+   .pixelformat= V4L2_PIX_FMT_RGB565X,
+   },
+   {
+   .description= YUYV (YUV 4:2:2), packed,
+   .pixelformat= V4L2_PIX_FMT_YUYV,
+   },
+   {
+   .description= UYVY, packed,
+   .pixelformat= V4L2_PIX_FMT_UYVY,
+   },
+   {
+   /* Note:  V4L2 defines RGB555 as:
+*
+*  Byte 0Byte 1
+*  g2 g1 g0 r4 r3 r2 r1 r0   x  b4 b3 b2 b1 b0 g4 g3
+*
+* We interpret RGB555 as:
+*
+*  Byte 0Byte 1
+*  g2 g1 g0 b4 b3 b2 b1 b0   x  r4 r3 r2 r1 r0 g4 g3
+*/
+   .description= RGB555, le,
+   .pixelformat= V4L2_PIX_FMT_RGB555,
+   },
+   {
+   /* Note:  V4L2 defines RGB555X as:
+*
+*  Byte 0Byte 1
+*   

[PATCH 13/33] Add omap touchscreen driver

2008-08-30 Thread Felipe Balbi
From: Felipe Balbi [EMAIL PROTECTED]

Signed-off-by: Felipe Balbi [EMAIL PROTECTED]
---
 drivers/input/touchscreen/Makefile   |1 +
 drivers/input/touchscreen/omap/Makefile  |   10 +
 drivers/input/touchscreen/omap/omap_ts.c |  267 ++
 drivers/input/touchscreen/omap/omap_ts.h |   57 +++
 drivers/input/touchscreen/omap/ts_hx.c   |  184 
 5 files changed, 519 insertions(+), 0 deletions(-)
 create mode 100644 drivers/input/touchscreen/omap/Makefile
 create mode 100644 drivers/input/touchscreen/omap/omap_ts.c
 create mode 100644 drivers/input/touchscreen/omap/omap_ts.h
 create mode 100644 drivers/input/touchscreen/omap/ts_hx.c

diff --git a/drivers/input/touchscreen/Makefile 
b/drivers/input/touchscreen/Makefile
index 0342389..e0bc8fb 100644
--- a/drivers/input/touchscreen/Makefile
+++ b/drivers/input/touchscreen/Makefile
@@ -27,6 +27,7 @@ obj-$(CONFIG_TOUCHSCREEN_TOUCHRIGHT)  += touchright.o
 obj-$(CONFIG_TOUCHSCREEN_TOUCHWIN) += touchwin.o
 obj-$(CONFIG_TOUCHSCREEN_UCB1400)  += ucb1400_ts.o
 obj-$(CONFIG_TOUCHSCREEN_TSC2005)  += tsc2005.o
+obj-$(CONFIG_TOUCHSCREEN_OMAP) += omap/
 obj-$(CONFIG_TOUCHSCREEN_WM97XX)   += wm97xx-ts.o
 wm97xx-ts-$(CONFIG_TOUCHSCREEN_WM9705) += wm9705.o
 wm97xx-ts-$(CONFIG_TOUCHSCREEN_WM9712) += wm9712.o
diff --git a/drivers/input/touchscreen/omap/Makefile 
b/drivers/input/touchscreen/omap/Makefile
new file mode 100644
index 000..af6344e
--- /dev/null
+++ b/drivers/input/touchscreen/omap/Makefile
@@ -0,0 +1,10 @@
+#
+# Makefile for the OMAP touchscreen input driver
+#
+
+obj-$(CONFIG_TOUCHSCREEN_OMAP) += omapts.o
+
+objs-$(CONFIG_ARCH_OMAP16XX)$(CONFIG_MACH_OMAP_H2) += ts_hx.o
+objs-$(CONFIG_ARCH_OMAP16XX)$(CONFIG_MACH_OMAP_H3) += ts_hx.o
+
+omapts-objs := omap_ts.o $(objs-yy)
diff --git a/drivers/input/touchscreen/omap/omap_ts.c 
b/drivers/input/touchscreen/omap/omap_ts.c
new file mode 100644
index 000..ee85755
--- /dev/null
+++ b/drivers/input/touchscreen/omap/omap_ts.c
@@ -0,0 +1,267 @@
+/*
+ * input/touchscreen/omap/omap_ts.c
+ *
+ * touchscreen input device driver for various TI OMAP boards
+ * Copyright (c) 2002 MontaVista Software Inc.
+ * Copyright (c) 2004 Texas Instruments, Inc.
+ * Cleanup and modularization 2004 by Dirk Behme [EMAIL PROTECTED]
+ *
+ * Assembled using driver code copyright the companies above.
+ *
+ * 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
+ * History:
+ * 12/12/2004Srinath Modified and intergrated code for H2 and H3
+ *
+ */
+
+#include linux/errno.h
+#include linux/kernel.h
+#include linux/module.h
+#include linux/slab.h
+#include linux/input.h
+#include linux/init.h
+#include linux/wait.h
+#include linux/interrupt.h
+#include linux/suspend.h
+#include linux/platform_device.h
+
+#include asm/mach-types.h
+
+//#define DEBUG
+
+#include omap_ts.h
+
+#define OMAP_TS_NAME   omap_ts
+
+static struct ts_device *__initdata ts_devs[] = {
+#if defined(CONFIG_MACH_OMAP_H2) || defined(CONFIG_MACH_OMAP_H3)
+   hx_ts,
+#endif
+};
+
+static struct omap_ts_t ts_omap;
+
+static int omap_ts_read(void)
+{
+   u16 data[4] = { 0, 0, 0, 0 };
+
+   ts_omap.dev-read(data);
+
+   input_report_abs(ts_omap.inputdevice, ABS_X, data[0]);
+   input_report_abs(ts_omap.inputdevice, ABS_Y, data[1]);
+   input_report_abs(ts_omap.inputdevice, ABS_PRESSURE, data[2]);
+   input_sync(ts_omap.inputdevice);
+
+   DEBUG_TS(omap_ts_read: read x=%d,y=%d,p=%d\n, data[0], data[1],
+data[2]);
+
+   return 0;
+}
+
+static void omap_ts_timer(unsigned long data)
+{
+   unsigned long flags;
+
+   spin_lock_irqsave(ts_omap.lock, flags);
+
+   if (!ts_omap.dev-penup()) {
+   if (!ts_omap.touched) {
+   DEBUG_TS(omap_ts_timer: pen down\n);
+   input_report_key(ts_omap.inputdevice, BTN_TOUCH, 1);
+   }
+   ts_omap.touched = 1;
+   omap_ts_read();
+   ts_omap.ts_timer.expires = jiffies + HZ / 100;
+   add_timer((ts_omap.ts_timer));
+   } else {
+   if (ts_omap.touched) {
+   DEBUG_TS(omap_ts_timer: pen up\n);
+   ts_omap.touched = 0;
+   input_report_abs(ts_omap.inputdevice, ABS_X, 0);
+  

[PATCH 22/33] add omap nand drivers

2008-08-30 Thread Felipe Balbi
From: Felipe Balbi [EMAIL PROTECTED]

Signed-off-by: Felipe Balbi [EMAIL PROTECTED]
---
 drivers/mtd/nand/Kconfig   |   19 +
 drivers/mtd/nand/Makefile  |3 +
 drivers/mtd/nand/omap-hw.c |  860 
 drivers/mtd/nand/omap-nand-flash.c |  186 
 drivers/mtd/nand/omap2.c   |  757 +++
 5 files changed, 1825 insertions(+), 0 deletions(-)
 create mode 100644 drivers/mtd/nand/omap-hw.c
 create mode 100644 drivers/mtd/nand/omap-nand-flash.c
 create mode 100644 drivers/mtd/nand/omap2.c

diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig
index 41f361c..ed1a331 100644
--- a/drivers/mtd/nand/Kconfig
+++ b/drivers/mtd/nand/Kconfig
@@ -68,6 +68,25 @@ config MTD_NAND_AMS_DELTA
help
  Support for NAND flash on Amstrad E3 (Delta).
 
+config MTD_NAND_OMAP2
+   tristate NAND Flash device on OMAP2 and OMAP3
+   depends on ARM  MTD_NAND  (ARCH_OMAP2 || ARCH_OMAP3)
+   help
+  Support for NAND flash on Texas Instruments OMAP2 and OMAP3 
platforms.
+
+config MTD_NAND_OMAP
+   tristate NAND Flash device on OMAP H3/H2/P2 boards
+   depends on ARM  ARCH_OMAP1  MTD_NAND  (MACH_OMAP_H2 || 
MACH_OMAP_H3 || MACH_OMAP_PERSEUS2)
+   help
+ Support for NAND flash on Texas Instruments H3/H2/P2 platforms.
+
+config MTD_NAND_OMAP_HW
+   bool OMAP HW NAND Flash controller support
+depends on ARM  ARCH_OMAP16XX  MTD_NAND
+
+   help
+ Driver for TI OMAP16xx hardware NAND flash controller.
+
 config MTD_NAND_TOTO
tristate NAND Flash device on TOTO board
depends on ARCH_OMAP  BROKEN
diff --git a/drivers/mtd/nand/Makefile b/drivers/mtd/nand/Makefile
index b786c5d..ba42584 100644
--- a/drivers/mtd/nand/Makefile
+++ b/drivers/mtd/nand/Makefile
@@ -24,6 +24,9 @@ obj-$(CONFIG_MTD_NAND_NANDSIM)+= nandsim.o
 obj-$(CONFIG_MTD_NAND_CS553X)  += cs553x_nand.o
 obj-$(CONFIG_MTD_NAND_NDFC)+= ndfc.o
 obj-$(CONFIG_MTD_NAND_ATMEL)   += atmel_nand.o
+obj-$(CONFIG_MTD_NAND_OMAP)+= omap-nand-flash.o
+obj-$(CONFIG_MTD_NAND_OMAP2)   += omap2.o
+obj-$(CONFIG_MTD_NAND_OMAP_HW) += omap-hw.o
 obj-$(CONFIG_MTD_NAND_CM_X270) += cmx270_nand.o
 obj-$(CONFIG_MTD_NAND_BASLER_EXCITE)   += excite_nandflash.o
 obj-$(CONFIG_MTD_NAND_PXA3xx)  += pxa3xx_nand.o
diff --git a/drivers/mtd/nand/omap-hw.c b/drivers/mtd/nand/omap-hw.c
new file mode 100644
index 000..c598d9d
--- /dev/null
+++ b/drivers/mtd/nand/omap-hw.c
@@ -0,0 +1,860 @@
+/*
+ *  drivers/mtd/nand/omap-hw.c
+ *
+ *  This is the MTD driver for OMAP1710 internal HW NAND controller.
+ *
+ *  Copyright (C) 2004-2006 Nokia Corporation
+ *
+ *  Author: Jarkko Lavinen [EMAIL PROTECTED] and
+ *  Juha Yrjölä [EMAIL PROTECTED]
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ *
+ * 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; see the file COPYING. If not, write to the Free Software
+ * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+#include linux/slab.h
+#include linux/init.h
+#include linux/module.h
+#include linux/delay.h
+#include linux/delay.h
+#include linux/errno.h
+#include linux/sched.h
+#include linux/types.h
+#include linux/wait.h
+#include linux/spinlock.h
+#include linux/interrupt.h
+#include linux/mtd/mtd.h
+#include linux/mtd/nand.h
+#include linux/mtd/partitions.h
+#include linux/mtd/nand_ecc.h
+#include linux/dma-mapping.h
+#include linux/clk.h
+
+#include asm/io.h
+
+#include mach/board.h
+#include mach/dma.h
+
+#define NAND_BASE  0xfffbcc00
+#define NND_REVISION   0x00
+#define NND_ACCESS 0x04
+#define NND_ADDR_SRC   0x08
+#define NND_CTRL   0x10
+#define NND_MASK   0x14
+#define NND_STATUS 0x18
+#define NND_READY  0x1c
+#define NND_COMMAND0x20
+#define NND_COMMAND_SEC0x24
+#define NND_ECC_SELECT 0x28
+#define NND_ECC_START  0x2c
+#define NND_ECC_9  0x4c
+#define NND_RESET  0x50
+#define NND_FIFO   0x54
+#define NND_FIFOCTRL   0x58
+#define NND_PSC_CLK0x5c
+#define NND_SYSTEST0x60
+#define NND_SYSCFG 0x64
+#define NND_SYSSTATUS  0x68
+#define NND_FIFOTEST1  0x6c
+#define NND_FIFOTEST2  0x70
+#define NND_FIFOTEST3  0x74
+#define NND_FIFOTEST4  0x78
+#define NND_PSC1_CLK   0x8c

[PATCH 21/33] add OMAP HighSpeed mmc controller driver

2008-08-30 Thread Felipe Balbi
From: Felipe Balbi [EMAIL PROTECTED]

Signed-off-by: Felipe Balbi [EMAIL PROTECTED]
---
 drivers/mmc/host/Kconfig  |   13 +-
 drivers/mmc/host/Makefile |1 +
 drivers/mmc/host/omap_hsmmc.c | 1069 +
 3 files changed, 1082 insertions(+), 1 deletions(-)
 create mode 100644 drivers/mmc/host/omap_hsmmc.c

diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig
index ea8d7a3..08e57ae 100644
--- a/drivers/mmc/host/Kconfig
+++ b/drivers/mmc/host/Kconfig
@@ -67,7 +67,7 @@ config MMC_RICOH_MMC
 
 config MMC_OMAP
tristate TI OMAP Multimedia Card Interface support
-   depends on ARCH_OMAP
+   depends on ARCH_OMAP1 || (ARCH_OMAP2  ARCH_OMAP2420)
select TPS65010 if MACH_OMAP_H2
help
  This selects the TI OMAP Multimedia card Interface.
@@ -76,6 +76,17 @@ config MMC_OMAP
 
  If unsure, say N.
 
+config MMC_OMAP_HS
+   tristate TI OMAP High Speed Multimedia Card Interface support
+   depends on (ARCH_OMAP2  ARCH_OMAP2430) || ARCH_OMAP3
+   select TWL4030_CORE if MACH_OMAP_2430SDP || MACH_OMAP_3430SDP
+   help
+ This selects the TI OMAP High Speed Multimedia card Interface.
+ If you have an OMAP2(2430) or OMAP3 board with a Multimedia Card slot,
+ say Y or M here.
+
+ If unsure, say N.
+
 config MMC_WBSD
tristate Winbond W83L51xD SD/MMC Card Interface support
depends on ISA_DMA_API
diff --git a/drivers/mmc/host/Makefile b/drivers/mmc/host/Makefile
index c794cc5..ba477bc 100644
--- a/drivers/mmc/host/Makefile
+++ b/drivers/mmc/host/Makefile
@@ -15,6 +15,7 @@ obj-$(CONFIG_MMC_RICOH_MMC)   += ricoh_mmc.o
 obj-$(CONFIG_MMC_WBSD) += wbsd.o
 obj-$(CONFIG_MMC_AU1X) += au1xmmc.o
 obj-$(CONFIG_MMC_OMAP) += omap.o
+obj-$(CONFIG_MMC_OMAP_HS)  += omap_hsmmc.o
 obj-$(CONFIG_MMC_AT91) += at91_mci.o
 obj-$(CONFIG_MMC_ATMELMCI) += atmel-mci.o
 obj-$(CONFIG_MMC_TIFM_SD)  += tifm_sd.o
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
new file mode 100644
index 000..af34871
--- /dev/null
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -0,0 +1,1069 @@
+/*
+ * drivers/mmc/host/omap_hsmmc.c
+ *
+ * Driver for OMAP2430/3430 MMC controller.
+ *
+ * Copyright (C) 2007 Texas Instruments.
+ *
+ * Authors:
+ * Syed Mohammed Khasim[EMAIL PROTECTED]
+ * Madhusudhan [EMAIL PROTECTED]
+ * Mohit Jalori[EMAIL PROTECTED]
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2. This program is licensed as is without any warranty of any
+ * kind, whether express or implied.
+ */
+
+#include linux/module.h
+#include linux/init.h
+#include linux/interrupt.h
+#include linux/delay.h
+#include linux/dma-mapping.h
+#include linux/platform_device.h
+#include linux/workqueue.h
+#include linux/timer.h
+#include linux/clk.h
+#include linux/mmc/host.h
+#include linux/io.h
+#include linux/semaphore.h
+#include asm/dma.h
+#include mach/hardware.h
+#include mach/board.h
+#include mach/mmc.h
+#include mach/cpu.h
+
+/* OMAP HSMMC Host Controller Registers */
+#define OMAP_HSMMC_SYSCONFIG   0x0010
+#define OMAP_HSMMC_CON 0x002C
+#define OMAP_HSMMC_BLK 0x0104
+#define OMAP_HSMMC_ARG 0x0108
+#define OMAP_HSMMC_CMD 0x010C
+#define OMAP_HSMMC_RSP10   0x0110
+#define OMAP_HSMMC_RSP32   0x0114
+#define OMAP_HSMMC_RSP54   0x0118
+#define OMAP_HSMMC_RSP76   0x011C
+#define OMAP_HSMMC_DATA0x0120
+#define OMAP_HSMMC_HCTL0x0128
+#define OMAP_HSMMC_SYSCTL  0x012C
+#define OMAP_HSMMC_STAT0x0130
+#define OMAP_HSMMC_IE  0x0134
+#define OMAP_HSMMC_ISE 0x0138
+#define OMAP_HSMMC_CAPA0x0140
+
+#define VS18   (126)
+#define VS30   (125)
+#define SDVS18 (0x59)
+#define SDVS30 (0x69)
+#define SDVSCLR0xF1FF
+#define SDVSDET0x0400
+#define AUTOIDLE   0x1
+#define SDBP   (18)
+#define DTO0xe
+#define ICE0x1
+#define ICS0x2
+#define CEN(12)
+#define CLKD_MASK  0xFFC0
+#define INT_EN_MASK0x307F0033
+#define INIT_STREAM(11)
+#define DP_SELECT  (121)
+#define DDIR   (14)
+#define DMA_EN 0x1
+#define MSBS   15
+#define BCE11
+#define FOUR_BIT   1  1
+#define CC 0x1
+#define TC 0x02
+#define OD 0x1
+#define ERR(1  15)
+#define CMD_TIMEOUT(1  16)
+#define DATA_TIMEOUT   (1  20)
+#define CMD_CRC(1  17)
+#define DATA_CRC   (1  21)
+#define CARD_ERR   (1  28)
+#define 

[PATCH 25/33] add TWL4030 Battery Charger Interface driver

2008-08-30 Thread Felipe Balbi
From: Felipe Balbi [EMAIL PROTECTED]

Signed-off-by: Felipe Balbi [EMAIL PROTECTED]
---
 drivers/power/Kconfig   |8 +
 drivers/power/Makefile  |1 +
 drivers/power/twl4030_bci_battery.c | 1080 +++
 3 files changed, 1089 insertions(+), 0 deletions(-)
 create mode 100644 drivers/power/twl4030_bci_battery.c

diff --git a/drivers/power/Kconfig b/drivers/power/Kconfig
index 18b70fa..7bd8c2b 100644
--- a/drivers/power/Kconfig
+++ b/drivers/power/Kconfig
@@ -70,6 +70,14 @@ config BATTERY_BQ27200
help
  Say Y here to enable support for batteries with BQ27200(I2C) chip.
 
+config TWL4030_BCI_BATTERY
+   tristate OMAP TWL4030 BCI Battery driver
+   depends on (MACH_OMAP_2430SDP || MACH_OMAP_3430SDP)  TWL4030_MADC
+   default y
+   help
+ Support for OMAP TWL4030 BCI Battery driver.
+ This driver can give support for TWL4030 Battery Charge Interface.
+
 config BATTERY_TOSA
tristate Sharp SL-6000 (tosa) battery
depends on MACH_TOSA  MFD_TC6393XB
diff --git a/drivers/power/Makefile b/drivers/power/Makefile
index dc6cfa3..8da941a 100644
--- a/drivers/power/Makefile
+++ b/drivers/power/Makefile
@@ -21,5 +21,6 @@ obj-$(CONFIG_BATTERY_DS2760)  += ds2760_battery.o
 obj-$(CONFIG_BATTERY_PMU)  += pmu_battery.o
 obj-$(CONFIG_BATTERY_OLPC) += olpc_battery.o
 obj-$(CONFIG_BATTERY_BQ27x00)   += bq27x00_battery.o
+obj-$(CONFIG_TWL4030_BCI_BATTERY)  += twl4030_bci_battery.o
 obj-$(CONFIG_BATTERY_TOSA) += tosa_battery.o
 obj-$(CONFIG_BATTERY_PALMTX)   += palmtx_battery.o
diff --git a/drivers/power/twl4030_bci_battery.c 
b/drivers/power/twl4030_bci_battery.c
new file mode 100644
index 000..d30a0e4
--- /dev/null
+++ b/drivers/power/twl4030_bci_battery.c
@@ -0,0 +1,1080 @@
+/*
+ * linux/drivers/power/twl4030_bci_battery.c
+ *
+ * OMAP2430/3430 BCI battery driver for Linux
+ *
+ * Copyright (C) 2008 Texas Instruments, Inc.
+ * Author: Texas Instruments, Inc.
+ *
+ * This package is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ */
+
+#include linux/init.h
+#include linux/module.h
+#include linux/device.h
+#include linux/interrupt.h
+#include linux/delay.h
+#include linux/platform_device.h
+#include linux/i2c/twl4030.h
+#include linux/power_supply.h
+#include asm/arch/bci.h
+#include linux/i2c/twl4030-madc.h
+
+#define T2_BATTERY_VOLT0x04
+#define T2_BATTERY_TEMP0x06
+#define T2_BATTERY_CUR 0x08
+
+/* charger constants */
+#define NO_PW_CONN 0
+#define AC_PW_CONN 0x01
+#define USB_PW_CONN0x02
+
+/* TWL4030_MODULE_USB */
+#define REG_POWER_CTRL 0x0AC
+#define OTG_EN 0x020
+#define REG_PHY_CLK_CTRL   0x0FE
+#define REG_PHY_CLK_CTRL_STS   0x0FF
+#define PHY_DPLL_CLK   0x01
+
+#define REG_BCICTL10x023
+#define REG_BCICTL20x024
+#define CGAIN  0x020
+#define ITHEN  0x010
+#define ITHSENS0x007
+
+/* Boot BCI flag bits */
+#define BCIAUTOWEN 0x020
+#define CONFIG_DONE0x010
+#define BCIAUTOUSB 0x002
+#define BCIAUTOAC  0x001
+#define BCIMSTAT_MASK  0x03F
+
+/* Boot BCI register */
+#define REG_BOOT_BCI   0x007
+#define REG_CTRL1  0x00
+#define REG_SW1SELECT_MSB  0x07
+#define SW1_CH9_SEL0x02
+#define REG_CTRL_SW1   0x012
+#define SW1_TRIGGER0x020
+#define EOC_SW10x002
+#define REG_GPCH9  0x049
+#define REG_STS_HW_CONDITIONS  0x0F
+#define STS_VBUS   0x080
+#define STS_CHG0x02
+#define REG_BCIMSTATEC 0x02
+#define REG_BCIMFSTS4  0x010
+#define REG_BCIMFSTS2  0x00E
+#define REG_BCIMFSTS3  0x00F
+#define REG_BCIMFSTS1  0x001
+#define USBFASTMCHG0x004
+#define BATSTSPCHG 0x004
+#define BATSTSMCHG 0x040
+#define VBATOV40x020
+#define VBATOV30x010
+#define VBATOV20x008
+#define VBATOV10x004
+#define REG_BB_CFG 0x012
+#define BBCHEN 0x010
+
+/* Power supply charge interrupt */
+#define REG_PWR_ISR1   0x00
+#define REG_PWR_IMR1   0x01
+#define REG_PWR_EDR1   0x05
+#define REG_PWR_SIH_CTRL   0x007
+
+#define USB_PRES   0x004
+#define CHG_PRES   0x002
+
+#define USB_PRES_RISING0x020
+#define USB_PRES_FALLING   0x010
+#define CHG_PRES_RISING

[PATCH 27/33] add tsc210x driver

2008-08-30 Thread Felipe Balbi
From: Felipe Balbi [EMAIL PROTECTED]

Signed-off-by: Felipe Balbi [EMAIL PROTECTED]
---
 drivers/spi/Kconfig   |   19 +
 drivers/spi/Makefile  |1 +
 drivers/spi/tsc210x.c | 1262 +
 3 files changed, 1282 insertions(+), 0 deletions(-)
 create mode 100644 drivers/spi/tsc210x.c

diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
index b9d0efb..2a200ff 100644
--- a/drivers/spi/Kconfig
+++ b/drivers/spi/Kconfig
@@ -225,6 +225,25 @@ config SPI_AT25
  This driver can also be built as a module.  If so, the module
  will be called at25.
 
+config SPI_TSC210X
+   depends on SPI_MASTER  EXPERIMENTAL
+   tristate TI TSC210x (TSC2101/TSC2102) support
+   help
+ Say Y here if you want support for the TSC210x chips.  Some
+ boards use these for touchscreen and audio support.
+
+ These are members of a family of highly integrated PDA analog
+ interface circuit.  They include a 12-bit ADC used for battery,
+ temperature, touchscreen, and other sensors.  They also have
+ an audio DAC and amplifier, and in some models an audio ADC.
+ The audio support is highly chip-specific, but most of the
+ sensor support works the same.
+
+ Note that the device has to be present in the board's SPI
+ devices table for this driver to load.  This driver doesn't
+ automatically enable touchscreen, sensors or audio
+ functionality - enable these in their respective menus.
+
 config SPI_SPIDEV
tristate User mode SPI device driver support
depends on EXPERIMENTAL
diff --git a/drivers/spi/Makefile b/drivers/spi/Makefile
index ccf18de..bf12723 100644
--- a/drivers/spi/Makefile
+++ b/drivers/spi/Makefile
@@ -35,6 +35,7 @@ obj-$(CONFIG_SPI_SH_SCI)  += spi_sh_sci.o
 obj-$(CONFIG_SPI_AT25) += at25.o
 obj-$(CONFIG_SPI_SPIDEV)   += spidev.o
 obj-$(CONFIG_SPI_TLE62X0)  += tle62x0.o
+obj-$(CONFIG_SPI_TSC210X)  += tsc210x.o
 #  ... add above this line ...
 
 # SPI slave controller drivers (upstream link)
diff --git a/drivers/spi/tsc210x.c b/drivers/spi/tsc210x.c
new file mode 100644
index 000..1d2ac94
--- /dev/null
+++ b/drivers/spi/tsc210x.c
@@ -0,0 +1,1262 @@
+/*
+ * tsc210x.c - TSC2101/2102/... driver core
+ *
+ * Copyright (c) 2005-2007 Andrzej Zaborowski  [EMAIL PROTECTED]
+ *
+ * This package 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 package 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 package; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include linux/module.h
+#include linux/init.h
+#include linux/errno.h
+#include linux/platform_device.h
+#include linux/suspend.h
+#include linux/interrupt.h
+#include linux/clk.h
+#include linux/err.h
+#include linux/mutex.h
+#include linux/workqueue.h
+#include linux/completion.h
+#include linux/autoconf.h
+#include linux/spi/spi.h
+#include linux/spi/tsc210x.h
+
+
+/* NOTE:  It should be straightforward to make this driver framework handle
+ * tsc2100 and tsc2111 chips, and maybe others too.  The main differences
+ * are in the audio codec capabilities, but there are also some differences
+ * in how the various sensors (including touchscreen) are handled.
+ */
+
+/* Bit field definitions for chip registers */
+
+/* Scan X, Y, Z1, Z2, chip controlled, 12-bit, 16 samples, 500 usec */
+#define TSC210X_ADC_TS_CONTROL 0x8bf4
+/* Scan BAT1, BAT2, AUX1, AUX2, 12-bit, 16 samples, 500 usec */
+#define TSC210X_ADC_SCAN_CONTROL   0x2ff4
+/* Scan TEMP1, 12-bit, 16 samples, 500 usec */
+#define TSC210X_ADC_T1_CONTROL 0x2bf4
+/* Scan TEMP2, 12-bit, 16 samples, 500 usec */
+#define TSC210X_ADC_T2_CONTROL 0x33f4
+/* PINT/DAV acts as DAV */
+#define TSC210X_ADC_DAV0x4000
+/* Internal reference, 100 usec delay, 1.25 V reference */
+#define TSC210X_ADC_INT_REF0x0016
+/* External reference, 100 usec delay, 1.25 V reference */
+#define TSC210X_ADC_EXT_REF0x0002
+/* 84 usec precharge time, 32 usec sense time */
+#define TSC210X_CONFIG_TIMES   0x0008
+/* The reset sequence */
+#define TSC210X_RESET  0xbb00
+/* Pen Status bit */
+#define TSC210X_ADC_PSTCM  (1  15)
+/* A/D Status bit */
+#define TSC210X_ADC_ADST   (1  14)
+/* (At least) One of X, Y, Z1, Z2 contains data */
+#define TSC210X_TS_DAV 0x0780
+/* 

[PATCH 23/33] add omap irda driver

2008-08-30 Thread Felipe Balbi
From: Felipe Balbi [EMAIL PROTECTED]

Signed-off-by: Felipe Balbi [EMAIL PROTECTED]
---
 drivers/net/irda/Kconfig   |   10 +
 drivers/net/irda/Makefile  |1 +
 drivers/net/irda/omap-ir.c |  901 
 3 files changed, 912 insertions(+), 0 deletions(-)
 create mode 100644 drivers/net/irda/omap-ir.c

diff --git a/drivers/net/irda/Kconfig b/drivers/net/irda/Kconfig
index e631755..b83e25b 100644
--- a/drivers/net/irda/Kconfig
+++ b/drivers/net/irda/Kconfig
@@ -342,5 +342,15 @@ config MCS_FIR
  To compile it as a module, choose M here: the module will be called
  mcs7780.
 
+config OMAP_IR
+   tristate OMAP IrDA(SIR/MIR/FIR)
+   depends on IRDA  ARCH_OMAP
+   select GPIOEXPANDER_OMAP if (MACH_OMAP_H3 || MACH_OMAP_H4)
+help
+ Say Y here if you want to build support for the Texas Instruments
+ OMAP IrDA device driver, which supports SIR/MIR/FIR. This driver
+ relies on platform specific helper routines so available capabilities
+ may vary from one OMAP target to another.
+
 endmenu
 
diff --git a/drivers/net/irda/Makefile b/drivers/net/irda/Makefile
index 5d20fde..49e6f06 100644
--- a/drivers/net/irda/Makefile
+++ b/drivers/net/irda/Makefile
@@ -18,6 +18,7 @@ obj-$(CONFIG_VLSI_FIR)+= vlsi_ir.o
 obj-$(CONFIG_VIA_FIR)  += via-ircc.o
 obj-$(CONFIG_PXA_FICP) += pxaficp_ir.o
 obj-$(CONFIG_MCS_FIR)  += mcs7780.o
+obj-$(CONFIG_OMAP_IR)  += omap-ir.o
 obj-$(CONFIG_AU1000_FIR)   += au1k_ir.o
 # SIR drivers
 obj-$(CONFIG_IRTTY_SIR)+= irtty-sir.o  sir-dev.o
diff --git a/drivers/net/irda/omap-ir.c b/drivers/net/irda/omap-ir.c
new file mode 100644
index 000..b706253
--- /dev/null
+++ b/drivers/net/irda/omap-ir.c
@@ -0,0 +1,901 @@
+/*
+ * BRIEF MODULE DESCRIPTION
+ *
+ * Infra-red driver for the OMAP1610-H2 and OMAP1710-H3 and H4 Platforms
+ *   (SIR/MIR/FIR modes)
+ *   (based on omap-sir.c)
+ *
+ * Copyright 2003 MontaVista Software Inc.
+ * Author: MontaVista Software, Inc.
+ *[EMAIL PROTECTED]
+ *
+ * Copyright 2004 Texas Instruments.
+ *
+ *  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  SOFTWARE  IS PROVIDED  ``AS  IS'' AND   ANY  EXPRESS OR 
IMPLIED
+ *  WARRANTIES,  INCLUDING, BUT NOT  LIMITED  TO, THE IMPLIED 
WARRANTIES OF
+ *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN
+ *  NO EVENT  SHALL   THE AUTHOR  BELIABLE FOR ANY   DIRECT, INDIRECT,
+ *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ *  NOT LIMITED  TO, PROCUREMENT OF  SUBSTITUTE GOODS  OR SERVICES; 
LOSS OF
+ *  USE, DATA, OR PROFITS; OR  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ *  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR 
TORT
+ *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ *  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *  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.,
+ *  675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ Modifications:
+ Feb 2004, Texas Instruments
+ - Ported to 2.6 kernel (Feb 2004).
+ *
+ Apr 2004, Texas Instruments
+ - Added support for H3 (Apr 2004).
+ Nov 2004, Texas Instruments
+ - Added support for Power Management.
+ */
+
+#include linux/module.h
+#include linux/types.h
+#include linux/init.h
+#include linux/errno.h
+#include linux/netdevice.h
+#include linux/slab.h
+#include linux/rtnetlink.h
+#include linux/interrupt.h
+#include linux/delay.h
+#include linux/ioport.h
+#include linux/dma-mapping.h
+#include linux/platform_device.h
+#include linux/i2c.h
+#include linux/workqueue.h
+
+#include net/irda/irda.h
+#include net/irda/irmod.h
+#include net/irda/wrapper.h
+#include net/irda/irda_device.h
+
+#include asm/irq.h
+#include asm/io.h
+#include mach/hardware.h
+#include asm/serial.h
+#include asm/mach-types.h
+#include asm/dma.h
+#include mach/mux.h
+#include mach/gpio.h
+#include mach/irda.h
+
+#define UART3_EFR_EN   (1  4)
+#define UART3_MCR_EN_TCR_TLR   (1  6)
+
+#define UART3_LCR_WL_8 (3  0)
+#define UART3_LCR_SP2  (1  2)
+#define UART3_LCR_DIVEN(1  7)
+
+#define UART3_FCR_FIFO_EN  (1  0)
+#define UART3_FCR_FIFO_RX  (1  1)
+#define UART3_FCR_FIFO_TX  (1  2)
+#define UART3_FCR_FIFO_DMA1(1  3)
+#define UART3_FCR_FIFO_TX_TRIG16   (1  4)
+#define UART3_FCR_FIFO_RX_TRIG16   (1  6)
+#define UART3_FCR_CONFIG   (\
+   UART3_FCR_FIFO_EN | UART3_FCR_FIFO_RX   |\
+

[PATCH 30/33] add omap backlight support

2008-08-30 Thread Felipe Balbi
From: Felipe Balbi [EMAIL PROTECTED]

Signed-off-by: Felipe Balbi [EMAIL PROTECTED]
---
 drivers/video/backlight/Kconfig   |9 ++
 drivers/video/backlight/Makefile  |1 +
 drivers/video/backlight/omap_bl.c |  218 +
 3 files changed, 228 insertions(+), 0 deletions(-)
 create mode 100644 drivers/video/backlight/omap_bl.c

diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig
index 452b770..6b8cb23 100644
--- a/drivers/video/backlight/Kconfig
+++ b/drivers/video/backlight/Kconfig
@@ -133,6 +133,15 @@ config BACKLIGHT_HP680
  If you have a HP Jornada 680, say y to enable the
  backlight driver.
 
+config BACKLIGHT_OMAP
+   tristate OMAP LCD Backlight
+   depends on BACKLIGHT_CLASS_DEVICE  (ARCH_OMAP1 || ARCH_OMAP2)
+   default y
+   help
+ This driver controls the LCD backlight level and power
+ for the PWL module of OMAP processors.  Say Y if you plan
+ to use power saving.
+
 config BACKLIGHT_PROGEAR
tristate Frontpath ProGear Backlight Driver
depends on BACKLIGHT_CLASS_DEVICE  PCI  X86
diff --git a/drivers/video/backlight/Makefile b/drivers/video/backlight/Makefile
index b405aac..a317041 100644
--- a/drivers/video/backlight/Makefile
+++ b/drivers/video/backlight/Makefile
@@ -12,6 +12,7 @@ obj-$(CONFIG_BACKLIGHT_CORGI) += corgi_bl.o
 obj-$(CONFIG_BACKLIGHT_HP680)  += hp680_bl.o
 obj-$(CONFIG_BACKLIGHT_LOCOMO) += locomolcd.o
 obj-$(CONFIG_BACKLIGHT_OMAP1)  += omap1_bl.o
+obj-$(CONFIG_BACKLIGHT_OMAP)   += omap_bl.o
 obj-$(CONFIG_BACKLIGHT_PROGEAR) += progear_bl.o
 obj-$(CONFIG_BACKLIGHT_CARILLO_RANCH) += cr_bllcd.o
 obj-$(CONFIG_BACKLIGHT_PWM)+= pwm_bl.o
diff --git a/drivers/video/backlight/omap_bl.c 
b/drivers/video/backlight/omap_bl.c
new file mode 100644
index 000..eb9b5ba
--- /dev/null
+++ b/drivers/video/backlight/omap_bl.c
@@ -0,0 +1,218 @@
+/*
+ * drivers/video/backlight/omap_bl.c
+ *
+ * Backlight driver for OMAP based boards.
+ *
+ * Copyright (c) 2006 Andrzej Zaborowski  [EMAIL PROTECTED]
+ *
+ * This package 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 package 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 package; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include linux/module.h
+#include linux/kernel.h
+#include linux/init.h
+#include linux/platform_device.h
+#include linux/fb.h
+#include linux/backlight.h
+
+#include mach/hardware.h
+#include mach/board.h
+#include mach/mux.h
+
+#define OMAPBL_MAX_INTENSITY   0xff
+
+struct omap_backlight {
+   int powermode;
+   int current_intensity;
+
+   struct device *dev;
+   struct omap_backlight_config *pdata;
+};
+
+static void inline omapbl_send_intensity(int intensity)
+{
+   omap_writeb(intensity, OMAP_PWL_ENABLE);
+}
+
+static void inline omapbl_send_enable(int enable)
+{
+   omap_writeb(enable, OMAP_PWL_CLK_ENABLE);
+}
+
+static void omapbl_blank(struct omap_backlight *bl, int mode)
+{
+   if (bl-pdata-set_power)
+   bl-pdata-set_power(bl-dev, mode);
+
+   switch (mode) {
+   case FB_BLANK_NORMAL:
+   case FB_BLANK_VSYNC_SUSPEND:
+   case FB_BLANK_HSYNC_SUSPEND:
+   case FB_BLANK_POWERDOWN:
+   omapbl_send_intensity(0);
+   omapbl_send_enable(0);
+   break;
+
+   case FB_BLANK_UNBLANK:
+   omapbl_send_intensity(bl-current_intensity);
+   omapbl_send_enable(1);
+   break;
+   }
+}
+
+#ifdef CONFIG_PM
+static int omapbl_suspend(struct platform_device *pdev, pm_message_t state)
+{
+   struct backlight_device *dev = platform_get_drvdata(pdev);
+   struct omap_backlight *bl = dev_get_drvdata(dev-dev);
+
+   omapbl_blank(bl, FB_BLANK_POWERDOWN);
+   return 0;
+}
+
+static int omapbl_resume(struct platform_device *pdev)
+{
+   struct backlight_device *dev = platform_get_drvdata(pdev);
+   struct omap_backlight *bl = dev_get_drvdata(dev-dev);
+
+   omapbl_blank(bl, bl-powermode);
+   return 0;
+}
+#else
+#define omapbl_suspend NULL
+#define omapbl_resume  NULL
+#endif
+
+static int omapbl_set_power(struct backlight_device *dev, int state)
+{
+   struct omap_backlight *bl = dev_get_drvdata(dev-dev);
+
+   omapbl_blank(bl, state);
+   bl-powermode = state;
+
+   return 0;
+}
+
+static int omapbl_update_status(struct backlight_device *dev)
+{
+   struct 

[PATCH 32/33] add omap 1-wire interface driver

2008-08-30 Thread Felipe Balbi
From: Felipe Balbi [EMAIL PROTECTED]

Signed-off-by: Felipe Balbi [EMAIL PROTECTED]
---
 arch/arm/plat-omap/include/mach/irqs.h |2 +
 drivers/w1/masters/Kconfig |7 +
 drivers/w1/masters/Makefile|1 +
 drivers/w1/masters/omap_hdq.c  |  704 
 4 files changed, 714 insertions(+), 0 deletions(-)
 create mode 100644 drivers/w1/masters/omap_hdq.c

diff --git a/arch/arm/plat-omap/include/mach/irqs.h 
b/arch/arm/plat-omap/include/mach/irqs.h
index 17248bb..c9e95a6 100644
--- a/arch/arm/plat-omap/include/mach/irqs.h
+++ b/arch/arm/plat-omap/include/mach/irqs.h
@@ -54,6 +54,8 @@
 #define INT_TIMER2 30
 #define INT_LCD_CTRL   31
 
+#define INT_24XX_HDQ_IRQ   58 /* Temporarily here for driver to build */
+
 /*
  * OMAP-1510 specific IRQ numbers for interrupt handler 1
  */
diff --git a/drivers/w1/masters/Kconfig b/drivers/w1/masters/Kconfig
index c449309..636d4f7 100644
--- a/drivers/w1/masters/Kconfig
+++ b/drivers/w1/masters/Kconfig
@@ -42,6 +42,13 @@ config W1_MASTER_DS1WM
  in HP iPAQ devices like h5xxx, h2200, and ASIC3-based like
  hx4700.
 
+config HDQ_MASTER_OMAP
+   tristate OMAP HDQ driver
+   depends on ARCH_OMAP2430 || ARCH_OMAP34XX
+   help
+ Say Y here if you want support for the 1-wire or HDQ Interface
+ on an OMAP processor.
+
 config W1_MASTER_GPIO
tristate GPIO 1-wire busmaster
depends on GENERIC_GPIO
diff --git a/drivers/w1/masters/Makefile b/drivers/w1/masters/Makefile
index 1420b5b..1daeb6e 100644
--- a/drivers/w1/masters/Makefile
+++ b/drivers/w1/masters/Makefile
@@ -6,4 +6,5 @@ obj-$(CONFIG_W1_MASTER_MATROX)  += matrox_w1.o
 obj-$(CONFIG_W1_MASTER_DS2490) += ds2490.o
 obj-$(CONFIG_W1_MASTER_DS2482) += ds2482.o
 obj-$(CONFIG_W1_MASTER_DS1WM)  += ds1wm.o
+obj-$(CONFIG_HDQ_MASTER_OMAP)  += omap_hdq.o
 obj-$(CONFIG_W1_MASTER_GPIO)   += w1-gpio.o
diff --git a/drivers/w1/masters/omap_hdq.c b/drivers/w1/masters/omap_hdq.c
new file mode 100644
index 000..880e282
--- /dev/null
+++ b/drivers/w1/masters/omap_hdq.c
@@ -0,0 +1,704 @@
+/*
+ * drivers/w1/masters/omap_hdq.c
+ *
+ * Copyright (C) 2007 Texas Instruments, Inc.
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2. This program is licensed as is without any warranty of any
+ * kind, whether express or implied.
+ *
+ */
+#include linux/kernel.h
+#include linux/module.h
+#include linux/platform_device.h
+#include linux/interrupt.h
+#include linux/err.h
+#include linux/clk.h
+#include linux/io.h
+#include asm/irq.h
+#include mach/hardware.h
+
+#include ../w1.h
+#include ../w1_int.h
+
+#defineMOD_NAMEOMAP_HDQ:
+
+#define OMAP_HDQ_REVISION  0x00
+#define OMAP_HDQ_TX_DATA   0x04
+#define OMAP_HDQ_RX_DATA   0x08
+#define OMAP_HDQ_CTRL_STATUS   0x0c
+#define OMAP_HDQ_CTRL_STATUS_INTERRUPTMASK (16)
+#define OMAP_HDQ_CTRL_STATUS_CLOCKENABLE   (15)
+#define OMAP_HDQ_CTRL_STATUS_GO(14)
+#define OMAP_HDQ_CTRL_STATUS_INITIALIZATION(12)
+#define OMAP_HDQ_CTRL_STATUS_DIR   (11)
+#define OMAP_HDQ_CTRL_STATUS_MODE  (10)
+#define OMAP_HDQ_INT_STATUS0x10
+#define OMAP_HDQ_INT_STATUS_TXCOMPLETE (12)
+#define OMAP_HDQ_INT_STATUS_RXCOMPLETE (11)
+#define OMAP_HDQ_INT_STATUS_TIMEOUT(10)
+#define OMAP_HDQ_SYSCONFIG 0x14
+#define OMAP_HDQ_SYSCONFIG_SOFTRESET   (11)
+#define OMAP_HDQ_SYSCONFIG_AUTOIDLE(10)
+#define OMAP_HDQ_SYSSTATUS 0x18
+#define OMAP_HDQ_SYSSTATUS_RESETDONE   (10)
+
+#define OMAP_HDQ_FLAG_CLEAR0
+#define OMAP_HDQ_FLAG_SET  1
+#define OMAP_HDQ_TIMEOUT   (HZ/5)
+
+#define OMAP_HDQ_MAX_USER  4
+
+DECLARE_WAIT_QUEUE_HEAD(hdq_wait_queue);
+int W1_ID;
+
+struct hdq_data {
+   resource_size_t hdq_base;
+   struct  semaphore   hdq_semlock;
+   int hdq_usecount;
+   struct  clk *hdq_ick;
+   struct  clk *hdq_fck;
+   u8  hdq_irqstatus;
+   spinlock_t  hdq_spinlock;
+};
+
+static struct hdq_data *hdq_data;
+
+static int omap_hdq_get(void);
+static int omap_hdq_put(void);
+static int omap_hdq_break(void);
+
+static int __init omap_hdq_probe(struct platform_device *pdev);
+static int omap_hdq_remove(struct platform_device *pdev);
+
+static struct platform_driver omap_hdq_driver = {
+   .probe = omap_hdq_probe,
+   .remove = omap_hdq_remove,
+   .suspend = NULL,
+   .resume = NULL,
+   .driver = {
+   .name = omap_hdq,
+   },
+};
+
+static u8 omap_w1_read_byte(void *data);
+static void omap_w1_write_byte(void *data, u8 byte);

omap: update omap README

2008-08-30 Thread Felipe Balbi
From: Felipe Balbi [EMAIL PROTECTED]

OMAP's README was a bit outdated making references to
__REG() macros and unexistent paths.

Trivial fix.

Signed-off-by: Felipe Balbi [EMAIL PROTECTED]
---

diff --git a/Documentation/arm/OMAP/README b/Documentation/arm/OMAP/README
index f8ffb68..54fa7d4 100644
--- a/Documentation/arm/OMAP/README
+++ b/Documentation/arm/OMAP/README
@@ -5,19 +5,19 @@
 This is the README for Linux 2.6 on ARM based TI OMAP processors.
 
 In the first section it gives some general hints how to start with OMAP Linux.
- 
-When successfully build a OMAP Linux kernel with help of first section and no 
+
+When successfully build a OMAP Linux kernel with help of first section and no
 bootloader is already on the board, section 2 gives some tips how to use
-commercial JTAG tools. 
+commercial JTAG tools.
 
 In March 2004 the Linux Kernel 2.6 for ARM based TI OMAP processors was 
cleaned.
-The goal was to send clean patches to RMK's official ARM tree and to make it 
+The goal was to send clean patches to RMK's official ARM tree and to make it
 easier to add new OMAP processors or boards to the kernel tree. To keep the
-kernel tree clean now, this document describes also some steps how 
-to add code for a new OMAP processor or OMAP based board to the OMAP Linux 2.6 
+kernel tree clean now, this document describes also some steps how
+to add code for a new OMAP processor or OMAP based board to the OMAP Linux 2.6
 kernel tree. This is what the third section of this document is about.
 
-Section 4 of this README reports some rules to be followed to write 
+Section 4 of this README reports some rules to be followed to write
 clean code to make it ready for easy inclusion into public OMAP Linux kernel.
 
 For more information also see TI's 'Linux Community for Texas Instruments OMAP
@@ -29,26 +29,27 @@ There, various downloads and resources can be found (e.g. 
documentation how
 to build the kernel, how to use u-boot with OMAP Linux, pre-built tool chain
 etc.).
 
-The mailing list for OMAP Linux is hosted there, too:
+The mailing list for OMAP Linux is hosted by vger.kernel.org. To subscribe
+send 'subscribe linux-omap' to [EMAIL PROTECTED] For archives see:
 
-http://linux.omap.com/mailman/listinfo
+http://marc.info/?l=linux-omap
 
 
 1. General hints how to start with OMAP Linux
 --
 
-The minimal setup is a arm-linux-gcc cross compiler, make, and some editor.
+The minimal setup is an arm-linux-gcc cross compiler, make, and some editor.
 You will also most likely need a JTAG to flash the bootloader for the first
 time.
 
 The first step is to get a bootloader for your board, u-boot is the
 recommended one:
 
-http://www.denx.de/en/Software/GIT
+http://git.denx.de/?p=u-boot.git;a=summary
 
-Then you need to compile it with the same cross compiler as you would use
-for the Linux kernel. Then you need to flash it to the board either via the
-serial port, or by using a JTAG.
+You need to compile it with the same cross compiler as you would use
+for the Linux kernel and flash it to the board either via the serial
+port, or by using a JTAG.
 
 Once you have the bootloader running, you can compile the kernel.
 
@@ -60,9 +61,9 @@ and is the recommended one.
 
 http://www.muru.com/linux/omap/README_OMAP_GIT
 
-Hint: If you are sitting behind a firewall and have to use a proxy for 
+Hint: If you are sitting behind a firewall and have to use a proxy for
 internet access, you can access GIT by http by setting the
-http_proxy envirionment variable:
+http_proxy environment variable:
 
 http_proxy=http://proxy_username:[EMAIL PROTECTED]:proxy_port/
 
@@ -98,13 +99,13 @@ $ tar xjf linux-2.6.4.tar.bz2
 $ cd linux-2.6.4
 $ cat ../Linux-2.6.4-omap1 | patch -p1
 
-Note: If OMAP patch from muru.com is against a kernel release candidate, 
+Note: If OMAP patch from muru.com is against a kernel release candidate,
 marked by -rcX, then kernel can be found on kernel.org under v2.6/testing/
 
 Now, if you have a local kernel tree, either by GIT or by patch, you
 should look into arch/arm/configs/ to see which of the various omap_xxx
-configurations there you want to use. For example, if you have a OMAP1510
-based Innovator board, you select omap_innovator_1510_defconfig by 
+configurations there you want to use. For example, if you have an OMAP1510
+based Innovator board, you select omap_innovator_1510_defconfig by
 
 $ make omap_innovator_1510_defconfig
 
@@ -137,14 +138,14 @@ Examples are TI's Code Composer Studio (CCS) or 
Lauterbach's TRACE32 JTAG.
 
 - Linux kernel download with CCS
 
-You can use CCS to directly load an ELF file to your board. For example, use  
+You can use CCS to directly load an ELF file to your board. For example, use
 arch/arm/boot/compressed/vmlinux. zImage isn't suited because it is not an ELF
-file. CCS looks for .out files, so copy arch/arm/boot/compressed/vmlinux 
+file. CCS looks for .out files, so copy