• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ serio_get_drvdata函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: spaceball_interrupt

static irqreturn_t spaceball_interrupt(struct serio *serio,
		unsigned char data, unsigned int flags)
{
	struct spaceball *spaceball = serio_get_drvdata(serio);

	switch (data) {
		case 0xd:
			spaceball_process_packet(spaceball);
			spaceball->idx = 0;
			spaceball->escape = 0;
			break;
		case '^':
			if (!spaceball->escape) {
				spaceball->escape = 1;
				break;
			}
			spaceball->escape = 0;
		case 'M':
		case 'Q':
		case 'S':
			if (spaceball->escape) {
				spaceball->escape = 0;
				data &= 0x1f;
			}
		default:
			if (spaceball->escape)
				spaceball->escape = 0;
			if (spaceball->idx < SPACEBALL_MAX_LENGTH)
				spaceball->data[spaceball->idx++] = data;
			break;
	}
	return IRQ_HANDLED;
}
开发者ID:smx-smx,项目名称:dsl-n55u,代码行数:33,代码来源:spaceball.c


示例2: fujitsu_interrupt

/*
 * Decode serial data (5 bytes per packet)
 * First byte
 * 1 C 0 0 R S S S
 * Where C is 1 while in calibration mode (which we don't use)
 * R is 1 when no coordinate corection was done.
 * S are button state
 */
static irqreturn_t fujitsu_interrupt(struct serio *serio,
				     unsigned char data, unsigned int flags)
{
	struct fujitsu *fujitsu = serio_get_drvdata(serio);
	struct input_dev *dev = fujitsu->dev;

	if (fujitsu->idx == 0) {
		/* resync skip until start of frame */
		if ((data & 0xf0) != 0x80)
			return IRQ_HANDLED;
	} else {
		/* resync skip garbage */
		if (data & 0x80) {
			fujitsu->idx = 0;
			return IRQ_HANDLED;
		}
	}

	fujitsu->data[fujitsu->idx++] = data;
	if (fujitsu->idx == FUJITSU_LENGTH) {
		input_report_abs(dev, ABS_X,
				 (fujitsu->data[2] << 7) | fujitsu->data[1]);
		input_report_abs(dev, ABS_Y,
				 (fujitsu->data[4] << 7) | fujitsu->data[3]);
		input_report_key(dev, BTN_TOUCH,
				 (fujitsu->data[0] & 0x03) != 2);
		input_sync(dev);
		fujitsu->idx = 0;
	}

	return IRQ_HANDLED;
}
开发者ID:CSCLOG,项目名称:beaglebone,代码行数:40,代码来源:fujitsu_ts.c


示例3: touchit213_interrupt

static irqreturn_t touchit213_interrupt(struct serio *serio,
		unsigned char data, unsigned int flags)
{
	struct touchit213 *touchit213 = serio_get_drvdata(serio);
	struct input_dev *dev = touchit213->dev;

	touchit213->data[touchit213->idx] = data;

	switch (touchit213->idx++) {
	case 0:
		if ((touchit213->data[0] & T213_FORMAT_STATUS_MASK) !=
				T213_FORMAT_STATUS_BYTE) {
			pr_debug("unsynchronized data: 0x%02x\n", data);
			touchit213->idx = 0;
		}
		break;

	case 4:
		touchit213->idx = 0;
		input_report_abs(dev, ABS_X,
			(touchit213->data[1] << 7) | touchit213->data[2]);
		input_report_abs(dev, ABS_Y,
			(touchit213->data[3] << 7) | touchit213->data[4]);
		input_report_key(dev, BTN_TOUCH,
			touchit213->data[0] & T213_FORMAT_TOUCH_BIT);
		input_sync(dev);
		break;
	}

	return IRQ_HANDLED;
}
开发者ID:AlexShiLucky,项目名称:linux,代码行数:31,代码来源:touchit213.c


示例4: taos_interrupt

static irqreturn_t taos_interrupt(struct serio *serio, unsigned char data,
				  unsigned int flags)
{
	struct taos_data *taos = serio_get_drvdata(serio);

	switch (taos->state) {
	case TAOS_STATE_INIT:
		taos->buffer[taos->pos++] = data;
		if (data == ':'
		 || taos->pos == TAOS_BUFFER_SIZE - 1) {
			taos->buffer[taos->pos] = '\0';
			taos->state = TAOS_STATE_IDLE;
			wake_up_interruptible(&wq);
		}
		break;
	case TAOS_STATE_SEND:
		if (taos->buffer[++taos->pos])
			serio_write(serio, taos->buffer[taos->pos]);
		else {
			taos->state = TAOS_STATE_IDLE;
			wake_up_interruptible(&wq);
		}
		break;
	case TAOS_STATE_RECV:
		taos->buffer[taos->pos++] = data;
		if (data == ']') {
			taos->buffer[taos->pos] = '\0';
			taos->state = TAOS_STATE_IDLE;
			wake_up_interruptible(&wq);
		}
		break;
	}

	return IRQ_HANDLED;
}
开发者ID:458941968,项目名称:mini2440-kernel-2.6.29,代码行数:35,代码来源:i2c-taos-evm.c


