Skip to content

Commit

Permalink
Input: i8042 - export i8042_command()
Browse files Browse the repository at this point in the history
Export the i8042_command() function which manages the mutual
exclusion with the help of the i8042_lock spinlock. This allows
to access i8042 safely from other parts of the kernel.

Signed-off-by: Márton Németh <nm127@freemail.hu>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
  • Loading branch information
Márton Németh authored and Dmitry Torokhov committed Oct 22, 2007
1 parent 82ba56c commit 553a05b
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 23 deletions.
4 changes: 3 additions & 1 deletion drivers/input/serio/i8042.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <linux/err.h>
#include <linux/rcupdate.h>
#include <linux/platform_device.h>
#include <linux/i8042.h>

#include <asm/io.h>

Expand Down Expand Up @@ -208,7 +209,7 @@ static int __i8042_command(unsigned char *param, int command)
return 0;
}

static int i8042_command(unsigned char *param, int command)
int i8042_command(unsigned char *param, int command)
{
unsigned long flags;
int retval;
Expand All @@ -219,6 +220,7 @@ static int i8042_command(unsigned char *param, int command)

return retval;
}
EXPORT_SYMBOL(i8042_command);

/*
* i8042_kbd_write() sends a byte out through the keyboard interface.
Expand Down
22 changes: 0 additions & 22 deletions drivers/input/serio/i8042.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,28 +60,6 @@
#define I8042_CTR_AUXDIS 0x20
#define I8042_CTR_XLATE 0x40

/*
* Commands.
*/

#define I8042_CMD_CTL_RCTR 0x0120
#define I8042_CMD_CTL_WCTR 0x1060
#define I8042_CMD_CTL_TEST 0x01aa

#define I8042_CMD_KBD_DISABLE 0x00ad
#define I8042_CMD_KBD_ENABLE 0x00ae
#define I8042_CMD_KBD_TEST 0x01ab
#define I8042_CMD_KBD_LOOP 0x11d2

#define I8042_CMD_AUX_DISABLE 0x00a7
#define I8042_CMD_AUX_ENABLE 0x00a8
#define I8042_CMD_AUX_TEST 0x01a9
#define I8042_CMD_AUX_SEND 0x10d4
#define I8042_CMD_AUX_LOOP 0x11d3

#define I8042_CMD_MUX_PFX 0x0090
#define I8042_CMD_MUX_SEND 0x1090

/*
* Return codes.
*/
Expand Down
35 changes: 35 additions & 0 deletions include/linux/i8042.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#ifndef _LINUX_I8042_H
#define _LINUX_I8042_H

/*
* 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.
*/


/*
* Standard commands.
*/

#define I8042_CMD_CTL_RCTR 0x0120
#define I8042_CMD_CTL_WCTR 0x1060
#define I8042_CMD_CTL_TEST 0x01aa

#define I8042_CMD_KBD_DISABLE 0x00ad
#define I8042_CMD_KBD_ENABLE 0x00ae
#define I8042_CMD_KBD_TEST 0x01ab
#define I8042_CMD_KBD_LOOP 0x11d2

#define I8042_CMD_AUX_DISABLE 0x00a7
#define I8042_CMD_AUX_ENABLE 0x00a8
#define I8042_CMD_AUX_TEST 0x01a9
#define I8042_CMD_AUX_SEND 0x10d4
#define I8042_CMD_AUX_LOOP 0x11d3

#define I8042_CMD_MUX_PFX 0x0090
#define I8042_CMD_MUX_SEND 0x1090

int i8042_command(unsigned char *param, int command);

#endif

0 comments on commit 553a05b

Please sign in to comment.