Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 16917
b: refs/heads/master
c: 9ded96f
h: refs/heads/master
i:
  16915: 8bd2ee7
v: v3
  • Loading branch information
Russell King authored and Linus Torvalds committed Jan 9, 2006
1 parent 1265ce8 commit 251111f
Show file tree
Hide file tree
Showing 15 changed files with 81 additions and 62 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 705b6c7b34f2621f95f606d0e683daa10cdb8eb9
refs/heads/master: 9ded96f24c3a5fcbef954e88c443385a1af37eb9
14 changes: 12 additions & 2 deletions trunk/arch/arm/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -684,8 +684,12 @@ int setup_irq(unsigned int irq, struct irqaction *new)
spin_lock_irqsave(&irq_controller_lock, flags);
p = &desc->action;
if ((old = *p) != NULL) {
/* Can't share interrupts unless both agree to */
if (!(old->flags & new->flags & SA_SHIRQ)) {
/*
* Can't share interrupts unless both agree to and are
* the same type.
*/
if (!(old->flags & new->flags & SA_SHIRQ) ||
(~old->flags & new->flags) & SA_TRIGGER_MASK) {
spin_unlock_irqrestore(&irq_controller_lock, flags);
return -EBUSY;
}
Expand All @@ -705,6 +709,12 @@ int setup_irq(unsigned int irq, struct irqaction *new)
desc->running = 0;
desc->pending = 0;
desc->disable_depth = 1;

if (new->flags & SA_TRIGGER_MASK) {
unsigned int type = new->flags & SA_TRIGGER_MASK;
desc->chip->set_type(irq, type);
}

if (!desc->noautoenable) {
desc->disable_depth = 0;
desc->chip->unmask(irq);
Expand Down
3 changes: 1 addition & 2 deletions trunk/arch/arm/mach-omap1/serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,8 @@ static void __init omap_serial_set_port_wakeup(int gpio_nr)
return;
}
omap_set_gpio_direction(gpio_nr, 1);
set_irq_type(OMAP_GPIO_IRQ(gpio_nr), IRQT_RISING);
ret = request_irq(OMAP_GPIO_IRQ(gpio_nr), &omap_serial_wake_interrupt,
0, "serial wakeup", NULL);
SA_TRIGGER_RISING, "serial wakeup", NULL);
if (ret) {
omap_free_gpio(gpio_nr);
printk(KERN_ERR "No interrupt for UART wake GPIO: %i\n",
Expand Down
7 changes: 3 additions & 4 deletions trunk/arch/arm/mach-pxa/corgi.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,15 +213,14 @@ static int corgi_mci_init(struct device *dev, irqreturn_t (*corgi_detect_int)(in

corgi_mci_platform_data.detect_delay = msecs_to_jiffies(250);

err = request_irq(CORGI_IRQ_GPIO_nSD_DETECT, corgi_detect_int, SA_INTERRUPT,
"MMC card detect", data);
err = request_irq(CORGI_IRQ_GPIO_nSD_DETECT, corgi_detect_int,
SA_INTERRUPT | SA_TRIGGER_RISING | SA_TRIGGER_FALLING,
"MMC card detect", data);
if (err) {
printk(KERN_ERR "corgi_mci_init: MMC/SD: can't request MMC card detect IRQ\n");
return -1;
}

set_irq_type(CORGI_IRQ_GPIO_nSD_DETECT, IRQT_BOTHEDGE);

return 0;
}

Expand Down
7 changes: 3 additions & 4 deletions trunk/arch/arm/mach-pxa/poodle.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,15 +146,14 @@ static int poodle_mci_init(struct device *dev, irqreturn_t (*poodle_detect_int)(

poodle_mci_platform_data.detect_delay = msecs_to_jiffies(250);

err = request_irq(POODLE_IRQ_GPIO_nSD_DETECT, poodle_detect_int, SA_INTERRUPT,
"MMC card detect", data);
err = request_irq(POODLE_IRQ_GPIO_nSD_DETECT, poodle_detect_int,
SA_INTERRUPT | SA_TRIGGER_RISING | SA_TRIGGER_FALLING,
"MMC card detect", data);
if (err) {
printk(KERN_ERR "poodle_mci_init: MMC/SD: can't request MMC card detect IRQ\n");
return -1;
}

set_irq_type(POODLE_IRQ_GPIO_nSD_DETECT, IRQT_BOTHEDGE);

return 0;
}

Expand Down
7 changes: 3 additions & 4 deletions trunk/arch/arm/mach-pxa/spitz.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,15 +296,14 @@ static int spitz_mci_init(struct device *dev, irqreturn_t (*spitz_detect_int)(in

spitz_mci_platform_data.detect_delay = msecs_to_jiffies(250);

err = request_irq(SPITZ_IRQ_GPIO_nSD_DETECT, spitz_detect_int, SA_INTERRUPT,
"MMC card detect", data);
err = request_irq(SPITZ_IRQ_GPIO_nSD_DETECT, spitz_detect_int,
SA_INTERRUPT | SA_TRIGGER_RISING | SA_TRIGGER_FALLING,
"MMC card detect", data);
if (err) {
printk(KERN_ERR "spitz_mci_init: MMC/SD: can't request MMC card detect IRQ\n");
return -1;
}

set_irq_type(SPITZ_IRQ_GPIO_nSD_DETECT, IRQT_BOTHEDGE);

return 0;
}

Expand Down
6 changes: 3 additions & 3 deletions trunk/arch/arm/mach-s3c2410/usb-simtec.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@ static void usb_simtec_enableoc(struct s3c2410_hcd_info *info, int on)
int ret;

if (on) {
ret = request_irq(IRQ_USBOC, usb_simtec_ocirq, SA_INTERRUPT,
ret = request_irq(IRQ_USBOC, usb_simtec_ocirq,
SA_INTERRUPT | SA_TRIGGER_RISING |
SA_TRIGGER_FALLING,
"USB Over-current", info);
if (ret != 0) {
printk(KERN_ERR "failed to request usb oc irq\n");
}

set_irq_type(IRQ_USBOC, IRQT_BOTHEDGE);
} else {
free_irq(IRQ_USBOC, info);
}
Expand Down
11 changes: 6 additions & 5 deletions trunk/drivers/i2c/chips/tps65010.c
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,7 @@ tps65010_probe(struct i2c_adapter *bus, int address, int kind)
{
struct tps65010 *tps;
int status;
unsigned long irqflags;

if (the_tps) {
dev_dbg(&bus->dev, "only one %s for now\n", DRIVER_NAME);
Expand All @@ -520,35 +521,35 @@ tps65010_probe(struct i2c_adapter *bus, int address, int kind)
}

#ifdef CONFIG_ARM
irqflags = SA_SAMPLE_RANDOM | SA_TRIGGER_LOW;
if (machine_is_omap_h2()) {
tps->model = TPS65010;
omap_cfg_reg(W4_GPIO58);
tps->irq = OMAP_GPIO_IRQ(58);
omap_request_gpio(58);
omap_set_gpio_direction(58, 1);
set_irq_type(tps->irq, IRQT_FALLING);
irqflags |= SA_TRIGGER_FALLING;
}
if (machine_is_omap_osk()) {
tps->model = TPS65010;
// omap_cfg_reg(U19_1610_MPUIO1);
tps->irq = OMAP_GPIO_IRQ(OMAP_MPUIO(1));
omap_request_gpio(OMAP_MPUIO(1));
omap_set_gpio_direction(OMAP_MPUIO(1), 1);
set_irq_type(tps->irq, IRQT_FALLING);
irqflags |= SA_TRIGGER_FALLING;
}
if (machine_is_omap_h3()) {
tps->model = TPS65013;

// FIXME set up this board's IRQ ...
}
#else
#define set_irq_type(num,trigger) do{}while(0)
irqflags = SA_SAMPLE_RANDOM;
#endif

if (tps->irq > 0) {
set_irq_type(tps->irq, IRQT_LOW);
status = request_irq(tps->irq, tps65010_irq,
SA_SAMPLE_RANDOM, DRIVER_NAME, tps);
irqflags, DRIVER_NAME, tps);
if (status < 0) {
dev_dbg(&tps->client.dev, "can't get IRQ %d, err %d\n",
tps->irq, status);
Expand Down
6 changes: 2 additions & 4 deletions trunk/drivers/input/keyboard/corgikbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include <linux/jiffies.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <asm/irq.h>

#include <asm/arch/corgi.h>
#include <asm/arch/hardware.h>
Expand Down Expand Up @@ -343,10 +342,9 @@ static int __init corgikbd_probe(struct platform_device *pdev)
for (i = 0; i < CORGI_KEY_SENSE_NUM; i++) {
pxa_gpio_mode(CORGI_GPIO_KEY_SENSE(i) | GPIO_IN);
if (request_irq(CORGI_IRQ_GPIO_KEY_SENSE(i), corgikbd_interrupt,
SA_INTERRUPT, "corgikbd", corgikbd))
SA_INTERRUPT | SA_TRIGGER_RISING,
"corgikbd", corgikbd))
printk(KERN_WARNING "corgikbd: Can't get IRQ: %d!\n", i);
else
set_irq_type(CORGI_IRQ_GPIO_KEY_SENSE(i),IRQT_RISING);
}

/* Set Strobe lines as outputs - set high */
Expand Down
27 changes: 14 additions & 13 deletions trunk/drivers/input/keyboard/spitzkbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include <linux/jiffies.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <asm/irq.h>

#include <asm/arch/spitz.h>
#include <asm/arch/hardware.h>
Expand Down Expand Up @@ -407,10 +406,9 @@ static int __init spitzkbd_probe(struct platform_device *dev)
for (i = 0; i < SPITZ_KEY_SENSE_NUM; i++) {
pxa_gpio_mode(spitz_senses[i] | GPIO_IN);
if (request_irq(IRQ_GPIO(spitz_senses[i]), spitzkbd_interrupt,
SA_INTERRUPT, "Spitzkbd Sense", spitzkbd))
SA_INTERRUPT|SA_TRIGGER_RISING,
"Spitzkbd Sense", spitzkbd))
printk(KERN_WARNING "spitzkbd: Can't get Sense IRQ: %d!\n", i);
else
set_irq_type(IRQ_GPIO(spitz_senses[i]),IRQT_RISING);
}

/* Set Strobe lines as outputs - set high */
Expand All @@ -422,15 +420,18 @@ static int __init spitzkbd_probe(struct platform_device *dev)
pxa_gpio_mode(SPITZ_GPIO_SWA | GPIO_IN);
pxa_gpio_mode(SPITZ_GPIO_SWB | GPIO_IN);

request_irq(SPITZ_IRQ_GPIO_SYNC, spitzkbd_interrupt, SA_INTERRUPT, "Spitzkbd Sync", spitzkbd);
request_irq(SPITZ_IRQ_GPIO_ON_KEY, spitzkbd_interrupt, SA_INTERRUPT, "Spitzkbd PwrOn", spitzkbd);
request_irq(SPITZ_IRQ_GPIO_SWA, spitzkbd_hinge_isr, SA_INTERRUPT, "Spitzkbd SWA", spitzkbd);
request_irq(SPITZ_IRQ_GPIO_SWB, spitzkbd_hinge_isr, SA_INTERRUPT, "Spitzkbd SWB", spitzkbd);

set_irq_type(SPITZ_IRQ_GPIO_SYNC, IRQT_BOTHEDGE);
set_irq_type(SPITZ_IRQ_GPIO_ON_KEY, IRQT_BOTHEDGE);
set_irq_type(SPITZ_IRQ_GPIO_SWA, IRQT_BOTHEDGE);
set_irq_type(SPITZ_IRQ_GPIO_SWB, IRQT_BOTHEDGE);
request_irq(SPITZ_IRQ_GPIO_SYNC, spitzkbd_interrupt,
SA_INTERRUPT | SA_TRIGGER_RISING | SA_TRIGGER_FALLING,
"Spitzkbd Sync", spitzkbd);
request_irq(SPITZ_IRQ_GPIO_ON_KEY, spitzkbd_interrupt,
SA_INTERRUPT | SA_TRIGGER_RISING | SA_TRIGGER_FALLING,
"Spitzkbd PwrOn", spitzkbd);
request_irq(SPITZ_IRQ_GPIO_SWA, spitzkbd_hinge_isr,
SA_INTERRUPT | SA_TRIGGER_RISING | SA_TRIGGER_FALLING,
"Spitzkbd SWA", spitzkbd);
request_irq(SPITZ_IRQ_GPIO_SWB, spitzkbd_hinge_isr,
SA_INTERRUPT | SA_TRIGGER_RISING | SA_TRIGGER_FALLING,
"Spitzkbd SWB", spitzkbd);

printk(KERN_INFO "input: Spitz Keyboard Registered\n");

Expand Down
5 changes: 2 additions & 3 deletions trunk/drivers/mfd/ucb1x00-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

#include <asm/dma.h>
#include <asm/hardware.h>
#include <asm/irq.h>

#include "ucb1x00.h"

Expand Down Expand Up @@ -507,14 +506,14 @@ static int ucb1x00_probe(struct mcp *mcp)
goto err_free;
}

ret = request_irq(ucb->irq, ucb1x00_irq, 0, "UCB1x00", ucb);
ret = request_irq(ucb->irq, ucb1x00_irq, SA_TRIGGER_RISING,
"UCB1x00", ucb);
if (ret) {
printk(KERN_ERR "ucb1x00: unable to grab irq%d: %d\n",
ucb->irq, ret);
goto err_free;
}

set_irq_type(ucb->irq, IRQT_RISING);
mcp_set_drvdata(mcp, ucb);

ret = class_device_register(&ucb->cdev);
Expand Down
5 changes: 1 addition & 4 deletions trunk/drivers/net/smc91x.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ static const char version[] =
#include <linux/skbuff.h>

#include <asm/io.h>
#include <asm/irq.h>

#include "smc91x.h"

Expand Down Expand Up @@ -2007,12 +2006,10 @@ static int __init smc_probe(struct net_device *dev, void __iomem *ioaddr)
}

/* Grab the IRQ */
retval = request_irq(dev->irq, &smc_interrupt, 0, dev->name, dev);
retval = request_irq(dev->irq, &smc_interrupt, SMC_IRQ_FLAGS, dev->name, dev);
if (retval)
goto err_out;

set_irq_type(dev->irq, SMC_IRQ_TRIGGER_TYPE);

#ifdef SMC_USE_PXA_DMA
{
int dma = pxa_request_dma(dev->name, DMA_PRIO_LOW,
Expand Down
18 changes: 9 additions & 9 deletions trunk/drivers/net/smc91x.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
__l--; \
} \
} while (0)
#define set_irq_type(irq, type)
#define SMC_IRQ_FLAGS (0)

#elif defined(CONFIG_SA1100_PLEB)
/* We can only do 16-bit reads and writes in the static memory space. */
Expand All @@ -109,7 +109,7 @@
#define SMC_outw(v, a, r) writew(v, (a) + (r))
#define SMC_outsw(a, r, p, l) writesw((a) + (r), p, l)

#define set_irq_type(irq, type) do {} while (0)
#define SMC_IRQ_FLAGS (0)

#elif defined(CONFIG_SA1100_ASSABET)

Expand Down Expand Up @@ -185,11 +185,11 @@ SMC_outw(u16 val, void __iomem *ioaddr, int reg)
#include <asm/mach-types.h>
#include <asm/arch/cpu.h>

#define SMC_IRQ_TRIGGER_TYPE (( \
#define SMC_IRQ_FLAGS (( \
machine_is_omap_h2() \
|| machine_is_omap_h3() \
|| (machine_is_omap_innovator() && !cpu_is_omap1510()) \
) ? IRQT_FALLING : IRQT_RISING)
) ? SA_TRIGGER_FALLING : SA_TRIGGER_RISING)


