staging: ti dspbridge: add services
[cascardo/linux.git] / drivers / staging / tidspbridge / services / services.c
1 /*
2  * services.c
3  *
4  * DSP-BIOS Bridge driver support functions for TI OMAP processors.
5  *
6  * Provide SERVICES loading.
7  *
8  * Copyright (C) 2005-2006 Texas Instruments, Inc.
9  *
10  * This package is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2 as
12  * published by the Free Software Foundation.
13  *
14  * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
15  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
16  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
17  */
18
19 #include <dspbridge/host_os.h>
20
21 /*  ----------------------------------- DSP/BIOS Bridge */
22 #include <dspbridge/std.h>
23 #include <dspbridge/dbdefs.h>
24
25 /*  ----------------------------------- Trace & Debug */
26 #include <dspbridge/dbc.h>
27
28 /*  ----------------------------------- OS Adaptation Layer */
29 #include <dspbridge/cfg.h>
30 #include <dspbridge/ntfy.h>
31 #include <dspbridge/sync.h>
32 #include <dspbridge/clk.h>
33
34 /*  ----------------------------------- This */
35 #include <dspbridge/services.h>
36
37 /*
38  *  ======== services_exit ========
39  *  Purpose:
40  *      Discontinue usage of module; free resources when reference count
41  *      reaches 0.
42  */
43 void services_exit(void)
44 {
45         cfg_exit();
46 }
47
48 /*
49  *  ======== services_init ========
50  *  Purpose:
51  *      Initializes SERVICES modules.
52  */
53 bool services_init(void)
54 {
55         bool ret = true;
56         bool fcfg;
57
58         /* Perform required initialization of SERVICES modules. */
59         fcfg = cfg_init();
60
61         ret = fcfg;
62
63         if (!ret) {
64                 if (fcfg)
65                         cfg_exit();
66         }
67
68         return ret;
69 }