当前位置: 首页>>代码示例>>C++>>正文


C++ IRQ_GPIO函数代码示例

本文整理汇总了C++中IRQ_GPIO函数的典型用法代码示例。如果您正苦于以下问题:C++ IRQ_GPIO函数的具体用法?C++ IRQ_GPIO怎么用?C++ IRQ_GPIO使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了IRQ_GPIO函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: k3v2_gpio_key_irq_handler

static irqreturn_t k3v2_gpio_key_irq_handler(int irq, void *dev_id)
{
	struct k3v2_gpio_key *gpio_key = (struct k3v2_gpio_key *)dev_id;

	switch (irq) {
	case IRQ_GPIO(GPIO_17_1):
		schedule_delayed_work(&(gpio_key->gpio_keyup_work), 0);
		break;

	case IRQ_GPIO(GPIO_17_2):
		schedule_delayed_work(&(gpio_key->gpio_keydown_work), 0);
		break;
	case IRQ_GPIO(GPIO_17_6):
		schedule_delayed_work(&(gpio_key->gpio_camerafocus_work), 0);
		break;
	case IRQ_GPIO(GPIO_17_7):
		schedule_delayed_work(&(gpio_key->gpio_camera_work), 0);
		break;
	default:
		printk(KERN_ERR "[gpiokey][%s]invalid irq %d!\n", __FUNCTION__, irq);
		break;
	}

	return IRQ_HANDLED;
}
开发者ID:alfataks-P6-Carbon,项目名称:Kernel-3.0.8,代码行数:25,代码来源:k3v2_gpio_key.c

示例2: aspenite_u2o_vbus_detect

static int aspenite_u2o_vbus_detect(void *func, int enable)
{
	int ret;

	if (enable) {
		/* FIXME needed for future SRP support
		 * request_irq(IRQ_GPIO(gpio_usb_otg_stat1),
			aspenite_u2o_vbus_event, IRQF_DISABLED |
			IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
			"otg_stat1", func);
		 */
		ret = request_irq(IRQ_GPIO(gpio_usb_otg_stat2),
			(irq_handler_t)aspenite_u2o_vbus_event, IRQF_DISABLED |
			IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
			"otg_stat2", func);
		if (ret)
			printk(KERN_INFO "request irq otgstat2 %d failed: %d\n",
					IRQ_GPIO(gpio_usb_otg_stat2), ret);
	} else {
		/* free_irq(IRQ_GPIO(gpio_usb_otg_stat1), NULL); */
		free_irq(IRQ_GPIO(gpio_usb_otg_stat2), func);
	}

	return 0;
}
开发者ID:kamejoko80,项目名称:linux-2.6.28-silvermoon,代码行数:25,代码来源:aspenite.c

示例3: yf255_init_irq

static void __init yf255_init_irq(void)
{
	int irq;

	pxa25x_init_irq();
#if 1
	/* setup extra yf255 irqs */
	for (irq = YF255_IRQ(0); irq <= YF255_LAST_IRQ; irq++) {
		set_irq_chip(irq, &yf255_irq_chip);
		set_irq_handler(irq, handle_level_irq);
		set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
	}
#endif

	/*For Ethernet_INT*/
	set_irq_type(IRQ_GPIO(0), IRQ_TYPE_EDGE_RISING);

	/*For RTC_INT*/
	set_irq_type(IRQ_GPIO(1), IRQ_TYPE_EDGE_RISING);

	/*For AC97_IRQ*/
//	set_irq_type(IRQ_GPIO(3), IRQ_TYPE_EDGE_RISING);

	/*For PCMCIA_DECT*/
	set_irq_type(IRQ_GPIO(4), IRQ_TYPE_EDGE_RISING);
	/*For PCMCIA_RDY*/
	set_irq_type(IRQ_GPIO(5), IRQ_TYPE_EDGE_RISING);

	/*For MMC*/
	set_irq_type(IRQ_GPIO(12), IRQ_TYPE_LEVEL_LOW);// IRQ_TYPE_EDGE_FALLING);//zkj
}
开发者ID:adangdang,项目名称:android-2.6.27-yf255,代码行数:31,代码来源:yf255.c

示例4: a716_stylus

static irqreturn_t a716_stylus(int irq, void *dev_id)
{
	ts_pos_t ts_pos;

	if (irq == IRQ_GPIO(GPIO_NR_A716_STYLUS_IRQ_N) && irq_disable == 0) {
		//printk("IRQ\n");
		irq_disable = 1;
		disable_irq(IRQ_GPIO(GPIO_NR_A716_STYLUS_IRQ_N));
	}

	read_xydata(&ts_pos);

	if (ts_pos.xd == 0 || ts_pos.yd == 0) {
		report_touchpanel(0, 0, 0);
		//printk("touch released\n");
		if (irq_disable == 1) {
			request_irq(IRQ_GPIO(GPIO_NR_A716_STYLUS_IRQ_N), a716_stylus, SA_SAMPLE_RANDOM, "ad7873 stylus", NULL);
			set_irq_type(IRQ_GPIO(GPIO_NR_A716_STYLUS_IRQ_N), IRQT_FALLING);
			enable_irq(IRQ_GPIO(GPIO_NR_A716_STYLUS_IRQ_N));
			irq_disable = 0;
		}
		return IRQ_HANDLED;
	}

	//printk("%04d %04d\n", (int)ts_pos.xd, (int)ts_pos.yd);
	//printk("touch pressed\n");
	report_touchpanel(ts_pos.xd, ts_pos.yd, 1);

	mod_timer(&timer_pen, jiffies + (SAMPLE_TIMEOUT * HZ) / 1000);

	//printk("callback\n");
	return IRQ_HANDLED;
};
开发者ID:ManiacTwister,项目名称:linux-hnd,代码行数:33,代码来源:a716_ssp.c

示例5: __cmx270_pci_init_irq

void __cmx270_pci_init_irq(void)
{
	it8152_init_irq();
	pxa_gpio_mode(IRQ_TO_GPIO(GPIO_IT8152_IRQ));
	set_irq_type(IRQ_GPIO(GPIO_IT8152_IRQ), IRQT_RISING);

	set_irq_chained_handler(IRQ_GPIO(GPIO_IT8152_IRQ),
				cmx270_it8152_irq_demux);
}
开发者ID:ForayJones,项目名称:iods,代码行数:9,代码来源:cm-x270-pci.c

示例6: tekom_ts_probe

static int tekom_ts_probe(struct i2c_client *client, const struct i2c_device_id * id)
{
	int ret = -EIO;
	struct tekom_touch_data *p_tekom_touch;
	struct input_dev 	*tekom_ts_input_dev;	

	/* register input device */
	tekom_ts_input_dev = input_allocate_device();	
      	tekom_ts_input_dev->name = "Tekom capcitive touchscreen";
	tekom_ts_input_dev->open = tekom_ts_input_open;
	tekom_ts_input_dev->close = tekom_ts_input_close;
	__set_bit(EV_ABS, tekom_ts_input_dev->evbit);
	__set_bit(ABS_X, tekom_ts_input_dev->absbit);
	__set_bit(ABS_Y, tekom_ts_input_dev->absbit);
	__set_bit(ABS_PRESSURE, tekom_ts_input_dev->absbit);
	set_bit(EV_KEY, tekom_ts_input_dev->evbit);
	set_bit(BTN_TOUCH, tekom_ts_input_dev->keybit);

	/* Malloc p_touch context */
	p_tekom_touch = kzalloc(sizeof(struct tekom_touch_data), GFP_KERNEL);
	if (!p_tekom_touch) {
		ret = -ENOMEM;
		goto err;
	}
	
	p_tekom_touch->tekom_ts_input_dev = tekom_ts_input_dev;
	platform_set_drvdata(client, p_tekom_touch);
	input_set_drvdata(tekom_ts_input_dev, p_tekom_touch);
	ret = input_register_device(tekom_ts_input_dev);

	p_tekom_touch->client = client;
	p_tekom_touch->pen_down = 0;
	p_tekom_touch->use_count = 0;
	p_tekom_touch->poll_jiffies = 5;

	tekom_touch_gpio_init();
	ret = request_irq(IRQ_GPIO(MFP2GPIO(TOUCH_INT)), tekom_touch_interrupt, 
		IRQF_TRIGGER_FALLING, "Tekom_capcitive", p_tekom_touch);

	ret = request_irq(IRQ_GPIO(MFP2GPIO(SLIDE_INT)), slide_interrupt, 
		IRQF_TRIGGER_FALLING|IRQF_TRIGGER_RISING, "SLIDE_INT", p_tekom_touch);

	init_timer(&p_tekom_touch->poll_timer);
	p_tekom_touch->poll_timer.data    = (unsigned long)p_tekom_touch;
	p_tekom_touch->poll_timer.function = tekom_poll_timer_handler;

	ret = sysfs_create_group(&client->dev.kobj, &tekom_touch_attr_group);
	
	printk("Android tekom capcitive touchscreen driver register succ\n");
	return 0;

err:	
	return ret;
}
开发者ID:abgoyal,项目名称:OpenX2-kernel-original,代码行数:54,代码来源:tekom_touch.c