#elif defined(CONFIG_SH_SH4202_MICRODEV)
Expand All @@ -209,7 +209,7 @@ SMC_outw(u16 val, void __iomem *ioaddr, int reg)
#define SMC_insw(a, r, p, l) insw((a) + (r) - 0xa0000000, p, l)
#define SMC_outsw(a, r, p, l) outsw((a) + (r) - 0xa0000000, p, l)

#define set_irq_type(irq, type) do {} while(0)
#define SMC_IRQ_FLAGS (0)

#elif defined(CONFIG_ISA)

Expand Down Expand Up @@ -237,7 +237,7 @@ SMC_outw(u16 val, void __iomem *ioaddr, int reg)
#define SMC_insw(a, r, p, l) insw(((u32)a) + (r), p, l)
#define SMC_outsw(a, r, p, l) outsw(((u32)a) + (r), p, l)

#define set_irq_type(irq, type) do {} while(0)
#define SMC_IRQ_FLAGS (0)

#define RPC_LSA_DEFAULT RPC_LED_TX_RX
#define RPC_LSB_DEFAULT RPC_LED_100_10
Expand Down Expand Up @@ -319,7 +319,7 @@ static inline void SMC_outsw (unsigned long a, int r, unsigned char* p, int l)
au_writew(*_p++ , _a); \
} while(0)

