~ubuntu-branches/ubuntu/lucid/linux-qcm-msm/lucid

« back to all changes in this revision

Viewing changes to arch/arm/mach-msm/irq.c

  • Committer: Bazaar Package Importer
  • Author(s): Andy Whitcroft, Andy Whitcroft, Ubuntu: 2.6.31-21.59, Ubuntu: 2.6.31-20.58
  • Date: 2010-03-31 18:43:39 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20100331184339-q3ee013jxywlf5ln
Tags: 2.6.31-800.2
[ Andy Whitcroft ]

* getabis -- get the correct source package
* rebase to Ubuntu-2.6.31-21.59

[ Ubuntu: 2.6.31-21.59 ]

* [Config] generic-pae switch to M586TSC
  - LP: #519448
* (pre-stable) drm/i915: Increase fb alignment to 64k
  - LP: #404064
* Input: i8042 - bypass AUX IRQ delivery test on laptops
  - LP: #534448
* SAUCE: Fix volume hotkeys for Dell Studio 1557
  - LP: #465250
* SAUCE: aufs: Fix header files inclusion in debug.h
  - LP: #517151
* [Config] Enable all CGROUP configuration options
  - LP: #480739
* Revert "[Upstream] acerhdf: Limit modalias matching to supported
  boards"
  - LP: #509730
* [Config] ext3 defaults to ordered mode
  - LP: #510067
* [Config] Fix sub-flavours package conflicts
  - LP: #454827
* PCI/cardbus: Add a fixup hook and fix powerpc
  - LP: #455723
* fnctl: f_modown should call write_lock_irqsave/restore
  - LP: #519436
* ACPI: enable C2 and Turbo-mode on Nehalem notebooks on A/C
  - LP: #516325
* tg3: Add 57788, remove 57720
  - LP: #515390
* HID: ignore all recent SoundGraph iMON devices
  - LP: #488443
* Input: ALPS - add interleaved protocol support (Dell E6x00 series)
  - LP: #296610
* acerhdf: limit modalias matching to supported
  - LP: #509730
* ASoC: Do not write to invalid registers on the wm9712.
  - LP: #509730
* cifs: NULL out tcon, pSesInfo, and srvTcp pointers when chasing DFS
  referrals
  - LP: #509730
* clockevents: Prevent clockevent_devices list corruption on cpu hotplug
  - LP: #509730
* dma: at_hdmac: correct incompatible type for argument 1 of
  'spin_lock_bh'
  - LP: #509730
* drivers/net/usb: Correct code taking the size of a pointer
  - LP: #509730
* Libertas: fix buffer overflow in lbs_get_essid()
  - LP: #509730
* md: Fix unfortunate interaction with evms
  - LP: #509730
* pata_cmd64x: fix overclocking of UDMA0-2 modes
  - LP: #509730
* pata_hpt3x2n: fix clock turnaround
  - LP: #509730
* SCSI: fc class: fix fc_transport_init error handling
  - LP: #509730
* sound: sgio2audio/pdaudiocf/usb-audio: initialize PCM buffer
  - LP: #509730
* USB: emi62: fix crash when trying to load EMI 6|2 firmware
  - LP: #509730
* USB: Fix a bug on appledisplay.c regarding signedness
  - LP: #509730
* USB: musb: gadget_ep0: avoid SetupEnd interrupt
  - LP: #509730
* USB: option: support hi speed for modem Haier CE100
  - LP: #490068, #509730
* x86, cpuid: Add "volatile" to asm in native_cpuid()
  - LP: #509730
* e100: Use pci pool to work around GFP_ATOMIC order 5 memory allocation
  failure
  - LP: #509730
* e100: Fix broken cbs accounting due to missing memset.
  - LP: #509730
* hostap: Revert a toxic part of the conversion to net_device_ops
  - LP: #509730
* hwmon: (fschmd) Fix check on unsigned in watchdog_write()
  - LP: #509730
* hwmon: (sht15) Off-by-one error in array index + incorrect constants
  - LP: #509730
