~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to arch/mips/txx9/generic/irq_tx4939.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
        unsigned char mode;
51
51
} tx4939irq[TX4939_NUM_IR] __read_mostly;
52
52
 
53
 
static void tx4939_irq_unmask(unsigned int irq)
 
53
static void tx4939_irq_unmask(struct irq_data *d)
54
54
{
55
 
        unsigned int irq_nr = irq - TXX9_IRQ_BASE;
 
55
        unsigned int irq_nr = d->irq - TXX9_IRQ_BASE;
56
56
        u32 __iomem *lvlp;
57
57
        int ofs;
58
58
        if (irq_nr < 32) {
68
68
                     lvlp);
69
69
}
70
70
 
71
 
static inline void tx4939_irq_mask(unsigned int irq)
 
71
static inline void tx4939_irq_mask(struct irq_data *d)
72
72
{
73
 
        unsigned int irq_nr = irq - TXX9_IRQ_BASE;
 
73
        unsigned int irq_nr = d->irq - TXX9_IRQ_BASE;
74
74
        u32 __iomem *lvlp;
75
75
        int ofs;
76
76
        if (irq_nr < 32) {
87
87
        mmiowb();
88
88
}
89
89
 
90
 
static void tx4939_irq_mask_ack(unsigned int irq)
 
90
static void tx4939_irq_mask_ack(struct irq_data *d)
91
91
{
92
 
        unsigned int irq_nr = irq - TXX9_IRQ_BASE;
 
92
        unsigned int irq_nr = d->irq - TXX9_IRQ_BASE;
93
93
 
94
 
        tx4939_irq_mask(irq);
 
94
        tx4939_irq_mask(d);
95
95
        if (TXx9_IRCR_EDGE(tx4939irq[irq_nr].mode)) {
96
96
                irq_nr--;
97
97
                /* clear edge detection */
101
101
        }
102
102
}
103
103
 
104
 
static int tx4939_irq_set_type(unsigned int irq, unsigned int flow_type)
 
104
static int tx4939_irq_set_type(struct irq_data *d, unsigned int flow_type)
105
105
{
106
 
        unsigned int irq_nr = irq - TXX9_IRQ_BASE;
 
106
        unsigned int irq_nr = d->irq - TXX9_IRQ_BASE;
107
107
        u32 cr;
108
108
        u32 __iomem *crp;
109
109
        int ofs;
145
145
 
146
146
static struct irq_chip tx4939_irq_chip = {
147
147
        .name           = "TX4939",
148
 
        .ack            = tx4939_irq_mask_ack,
149
 
        .mask           = tx4939_irq_mask,
150
 
        .mask_ack       = tx4939_irq_mask_ack,
151
 
        .unmask         = tx4939_irq_unmask,
152
 
        .set_type       = tx4939_irq_set_type,
 
148
        .irq_ack        = tx4939_irq_mask_ack,
 
149
        .irq_mask       = tx4939_irq_mask,
 
150
        .irq_mask_ack   = tx4939_irq_mask_ack,
 
151
        .irq_unmask     = tx4939_irq_unmask,
 
152
        .irq_set_type   = tx4939_irq_set_type,
153
153
};
154
154
 
155
155
static int tx4939_irq_set_pri(int irc_irq, int new_pri)
176
176
        for (i = 1; i < TX4939_NUM_IR; i++) {
177
177
                tx4939irq[i].level = 4; /* middle level */
178
178
                tx4939irq[i].mode = TXx9_IRCR_LOW;
179
 
                set_irq_chip_and_handler(TXX9_IRQ_BASE + i,
180
 
                                         &tx4939_irq_chip, handle_level_irq);
 
179
                irq_set_chip_and_handler(TXX9_IRQ_BASE + i, &tx4939_irq_chip,
 
180
                                         handle_level_irq);
181
181
        }
182
182
 
183
183
        /* mask all IRC interrupts */
193
193
        __raw_writel(TXx9_IRCER_ICE, &tx4939_ircptr->den.r);
194
194
        __raw_writel(irc_elevel, &tx4939_ircptr->msk.r);
195
195
 
196
 
        set_irq_chained_handler(MIPS_CPU_IRQ_BASE + TX4939_IRC_INT,
 
196
        irq_set_chained_handler(MIPS_CPU_IRQ_BASE + TX4939_IRC_INT,
197
197
                                handle_simple_irq);
198
198
 
199
199
        /* raise priority for errors, timers, sio */