示例5: lkkbd_interrupt

/*
 * lkkbd_interrupt() is called by the low level driver when a character
 * is received.
 */
static irqreturn_t
lkkbd_interrupt (struct serio *serio, unsigned char data, unsigned int flags)
{
	struct lkkbd *lk = serio_get_drvdata (serio);
	int i;

	DBG (KERN_INFO "Got byte 0x%02x\n", data);

	if (lk->ignore_bytes > 0) {
		DBG (KERN_INFO "Ignoring a byte on %s\n", lk->name);
		lk->id[LK_NUM_IGNORE_BYTES - lk->ignore_bytes--] = data;

		if (lk->ignore_bytes == 0)
			lkkbd_detection_done (lk);

		return IRQ_HANDLED;
	}

	switch (data) {
		case LK_ALL_KEYS_UP:
			for (i = 0; i < ARRAY_SIZE (lkkbd_keycode); i++)
				if (lk->keycode[i] != KEY_RESERVED)
					input_report_key (lk->dev, lk->keycode[i], 0);
			input_sync (lk->dev);
			break;

		case 0x01:
			DBG (KERN_INFO "Got 0x01, scheduling re-initialization\n");
			lk->ignore_bytes = LK_NUM_IGNORE_BYTES;
			lk->id[LK_NUM_IGNORE_BYTES - lk->ignore_bytes--] = data;
			schedule_work (&lk->tq);
			break;

		case LK_METRONOME:
		case LK_OUTPUT_ERROR:
		case LK_INPUT_ERROR:
		case LK_KBD_LOCKED:
		case LK_KBD_TEST_MODE_ACK:
		case LK_PREFIX_KEY_DOWN:
		case LK_MODE_CHANGE_ACK:
		case LK_RESPONSE_RESERVED:
			DBG (KERN_INFO "Got %s and don't know how to handle...\n",
					response_name (data));
			break;

		default:
			if (lk->keycode[data] != KEY_RESERVED) {
				if (!test_bit (lk->keycode[data], lk->dev->key))
					input_report_key (lk->dev, lk->keycode[data], 1);
				else
					input_report_key (lk->dev, lk->keycode[data], 0);
				input_sync (lk->dev);
                        } else
                                printk (KERN_WARNING "%s: Unknown key with "
						"scancode 0x%02x on %s.\n",
						__FILE__, data, lk->name);
	}

	return IRQ_HANDLED;
}
开发者ID:Tigrouzen,项目名称:k1099,代码行数:64,代码来源:lkkbd.c


示例6: sec_keyboard_disconnect

static void sec_keyboard_disconnect(struct serio *serio)
{
	struct sec_keyboard_drvdata *data = serio_get_drvdata(serio);
	printk(KERN_DEBUG "[Keyboard] %s", __func__);
	data->tx_ready = false;
	serio_close(serio);
}
开发者ID:Andro-Boy,项目名称:Googy-Max2-Kernel,代码行数:7,代码来源:sec_keyboard.c


示例7: sec_keyboard_interrupt

static irqreturn_t sec_keyboard_interrupt(struct serio *serio,
		unsigned char data, unsigned int flags)
{
	struct sec_keyboard_drvdata *ddata = serio_get_drvdata(serio);
	if (ddata->pre_connected)
		sec_keyboard_process_data(ddata, data);
	return IRQ_HANDLED;
}
开发者ID:Andro-Boy,项目名称:Googy-Max2-Kernel,代码行数:8,代码来源:sec_keyboard.c


示例8: spaceball_disconnect

static void spaceball_disconnect(struct serio *serio)
{
	struct spaceball* spaceball = serio_get_drvdata(serio);

	serio_close(serio);
	serio_set_drvdata(serio, NULL);
	input_unregister_device(spaceball->dev);
	kfree(spaceball);
}
开发者ID:smx-smx,项目名称:dsl-n55u,代码行数:9,代码来源:spaceball.c


示例9: iforce_serio_disconnect

static void iforce_serio_disconnect(struct serio *serio)
{
	struct iforce *iforce = serio_get_drvdata(serio);

	input_unregister_device(iforce->dev);
	serio_close(serio);
	serio_set_drvdata(serio, NULL);
	kfree(iforce);
}
开发者ID:KrisChaplin,项目名称:LRT2x4_v1.0.2.06_GPL_source,代码行数:9,代码来源:iforce-serio.c


示例10: nkbd_disconnect

static void nkbd_disconnect(struct serio *serio)
{
	struct nkbd *nkbd = serio_get_drvdata(serio);

	serio_close(serio);
	serio_set_drvdata(serio, NULL);
	input_unregister_device(nkbd->dev);
	kfree(nkbd);
}
开发者ID:AlexShiLucky,项目名称:linux,代码行数:9,代码来源:newtonkbd.c


示例11: vsxxxaa_disconnect