* i2c/tsl2550: Fix lux value in extended mode
  - LP: #509730
* ipv6: reassembly: use seperate reassembly queues for conntrack and
  local delivery
  - LP: #509730
* S390: dasd: support DIAG access for read-only devices
  - LP: #509730
* udf: Try harder when looking for VAT inode
  - LP: #509730
* V4L/DVB (13596): ov511.c typo: lock => unlock
  - LP: #509730
* x86/ptrace: make genregs[32]_get/set more robust
  - LP: #509730
* XFS bug in log recover with quota (bugzilla id 855)
  - LP: #509730
* generic_permission: MAY_OPEN is not write access
  - LP: #509730
* memcg: avoid oom-killing innocent task in case of use_hierarchy
  - LP: #509730
* Input: atkbd - add force relese key quirk for Samsung R59P/R60P/R61P
  - LP: #253874, #509730
* Add unlocked version of inode_add_bytes() function
  - LP: #509730
* ext4: fix sleep inside spinlock issue with quota and dealloc (#14739)
  - LP: #509730
* Linux 2.6.31.10
  - LP: #509730
* Linux 2.6.31.11
  - LP: #509730
* quota: decouple fs reserved space from quota reservation
  - LP: #510674
* ext4: Convert to generic reserved quota's space management.
  - LP: #510674
* hwmon: (adt7462) Fix pin 28 monitoring
  - LP: #510674
* netfilter: nf_ct_ftp: fix out of bounds read in update_nl_seq()
  - LP: #510674
* quota: Fix dquot_transfer for filesystems different from ext4
  - LP: #510674
* fix braindamage in audit_tree.c untag_chunk()
  - LP: #510674
* fix more leaks in audit_tree.c tag_chunk()
  - LP: #510674
* ACPI: sleep: another HP DMI entry for init_set_sci_en_on_resume
  - LP: #453963, #510674
* ACPI: add DMI entry for SCI_EN resume quirk on HP dv4
  - LP: #453963, #510674
* ACPI: sleep: another HP/Compaq DMI entries for
  init_set_sci_en_on_resume
  - LP: #453963, #510674
* ACPI: DMI init_set_sci_en_on_resume for HP-Compaq C700
  - LP: #453963, #510674
* Linux 2.6.31.12
  - LP: #510674

[ Ubuntu: 2.6.31-20.58 ]

* Revert "[Upstream] e1000: enhance frame fragment detection"
  - CVE-2009-4536
* Revert "[Upstream] e1000e: enhance frame fragment detection"
  - CVE-2009-4538
* e1000: enhance frame fragment detection
  - CVE-2009-4536
* e1000/e1000e: don't use small hardware rx buffers
  - CVE-2009-4536
* e1000e: enhance frame fragment detection
  - CVE-2009-4538
* KVM: PIT: control word is write-only
  - CVE-2010-0309
* connector: Delete buggy notification code.
  - CVE-2010-0410
* Fix potential crash with sys_move_pages
  - CVE-2010-0415
* futex: Handle user space corruption gracefully
  - CVE-2010-0622
* futex_lock_pi() key refcnt fix
  - CVE-2010-0623
* Split 'flush_old_exec' into two functions
  - CVE-2010-0307
* Fix 'flush_old_exec()/setup_new_exec()' split
  - CVE-2010-0307
* x86: get rid of the insane TIF_ABI_PENDING bit
  - CVE-2010-0307
* powerpc: TIF_ABI_PENDING bit removal
  - CVE-2010-0307
* sparc: TIF_ABI_PENDING bit removal
  - CVE-2010-0307
* x86: set_personality_ia32() misses force_personality32
  - CVE-2010-0307

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* linux/arch/arm/mach-msm/irq.c
 
2
 *
 
3
 * Copyright (C) 2007 Google, Inc.
 
4
 *
 
5
 * This software is licensed under the terms of the GNU General Public
 
6
 * License version 2, as published by the Free Software Foundation, and
 
7
 * may be copied, distributed, and modified under those terms.
 
8
 *
 
9
 * This program is distributed in the hope that it will be useful,
 
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
 * GNU General Public License for more details.
 
13
 *
 
14
 */
 
15
 
 
16
#include <linux/init.h>
 
17
#include <linux/module.h>
 
18
#include <linux/sched.h>
 
19
#include <linux/interrupt.h>
 
20
#include <linux/ptrace.h>
 
21
#include <linux/timer.h>
 
22
#include <linux/irq.h>
 
23
#include <linux/io.h>
 
24
 
 
25
#include <mach/hardware.h>
 
26
 
 
27
#include <mach/msm_iomap.h>
 
28
 
 
29
#define VIC_REG(off) (MSM_VIC_BASE + (off))
 
30
 
 
31
#define VIC_INT_SELECT0     VIC_REG(0x0000)  /* 1: FIQ, 0: IRQ */
 
32
#define VIC_INT_SELECT1     VIC_REG(0x0004)  /* 1: FIQ, 0: IRQ */
 
33
#define VIC_INT_EN0         VIC_REG(0x0010)
 
34
#define VIC_INT_EN1         VIC_REG(0x0014)
 
35
#define VIC_INT_ENCLEAR0    VIC_REG(0x0020)
 
36
#define VIC_INT_ENCLEAR1    VIC_REG(0x0024)
 
37
#define VIC_INT_ENSET0      VIC_REG(0x0030)
 
38
#define VIC_INT_ENSET1      VIC_REG(0x0034)
 
39
#define VIC_INT_TYPE0       VIC_REG(0x0040)  /* 1: EDGE, 0: LEVEL  */
 
40
#define VIC_INT_TYPE1       VIC_REG(0x0044)  /* 1: EDGE, 0: LEVEL  */
 
41
#define VIC_INT_POLARITY0   VIC_REG(0x0050)  /* 1: NEG, 0: POS */
 
42
#define VIC_INT_POLARITY1   VIC_REG(0x0054)  /* 1: NEG, 0: POS */
 
43
#define VIC_NO_PEND_VAL     VIC_REG(0x0060)
 
44
#define VIC_INT_MASTEREN    VIC_REG(0x0064)  /* 1: IRQ, 2: FIQ     */
 
45
#define VIC_PROTECTION      VIC_REG(0x006C)  /* 1: ENABLE          */
 
46
#define VIC_CONFIG          VIC_REG(0x0068)  /* 1: USE ARM1136 VIC */
 
47
#define VIC_IRQ_STATUS0     VIC_REG(0x0080)
 
48
#define VIC_IRQ_STATUS1     VIC_REG(0x0084)
 
49
#define VIC_FIQ_STATUS0     VIC_REG(0x0090)
 
50
#define VIC_FIQ_STATUS1     VIC_REG(0x0094)
 
51
#define VIC_RAW_STATUS0     VIC_REG(0x00A0)
 
52
#define VIC_RAW_STATUS1     VIC_REG(0x00A4)
 
53
#define VIC_INT_CLEAR0      VIC_REG(0x00B0)
 
54
#define VIC_INT_CLEAR1      VIC_REG(0x00B4)
 
55
#define VIC_SOFTINT0        VIC_REG(0x00C0)
 
56
#define VIC_SOFTINT1        VIC_REG(0x00C4)
 
57
#define VIC_IRQ_VEC_RD      VIC_REG(0x00D0)  /* pending int # */
 
58
#define VIC_IRQ_VEC_PEND_RD VIC_REG(0x00D4)  /* pending vector addr */
 
59
#define VIC_IRQ_VEC_WR      VIC_REG(0x00D8)
 
60
#define VIC_IRQ_IN_SERVICE  VIC_REG(0x00E0)
 
61
#define VIC_IRQ_IN_STACK    VIC_REG(0x00E4)
 
62
#define VIC_TEST_BUS_SEL    VIC_REG(0x00E8)
 
63
 
 
64
#define VIC_VECTPRIORITY(n) VIC_REG(0x0200+((n) * 4))
 
65
#define VIC_VECTADDR(n)     VIC_REG(0x0400+((n) * 4))
 
66
 
 
67
static void msm_irq_ack(unsigned int irq)
 
68
{
 
69
        void __iomem *reg = VIC_INT_CLEAR0 + ((irq & 32) ? 4 : 0);
 
70
        irq = 1 << (irq & 31);
 
71
        writel(irq, reg);
 
72
}
 
73
 
 
74
static void msm_irq_mask(unsigned int irq)
 
75
{
 
76
        void __iomem *reg = VIC_INT_ENCLEAR0 + ((irq & 32) ? 4 : 0);
 
77
        writel(1 << (irq & 31), reg);
 
78
}
 
79
 
 
80
static void msm_irq_unmask(unsigned int irq)
 
81
{
 
82
        void __iomem *reg = VIC_INT_ENSET0 + ((irq & 32) ? 4 : 0);
 
83
        writel(1 << (irq & 31), reg);
 
84
}
 
85
 
 
86
static int msm_irq_set_wake(unsigned int irq, unsigned int on)
 
87
{
 
88
        return -EINVAL;
 
89
}
 
90
 
 
91
static int msm_irq_set_type(unsigned int irq, unsigned int flow_type)
 
92
{
 
93
        void __iomem *treg = VIC_INT_TYPE0 + ((irq & 32) ? 4 : 0);
 
94
        void __iomem *preg = VIC_INT_POLARITY0 + ((irq & 32) ? 4 : 0);
 
95
        int b = 1 << (irq & 31);
 
96
 
 
97
        if (flow_type & (IRQF_TRIGGER_FALLING | IRQF_TRIGGER_LOW))
 
98
                writel(readl(preg) | b, preg);
 
99
        if (flow_type & (IRQF_TRIGGER_RISING | IRQF_TRIGGER_HIGH))
 
100
                writel(readl(preg) & (~b), preg);
 
101
 
 
102
        if (flow_type & (IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING)) {
 
103
                writel(readl(treg) | b, treg);
 
104
                set_irq_handler(irq, handle_edge_irq);
 
105
        }
 
106
        if (flow_type & (IRQF_TRIGGER_HIGH | IRQF_TRIGGER_LOW)) {
 
107
                writel(readl(treg) & (~b), treg);
 
108
                set_irq_handler(irq, handle_level_irq);
 
109
        }
 
110
        return 0;
 
111
}
 
112
 
 
113
static struct irq_chip msm_irq_chip = {
 
114
        .name      = "msm",
 
115
        .ack       = msm_irq_ack,
 
116
        .mask      = msm_irq_mask,
 
117
        .unmask    = msm_irq_unmask,
 
118
        .set_wake  = msm_irq_set_wake,
 
119
        .set_type  = msm_irq_set_type,
 
120
};
 
121
 
 
122
void __init msm_init_irq(void)
 
123
{
 
124
        unsigned n;
 
125
 
 
126
        /* select level interrupts */
 
127
        writel(0, VIC_INT_TYPE0);
 
128
        writel(0, VIC_INT_TYPE1);
 
129
 
 
130
        /* select highlevel interrupts */
 
131
        writel(0, VIC_INT_POLARITY0);
 
132
        writel(0, VIC_INT_POLARITY1);
 
133
 
 
134
        /* select IRQ for all INTs */
 
135
        writel(0, VIC_INT_SELECT0);
 
136
        writel(0, VIC_INT_SELECT1);
 
137
 
 
138
        /* disable all INTs */
 
139
        writel(0, VIC_INT_EN0);
 
140
        writel(0, VIC_INT_EN1);
 
141
 
 
142
        /* don't use 1136 vic */
 
143
        writel(0, VIC_CONFIG);
 
144
 
 
145
        /* enable interrupt controller */
 
146
        writel(1, VIC_INT_MASTEREN);
 
147
 
 
148
        for (n = 0; n < NR_MSM_IRQS; n++) {
 
149
                set_irq_chip(n, &msm_irq_chip);
 
150
                set_irq_handler(n, handle_level_irq);
 
151
                set_irq_flags(n, IRQF_VALID);
 
152
        }
 
153
}