Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
b72f6254
Commit
b72f6254
authored
Aug 28, 2002
by
David S. Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
I8042: Add SPARC support.
parent
cb2a8c22
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
102 additions
and
0 deletions
+102
-0
drivers/input/serio/i8042-sparcio.h
drivers/input/serio/i8042-sparcio.h
+100
-0
drivers/input/serio/i8042.h
drivers/input/serio/i8042.h
+2
-0
No files found.
drivers/input/serio/i8042-sparcio.h
0 → 100644
View file @
b72f6254
#ifndef _I8042_SPARCIO_H
#define _I8042_SPARCIO_H
#include <asm/oplib.h>
#include <asm/ebus.h>
static
int
i8042_kbd_irq
=
-
1
;
static
int
i8042_aux_irq
=
-
1
;
#define I8042_KBD_IRQ i8042_kbd_irq
#define I8042_AUX_IRQ i8042_aux_irq
#define I8042_KBD_PHYS_DESC "sparcps2/serio0"
#define I8042_AUX_PHYS_DESC "sparcps2/serio1"
static
unsigned
long
kbd_iobase
;
static
inline
int
i8042_read_data
(
void
)
{
return
readb
(
kbd_iobase
+
0x60UL
);
}
static
inline
int
i8042_read_status
(
void
)
{
return
readb
(
kbd_iobase
+
0x64UL
);
}
static
inline
void
i8042_write_data
(
int
val
)
{
writeb
(
val
,
kbd_iobase
+
0x60UL
);
}
static
inline
void
i8042_write_command
(
int
val
)
{
writeb
(
val
,
kbd_iobase
+
0x64UL
);
}
#define OBP_PS2KBD_NAME1 "kb_ps2"
#define OBP_PS2KBD_NAME2 "keyboard"
#define OBP_PS2MS_NAME1 "kdmouse"
#define OBP_PS2MS_NAME2 "mouse"
static
int
i8042_platform_init
(
void
)
{
char
prop
[
128
];
int
len
;
len
=
prom_getproperty
(
prom_root_node
,
"name"
,
prop
,
sizeof
(
prop
));
if
(
len
<
0
)
{
printk
(
"i8042: Cannot get name property of root OBP node.
\n
"
);
return
0
;
}
if
(
strncmp
(
prop
,
"SUNW,JavaStation-1"
,
len
)
==
0
)
{
/* Hardcoded values for MrCoffee. */
i8042_kbd_irq
=
i8042_aux_irq
=
13
|
0x20
;
kbd_iobase
=
(
unsigned
long
)
ioremap
(
0x71300060
,
8
);
if
(
!
kbd_iobase
)
return
0
;
}
else
{
struct
linux_ebus
*
ebus
;
struct
linux_ebus_device
*
edev
;
struct
linux_ebus_child
*
child
;
for_each_ebus
(
ebus
)
{
for_each_ebusdev
(
edev
,
ebus
)
{
if
(
!
strcmp
(
edev
->
prom_name
,
"8042"
))
goto
edev_found
;
}
}
return
0
;
edev_found:
for_each_edevchild
(
edev
,
child
)
{
if
(
!
strcmp
(
child
->
prom_name
,
OBP_PS2KBD_NAME1
)
||
!
strcmp
(
child
->
prom_name
,
OBP_PS2KBD_NAME2
))
{
i8042_kbd_irq
=
child
->
irqs
[
0
];
kbd_iobase
=
(
unsigned
long
)
ioremap
(
child
->
resource
[
0
].
start
);
}
if
(
!
strcmp
(
child
->
prom_name
,
OBP_PS2MS_NAME1
)
||
!
strcmp
(
child
->
prom_name
,
OBP_PS2MS_NAME2
))
i8042_aux_irq
=
child
->
irqs
[
0
];
}
if
(
i8042_kbd_irq
==
-
1
||
i8042_aux_irq
==
-
1
)
{
printk
(
"i8042: Error, 8042 device lacks both kbd and "
"mouse nodes.
\n
"
);
return
0
;
}
}
printk
(
"i8042: kbd_base[%lx] irq[kbd(%x):aux(%x)]
\n
"
,
kbd_iobase
,
i8042_kbd_irq
,
i8042_aux_irq
);
return
1
;
}
static
inline
void
i8042_platform_exit
(
void
)
{
iounmap
((
void
*
)
kbd_iobase
);
}
drivers/input/serio/i8042.h
View file @
b72f6254
...
@@ -15,6 +15,8 @@
...
@@ -15,6 +15,8 @@
#if defined(CONFIG_PPC)
#if defined(CONFIG_PPC)
#include "i8042-ppcio.h"
#include "i8042-ppcio.h"
#elif defined(CONFIG_SPARC32) || defined(CONFIG_SPARC64)
#include "i8042-sparcio.h"
#else
#else
#include "i8042-io.h"
#include "i8042-io.h"
#endif
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment