Changeset 26e7d6d in mainline for uspace/srv/hid/s3c24xx_ts/s3c24xx_ts.c
- Timestamp:
- 2011-09-19T16:31:00Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a347a11
- Parents:
- 3842a955 (diff), 086290d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/s3c24xx_ts/s3c24xx_ts.c
r3842a955 r26e7d6d 39 39 #include <ddi.h> 40 40 #include <libarch/ddi.h> 41 #include < devmap.h>41 #include <loc.h> 42 42 #include <io/console.h> 43 43 #include <vfs/vfs.h> 44 #include <ipc/mouse .h>44 #include <ipc/mouseev.h> 45 45 #include <async.h> 46 #include <async_obsolete.h>47 46 #include <unistd.h> 48 47 #include <stdio.h> … … 53 52 #include "s3c24xx_ts.h" 54 53 55 // FIXME: remove this header 56 #include <kernel/ipc/ipc_methods.h> 57 58 #define NAME "s3c24ser" 59 #define NAMESPACE "hid_in" 54 #define NAME "s3c24ser" 55 #define NAMESPACE "hid" 60 56 61 57 static irq_cmd_t ts_irq_cmds[] = { … … 90 86 printf(NAME ": S3C24xx touchscreen driver\n"); 91 87 92 rc = devmap_driver_register(NAME, s3c24xx_ts_connection);88 rc = loc_server_register(NAME, s3c24xx_ts_connection); 93 89 if (rc < 0) { 94 90 printf(NAME ": Unable to register driver.\n"); … … 103 99 return -1; 104 100 105 rc = devmap_device_register(NAMESPACE "/mouse", &ts->devmap_handle);101 rc = loc_service_register(NAMESPACE "/mouse", &ts->service_id); 106 102 if (rc != EOK) { 107 103 printf(NAME ": Unable to register device %s.\n", … … 134 130 135 131 ts->io = vaddr; 136 ts->client_ phone = -1;132 ts->client_sess = NULL; 137 133 ts->state = ts_wait_pendown; 138 134 ts->last_x = 0; … … 284 280 button = 1; 285 281 press = 0; 286 async_obsolete_msg_2(ts->client_phone, MEVENT_BUTTON, button, press); 282 283 async_exch_t *exch = async_exchange_begin(ts->client_sess); 284 async_msg_2(exch, MOUSEEV_BUTTON_EVENT, button, press); 285 async_exchange_end(exch); 287 286 288 287 s3c24xx_ts_wait_for_int_mode(ts, updn_down); … … 325 324 326 325 /* Send notifications to client. */ 327 async_obsolete_msg_2(ts->client_phone, MEVENT_MOVE, dx, dy); 328 async_obsolete_msg_2(ts->client_phone, MEVENT_BUTTON, button, press); 326 async_exch_t *exch = async_exchange_begin(ts->client_sess); 327 async_msg_2(exch, MOUSEEV_MOVE_EVENT, dx, dy); 328 async_msg_2(exch, MOUSEEV_BUTTON_EVENT, button, press); 329 async_exchange_end(exch); 329 330 330 331 ts->last_x = x_pos; … … 377 378 void *arg) 378 379 { 379 ipc_callid_t callid;380 ipc_call_t call;381 int retval;382 383 380 async_answer_0(iid, EOK); 384 385 while (1) { 386 callid = async_get_call(&call); 381 382 while (true) { 383 ipc_call_t call; 384 ipc_callid_t callid = async_get_call(&call); 387 385 388 386 if (!IPC_GET_IMETHOD(call)) { 389 if (ts->client_ phone != -1) {390 async_ obsolete_hangup(ts->client_phone);391 ts->client_ phone = -1;387 if (ts->client_sess != NULL) { 388 async_hangup(ts->client_sess); 389 ts->client_sess = NULL; 392 390 } 393 391 394 392 async_answer_0(callid, EOK); 395 393 return; 396 394 } 397 395 398 switch (IPC_GET_IMETHOD(call)) { 399 case IPC_M_CONNECT_TO_ME: 400 if (ts->client_phone != -1) { 401 retval = ELIMIT; 402 break; 403 } 404 ts->client_phone = IPC_GET_ARG5(call); 405 retval = 0; 406 break; 407 default: 408 retval = EINVAL; 409 } 410 async_answer_0(callid, retval); 396 async_sess_t *sess = 397 async_callback_receive_start(EXCHANGE_SERIALIZE, &call); 398 if (sess != NULL) { 399 if (ts->client_sess == NULL) { 400 ts->client_sess = sess; 401 async_answer_0(callid, EOK); 402 } else 403 async_answer_0(callid, ELIMIT); 404 } else 405 async_answer_0(callid, EINVAL); 411 406 } 412 407 }
Note:
See TracChangeset
for help on using the changeset viewer.