#define pr_fmt(fmt) …
#include <linux/types.h>
#include <linux/delay.h>
#include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/ioport.h>
#include <linux/init.h>
#include <linux/serio.h>
#include <linux/err.h>
#include <linux/rcupdate.h>
#include <linux/platform_device.h>
#include <linux/i8042.h>
#include <linux/slab.h>
#include <linux/suspend.h>
#include <linux/property.h>
#include <asm/io.h>
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
static bool i8042_nokbd;
module_param_named(nokbd, i8042_nokbd, bool, 0);
MODULE_PARM_DESC(…) …;
static bool i8042_noaux;
module_param_named(noaux, i8042_noaux, bool, 0);
MODULE_PARM_DESC(…) …;
static bool i8042_nomux;
module_param_named(nomux, i8042_nomux, bool, 0);
MODULE_PARM_DESC(…) …;
static bool i8042_unlock;
module_param_named(unlock, i8042_unlock, bool, 0);
MODULE_PARM_DESC(…) …;
static bool i8042_probe_defer;
module_param_named(probe_defer, i8042_probe_defer, bool, 0);
MODULE_PARM_DESC(…) …;
enum i8042_controller_reset_mode { … };
static enum i8042_controller_reset_mode i8042_reset = …;
static int i8042_set_reset(const char *val, const struct kernel_param *kp)
{ … }
static const struct kernel_param_ops param_ops_reset_param = …;
#define param_check_reset_param(name, p) …
module_param_named(reset, i8042_reset, reset_param, 0);
MODULE_PARM_DESC(…) …;
static bool i8042_direct;
module_param_named(direct, i8042_direct, bool, 0);
MODULE_PARM_DESC(…) …;
static bool i8042_dumbkbd;
module_param_named(dumbkbd, i8042_dumbkbd, bool, 0);
MODULE_PARM_DESC(…) …;
static bool i8042_noloop;
module_param_named(noloop, i8042_noloop, bool, 0);
MODULE_PARM_DESC(…) …;
static bool i8042_notimeout;
module_param_named(notimeout, i8042_notimeout, bool, 0);
MODULE_PARM_DESC(…) …;
static bool i8042_kbdreset;
module_param_named(kbdreset, i8042_kbdreset, bool, 0);
MODULE_PARM_DESC(…) …;
#ifdef CONFIG_X86
static bool i8042_dritek;
module_param_named(dritek, i8042_dritek, bool, 0);
MODULE_PARM_DESC(…) …;
#endif
#ifdef CONFIG_PNP
static bool i8042_nopnp;
module_param_named(nopnp, i8042_nopnp, bool, 0);
MODULE_PARM_DESC(…) …;
#endif
static bool i8042_forcenorestore;
module_param_named(forcenorestore, i8042_forcenorestore, bool, 0);
MODULE_PARM_DESC(…) …;
#define DEBUG
#ifdef DEBUG
static bool i8042_debug;
module_param_named(debug, i8042_debug, bool, 0600);
MODULE_PARM_DESC(…) …;
static bool i8042_unmask_kbd_data;
module_param_named(unmask_kbd_data, i8042_unmask_kbd_data, bool, 0600);
MODULE_PARM_DESC(…) …;
#endif
static bool i8042_present;
static bool i8042_bypass_aux_irq_test;
static char i8042_kbd_firmware_id[128];
static char i8042_aux_firmware_id[128];
static struct fwnode_handle *i8042_kbd_fwnode;
#include "i8042.h"
static DEFINE_SPINLOCK(i8042_lock);
static DEFINE_MUTEX(i8042_mutex);
struct i8042_port { … };
#define I8042_KBD_PORT_NO …
#define I8042_AUX_PORT_NO …
#define I8042_MUX_PORT_NO …
#define I8042_NUM_PORTS …
static struct i8042_port i8042_ports[I8042_NUM_PORTS];
static unsigned char i8042_initial_ctr;
static unsigned char i8042_ctr;
static bool i8042_mux_present;
static bool i8042_kbd_irq_registered;
static bool i8042_aux_irq_registered;
static unsigned char i8042_suppress_kbd_ack;
static struct platform_device *i8042_platform_device;
static struct notifier_block i8042_kbd_bind_notifier_block;
static irqreturn_t i8042_interrupt(int irq, void *dev_id);
static bool (*i8042_platform_filter)(unsigned char data, unsigned char str,
struct serio *serio);
void i8042_lock_chip(void)
{ … }
EXPORT_SYMBOL(…);
void i8042_unlock_chip(void)
{ … }
EXPORT_SYMBOL(…);
int i8042_install_filter(bool (*filter)(unsigned char data, unsigned char str,
struct serio *serio))
{ … }
EXPORT_SYMBOL(…);
int i8042_remove_filter(bool (*filter)(unsigned char data, unsigned char str,
struct serio *port))
{ … }
EXPORT_SYMBOL(…);
static int i8042_wait_read(void)
{ … }
static int i8042_wait_write(void)
{ … }
static int i8042_flush(void)
{ … }
static int __i8042_command(unsigned char *param, int command)
{ … }
int i8042_command(unsigned char *param, int command)
{ … }
EXPORT_SYMBOL(…);
static int i8042_kbd_write(struct serio *port, unsigned char c)
{ … }
static int i8042_aux_write(struct serio *serio, unsigned char c)
{ … }
static void i8042_port_close(struct serio *serio)
{ … }
static int i8042_start(struct serio *serio)
{ … }
static void i8042_stop(struct serio *serio)
{ … }
static bool i8042_filter(unsigned char data, unsigned char str,
struct serio *serio)
{ … }
static irqreturn_t i8042_interrupt(int irq, void *dev_id)
{ … }
static int i8042_enable_kbd_port(void)
{ … }
static int i8042_enable_aux_port(void)
{ … }
static int i8042_enable_mux_ports(void)
{ … }
static int i8042_set_mux_mode(bool multiplex, unsigned char *mux_version)
{ … }
static int i8042_check_mux(void)
{ … }
static struct completion i8042_aux_irq_delivered;
static bool i8042_irq_being_tested;
static irqreturn_t i8042_aux_test_irq(int irq, void *dev_id)
{ … }
static int i8042_toggle_aux(bool on)
{ … }
static int i8042_check_aux(void)
{ … }
static int i8042_controller_check(void)
{ … }
static int i8042_controller_selftest(void)
{ … }
static int i8042_controller_init(void)
{ … }
static void i8042_controller_reset(bool s2r_wants_reset)
{ … }
#define DELAY …
static long i8042_panic_blink(int state)
{ … }
#undef DELAY
#ifdef CONFIG_X86
static void i8042_dritek_enable(void)
{ … }
#endif
#ifdef CONFIG_PM
static int i8042_controller_resume(bool s2r_wants_reset)
{ … }
static int i8042_pm_suspend(struct device *dev)
{ … }
static int i8042_pm_resume_noirq(struct device *dev)
{ … }
static int i8042_pm_resume(struct device *dev)
{ … }
static int i8042_pm_thaw(struct device *dev)
{ … }
static int i8042_pm_reset(struct device *dev)
{ … }
static int i8042_pm_restore(struct device *dev)
{ … }
static const struct dev_pm_ops i8042_pm_ops = …;
#endif
static void i8042_shutdown(struct platform_device *dev)
{ … }
static int i8042_create_kbd_port(void)
{ … }
static int i8042_create_aux_port(int idx)
{ … }
static void i8042_free_kbd_port(void)
{ … }
static void i8042_free_aux_ports(void)
{ … }
static void i8042_register_ports(void)
{ … }
static void i8042_unregister_ports(void)
{ … }
static void i8042_free_irqs(void)
{ … }
static int i8042_setup_aux(void)
{ … }
static int i8042_setup_kbd(void)
{ … }
static int i8042_kbd_bind_notifier(struct notifier_block *nb,
unsigned long action, void *data)
{ … }
static int i8042_probe(struct platform_device *dev)
{ … }
static void i8042_remove(struct platform_device *dev)
{ … }
static struct platform_driver i8042_driver = …;
static struct notifier_block i8042_kbd_bind_notifier_block = …;
static int __init i8042_init(void)
{ … }
static void __exit i8042_exit(void)
{ … }
module_init(…) …;
module_exit(i8042_exit);