grub2: bring back build of aros-side grub2 tools
[AROS.git] / rom / hidds / i8042 / startup.c
blobaf77652230e357e8535ccbb7b42ab7e325e06d53
1 /*
2 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <aros/debug.h>
7 #include <aros/symbolsets.h>
8 #include <hidd/hidd.h>
9 #include <hidd/keyboard.h>
10 #include <hidd/mouse.h>
11 #include <proto/oop.h>
13 #include "libbase.h"
15 #undef HiddAttrBase
16 #undef HWBase
17 #undef OOPBase
18 #define HiddAttrBase (LIBBASE->ksd.hiddAttrBase)
19 #define HWBase (LIBBASE->ksd.hwMethodBase)
20 #define OOPBase (LIBBASE->ksd.cs_OOPBase)
22 static int init_kbd(struct kbdbase *LIBBASE)
24 OOP_Object *kbd = OOP_NewObject(NULL, CLID_HW_Kbd, NULL);
25 OOP_Object *ms = OOP_NewObject(NULL, CLID_HW_Mouse, NULL);
27 if ((!kbd) || (!ms))
29 /* This can be triggered by old base kickstart */
30 D(bug("[i8042] Subsystem classes not found\n"));
31 return FALSE;
34 if (!HW_AddDriver(kbd, LIBBASE->ksd.kbdclass, NULL))
36 D(bug("[i8042] No controller detected\n"));
37 return FALSE;
39 LIBBASE->library.lib_OpenCnt = 1;
41 /* Mouse can be missing, it's not a failure */
42 if (HW_AddDriver(ms, LIBBASE->ksd.mouseclass, NULL))
44 D(bug("[i8042] Mouse driver installed\n"));
45 LIBBASE->library.lib_OpenCnt++;
48 return TRUE;
51 ADD2INITLIB(init_kbd, 10);