1 #ifndef _I8042_X86IA64IO_H
2 #define _I8042_X86IA64IO_H
18 #define I8042_KBD_PHYS_DESC "isa0060/serio0"
19 #define I8042_AUX_PHYS_DESC "isa0060/serio1"
20 #define I8042_MUX_PHYS_DESC "isa0060/serio%d"
27 # define I8042_MAP_IRQ(x) isa_irq_to_vector((x))
29 # define I8042_MAP_IRQ(x) (x)
32 #define I8042_KBD_IRQ i8042_kbd_irq
33 #define I8042_AUX_IRQ i8042_aux_irq
35 static int i8042_kbd_irq;
36 static int i8042_aux_irq;
42 #define I8042_COMMAND_REG i8042_command_reg
43 #define I8042_STATUS_REG i8042_command_reg
44 #define I8042_DATA_REG i8042_data_reg
46 static int i8042_command_reg = 0x64;
47 static int i8042_data_reg = 0x60;
50 static inline int i8042_read_data(
void)
55 static inline int i8042_read_status(
void)
60 static inline void i8042_write_data(
int val)
65 static inline void i8042_write_command(
int val)
692 static bool i8042_pnp_kbd_registered;
693 static unsigned int i8042_pnp_kbd_devices;
694 static bool i8042_pnp_aux_registered;
695 static unsigned int i8042_pnp_aux_devices;
697 static int i8042_pnp_command_reg;
698 static int i8042_pnp_data_reg;
699 static int i8042_pnp_kbd_irq;
700 static int i8042_pnp_aux_irq;
702 static char i8042_pnp_kbd_name[32];
703 static char i8042_pnp_aux_name[32];
707 if (pnp_port_valid(dev, 0) && pnp_port_len(dev, 0) == 1)
708 i8042_pnp_data_reg = pnp_port_start(dev,0);
710 if (pnp_port_valid(dev, 1) && pnp_port_len(dev, 1) == 1)
711 i8042_pnp_command_reg = pnp_port_start(dev, 1);
713 if (pnp_irq_valid(dev,0))
714 i8042_pnp_kbd_irq =
pnp_irq(dev, 0);
716 strlcpy(i8042_pnp_kbd_name, did->
id,
sizeof(i8042_pnp_kbd_name));
718 strlcat(i8042_pnp_kbd_name,
":",
sizeof(i8042_pnp_kbd_name));
725 i8042_pnp_kbd_devices++;
731 if (pnp_port_valid(dev, 0) && pnp_port_len(dev, 0) == 1)
732 i8042_pnp_data_reg = pnp_port_start(dev,0);
734 if (pnp_port_valid(dev, 1) && pnp_port_len(dev, 1) == 1)
735 i8042_pnp_command_reg = pnp_port_start(dev, 1);
737 if (pnp_irq_valid(dev, 0))
738 i8042_pnp_aux_irq =
pnp_irq(dev, 0);
740 strlcpy(i8042_pnp_aux_name, did->
id,
sizeof(i8042_pnp_aux_name));
742 strlcat(i8042_pnp_aux_name,
":",
sizeof(i8042_pnp_aux_name));
746 i8042_pnp_aux_devices++;
751 { .
id =
"PNP0300", .driver_data = 0 },
752 { .id =
"PNP0301", .driver_data = 0 },
753 { .id =
"PNP0302", .driver_data = 0 },
754 { .id =
"PNP0303", .driver_data = 0 },
755 { .id =
"PNP0304", .driver_data = 0 },
756 { .id =
"PNP0305", .driver_data = 0 },
757 { .id =
"PNP0306", .driver_data = 0 },
758 { .id =
"PNP0309", .driver_data = 0 },
759 { .id =
"PNP030a", .driver_data = 0 },
760 { .id =
"PNP030b", .driver_data = 0 },
761 { .id =
"PNP0320", .driver_data = 0 },
762 { .id =
"PNP0343", .driver_data = 0 },
763 { .id =
"PNP0344", .driver_data = 0 },
764 { .id =
"PNP0345", .driver_data = 0 },
765 { .id =
"CPQA0D7", .driver_data = 0 },
769 static struct pnp_driver i8042_pnp_kbd_driver = {
771 .id_table = pnp_kbd_devids,
772 .probe = i8042_pnp_kbd_probe,
776 { .
id =
"AUI0200", .driver_data = 0 },
777 { .id =
"FJC6000", .driver_data = 0 },
778 { .id =
"FJC6001", .driver_data = 0 },
779 { .id =
"PNP0f03", .driver_data = 0 },
780 { .id =
"PNP0f0b", .driver_data = 0 },
781 { .id =
"PNP0f0e", .driver_data = 0 },
782 { .id =
"PNP0f12", .driver_data = 0 },
783 { .id =
"PNP0f13", .driver_data = 0 },
784 { .id =
"PNP0f19", .driver_data = 0 },
785 { .id =
"PNP0f1c", .driver_data = 0 },
786 { .id =
"SYN0801", .driver_data = 0 },
790 static struct pnp_driver i8042_pnp_aux_driver = {
792 .id_table = pnp_aux_devids,
793 .probe = i8042_pnp_aux_probe,
796 static void i8042_pnp_exit(
void)
798 if (i8042_pnp_kbd_registered) {
799 i8042_pnp_kbd_registered =
false;
803 if (i8042_pnp_aux_registered) {
804 i8042_pnp_aux_registered =
false;
809 static int __init i8042_pnp_init(
void)
811 char kbd_irq_str[4] = { 0 }, aux_irq_str[4] = { 0 };
812 bool pnp_data_busted =
false;
821 pr_info(
"PNP detection disabled\n");
827 i8042_pnp_kbd_registered =
true;
831 i8042_pnp_aux_registered =
true;
833 if (!i8042_pnp_kbd_devices && !i8042_pnp_aux_devices) {
835 #if defined(__ia64__)
838 pr_info(
"PNP: No PS/2 controller found. Probing ports directly.\n");
843 if (i8042_pnp_kbd_devices)
844 snprintf(kbd_irq_str,
sizeof(kbd_irq_str),
845 "%d", i8042_pnp_kbd_irq);
846 if (i8042_pnp_aux_devices)
847 snprintf(aux_irq_str,
sizeof(aux_irq_str),
848 "%d", i8042_pnp_aux_irq);
850 pr_info(
"PNP: PS/2 Controller [%s%s%s] at %#x,%#x irq %s%s%s\n",
851 i8042_pnp_kbd_name, (i8042_pnp_kbd_devices && i8042_pnp_aux_devices) ?
"," :
"",
853 i8042_pnp_data_reg, i8042_pnp_command_reg,
854 kbd_irq_str, (i8042_pnp_kbd_devices && i8042_pnp_aux_devices) ?
"," :
"",
857 #if defined(__ia64__)
858 if (!i8042_pnp_kbd_devices)
860 if (!i8042_pnp_aux_devices)
864 if (((i8042_pnp_data_reg & ~0xf) == (i8042_data_reg & ~0xf) &&
865 i8042_pnp_data_reg != i8042_data_reg) ||
866 !i8042_pnp_data_reg) {
867 pr_warn(
"PNP: PS/2 controller has invalid data port %#x; using default %#x\n",
868 i8042_pnp_data_reg, i8042_data_reg);
869 i8042_pnp_data_reg = i8042_data_reg;
870 pnp_data_busted =
true;
873 if (((i8042_pnp_command_reg & ~0xf) == (i8042_command_reg & ~0xf) &&
874 i8042_pnp_command_reg != i8042_command_reg) ||
875 !i8042_pnp_command_reg) {
876 pr_warn(
"PNP: PS/2 controller has invalid command port %#x; using default %#x\n",
877 i8042_pnp_command_reg, i8042_command_reg);
878 i8042_pnp_command_reg = i8042_command_reg;
879 pnp_data_busted =
true;
882 if (!i8042_nokbd && !i8042_pnp_kbd_irq) {
883 pr_warn(
"PNP: PS/2 controller doesn't have KBD irq; using default %d\n",
885 i8042_pnp_kbd_irq = i8042_kbd_irq;
886 pnp_data_busted =
true;
889 if (!i8042_noaux && !i8042_pnp_aux_irq) {
890 if (!pnp_data_busted && i8042_pnp_kbd_irq) {
891 pr_warn(
"PNP: PS/2 appears to have AUX port disabled, "
892 "if this is incorrect please boot with i8042.nopnp\n");
895 pr_warn(
"PNP: PS/2 controller doesn't have AUX irq; using default %d\n",
897 i8042_pnp_aux_irq = i8042_aux_irq;
901 i8042_data_reg = i8042_pnp_data_reg;
902 i8042_command_reg = i8042_pnp_command_reg;
903 i8042_kbd_irq = i8042_pnp_kbd_irq;
904 i8042_aux_irq = i8042_pnp_aux_irq;
907 i8042_bypass_aux_irq_test = !pnp_data_busted &&
915 static inline int i8042_pnp_init(
void) {
return 0; }
916 static inline void i8042_pnp_exit(
void) { }
919 static int __init i8042_platform_init(
void)
940 retval = i8042_pnp_init();
944 #if defined(__ia64__)
959 i8042_notimeout =
true;
968 static inline void i8042_platform_exit(
void)