Release 4.7 include/linux/serio.h
/*
* Copyright (C) 1999-2002 Vojtech Pavlik
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published by
* the Free Software Foundation.
*/
#ifndef _SERIO_H
#define _SERIO_H
#include <linux/types.h>
#include <linux/interrupt.h>
#include <linux/list.h>
#include <linux/spinlock.h>
#include <linux/mutex.h>
#include <linux/device.h>
#include <linux/mod_devicetable.h>
#include <uapi/linux/serio.h>
extern struct bus_type serio_bus;
struct serio {
void *port_data;
char name[32];
char phys[32];
char firmware_id[128];
bool manual_bind;
struct serio_device_id id;
spinlock_t lock; /* protects critical sections from port's interrupt handler */
int (*write)(struct serio *, unsigned char);
int (*open)(struct serio *);
void (*close)(struct serio *);
int (*start)(struct serio *);
void (*stop)(struct serio *);
struct serio *parent;
struct list_head child_node; /* Entry in parent->children list */
struct list_head children;
unsigned int depth; /* level of nesting in serio hierarchy */
struct serio_driver *drv; /* accessed from interrupt, must be protected by serio->lock and serio->sem */
struct mutex drv_mutex; /* protects serio->drv so attributes can pin driver */
struct device dev;
struct list_head node;
};
#define to_serio_port(d) container_of(d, struct serio, dev)
struct serio_driver {
const char *description;
const struct serio_device_id *id_table;
bool manual_bind;
void (*write_wakeup)(struct serio *);
irqreturn_t (*interrupt)(struct serio *, unsigned char, unsigned int);
int (*connect)(struct serio *, struct serio_driver *drv);
int (*reconnect)(struct serio *);
void (*disconnect)(struct serio *);
void (*cleanup)(struct serio *);
struct device_driver driver;
};
#define to_serio_driver(d) container_of(d, struct serio_driver, driver)
int serio_open(struct serio *serio, struct serio_driver *drv);
void serio_close(struct serio *serio);
void serio_rescan(struct serio *serio);
void serio_reconnect(struct serio *serio);
irqreturn_t serio_interrupt(struct serio *serio, unsigned char data, unsigned int flags);
void __serio_register_port(struct serio *serio, struct module *owner);
/* use a define to avoid include chaining to get THIS_MODULE */
#define serio_register_port(serio) \
__serio_register_port(serio, THIS_MODULE)
void serio_unregister_port(struct serio *serio);
void serio_unregister_child_port(struct serio *serio);
int __must_check __serio_register_driver(struct serio_driver *drv,
struct module *owner, const char *mod_name);
/* use a define to avoid include chaining to get THIS_MODULE & friends */
#define serio_register_driver(drv) \
__serio_register_driver(drv, THIS_MODULE, KBUILD_MODNAME)
void serio_unregister_driver(struct serio_driver *drv);
/**
* module_serio_driver() - Helper macro for registering a serio driver
* @__serio_driver: serio_driver struct
*
* Helper macro for serio drivers which do not do anything special in
* module init/exit. This eliminates a lot of boilerplate. Each module
* may only use this macro once, and calling it replaces module_init()
* and module_exit().
*/
#define module_serio_driver(__serio_driver) \
module_driver(__serio_driver, serio_register_driver, \
serio_unregister_driver)
static inline int serio_write(struct serio *serio, unsigned char data)
{
if (serio->write)
return serio->write(serio, data);
else
return -1;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
pre-git | pre-git | 25 | 67.57% | 1 | 33.33% |
vojtech pavlik | vojtech pavlik | 11 | 29.73% | 1 | 33.33% |
dmitry torokhov | dmitry torokhov | 1 | 2.70% | 1 | 33.33% |
| Total | 37 | 100.00% | 3 | 100.00% |
static inline void serio_drv_write_wakeup(struct serio *serio)
{
if (serio->drv && serio->drv->write_wakeup)
serio->drv->write_wakeup(serio);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
vojtech pavlik | vojtech pavlik | 28 | 84.85% | 1 | 33.33% |
dmitry torokhov | dmitry torokhov | 5 | 15.15% | 2 | 66.67% |
| Total | 33 | 100.00% | 3 | 100.00% |
/*
* Use the following functions to manipulate serio's per-port
* driver-specific data.
*/
static inline void *serio_get_drvdata(struct serio *serio)
{
return dev_get_drvdata(&serio->dev);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
dmitry torokhov | dmitry torokhov | 22 | 100.00% | 2 | 100.00% |
| Total | 22 | 100.00% | 2 | 100.00% |
static inline void serio_set_drvdata(struct serio *serio, void *data)
{
dev_set_drvdata(&serio->dev, data);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
dmitry torokhov | dmitry torokhov | 26 | 100.00% | 2 | 100.00% |
| Total | 26 | 100.00% | 2 | 100.00% |
/*
* Use the following functions to protect critical sections in
* driver code from port's interrupt handler
*/
static inline void serio_pause_rx(struct serio *serio)
{
spin_lock_irq(&serio->lock);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
dmitry torokhov | dmitry torokhov | 20 | 100.00% | 2 | 100.00% |
| Total | 20 | 100.00% | 2 | 100.00% |
static inline void serio_continue_rx(struct serio *serio)
{
spin_unlock_irq(&serio->lock);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
dmitry torokhov | dmitry torokhov | 20 | 100.00% | 2 | 100.00% |
| Total | 20 | 100.00% | 2 | 100.00% |
#endif
Overall Contributors
| Person | Tokens | Prop | Commits | CommitProp |
dmitry torokhov | dmitry torokhov | 234 | 39.53% | 22 | 52.38% |
pre-git | pre-git | 175 | 29.56% | 1 | 2.38% |
vojtech pavlik | vojtech pavlik | 103 | 17.40% | 8 | 19.05% |
greg kroah-hartman | greg kroah-hartman | 22 | 3.72% | 1 | 2.38% |
paul gortmaker | paul gortmaker | 11 | 1.86% | 1 | 2.38% |
dmitry eremin-baryshkov | dmitry eremin-baryshkov | 9 | 1.52% | 1 | 2.38% |
axel lin | axel lin | 9 | 1.52% | 1 | 2.38% |
hans de goede | hans de goede | 6 | 1.01% | 1 | 2.38% |
stephen chandler paul | stephen chandler paul | 5 | 0.84% | 1 | 2.38% |
arjan van de ven | arjan van de ven | 5 | 0.84% | 1 | 2.38% |
jiri kosina | jiri kosina | 5 | 0.84% | 1 | 2.38% |
david howells | david howells | 4 | 0.68% | 1 | 2.38% |
akinobu mita | akinobu mita | 2 | 0.34% | 1 | 2.38% |
andrew morton | andrew morton | 2 | 0.34% | 1 | 2.38% |
| Total | 592 | 100.00% | 42 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.