示例7: sharpsl_pm_pxa_remove

void sharpsl_pm_pxa_remove(void)
{
    free_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_acin), sharpsl_ac_isr);
    free_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_batlock), sharpsl_fatal_isr);

    if (sharpsl_pm.machinfo->gpio_fatal)
        free_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_fatal), sharpsl_fatal_isr);

    if (sharpsl_pm.machinfo->batfull_irq)
        free_irq(IRQ_GPIO(sharpsl_pm.machinfo->gpio_batfull), sharpsl_chrg_full_isr);
}
开发者ID:274914765,项目名称:C,代码行数:11,代码来源:sharpsl_pm.c

示例8: gpio_watch

static int gpio_watch(int x)
{
	int ret;
	ret = request_irq (IRQ_GPIO(x), gpio_irq, SA_SAMPLE_RANDOM, "test_handler", (void*)x);
	set_irq_type (IRQ_GPIO(x), IRQT_BOTHEDGE);
	if(ret!=0) {
		printk(KERN_ERR "GPIOed: failed to register for GPIO %d\n", x);
		return 1;
	} else {
		printk(KERN_ERR "GPIOed: Registered GPIO %d\n", x);
		return 0;
	}
}
开发者ID:fourks,项目名称:tools,代码行数:13,代码来源:gpioed.c

示例9: eseries_battery_init

static int eseries_battery_init(void) {
	int ret;

	if(!(machine_is_e740() || machine_is_e750() || machine_is_e800()))
		return -ENODEV;

	ret = request_irq(IRQ_GPIO(10), eseries_battery_irq, 0, "battery", NULL);
	if(ret)
		return ret;
	set_irq_type(IRQ_GPIO(10), IRQT_BOTHEDGE);

	eseries_battery_probe(NULL);

	return 0;
}
开发者ID:ManiacTwister,项目名称:linux-hnd,代码行数:15,代码来源:eseries_battery.c

示例10: palmtx_pcmcia_hw_init

static int palmtx_pcmcia_hw_init (struct soc_pcmcia_socket *skt)
{
        GPSR(GPIO48_nPOE_MD) =	GPIO_bit(GPIO48_nPOE_MD) |
				GPIO_bit(GPIO49_nPWE_MD) |
				GPIO_bit(GPIO50_nPIOR_MD) |
				GPIO_bit(GPIO51_nPIOW_MD) |
				GPIO_bit(GPIO85_nPCE_1_MD) |
				GPIO_bit(GPIO53_nPCE_2_MD) |
				GPIO_bit(GPIO54_pSKTSEL_MD) |
				GPIO_bit(GPIO55_nPREG_MD) |
				GPIO_bit(GPIO56_nPWAIT_MD) |
				GPIO_bit(GPIO57_nIOIS16_MD);

        pxa_gpio_mode(GPIO48_nPOE_MD);
        pxa_gpio_mode(GPIO49_nPWE_MD);
        pxa_gpio_mode(GPIO50_nPIOR_MD);
        pxa_gpio_mode(GPIO51_nPIOW_MD);
        pxa_gpio_mode(GPIO85_nPCE_1_MD);
        pxa_gpio_mode(GPIO53_nPCE_2_MD);
        pxa_gpio_mode(GPIO54_pSKTSEL_MD);
        pxa_gpio_mode(GPIO55_nPREG_MD);
        pxa_gpio_mode(GPIO56_nPWAIT_MD);
        pxa_gpio_mode(GPIO57_nIOIS16_MD);

	skt->irq = IRQ_GPIO(GPIO_NR_PALMTX_PCMCIA_READY);

	palmtx_pcmcia_dbg("%s:%i, Socket:%d\n", __FUNCTION__, __LINE__, skt->nr);
        return soc_pcmcia_request_irqs(skt, palmtx_socket_state_irqs,
				       ARRAY_SIZE(palmtx_socket_state_irqs));
}
开发者ID:ManiacTwister,项目名称:linux-hnd,代码行数:30,代码来源:palmtx_pcmcia.c

示例11: lubbock_init_irq

static void __init lubbock_init_irq(void)
{
	int irq;

	pxa_init_irq();

	/* setup extra lubbock irqs */
	for (irq = LUBBOCK_IRQ(0); irq <= LUBBOCK_LAST_IRQ; irq++) {
		set_irq_chip(irq, &lubbock_irq_chip);
		set_irq_handler(irq, do_level_IRQ);
		set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
	}

	set_irq_chained_handler(IRQ_GPIO(0), lubbock_irq_handler);
	set_irq_type(IRQ_GPIO(0), IRQT_FALLING);
}
开发者ID:Dronevery,项目名称:JetsonTK1-kernel,代码行数:16,代码来源:lubbock.c

示例12: cleanup_module

// the module last called function
void cleanup_module(void) {

	remove_proc_entry(PROCFS_PID_NAME, &proc_root);
	remove_proc_entry(PROCFS_CMD_NAME, &proc_root);

	PDEBUG("Freeing registered irq %d for GPIO %d\n", IRQ_GPIO(gpio_in_streamctl), gpio_in_streamctl);
	free_irq(IRQ_GPIO(gpio_in_streamctl), &data);

	turn_off_gpio(gpio_out_modem);
	// turn off led green: reverse logic
	turn_on_gpio(gpio_out_green);
	del_timer(&jiq_pulse_timer);

	printk(KERN_INFO MODULE_NAME ": Stopping gpio module...\n");

}  
开发者ID:pallotron,项目名称:colibri-gpo,代码行数:17,代码来源:gpio-pulse.c

示例13: pxa_mask_muxed_gpio

static void pxa_mask_muxed_gpio(unsigned int irq)
{
	int gpio = irq - IRQ_GPIO(2) + 2;
	__clear_bit(gpio, GPIO_IRQ_mask);
	GRER(gpio) &= ~GPIO_bit(gpio);
	GFER(gpio) &= ~GPIO_bit(gpio);
}
开发者ID:420GrayFox,项目名称:dsl-n55u-bender,代码行数:7,代码来源:irq.c

示例14: pxa_unmask_muxed_gpio

static void pxa_unmask_muxed_gpio(unsigned int irq)
{
	int gpio = irq - IRQ_GPIO(2) + 2;
	int idx = gpio >> 5;
	__set_bit(gpio, GPIO_IRQ_mask);
	GRER(gpio) = GPIO_IRQ_rising_edge[idx] & GPIO_IRQ_mask[idx];
	GFER(gpio) = GPIO_IRQ_falling_edge[idx] & GPIO_IRQ_mask[idx];
}
开发者ID:420GrayFox,项目名称:dsl-n55u-bender,代码行数:8,代码来源:irq.c

示例15: yf255_mmc_poll

static void yf255_mmc_poll(unsigned long data)
{
	unsigned long flags;

	/* clear any previous irq state, then ... */
	local_irq_save(flags);
	YF255_IRQ_SET_CLR &= ~(1 << 0);
	local_irq_restore(flags);

	/* poll until mmc/sd card is removed */
	if (YF255_IRQ_SET_CLR & (1 << 0))
		mod_timer(&mmc_timer, jiffies + MMC_POLL_RATE);
	else {
		(void) mmc_detect_int(IRQ_GPIO(12), (void *)data);
		enable_irq(IRQ_GPIO(12));
	}
}
开发者ID:adangdang,项目名称:android-2.6.27-yf255,代码行数:17,代码来源:yf255.c


注:本文中的IRQ_GPIO函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。