Release 4.11 drivers/input/serio/i8042-sparcio.h
#ifndef _I8042_SPARCIO_H
#define _I8042_SPARCIO_H
#include <linux/of_device.h>
#include <asm/io.h>
#include <asm/oplib.h>
#include <asm/prom.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"
#define I8042_MUX_PHYS_DESC "sparcps2/serio%d"
static void __iomem *kbd_iobase;
#define I8042_COMMAND_REG (kbd_iobase + 0x64UL)
#define I8042_DATA_REG (kbd_iobase + 0x60UL)
static inline int i8042_read_data(void)
{
return readb(kbd_iobase + 0x60UL);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
David S. Miller | 17 | 100.00% | 1 | 100.00% |
Total | 17 | 100.00% | 1 | 100.00% |
static inline int i8042_read_status(void)
{
return readb(kbd_iobase + 0x64UL);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
David S. Miller | 17 | 100.00% | 1 | 100.00% |
Total | 17 | 100.00% | 1 | 100.00% |
static inline void i8042_write_data(int val)
{
writeb(val, kbd_iobase + 0x60UL);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
David S. Miller | 19 | 100.00% | 1 | 100.00% |
Total | 19 | 100.00% | 1 | 100.00% |
static inline void i8042_write_command(int val)
{
writeb(val, kbd_iobase + 0x64UL);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
David S. Miller | 19 | 100.00% | 1 | 100.00% |
Total | 19 | 100.00% | 1 | 100.00% |
#ifdef CONFIG_PCI
static struct resource *kbd_res;
#define OBP_PS2KBD_NAME1 "kb_ps2"
#define OBP_PS2KBD_NAME2 "keyboard"
#define OBP_PS2MS_NAME1 "kdmouse"
#define OBP_PS2MS_NAME2 "mouse"
static int sparc_i8042_probe(struct platform_device *op)
{
struct device_node *dp = op->dev.of_node;
dp = dp->child;
while (dp) {
if (!strcmp(dp->name, OBP_PS2KBD_NAME1) ||
!strcmp(dp->name, OBP_PS2KBD_NAME2)) {
struct platform_device *kbd = of_find_device_by_node(dp);
unsigned int irq = kbd->archdata.irqs[0];
if (irq == 0xffffffff)
irq = op->archdata.irqs[0];
i8042_kbd_irq = irq;
kbd_iobase = of_ioremap(&kbd->resource[0],
0, 8, "kbd");
kbd_res = &kbd->resource[0];
} else if (!strcmp(dp->name, OBP_PS2MS_NAME1) ||
!strcmp(dp->name, OBP_PS2MS_NAME2)) {
struct platform_device *ms = of_find_device_by_node(dp);
unsigned int irq = ms->archdata.irqs[0];
if (irq == 0xffffffff)
irq = op->archdata.irqs[0];
i8042_aux_irq = irq;
}
dp = dp->sibling;
}
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
David S. Miller | 195 | 93.30% | 3 | 50.00% |
Grant C. Likely | 14 | 6.70% | 3 | 50.00% |
Total | 209 | 100.00% | 6 | 100.00% |
static int sparc_i8042_remove(struct platform_device *op)
{
of_iounmap(kbd_res, kbd_iobase, 8);
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
David S. Miller | 22 | 95.65% | 3 | 75.00% |
Grant C. Likely | 1 | 4.35% | 1 | 25.00% |
Total | 23 | 100.00% | 4 | 100.00% |
static const struct of_device_id sparc_i8042_match[] = {
{
.name = "8042",
},
{},
};
MODULE_DEVICE_TABLE(of, sparc_i8042_match);
static struct platform_driver sparc_i8042_driver = {
.driver = {
.name = "i8042",
.of_match_table = sparc_i8042_match,
},
.probe = sparc_i8042_probe,
.remove = sparc_i8042_remove,
};
static int __init i8042_platform_init(void)
{
struct device_node *root = of_find_node_by_path("/");
if (!strcmp(root->name, "SUNW,JavaStation-1")) {
/* Hardcoded values for MrCoffee. */
i8042_kbd_irq = i8042_aux_irq = 13 | 0x20;
kbd_iobase = ioremap(0x71300060, 8);
if (!kbd_iobase)
return -ENODEV;
} else {
int err = platform_driver_register(&sparc_i8042_driver);
if (err)
return err;
if (i8042_kbd_irq == -1 ||
i8042_aux_irq == -1) {
if (kbd_iobase) {
of_iounmap(kbd_res, kbd_iobase, 8);
kbd_iobase = (void __iomem *) NULL;
}
return -ENODEV;
}
}
i8042_reset = I8042_RESET_ALWAYS;
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
David S. Miller | 119 | 92.97% | 5 | 55.56% |
Vojtech Pavlik | 6 | 4.69% | 1 | 11.11% |
Grant C. Likely | 1 | 0.78% | 1 | 11.11% |
Dmitry Torokhov | 1 | 0.78% | 1 | 11.11% |
Marcos Paulo de Souza | 1 | 0.78% | 1 | 11.11% |
Total | 128 | 100.00% | 9 | 100.00% |
static inline void i8042_platform_exit(void)
{
struct device_node *root = of_find_node_by_path("/");
if (strcmp(root->name, "SUNW,JavaStation-1"))
platform_driver_unregister(&sparc_i8042_driver);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
David S. Miller | 35 | 97.22% | 2 | 66.67% |
Grant C. Likely | 1 | 2.78% | 1 | 33.33% |
Total | 36 | 100.00% | 3 | 100.00% |
#else /* !CONFIG_PCI */
static int __init i8042_platform_init(void)
{
return -ENODEV;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Alexander Beregalov | 13 | 100.00% | 1 | 100.00% |
Total | 13 | 100.00% | 1 | 100.00% |
static inline void i8042_platform_exit(void)
{
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Alexander Beregalov | 8 | 100.00% | 1 | 100.00% |
Total | 8 | 100.00% | 1 | 100.00% |
#endif /* !CONFIG_PCI */
#endif /* _I8042_SPARCIO_H */
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
David S. Miller | 569 | 88.08% | 10 | 45.45% |
Alexander Beregalov | 30 | 4.64% | 1 | 4.55% |
Grant C. Likely | 24 | 3.72% | 5 | 22.73% |
Vojtech Pavlik | 10 | 1.55% | 1 | 4.55% |
Vincent Stehlé | 6 | 0.93% | 1 | 4.55% |
Stephen Rothwell | 4 | 0.62% | 1 | 4.55% |
Andrew Morton | 1 | 0.15% | 1 | 4.55% |
Dmitry Torokhov | 1 | 0.15% | 1 | 4.55% |
Marcos Paulo de Souza | 1 | 0.15% | 1 | 4.55% |
Total | 646 | 100.00% | 22 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.