static void vsxxxaa_disconnect(struct serio *serio)
{
	struct vsxxxaa *mouse = serio_get_drvdata(serio);

	serio_close(serio);
	serio_set_drvdata(serio, NULL);
	input_unregister_device(mouse->dev);
	kfree(mouse);
}
开发者ID:Medvedroid,项目名称:OT_903D-kernel-2.6.35.7,代码行数:9,代码来源:vsxxxaa.c


示例12: sec_keyboard_interrupt

static irqreturn_t sec_keyboard_interrupt(struct serio *serio,
		unsigned char data, unsigned int flags)
{
	struct sec_keyboard_drvdata *ddata = serio_get_drvdata(serio);
	ddata->scan_code = data;
	if (ddata->pre_connected)
		schedule_delayed_work(&ddata->handledata_dwork, 0);
	return IRQ_HANDLED;
}
开发者ID:KernelStalker,项目名称:GalaxyS3_Tmo-Att_Kernel,代码行数:9,代码来源:sec_keyboard.c


示例13: sunkbd_disconnect

static void sunkbd_disconnect(struct serio *serio)
{
	struct sunkbd *sunkbd = serio_get_drvdata(serio);

	sunkbd_enable(sunkbd, false);
	input_unregister_device(sunkbd->dev);
	serio_close(serio);
	serio_set_drvdata(serio, NULL);
	kfree(sunkbd);
}
开发者ID:Medvedroid,项目名称:OT_903D-kernel-2.6.35.7,代码行数:10,代码来源:sunkbd.c


示例14: vsxxxaa_interrupt

static irqreturn_t vsxxxaa_interrupt(struct serio *serio,
				     unsigned char data, unsigned int flags)
{
	struct vsxxxaa *mouse = serio_get_drvdata(serio);

	vsxxxaa_queue_byte(mouse, data);
	vsxxxaa_parse_buffer(mouse);

	return IRQ_HANDLED;
}
开发者ID:Medvedroid,项目名称:OT_903D-kernel-2.6.35.7,代码行数:10,代码来源:vsxxxaa.c


示例15: dock_keyboard_serio_disconnect

static void dock_keyboard_serio_disconnect(struct serio *serio)
{
	struct dock_keyboard_data *data = serio_get_drvdata(serio);

	pr_debug("kbd: serio_disconnect\n");

	data->serio = NULL;
	serio_close(serio);
	serio_set_drvdata(serio, NULL);
}
开发者ID:nickh186,项目名称:Samsung-GT-P3113-AOSP-CM-Kernel-and-Ramdisk,代码行数:10,代码来源:sec_dock_keyboard.c


示例16: elo_disconnect

static void elo_disconnect(struct serio *serio)
{
    struct elo *elo = serio_get_drvdata(serio);

    input_get_device(elo->dev);
    input_unregister_device(elo->dev);
    serio_close(serio);
    serio_set_drvdata(serio, NULL);
    input_put_device(elo->dev);
    kfree(elo);
}
开发者ID:b3rnik,项目名称:dsl-n55u-bender,代码行数:11,代码来源:elo.c


示例17: hil_dev_disconnect

static void hil_dev_disconnect(struct serio *serio)
{
	struct hil_dev *dev = serio_get_drvdata(serio);

	BUG_ON(dev == NULL);

	serio_close(serio);
	input_unregister_device(dev->dev);
	serio_set_drvdata(serio, NULL);
	kfree(dev);
}
开发者ID:mikuhatsune001,项目名称:linux2.6.32,代码行数:11,代码来源:hil_kbd.c


示例18: touchit213_disconnect

static void touchit213_disconnect(struct serio *serio)
{
	struct touchit213 *touchit213 = serio_get_drvdata(serio);

	input_get_device(touchit213->dev);
	input_unregister_device(touchit213->dev);
	serio_close(serio);
	serio_set_drvdata(serio, NULL);
	input_put_device(touchit213->dev);
	kfree(touchit213);
}
开发者ID:AlexShiLucky,项目名称:linux,代码行数:11,代码来源:touchit213.c


示例19: gunze_disconnect

static void gunze_disconnect(struct serio *serio)
{
	struct gunze *gunze = serio_get_drvdata(serio);

	input_get_device(gunze->dev);
	input_unregister_device(gunze->dev);
	serio_close(serio);
	serio_set_drvdata(serio, NULL);
	input_put_device(gunze->dev);
	kfree(gunze);
}
开发者ID:romanbb,项目名称:android_kernel_lge_d851,代码行数:11,代码来源:gunze.c


示例20: tsc_disconnect

static void tsc_disconnect(struct serio *serio)
{
	struct tsc_ser *ptsc = serio_get_drvdata(serio);

	serio_close(serio);

	input_unregister_device(ptsc->dev);
	kfree(ptsc);

	serio_set_drvdata(serio, NULL);
}
开发者ID:openube,项目名称:android_kernel_sony_c2305,代码行数:11,代码来源:tsc40.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ serio_interrupt函数代码示例发布时间:2022-05-30
下一篇:
C++ serio_close函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap