本文整理汇总了C++中serio_get_drvdata函数的典型用法代码示例。如果您正苦于以下问题:C++ serio_get_drvdata函数的具体用法?C++ serio_get_drvdata怎么用?C++ serio_get_drvdata使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了serio_get_drvdata函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}