Index: uspace/srv/hid/input/Makefile
===================================================================
--- uspace/srv/hid/input/Makefile	(revision 7aa9430447f0291e544450fa9f31d4ba06a73c7f)
+++ uspace/srv/hid/input/Makefile	(revision 17651f8b055cf4bb7799acdcb2095f5d02ca11a1)
@@ -37,10 +37,6 @@
 	layout/us_dvorak.c \
 	layout/ar.c \
-	port/adb.c \
-	port/adb_mouse.c \
 	port/chardev.c \
-	proto/adb.c \
 	proto/mousedev.c \
-	ctl/apple.c \
 	ctl/kbdev.c \
 	ctl/stty.c \
Index: uspace/srv/hid/input/ctl/apple.c
===================================================================
--- uspace/srv/hid/input/ctl/apple.c	(revision 7aa9430447f0291e544450fa9f31d4ba06a73c7f)
+++ 	(revision )
@@ -1,219 +1,0 @@
-/*
- * Copyright (c) 2011 Jiri Svoboda
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup kbd_ctl
- * @ingroup input
- * @{
- */
-/**
- * @file
- * @brief Apple ADB keyboard controller driver.
- */
-
-#include <io/console.h>
-#include <io/keycode.h>
-#include "../kbd.h"
-#include "../kbd_ctl.h"
-#include "../kbd_port.h"
-
-static void apple_ctl_parse(sysarg_t);
-static int apple_ctl_init(kbd_dev_t *);
-static void apple_ctl_set_ind(kbd_dev_t *, unsigned int);
-
-kbd_ctl_ops_t apple_ctl = {
-	.parse = apple_ctl_parse,
-	.init = apple_ctl_init,
-	.set_ind = apple_ctl_set_ind
-};
-
-#define KBD_KEY_RELEASE  0x80
-
-static unsigned int scanmap[] = {
-	[0x00] = KC_A,
-	[0x01] = KC_S,
-	[0x02] = KC_D,
-	[0x03] = KC_F,
-	[0x04] = KC_H,
-	[0x05] = KC_G,
-	[0x06] = KC_Z,
-	[0x07] = KC_X,
-	[0x08] = KC_C,
-	[0x09] = KC_V,
-	[0x0a] = KC_BACKSLASH,
-	[0x0b] = KC_B,
-	[0x0c] = KC_Q,
-	[0x0d] = KC_W,
-	[0x0e] = KC_E,
-	[0x0f] = KC_R,
-	[0x10] = KC_Y,
-	[0x11] = KC_T,
-	[0x12] = KC_1,
-	[0x13] = KC_2,
-	[0x14] = KC_3,
-	[0x15] = KC_4,
-	[0x16] = KC_6,
-	[0x17] = KC_5,
-	[0x18] = KC_EQUALS,
-	[0x19] = KC_9,
-	[0x1a] = KC_7,
-	[0x1b] = KC_MINUS,
-	[0x1c] = KC_8,
-	[0x1d] = KC_0,
-	[0x1e] = KC_RBRACKET,
-	[0x1f] = KC_O,
-	[0x20] = KC_U,
-	[0x21] = KC_LBRACKET,
-	[0x22] = KC_I,
-	[0x23] = KC_P,
-	[0x24] = KC_ENTER,
-	[0x25] = KC_L,
-	[0x26] = KC_J,
-	[0x27] = KC_QUOTE,
-	[0x28] = KC_K,
-	[0x29] = KC_SEMICOLON,
-	[0x2a] = KC_BACKSLASH,
-	[0x2b] = KC_COMMA,
-	[0x2c] = KC_SLASH,
-	[0x2d] = KC_N,
-	[0x2e] = KC_M,
-	[0x2f] = KC_PERIOD,
-	[0x30] = KC_TAB,
-	[0x31] = KC_SPACE,
-	[0x32] = KC_BACKTICK,
-	[0x33] = KC_BACKSPACE,
-	[0x34] = 0,
-	[0x35] = KC_ESCAPE,
-	[0x36] = KC_LCTRL,
-	[0x37] = 0,
-	[0x38] = KC_LSHIFT,
-	[0x39] = KC_CAPS_LOCK,
-	[0x3a] = KC_LALT,
-	[0x3b] = KC_LEFT,
-	[0x3c] = KC_RIGHT,
-	[0x3d] = KC_DOWN,
-	[0x3e] = KC_UP,
-	[0x3f] = 0,
-	[0x40] = 0,
-	[0x41] = KC_NPERIOD,
-	[0x42] = 0,
-	[0x43] = KC_NTIMES,
-	[0x44] = 0,
-	[0x45] = KC_NPLUS,
-	[0x46] = 0,
-	[0x47] = KC_NUM_LOCK,
-	[0x48] = 0,
-	[0x49] = 0,
-	[0x4a] = 0,
-	[0x4b] = KC_NSLASH,
-	[0x4c] = KC_NENTER,
-	[0x4d] = 0,
-	[0x4e] = KC_NMINUS,
-	[0x4f] = 0,
-	[0x50] = 0,
-	[0x51] = 0,
-	[0x52] = KC_N0,
-	[0x53] = KC_N1,
-	[0x54] = KC_N2,
-	[0x55] = KC_N3,
-	[0x56] = KC_N4,
-	[0x57] = KC_N5,
-	[0x58] = KC_N6,
-	[0x59] = KC_N7,
-	[0x5a] = 0,
-	[0x5b] = KC_N8,
-	[0x5c] = KC_N9,
-	[0x5d] = 0,
-	[0x5e] = 0,
-	[0x5f] = 0,
-	[0x60] = KC_F5,
-	[0x61] = KC_F6,
-	[0x62] = KC_F7,
-	[0x63] = KC_F3,
-	[0x64] = KC_F8,
-	[0x65] = KC_F9,
-	[0x66] = 0,
-	[0x67] = KC_F11,
-	[0x68] = 0,
-	[0x69] = KC_SYSREQ,
-	[0x6a] = 0,
-	[0x6b] = KC_SCROLL_LOCK,
-	[0x6c] = 0,
-	[0x6d] = KC_F10,
-	[0x6e] = 0,
-	[0x6f] = KC_F12,
-	[0x70] = 0,
-	[0x71] = KC_PAUSE,
-	[0x72] = KC_INSERT,
-	[0x73] = KC_HOME,
-	[0x74] = KC_PAGE_UP,
-	[0x75] = KC_DELETE,
-	[0x76] = KC_F4,
-	[0x77] = KC_END,
-	[0x78] = KC_F2,
-	[0x79] = KC_PAGE_DOWN,
-	[0x7a] = KC_F1,
-	[0x7b] = KC_RSHIFT,
-	[0x7c] = KC_RALT,
-	[0x7d] = KC_RCTRL,
-	[0x7e] = 0,
-	[0x7f] = 0
-};
-
-static kbd_dev_t *kbd_dev;
-
-static int apple_ctl_init(kbd_dev_t *kdev)
-{
-	kbd_dev = kdev;
-	return 0;
-}
-
-static void apple_ctl_parse(sysarg_t scancode)
-{
-	kbd_event_type_t type;
-	
-	if (scancode & KBD_KEY_RELEASE) {
-		scancode &= ~KBD_KEY_RELEASE;
-		type = KEY_RELEASE;
-	} else
-		type = KEY_PRESS;
-	
-	if (scancode >= sizeof(scanmap) / sizeof(unsigned int))
-		return;
-	
-	unsigned int key = scanmap[scancode];
-	if (key != 0)
-		kbd_push_event(kbd_dev, type, key);
-}
-
-static void apple_ctl_set_ind(kbd_dev_t *kdev, unsigned mods)
-{
-	(void) mods;
-}
-
-/** @}
- */
Index: uspace/srv/hid/input/input.c
===================================================================
--- uspace/srv/hid/input/input.c	(revision 7aa9430447f0291e544450fa9f31d4ba06a73c7f)
+++ uspace/srv/hid/input/input.c	(revision 17651f8b055cf4bb7799acdcb2095f5d02ca11a1)
@@ -458,32 +458,4 @@
 }
 
-/** Add new legacy mouse device. */
-static void mouse_add_dev(mouse_port_ops_t *port, mouse_proto_ops_t *proto)
-{
-	mouse_dev_t *mdev = mouse_dev_new();
-	if (mdev == NULL)
-		return;
-	
-	mdev->port_ops = port;
-	mdev->proto_ops = proto;
-	mdev->svc_id = 0;
-	
-	/* Initialize port driver. */
-	if ((*mdev->port_ops->init)(mdev) != 0)
-		goto fail;
-	
-	/* Initialize protocol driver. */
-	if ((*mdev->proto_ops->init)(mdev) != 0) {
-		/* XXX Uninit port */
-		goto fail;
-	}
-	
-	list_append(&mdev->link, &mouse_devs);
-	return;
-	
-fail:
-	free(mdev);
-}
-
 /** Add new kbdev device.
  *
@@ -643,7 +615,4 @@
 	kbd_add_dev(&chardev_port, &stty_ctl);
 #endif
-#if defined(UARCH_ppc32)
-	kbd_add_dev(&adb_port, &apple_ctl);
-#endif
 #if defined(UARCH_sparc64) && defined(PROCESSOR_sun4v)
 	kbd_add_dev(&chardev_port, &stty_ctl);
@@ -651,18 +620,4 @@
 	/* Silence warning on abs32le about kbd_add_dev() being unused */
 	(void) kbd_add_dev;
