Changeset d8a4e79 in mainline for uspace/drv/time/cmos-rtc/cmos-rtc.c
- Timestamp:
- 2012-04-04T20:22:20Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2a4c22d
- Parents:
- f87ea202
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/time/cmos-rtc/cmos-rtc.c
rf87ea202 rd8a4e79 46 46 #include <device/hw_res.h> 47 47 #include <devman.h> 48 #include <ipc/clock_ctl.h> 48 49 49 50 #include "cmos-regs.h" … … 82 83 static int rtc_register_read(rtc_t *rtc, int reg); 83 84 static int bcd2dec(int bcd); 85 static void rtc_default_handler(ddf_fun_t *fun, 86 ipc_callid_t callid, ipc_call_t *call); 84 87 85 88 … … 114 117 115 118 rtc_dev_ops.interfaces[CLOCK_DEV_IFACE] = &rtc_clock_dev_ops; 116 rtc_dev_ops.default_handler = NULL; /* XXX */119 rtc_dev_ops.default_handler = &rtc_default_handler; 117 120 } 118 121 … … 387 390 } 388 391 392 /** Default handler for client requests not handled 393 * by the standard interface 394 */ 395 static void 396 rtc_default_handler(ddf_fun_t *fun, ipc_callid_t callid, ipc_call_t *call) 397 { 398 sysarg_t method = IPC_GET_IMETHOD(*call); 399 rtc_t *rtc = RTC_FROM_FNODE(fun); 400 bool batt_ok; 401 402 switch (method) { 403 case CLOCK_GET_BATTERY_STATUS: 404 batt_ok = !(rtc_register_read(rtc, RTC_STATUS_D) & 405 RTC_BATTERY_OK); 406 async_answer_1(callid, EOK, batt_ok); 407 break; 408 default: 409 async_answer_0(callid, ENOTSUP); 410 } 411 } 412 389 413 /** Open the device 390 414 *
Note:
See TracChangeset
for help on using the changeset viewer.