Merge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6
[pandora-kernel.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 <linux/types.h>
20
21 #include <dspbridge/host_os.h>
22
23 /*  ----------------------------------- DSP/BIOS Bridge */
24 #include <dspbridge/dbdefs.h>
25
26 /*  ----------------------------------- Trace & Debug */
27 #include <dspbridge/dbc.h>
28
29 /*  ----------------------------------- OS Adaptation Layer */
30 #include <dspbridge/cfg.h>
31 #include <dspbridge/ntfy.h>
32 #include <dspbridge/sync.h>
33 #include <dspbridge/clk.h>
34
35 /*  ----------------------------------- This */
36 #include <dspbridge/services.h>
37
38 /*
39  *  ======== services_exit ========
40  *  Purpose:
41  *      Discontinue usage of module; free resources when reference count
42  *      reaches 0.
43  */
44 void services_exit(void)
45 {
46         cfg_exit();
47 }
48
49 /*
50  *  ======== services_init ========
51  *  Purpose:
52  *      Initializes SERVICES modules.
53  */
54 bool services_init(void)
55 {
56         bool ret = true;
57         bool fcfg;
58
59         /* Perform required initialization of SERVICES modules. */
60         fcfg = cfg_init();
61
62         ret = fcfg;
63
64         if (!ret) {
65                 if (fcfg)
66                         cfg_exit();
67         }
68
69         return ret;
70 }