-}
-
-/** Add legacy drivers/devices. */
-static void mouse_add_legacy_devs(void)
-{
-	/*
-	 * Need to add these drivers based on config unless we can probe
-	 * them automatically.
-	 */
-#if defined(UARCH_ppc32)
-	mouse_add_dev(&adb_mouse_port, &adb_proto);
-#endif
-	/* Silence warning on abs32le about mouse_add_dev() being unused */
-	(void) mouse_add_dev;
 }
 
@@ -895,7 +850,4 @@
 	kbd_add_legacy_devs();
 	
-	/* Add legacy mouse devices. */
-	mouse_add_legacy_devs();
-	
 	/* Register driver */
 	async_set_client_data_constructor(client_data_create);
Index: uspace/srv/hid/input/kbd_ctl.h
===================================================================
--- uspace/srv/hid/input/kbd_ctl.h	(revision 7aa9430447f0291e544450fa9f31d4ba06a73c7f)
+++ uspace/srv/hid/input/kbd_ctl.h	(revision 17651f8b055cf4bb7799acdcb2095f5d02ca11a1)
@@ -48,5 +48,4 @@
 } kbd_ctl_ops_t;
 
-extern kbd_ctl_ops_t apple_ctl;
 extern kbd_ctl_ops_t kbdev_ctl;
 extern kbd_ctl_ops_t stty_ctl;
Index: uspace/srv/hid/input/kbd_port.h
===================================================================
--- uspace/srv/hid/input/kbd_port.h	(revision 7aa9430447f0291e544450fa9f31d4ba06a73c7f)
+++ uspace/srv/hid/input/kbd_port.h	(revision 17651f8b055cf4bb7799acdcb2095f5d02ca11a1)
@@ -47,5 +47,4 @@
 } kbd_port_ops_t;
 
-extern kbd_port_ops_t adb_port;
 extern kbd_port_ops_t chardev_port;
 extern kbd_port_ops_t ns16550_port;
Index: uspace/srv/hid/input/mouse_port.h
===================================================================
--- uspace/srv/hid/input/mouse_port.h	(revision 7aa9430447f0291e544450fa9f31d4ba06a73c7f)
+++ uspace/srv/hid/input/mouse_port.h	(revision 17651f8b055cf4bb7799acdcb2095f5d02ca11a1)
@@ -47,5 +47,4 @@
 } mouse_port_ops_t;
 
-extern mouse_port_ops_t adb_mouse_port;
 extern mouse_port_ops_t chardev_mouse_port;
 
Index: uspace/srv/hid/input/mouse_proto.h
===================================================================
--- uspace/srv/hid/input/mouse_proto.h	(revision 7aa9430447f0291e544450fa9f31d4ba06a73c7f)
+++ uspace/srv/hid/input/mouse_proto.h	(revision 17651f8b055cf4bb7799acdcb2095f5d02ca11a1)
@@ -47,5 +47,4 @@
 } mouse_proto_ops_t;
 
-extern mouse_proto_ops_t adb_proto;
 extern mouse_proto_ops_t mousedev_proto;
 
Index: uspace/srv/hid/input/port/adb.c
===================================================================
--- uspace/srv/hid/input/port/adb.c	(revision 7aa9430447f0291e544450fa9f31d4ba06a73c7f)
+++ 	(revision )
@@ -1,142 +1,0 @@
-/*
- * Copyright (c) 2011 Jiri Svoboda
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup kbd_port
- * @ingroup kbd
- * @{
- */
-/** @file
- * @brief ADB keyboard port driver.
- */
-
-#include <ipc/adb.h>
-#include <async.h>
-#include <vfs/vfs.h>
-#include <errno.h>
-#include <loc.h>
-#include "../input.h"
-#include "../kbd_port.h"
-#include "../kbd.h"
-
-static void kbd_port_events(ipc_callid_t iid, ipc_call_t *icall, void *arg);
-static void adb_kbd_reg0_data(uint16_t data);
-
-static int adb_port_init(kbd_dev_t *);
-static void adb_port_write(uint8_t);
-
-kbd_port_ops_t adb_port = {
-	.init = adb_port_init,
-	.write = adb_port_write
-};
-
-static kbd_dev_t *kbd_dev;
-static async_sess_t *dev_sess;
-
-static int adb_port_init(kbd_dev_t *kdev)
-{
-	kbd_dev = kdev;
-	
-	const char *dev = "devices/\\hw\\adb\\kbd";
-	service_id_t service_id;
-	int rc = loc_service_get_id(dev, &service_id, IPC_FLAG_BLOCKING);
-	if (rc != EOK)
-		return rc;
-	
-	dev_sess = loc_service_connect(service_id, INTERFACE_DDF, 0);
-	if (dev_sess == NULL) {
-		printf("%s: Failed to connect to device\n", NAME);
-		return ENOENT;
-	}
-	
-	async_exch_t *exch = async_exchange_begin(dev_sess);
-	if (exch == NULL) {
-		printf("%s: Failed starting exchange with device\n", NAME);
-		async_hangup(dev_sess);
-		return ENOMEM;
-	}
-	
-	port_id_t port;
-	rc = async_create_callback_port(exch, INTERFACE_ADB_CB, 0, 0,
-	    kbd_port_events, NULL, &port);
-	
-	async_exchange_end(exch);
-	if (rc != EOK) {
-		printf("%s: Failed to create callback from device\n", NAME);
-		async_hangup(dev_sess);
-		return rc;
-	}
-	
-	return EOK;
-}
-
-static void adb_port_write(uint8_t data)
-{
-	/*async_msg_1(dev_phone, CHAR_WRITE_BYTE, data);*/
-}
-
-static void kbd_port_events(ipc_callid_t iid, ipc_call_t *icall, void *arg)
-{
-	/* Ignore parameters, the connection is already opened */
-	while (true) {
-
-		ipc_call_t call;
-		ipc_callid_t callid = async_get_call(&call);
-
-		int retval = EOK;
-		
-		if (!IPC_GET_IMETHOD(call)) {
-			/* TODO: Handle hangup */
-			return;
-		}
-		
-		switch (IPC_GET_IMETHOD(call)) {
-		case ADB_REG_NOTIF:
-			adb_kbd_reg0_data(IPC_GET_ARG1(call));
-			break;
-		default:
-			retval = ENOENT;
-		}
-		async_answer_0(callid, retval);
-	}
-}
-
-static void adb_kbd_reg0_data(uint16_t data)
-{
-	uint8_t b0 = (data >> 8) & 0xff;
-	uint8_t b1 = data & 0xff;
-	
-	if (b0 != 0xff)
-		kbd_push_data(kbd_dev, b0);
-	
-	if (b1 != 0xff)
-		kbd_push_data(kbd_dev, b1);
-}
-
-/**
- * @}
- */
Index: uspace/srv/hid/input/port/adb_mouse.c
===================================================================
--- uspace/srv/hid/input/port/adb_mouse.c	(revision 7aa9430447f0291e544450fa9f31d4ba06a73c7f)
+++ 	(revision )
@@ -1,125 +1,0 @@
-/*
- * Copyright (c) 2011 Martin Decky
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup mouse_port
- * @ingroup mouse
- * @{
- */
-/** @file
- * @brief ADB mouse port driver.
- */
-
-#include <ipc/adb.h>
-#include <async.h>
-#include <errno.h>
-#include <loc.h>
-#include <stdio.h>
-#include "../mouse.h"
-#include "../mouse_port.h"
-#include "../input.h"
-
-static mouse_dev_t *mouse_dev;
-static async_sess_t *dev_sess;
-
-static void mouse_port_events(ipc_callid_t iid, ipc_call_t *icall, void *arg)
-{
-	/* Ignore parameters, the connection is already opened */
-	while (true) {
-		ipc_call_t call;
-		ipc_callid_t callid = async_get_call(&call);
-		
-		int retval = EOK;
-		
-		if (!IPC_GET_IMETHOD(call)) {
-			/* TODO: Handle hangup */
-			return;
-		}
-		
-		switch (IPC_GET_IMETHOD(call)) {
-		case ADB_REG_NOTIF:
-			mouse_push_data(mouse_dev, IPC_GET_ARG1(call));
-			break;
-		default:
-			retval = ENOENT;
-		}
-		
-		async_answer_0(callid, retval);
-	}
-}
-
-static int adb_port_init(mouse_dev_t *mdev)
-{
-	const char *dev = "devices/\\hw\\adb\\mouse";
-	
-	mouse_dev = mdev;
-	
-	service_id_t service_id;
-	int rc = loc_service_get_id(dev, &service_id, IPC_FLAG_BLOCKING);
-	if (rc != EOK)
-		return rc;
-	
-	dev_sess = loc_service_connect(service_id, INTERFACE_DDF, 0);
-	if (dev_sess == NULL) {
-		printf("%s: Failed to connect to device\n", NAME);
-		return ENOENT;
-	}
-	
-	async_exch_t *exch = async_exchange_begin(dev_sess);
-	if (exch == NULL) {
-		printf("%s: Failed starting exchange with device\n", NAME);
-		async_hangup(dev_sess);
-		return ENOMEM;
-	}
-	
-	/* NB: The callback connection is slotted for removal */
-	port_id_t port;
-	rc = async_create_callback_port(exch, INTERFACE_ADB_CB, 0, 0,
-	    mouse_port_events, NULL, &port);
-	
-	async_exchange_end(exch);
-	if (rc != EOK) {
-		printf("%s: Failed to create callback from device\n", NAME);
-		async_hangup(dev_sess);
-		return rc;
-	}
-	
-	return EOK;
-}
-
-static void adb_port_write(uint8_t data)
-{
-}
-
-mouse_port_ops_t adb_mouse_port = {
-	.init = adb_port_init,
-	.write = adb_port_write
-};
-
-/**
- * @}
- */
Index: uspace/srv/hid/input/proto/adb.c
===================================================================
--- uspace/srv/hid/input/proto/adb.c	(revision 7aa9430447f0291e544450fa9f31d4ba06a73c7f)
+++ 	(revision )
@@ -1,94 +1,0 @@
-/*
- * Copyright (c) 2011 Martin Decky
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * - Redistributions of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- * - The name of the author may not be used to endorse or promote products
- *   derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @addtogroup mouse_proto
- * @ingroup input
- * @{
- */
-/**
- * @file
- * @brief ADB protocol driver.
- */
-
-#include <stdbool.h>
-#include "../mouse.h"
-#include "../mouse_port.h"
-#include "../mouse_proto.h"
-
-static mouse_dev_t *mouse_dev;
-static bool b1_pressed;
-static bool b2_pressed;
-
-static int adb_proto_init(mouse_dev_t *mdev)
-{
-	mouse_dev = mdev;
-	b1_pressed = false;
-	b2_pressed = false;
-	
-	return 0;
-}
-
-/** Process mouse data */
-static void adb_proto_parse(sysarg_t data)
-{
-	bool b1, b2;
-	uint16_t udx, udy;
-	int dx, dy;
-	
-	/* Extract fields. */
-	b1 = ((data >> 15) & 1) == 0;
-	udy = (data >> 8) & 0x7f;
-	b2 = ((data >> 7) & 1) == 0;
-	udx = data & 0x7f;
-	
-	/* Decode 7-bit two's complement signed values. */
-	dx = (udx & 0x40) ? (udx - 0x80) : udx;
-	dy = (udy & 0x40) ? (udy - 0x80) : udy;
-	
-	if (b1 != b1_pressed) {
-		mouse_push_event_button(mouse_dev, 1, b1);
-		b1_pressed = b1;
-	}
-	
-	if (b2 != b2_pressed) {
-		mouse_push_event_button(mouse_dev, 2, b2);
-		b1_pressed = b1;
-	}
-	
-	if (dx != 0 || dy != 0)
-		mouse_push_event_move(mouse_dev, dx, dy, 0);
-}
-
-mouse_proto_ops_t adb_proto = {
-	.parse = adb_proto_parse,
-	.init = adb_proto_init
-};
-
-/**
- * @}
- */
