summaryrefslogtreecommitdiff
path: root/packages/linux/linux-omap2-git/beagleboard/TWL4030-07.patch
diff options
context:
space:
mode:
Diffstat (limited to 'packages/linux/linux-omap2-git/beagleboard/TWL4030-07.patch')
-rw-r--r--packages/linux/linux-omap2-git/beagleboard/TWL4030-07.patch318
1 files changed, 318 insertions, 0 deletions
diff --git a/packages/linux/linux-omap2-git/beagleboard/TWL4030-07.patch b/packages/linux/linux-omap2-git/beagleboard/TWL4030-07.patch
new file mode 100644
index 0000000000..2847e84f62
--- /dev/null
+++ b/packages/linux/linux-omap2-git/beagleboard/TWL4030-07.patch
@@ -0,0 +1,318 @@
+X-Mozilla-Status: 0001
+X-Mozilla-Status2: 00000000
+Return-Path: <linux-omap-owner@vger.kernel.org>
+X-Spam-Checker-Version: SpamAssassin 3.2.2 (2007-07-23) on
+ morningsun.geekisp.com
+X-Spam-Level:
+X-Spam-Status: No, score=-3.0 required=5.0 tests=AWL,DKIM_POLICY_SIGNSOME,
+ DK_POLICY_SIGNSOME,RCVD_IN_DNSWL_MED autolearn=ham version=3.2.2
+Delivered-To: balister.org-philip@balister.org
+Received: (qmail 26193 invoked by uid 1003); 18 Jul 2008 01:35:31 -0000
+Received: from vger.kernel.org (209.132.176.167)
+ by mail.geekisp.com with SMTP; 18 Jul 2008 01:35:31 -0000
+Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
+ id S1752321AbYGRBfb (ORCPT <rfc822;philip@balister.org>);
+ Thu, 17 Jul 2008 21:35:31 -0400
+Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756854AbYGRBfb
+ (ORCPT <rfc822;linux-omap-outgoing>);
+ Thu, 17 Jul 2008 21:35:31 -0400
+Received: from utopia.booyaka.com ([72.9.107.138]:49367 "EHLO
+ utopia.booyaka.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org
+ with ESMTP id S1756351AbYGRBfZ (ORCPT
+ <rfc822;linux-omap@vger.kernel.org>); Thu, 17 Jul 2008 21:35:25 -0400
+Received: (qmail 13892 invoked by uid 526); 18 Jul 2008 01:35:23 -0000
+MBOX-Line: From nobody Thu Jul 17 19:34:54 2008
+From: Paul Walmsley <paul@pwsan.com>
+Subject: [PATCH 7/9] TWL4030: move TWL module register defs into separate
+ include files
+To: linux-omap@vger.kernel.org
+Date: Thu, 17 Jul 2008 19:34:54 -0600
+Message-ID: <20080718013453.18943.69329.stgit@localhost.localdomain>
+In-Reply-To: <20080718013205.18943.34047.stgit@localhost.localdomain>
+References: <20080718013205.18943.34047.stgit@localhost.localdomain>
+User-Agent: StGIT/0.14.3.163.g06f9
+MIME-Version: 1.0
+Content-Type: text/plain; charset="utf-8"
+Content-Transfer-Encoding: 7bit
+Sender: linux-omap-owner@vger.kernel.org
+Precedence: bulk
+List-ID: <linux-omap.vger.kernel.org>
+X-Mailing-List: linux-omap@vger.kernel.org
+
+twl_init_irq() accesses TWL module IMR and ISR registers. Currently, it
+uses "magic numbers" for these register indices, but symbolic constants
+are definitely preferred. Rather than duplicating already existing
+symbolic constants in twl4030-gpio.c and twl4030-pwrirq.c, move the
+existing constants out into include files. This patch should not change
+kernel behavior.
+
+Signed-off-by: Paul Walmsley <paul@pwsan.com>
+---
+
+ drivers/i2c/chips/twl4030-gpio.c | 48 -----------------------
+ drivers/i2c/chips/twl4030-pwrirq.c | 15 +++----
+ include/linux/i2c/twl4030-gpio.h | 76 ++++++++++++++++++++++++++++++++++++
+ include/linux/i2c/twl4030-pwrirq.h | 37 ++++++++++++++++++
+ 4 files changed, 121 insertions(+), 55 deletions(-)
+ create mode 100644 include/linux/i2c/twl4030-gpio.h
+ create mode 100644 include/linux/i2c/twl4030-pwrirq.h
+
+diff --git a/drivers/i2c/chips/twl4030-gpio.c b/drivers/i2c/chips/twl4030-gpio.c
+index f16a48b..9d17f45 100644
+--- a/drivers/i2c/chips/twl4030-gpio.c
++++ b/drivers/i2c/chips/twl4030-gpio.c
+@@ -38,6 +38,7 @@
+
+ #include <linux/i2c.h>
+ #include <linux/i2c/twl4030.h>
++#include <linux/i2c/twl4030-gpio.h>
+ #include <linux/slab.h>
+
+ #include <asm/arch/irqs.h>
+@@ -47,53 +48,6 @@
+
+ #include <linux/device.h>
+
+-/*
+- * GPIO Block Register definitions
+- */
+-
+-#define REG_GPIODATAIN1 0x0
+-#define REG_GPIODATAIN2 0x1
+-#define REG_GPIODATAIN3 0x2
+-#define REG_GPIODATADIR1 0x3
+-#define REG_GPIODATADIR2 0x4
+-#define REG_GPIODATADIR3 0x5
+-#define REG_GPIODATAOUT1 0x6
+-#define REG_GPIODATAOUT2 0x7
+-#define REG_GPIODATAOUT3 0x8
+-#define REG_CLEARGPIODATAOUT1 0x9
+-#define REG_CLEARGPIODATAOUT2 0xA
+-#define REG_CLEARGPIODATAOUT3 0xB
+-#define REG_SETGPIODATAOUT1 0xC
+-#define REG_SETGPIODATAOUT2 0xD
+-#define REG_SETGPIODATAOUT3 0xE
+-#define REG_GPIO_DEBEN1 0xF
+-#define REG_GPIO_DEBEN2 0x10
+-#define REG_GPIO_DEBEN3 0x11
+-#define REG_GPIO_CTRL 0x12
+-#define REG_GPIOPUPDCTR1 0x13
+-#define REG_GPIOPUPDCTR2 0x14
+-#define REG_GPIOPUPDCTR3 0x15
+-#define REG_GPIOPUPDCTR4 0x16
+-#define REG_GPIOPUPDCTR5 0x17
+-#define REG_GPIO_ISR1A 0x19
+-#define REG_GPIO_ISR2A 0x1A
+-#define REG_GPIO_ISR3A 0x1B
+-#define REG_GPIO_IMR1A 0x1C
+-#define REG_GPIO_IMR2A 0x1D
+-#define REG_GPIO_IMR3A 0x1E
+-#define REG_GPIO_ISR1B 0x1F
+-#define REG_GPIO_ISR2B 0x20
+-#define REG_GPIO_ISR3B 0x21
+-#define REG_GPIO_IMR1B 0x22
+-#define REG_GPIO_IMR2B 0x23
+-#define REG_GPIO_IMR3B 0x24
+-#define REG_GPIO_EDR1 0x28
+-#define REG_GPIO_EDR2 0x29
+-#define REG_GPIO_EDR3 0x2A
+-#define REG_GPIO_EDR4 0x2B
+-#define REG_GPIO_EDR5 0x2C
+-#define REG_GPIO_SIH_CTRL 0x2D
+-
+ /* BitField Definitions */
+
+ /* Data banks : 3 banks for 8 gpios each */
+diff --git a/drivers/i2c/chips/twl4030-pwrirq.c b/drivers/i2c/chips/twl4030-pwrirq.c
+index a4d2e92..1afdb65 100644
+--- a/drivers/i2c/chips/twl4030-pwrirq.c
++++ b/drivers/i2c/chips/twl4030-pwrirq.c
+@@ -27,10 +27,8 @@
+ #include <linux/random.h>
+ #include <linux/kthread.h>
+ #include <linux/i2c/twl4030.h>
++#include <linux/i2c/twl4030-pwrirq.h>
+
+-#define PWR_ISR1 0
+-#define PWR_IMR1 1
+-#define PWR_SIH_CTRL 7
+ #define PWR_SIH_CTRL_COR (1<<2)
+
+ static u8 twl4030_pwrirq_mask;
+@@ -93,7 +91,8 @@ static void do_twl4030_pwrmodule_irq(unsigned int irq, irq_desc_t *desc)
+ twl4030_pwrirq_mask |= 1 << (irq - TWL4030_PWR_IRQ_BASE);
+ local_irq_enable();
+ twl4030_i2c_write_u8(TWL4030_MODULE_INT,
+- twl4030_pwrirq_mask, PWR_IMR1);
++ twl4030_pwrirq_mask,
++ TWL4030_INT_PWR_IMR1);
+ }
+ }
+ }
+@@ -115,7 +114,7 @@ static void do_twl4030_pwrirq(unsigned int irq, irq_desc_t *desc)
+
+ local_irq_enable();
+ ret = twl4030_i2c_read_u8(TWL4030_MODULE_INT, &pwr_isr,
+- PWR_ISR1);
++ TWL4030_INT_PWR_ISR1);
+ if (ret) {
+ printk(KERN_WARNING
+ "I2C error %d while reading TWL4030"
+@@ -151,7 +150,7 @@ static int twl4030_pwrirq_thread(void *data)
+ twl4030_pwrirq_mask &= ~local_unmask;
+
+ twl4030_i2c_write_u8(TWL4030_MODULE_INT, twl4030_pwrirq_mask,
+- PWR_IMR1);
++ TWL4030_INT_PWR_IMR1);
+
+ local_irq_disable();
+ if (!twl4030_pwrirq_pending_unmask)
+@@ -172,14 +171,14 @@ static int __init twl4030_pwrirq_init(void)
+ twl4030_pwrirq_pending_unmask = 0;
+
+ err = twl4030_i2c_write_u8(TWL4030_MODULE_INT, twl4030_pwrirq_mask,
+- PWR_IMR1);
++ TWL4030_INT_PWR_IMR1);
+ if (err)
+ return err;
+
+ /* Enable clear on read */
+
+ err = twl4030_i2c_write_u8(TWL4030_MODULE_INT, PWR_SIH_CTRL_COR,
+- PWR_SIH_CTRL);
++ TWL4030_INT_PWR_SIH_CTRL);
+ if (err)
+ return err;
+
+diff --git a/include/linux/i2c/twl4030-gpio.h b/include/linux/i2c/twl4030-gpio.h
+new file mode 100644
+index 0000000..7cbf610
+--- /dev/null
++++ b/include/linux/i2c/twl4030-gpio.h
+@@ -0,0 +1,76 @@
++/*
++ * twl4030-gpio.h - header for TWL4030 GPIO module
++ *
++ * Copyright (C) 2005-2006, 2008 Texas Instruments, Inc.
++ * Copyright (C) 2008 Nokia Corporation
++ *
++ * Based on tlv320aic23.c:
++ * Copyright (c) by Kai Svahn <kai.svahn@nokia.com>
++ *
++ * 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
++ *
++ */
++
++#ifndef __TWL4030_GPIO_H_
++#define __TWL4030_GPIO_H_
++
++/*
++ * GPIO Block Register definitions
++ */
++
++#define REG_GPIODATAIN1 0x0
++#define REG_GPIODATAIN2 0x1
++#define REG_GPIODATAIN3 0x2
++#define REG_GPIODATADIR1 0x3
++#define REG_GPIODATADIR2 0x4
++#define REG_GPIODATADIR3 0x5
++#define REG_GPIODATAOUT1 0x6
++#define REG_GPIODATAOUT2 0x7
++#define REG_GPIODATAOUT3 0x8
++#define REG_CLEARGPIODATAOUT1 0x9
++#define REG_CLEARGPIODATAOUT2 0xA
++#define REG_CLEARGPIODATAOUT3 0xB
++#define REG_SETGPIODATAOUT1 0xC
++#define REG_SETGPIODATAOUT2 0xD
++#define REG_SETGPIODATAOUT3 0xE
++#define REG_GPIO_DEBEN1 0xF
++#define REG_GPIO_DEBEN2 0x10
++#define REG_GPIO_DEBEN3 0x11
++#define REG_GPIO_CTRL 0x12
++#define REG_GPIOPUPDCTR1 0x13
++#define REG_GPIOPUPDCTR2 0x14
++#define REG_GPIOPUPDCTR3 0x15
++#define REG_GPIOPUPDCTR4 0x16
++#define REG_GPIOPUPDCTR5 0x17
++#define REG_GPIO_ISR1A 0x19
++#define REG_GPIO_ISR2A 0x1A
++#define REG_GPIO_ISR3A 0x1B
++#define REG_GPIO_IMR1A 0x1C
++#define REG_GPIO_IMR2A 0x1D
++#define REG_GPIO_IMR3A 0x1E
++#define REG_GPIO_ISR1B 0x1F
++#define REG_GPIO_ISR2B 0x20
++#define REG_GPIO_ISR3B 0x21
++#define REG_GPIO_IMR1B 0x22
++#define REG_GPIO_IMR2B 0x23
++#define REG_GPIO_IMR3B 0x24
++#define REG_GPIO_EDR1 0x28
++#define REG_GPIO_EDR2 0x29
++#define REG_GPIO_EDR3 0x2A
++#define REG_GPIO_EDR4 0x2B
++#define REG_GPIO_EDR5 0x2C
++#define REG_GPIO_SIH_CTRL 0x2D
++
++#endif /* End of __TWL4030_GPIO_H */
+diff --git a/include/linux/i2c/twl4030-pwrirq.h b/include/linux/i2c/twl4030-pwrirq.h
+new file mode 100644
+index 0000000..7a13368
+--- /dev/null
++++ b/include/linux/i2c/twl4030-pwrirq.h
+@@ -0,0 +1,37 @@
++/*
++ * twl4030-gpio.h - header for TWL4030 GPIO module
++ *
++ * Copyright (C) 2008 Texas Instruments, Inc.
++ * Copyright (C) 2008 Nokia Corporation
++ *
++ * 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
++ *
++ */
++
++#ifndef __TWL4030_PWRIRQ_H_
++#define __TWL4030_PWRIRQ_H_
++
++/*
++ * INT Module Register definitions
++ * (not all registers are defined below)
++ */
++
++#define TWL4030_INT_PWR_ISR1 0x0
++#define TWL4030_INT_PWR_IMR1 0x1
++#define TWL4030_INT_PWR_ISR2 0x2
++#define TWL4030_INT_PWR_IMR2 0x3
++#define TWL4030_INT_PWR_SIH_CTRL 0x7
++
++#endif /* End of __TWL4030_PWRIRQ_H */
+
+
+--
+To unsubscribe from this list: send the line "unsubscribe linux-omap" in
+the body of a message to majordomo@vger.kernel.org
+More majordomo info at http://vger.kernel.org/majordomo-info.html
+