#ifndef _GAMEPORT_H
#define _GAMEPORT_H
#include <linux/types.h>
#include <linux/list.h>
#include <linux/mutex.h>
#include <linux/device.h>
#include <linux/timer.h>
#include <linux/slab.h>
#include <uapi/linux/gameport.h>
struct gameport { … };
#define to_gameport_port(d) …
struct gameport_driver { … };
#define to_gameport_driver(d) …
int gameport_open(struct gameport *gameport, struct gameport_driver *drv, int mode);
void gameport_close(struct gameport *gameport);
#if IS_REACHABLE(CONFIG_GAMEPORT)
void __gameport_register_port(struct gameport *gameport, struct module *owner);
#define gameport_register_port(gameport) …
void gameport_unregister_port(struct gameport *gameport);
__printf(2, 3)
void gameport_set_phys(struct gameport *gameport, const char *fmt, ...);
#else
static inline void gameport_register_port(struct gameport *gameport)
{
return;
}
static inline void gameport_unregister_port(struct gameport *gameport)
{
return;
}
static inline __printf(2, 3)
void gameport_set_phys(struct gameport *gameport, const char *fmt, ...)
{
return;
}
#endif
static inline struct gameport *gameport_allocate_port(void)
{ … }
static inline void gameport_free_port(struct gameport *gameport)
{ … }
static inline void gameport_set_name(struct gameport *gameport, const char *name)
{ … }
static inline void *gameport_get_drvdata(struct gameport *gameport)
{ … }
static inline void gameport_set_drvdata(struct gameport *gameport, void *data)
{ … }
static inline int gameport_pin_driver(struct gameport *gameport)
{ … }
static inline void gameport_unpin_driver(struct gameport *gameport)
{ … }
int __must_check __gameport_register_driver(struct gameport_driver *drv,
struct module *owner, const char *mod_name);
#define gameport_register_driver(drv) …
void gameport_unregister_driver(struct gameport_driver *drv);
#define module_gameport_driver(__gameport_driver) …
static inline void gameport_trigger(struct gameport *gameport)
{ … }
static inline unsigned char gameport_read(struct gameport *gameport)
{ … }
static inline int gameport_cooked_read(struct gameport *gameport, int *axes, int *buttons)
{ … }
static inline int gameport_calibrate(struct gameport *gameport, int *axes, int *max)
{ … }
static inline int gameport_time(struct gameport *gameport, int time)
{ … }
static inline void gameport_set_poll_handler(struct gameport *gameport, void (*handler)(struct gameport *))
{ … }
static inline void gameport_set_poll_interval(struct gameport *gameport, unsigned int msecs)
{ … }
void gameport_start_polling(struct gameport *gameport);
void gameport_stop_polling(struct gameport *gameport);
#endif