&dev_attr_cover_switch.attr);
sw->state = state;
if (omap_get_gpio_datain(sw->gpio))
- omap_set_gpio_edge_ctrl(sw->gpio, OMAP_GPIO_FALLING_EDGE);
+ set_irq_type(OMAP_GPIO_IRQ(sw->gpio), IRQT_FALLING);
else
- omap_set_gpio_edge_ctrl(sw->gpio, OMAP_GPIO_RISING_EDGE);
+ set_irq_type(OMAP_GPIO_IRQ(sw->gpio), IRQT_RISING);
print_sw_state(sw, state);
}
omap_set_gpio_direction(sw->gpio, direction);
if (omap_get_gpio_datain(sw->gpio))
- omap_set_gpio_edge_ctrl(sw->gpio, OMAP_GPIO_FALLING_EDGE);
+ set_irq_type(OMAP_GPIO_IRQ(sw->gpio), IRQT_FALLING);
else
- omap_set_gpio_edge_ctrl(sw->gpio, OMAP_GPIO_RISING_EDGE);
+ set_irq_type(OMAP_GPIO_IRQ(sw->gpio), IRQT_RISING);
switch (sw->type) {
case OMAP_GPIO_SWITCH_TYPE_COVER:
case METHOD_MPUIO:
reg += OMAP_MPUIO_GPIO_INT_EDGE;
l = __raw_readl((void __iomem *)reg);
- if (edge == OMAP_GPIO_RISING_EDGE)
+ if (edge == IRQT_RISING)
l |= 1 << gpio;
- else if (edge == OMAP_GPIO_FALLING_EDGE)
+ else if (edge == IRQT_FALLING)
l &= ~(1 << gpio);
else
goto bad;
case METHOD_GPIO_1510:
reg += OMAP1510_GPIO_INT_CONTROL;
l = __raw_readl((void __iomem *)reg);
- if (edge == OMAP_GPIO_RISING_EDGE)
+ if (edge == IRQT_RISING)
l |= 1 << gpio;
- else if (edge == OMAP_GPIO_FALLING_EDGE)
+ else if (edge == IRQT_FALLING)
l &= ~(1 << gpio);
else
goto bad;
break;
case METHOD_GPIO_1610:
+ /* NOTE: knows __IRQT_{FAL,RIS}EDGE match OMAP hardware */
edge &= 0x03;
if (gpio & 0x08)
reg += OMAP1610_GPIO_EDGE_CTRL2;
case METHOD_GPIO_730:
reg += OMAP730_GPIO_INT_CONTROL;
l = __raw_readl((void __iomem *)reg);
- if (edge == OMAP_GPIO_RISING_EDGE)
+ if (edge == IRQT_RISING)
l |= 1 << gpio;
- else if (edge == OMAP_GPIO_FALLING_EDGE)
+ else if (edge == IRQT_FALLING)
l &= ~(1 << gpio);
else
goto bad;
if (check_gpio(gpio) < 0)
return -EINVAL;
- /* NOTE: __IRQT_FALEDGE == OMAP_GPIO_FALLING_EDGE,
- * and __IRQT_RISEDGE == OMAP_GPIO_RISING_EDGE
- */
if (type & (__IRQT_LOWLVL|__IRQT_HIGHLVL|IRQT_PROBE))
return -EINVAL;
return retval;
}
-void omap_set_gpio_edge_ctrl(int gpio, int edge)
-{
- struct gpio_bank *bank;
-
- if (check_gpio(gpio) < 0)
- return;
- bank = get_gpio_bank(gpio);
- spin_lock(&bank->lock);
- _set_gpio_edge_ctrl(bank, get_gpio_index(gpio), edge);
- spin_unlock(&bank->lock);
-}
-
static int _get_gpio_edge_ctrl(struct gpio_bank *bank, int gpio)
{
case METHOD_MPUIO:
l = __raw_readl(reg + OMAP_MPUIO_GPIO_INT_EDGE);
return (l & (1 << gpio)) ?
- OMAP_GPIO_RISING_EDGE : OMAP_GPIO_FALLING_EDGE;
+ IRQT_RISING : IRQT_FALLING;
case METHOD_GPIO_1510:
l = __raw_readl(reg + OMAP1510_GPIO_INT_CONTROL);
return (l & (1 << gpio)) ?
- OMAP_GPIO_RISING_EDGE : OMAP_GPIO_FALLING_EDGE;
+ IRQT_RISING : IRQT_FALLING;
case METHOD_GPIO_1610:
if (gpio & 0x08)
reg += OMAP1610_GPIO_EDGE_CTRL2;
else
reg += OMAP1610_GPIO_EDGE_CTRL1;
+ /* NOTE: knows __IRQT_{FAL,RIS}EDGE match OMAP hardware */
return (__raw_readl(reg) >> ((gpio & 0x07) << 1)) & 0x03;
case METHOD_GPIO_730:
l = __raw_readl(reg + OMAP730_GPIO_INT_CONTROL);
return (l & (1 << gpio)) ?
- OMAP_GPIO_RISING_EDGE : OMAP_GPIO_FALLING_EDGE;
+ IRQT_RISING : IRQT_FALLING;
default:
BUG();
return -1;
unsigned int gpio = irq - IH_GPIO_BASE;
struct gpio_bank *bank = get_gpio_bank(gpio);
- if (_get_gpio_edge_ctrl(bank, get_gpio_index(gpio)) == OMAP_GPIO_NO_EDGE) {
+ if (_get_gpio_edge_ctrl(bank, get_gpio_index(gpio)) == IRQT_NOEDGE) {
printk(KERN_ERR "OMAP GPIO %d: trying to enable GPIO IRQ while no edge is set\n",
gpio);
- _set_gpio_edge_ctrl(bank, get_gpio_index(gpio), OMAP_GPIO_RISING_EDGE);
+ _set_gpio_edge_ctrl(bank, get_gpio_index(gpio), IRQT_RISING);
}
_set_gpio_irqenable(bank, gpio, 1);
}
EXPORT_SYMBOL(omap_set_gpio_direction);
EXPORT_SYMBOL(omap_set_gpio_dataout);
EXPORT_SYMBOL(omap_get_gpio_datain);
-EXPORT_SYMBOL(omap_set_gpio_edge_ctrl);
arch_initcall(omap_gpio_sysinit);
printk("Error requesting gpio 0 for smc91x irq\n");
return;
}
- omap_set_gpio_edge_ctrl(0, OMAP_GPIO_FALLING_EDGE);
}
static void __init h2_init_irq(void)
printk("Error requesting gpio 40 for smc91x irq\n");
return;
}
- omap_set_gpio_edge_ctrl(40, OMAP_GPIO_FALLING_EDGE);
}
void h3_init_irq(void)
printk("Error requesting gpio 0 for smc91x irq\n");
return;
}
- omap_set_gpio_edge_ctrl(0, OMAP_GPIO_FALLING_EDGE);
}
}
mdelay(50); /* 50ms until PHY ready */
/* smc91x interrupt pin */
omap_request_gpio(8);
- omap_set_gpio_edge_ctrl(8, OMAP_GPIO_RISING_EDGE);
omap_request_gpio(12);
omap_request_gpio(13);
omap_request_gpio(14);
omap_request_gpio(15);
- omap_set_gpio_edge_ctrl(12, OMAP_GPIO_FALLING_EDGE);
- omap_set_gpio_edge_ctrl(13, OMAP_GPIO_FALLING_EDGE);
- omap_set_gpio_edge_ctrl(14, OMAP_GPIO_FALLING_EDGE);
- omap_set_gpio_edge_ctrl(15, OMAP_GPIO_FALLING_EDGE);
+ set_irq_type(OMAP_GPIO_IRQ(12), IRQT_FALLING);
+ set_irq_type(OMAP_GPIO_IRQ(13), IRQT_FALLING);
+ set_irq_type(OMAP_GPIO_IRQ(14), IRQT_FALLING);
+ set_irq_type(OMAP_GPIO_IRQ(15), IRQT_FALLING);
platform_add_devices(netstar_devices, ARRAY_SIZE(netstar_devices));
printk("Error requesting gpio 0 for smc91x irq\n");
return;
}
- omap_set_gpio_edge_ctrl(0, OMAP_GPIO_RISING_EDGE);
/* Check EMIFS wait states to fix errors with SMC_GET_PKT_HDR */
EMIFS_CCS(1) |= 0x2;
printk("Error requesting gpio 62 for CF irq\n");
return;
}
- /* it's really active-low */
- omap_set_gpio_edge_ctrl(62, OMAP_GPIO_FALLING_EDGE);
+ /* the CF I/O IRQ is really active-low */
+ set_irq_type(OMAP_GPIO_IRQ(62), IRQT_FALLING);
}
static void __init osk_init_irq(void)
mdelay(50); /* 50ms until PHY ready */
/* smc91x interrupt pin */
omap_request_gpio(8);
- omap_set_gpio_edge_ctrl(8, OMAP_GPIO_RISING_EDGE);
/* 16C554 reset*/
omap_request_gpio(6);
omap_set_gpio_direction(6, 0);
omap_request_gpio(13);
omap_request_gpio(14);
omap_request_gpio(15);
- omap_set_gpio_edge_ctrl(12, OMAP_GPIO_RISING_EDGE);
- omap_set_gpio_edge_ctrl(13, OMAP_GPIO_RISING_EDGE);
- omap_set_gpio_edge_ctrl(14, OMAP_GPIO_RISING_EDGE);
- omap_set_gpio_edge_ctrl(15, OMAP_GPIO_RISING_EDGE);
+ set_irq_type(OMAP_GPIO_IRQ(12), IRQT_RISING);
+ set_irq_type(OMAP_GPIO_IRQ(13), IRQT_RISING);
+ set_irq_type(OMAP_GPIO_IRQ(14), IRQT_RISING);
+ set_irq_type(OMAP_GPIO_IRQ(15), IRQT_RISING);
platform_add_devices(voiceblue_devices, ARRAY_SIZE(voiceblue_devices));
omap_board_config = voiceblue_config;
*/
omap_request_gpio(13);
omap_set_gpio_direction(13, 1);
- omap_set_gpio_edge_ctrl(13, OMAP_GPIO_RISING_EDGE);
+ set_irq_type(OMAP_GPIO_IRQ(13), IRQT_RISING);
set_irq_chained_handler(OMAP1510_INT_FPGA, innovator_fpga_IRQ_demux);
}
isp->irq = OMAP_GPIO_IRQ(2);
omap_request_gpio(2);
omap_set_gpio_direction(2, 1);
- omap_set_gpio_edge_ctrl(2, OMAP_GPIO_FALLING_EDGE);
+ set_irq_type(isp->irq, IRQT_FALLING);
}
if (machine_is_omap_h3()) {
isp->irq = OMAP_GPIO_IRQ(14);
omap_request_gpio(14);
omap_set_gpio_direction(14, 1);
- omap_set_gpio_edge_ctrl(14, OMAP_GPIO_FALLING_EDGE);
+ set_irq_type(isp->irq, IRQT_FALLING);
}
status = request_irq(isp->irq, isp1301_irq,
tps->irq = OMAP_GPIO_IRQ(58);
omap_request_gpio(58);
omap_set_gpio_direction(58, 1);
- omap_set_gpio_edge_ctrl(58, OMAP_GPIO_FALLING_EDGE);
+ set_irq_type(tps->irq, IRQT_FALLING);
}
if (machine_is_omap_osk()) {
tps->model = TPS65010;
tps->irq = OMAP_GPIO_IRQ(OMAP_MPUIO(1));
omap_request_gpio(OMAP_MPUIO(1));
omap_set_gpio_direction(OMAP_MPUIO(1), 1);
- omap_set_gpio_edge_ctrl(OMAP_MPUIO(1), OMAP_GPIO_FALLING_EDGE);
+ set_irq_type(tps->irq, IRQT_FALLING);
}
if (machine_is_omap_h3()) {
tps->model = TPS65013;
};
omap_set_gpio_direction(gpio, 1);
- omap_set_gpio_edge_ctrl(gpio, OMAP_GPIO_FALLING_EDGE);
+ set_irq_type(ts->irq, IRQT_FALLING);
return 0;
}
omap_cfg_reg(P20_1610_GPIO4);
omap_request_gpio(4);
omap_set_gpio_direction(4, 1);
- omap_set_gpio_edge_ctrl(4, OMAP_GPIO_FALLING_EDGE);
+ set_irq_type(OMAP_GPIO_IRQ(4), IRQT_FALLING);
ts->irq = PEN_IRQ;
}
omap_set_gpio_direction(host->switch_pin, 1);
- omap_set_gpio_edge_ctrl(host->switch_pin, OMAP_GPIO_RISING_EDGE);
+ set_irq_type(OMAP_GPIO_IRQ(host->switch_pin), IRQT_RISING);
ret = request_irq(OMAP_GPIO_IRQ(host->switch_pin),
mmc_omap_switch_irq, 0, DRIVER_NAME, host);
if (ret) {
if (retval)
goto err_out;
- set_irq_type(dev->irq, IRQ_TRIGGER_TYPE);
+ set_irq_type(dev->irq, SMC_IRQ_TRIGGER_TYPE);
#ifdef SMC_USE_PXA_DMA
{
#include <asm/mach-types.h>
#include <asm/arch/cpu.h>
-#define IRQ_TRIGGER_TYPE (( \
+#define SMC_IRQ_TRIGGER_TYPE (( \
machine_is_omap_h2() \
|| machine_is_omap_h3() \
|| (machine_is_omap_innovator() && !cpu_is_omap1510()) \
#endif
-#ifndef IRQ_TRIGGER_TYPE
-#define IRQ_TRIGGER_TYPE IRQT_RISING
+#ifndef SMC_IRQ_TRIGGER_TYPE
+#define SMC_IRQ_TRIGGER_TYPE IRQT_RISING
#endif
#ifdef SMC_USE_PXA_DMA
IH_MPUIO_BASE + ((nr) & 0x0f) : \
IH_GPIO_BASE + ((nr) & 0x3f))
-/* For EDGECTRL */
-#define OMAP_GPIO_NO_EDGE 0x00
-#define OMAP_GPIO_FALLING_EDGE 0x01
-#define OMAP_GPIO_RISING_EDGE 0x02
-#define OMAP_GPIO_BOTH_EDGES 0x03
-
extern int omap_gpio_init(void); /* Call from board init only */
extern int omap_request_gpio(int gpio);
extern void omap_free_gpio(int gpio);
extern void omap_set_gpio_dataout(int gpio, int enable);
extern int omap_get_gpio_datain(int gpio);
-/* use ARM-standard set_irq_type() instead */
-extern void __deprecated omap_set_gpio_edge_ctrl(int gpio, int edge);
-
#endif