Changeset 2a5171db in mainline for uspace/drv/time/cmos-rtc/cmos-rtc.c


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

rtc: add the rtc_close() callback.

File:
1 edited

Legend:

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

    r923b2eba r2a5171db  
    6868
    6969
    70 static int
    71 rtc_time_get(ddf_fun_t *fun, struct tm *t);
    72 
    73 static int
    74 rtc_time_set(ddf_fun_t *fun, struct tm *t);
    75 
    76 static int
    77 rtc_dev_add(ddf_dev_t *dev);
    78 
    79 static int
    80 rtc_dev_initialize(rtc_t *rtc);
    81 
    82 static bool
    83 rtc_pio_enable(rtc_t *rtc);
    84 
    85 static void
    86 rtc_dev_cleanup(rtc_t *rtc);
    87 
    88 static int
    89 rtc_open(ddf_fun_t *fun);
     70static int  rtc_time_get(ddf_fun_t *fun, struct tm *t);
     71static int  rtc_time_set(ddf_fun_t *fun, struct tm *t);
     72static int  rtc_dev_add(ddf_dev_t *dev);
     73static int  rtc_dev_initialize(rtc_t *rtc);
     74static bool rtc_pio_enable(rtc_t *rtc);
     75static void rtc_dev_cleanup(rtc_t *rtc);
     76static int  rtc_open(ddf_fun_t *fun);
     77static void rtc_close(ddf_fun_t *fun);
    9078
    9179
     
    117105
    118106        rtc_dev_ops.open = rtc_open;
    119         rtc_dev_ops.close = NULL; /* XXX */
     107        rtc_dev_ops.close = rtc_close;
    120108
    121109        rtc_dev_ops.interfaces[CLOCK_DEV_IFACE] = &rtc_clock_dev_ops;
     
    349337}
    350338
     339/** Close the device
     340 *
     341 * @param fun  The function node
     342 */
     343static void
     344rtc_close(ddf_fun_t *fun)
     345{
     346        rtc_t *rtc = RTC_FROM_FNODE(fun);
     347
     348        fibril_mutex_lock(&rtc->mutex);
     349
     350        assert(rtc->client_connected);
     351        rtc->client_connected = false;
     352
     353        fibril_mutex_unlock(&rtc->mutex);
     354}
     355
    351356int
    352357main(int argc, char **argv)
Note: See TracChangeset for help on using the changeset viewer.