Changeset 4863bb52 in mainline for uspace/drv/time/rtc.c


Ignore:
Timestamp:
2012-03-30T08:56:22Z (12 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a31ca11f
Parents:
c9f703b
Message:

RTC: the rtc driver implements the CLOCK_DEV_IFACE interface.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/time/rtc.c

    rc9f703b r4863bb52  
    3636 */
    3737
     38#include <errno.h>
    3839#include <ddi.h>
    3940#include <stdio.h>
    4041#include <ddf/driver.h>
    4142#include <ddf/log.h>
     43#include <ops/clock.h>
    4244
    4345#define NAME "RTC"
     46
     47static int
     48rtc_time_get(ddf_fun_t *fun, time_t *t);
     49
     50static int
     51rtc_time_set(ddf_fun_t *fun, time_t t);
     52
    4453
    4554static ddf_dev_ops_t rtc_dev_ops;
     
    4857        .name = NAME,
    4958        .driver_ops = NULL,
     59};
     60
     61static clock_dev_ops_t rtc_clock_dev_ops = {
     62        .time_get = rtc_time_get,
     63        .time_set = rtc_time_set,
    5064};
    5165
     
    5771} rtc_t;
    5872
     73
     74/** Initialize the RTC driver */
    5975static void
    6076rtc_init(void)
     
    6480        rtc_dev_ops.open = NULL;
    6581        rtc_dev_ops.close = NULL;
     82
     83        rtc_dev_ops.interfaces[CLOCK_DEV_IFACE] = &rtc_clock_dev_ops;
     84        rtc_dev_ops.default_handler = NULL;
     85}
     86
     87static int
     88rtc_time_get(ddf_fun_t *fun, time_t *t)
     89{
     90        return EOK;
     91}
     92
     93static int
     94rtc_time_set(ddf_fun_t *fun, time_t t)
     95{
     96        return EOK;
    6697}
    6798
Note: See TracChangeset for help on using the changeset viewer.