#define set_irq_type(irq, type) do {} while (0)
#define SMC_IRQ_FLAGS (0)

#else

Expand All @@ -342,8 +342,8 @@ static inline void SMC_outsw (unsigned long a, int r, unsigned char* p, int l)

#endif

#ifndef SMC_IRQ_TRIGGER_TYPE
#define SMC_IRQ_TRIGGER_TYPE IRQT_RISING
#ifndef SMC_IRQ_FLAGS
#define SMC_IRQ_FLAGS SA_TRIGGER_RISING
#endif

#ifdef SMC_USE_PXA_DMA
Expand Down
12 changes: 8 additions & 4 deletions trunk/include/asm-arm/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,14 @@ extern void disable_irq_nosync(unsigned int);
extern void disable_irq(unsigned int);
extern void enable_irq(unsigned int);

#define __IRQT_FALEDGE (1 << 0)
#define __IRQT_RISEDGE (1 << 1)
#define __IRQT_LOWLVL (1 << 2)
#define __IRQT_HIGHLVL (1 << 3)
/*
* These correspond with the SA_TRIGGER_* defines, and therefore the
* IRQRESOURCE_IRQ_* defines.
*/
#define __IRQT_RISEDGE (1 << 0)
#define __IRQT_FALEDGE (1 << 1)
#define __IRQT_HIGHLVL (1 << 2)
#define __IRQT_LOWLVL (1 << 3)

#define IRQT_NOEDGE (0)
#define IRQT_RISING (__IRQT_RISEDGE)
Expand Down
13 changes: 13 additions & 0 deletions trunk/include/linux/signal.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,19 @@
#define SA_PROBE SA_ONESHOT
#define SA_SAMPLE_RANDOM SA_RESTART
#define SA_SHIRQ 0x04000000
/*
* As above, these correspond to the IORESOURCE_IRQ_* defines in
* linux/ioport.h to select the interrupt line behaviour. When
* requesting an interrupt without specifying a SA_TRIGGER, the
* setting should be assumed to be "as already configured", which
* may be as per machine or firmware initialisation.
*/
#define SA_TRIGGER_LOW 0x00000008
#define SA_TRIGGER_HIGH 0x00000004
#define SA_TRIGGER_FALLING 0x00000002
#define SA_TRIGGER_RISING 0x00000001
#define SA_TRIGGER_MASK (SA_TRIGGER_HIGH|SA_TRIGGER_LOW|\
SA_TRIGGER_RISING|SA_TRIGGER_FALLING)

/*
* Real Time signals may be queued.
Expand Down

0 comments on commit 251111f

Please sign in to comment.