1/*****************************************************************************
2 *
3 * Module Name: ec_osl.c
4 *   $Revision: 1.1.1.1 $
5 *
6 *****************************************************************************/
7
8/*
9 *  Copyright (C) 2000, 2001 Andrew Grover
10 *
11 *  This program is free software; you can redistribute it and/or modify
12 *  it under the terms of the GNU General Public License as published by
13 *  the Free Software Foundation; either version 2 of the License, or
14 *  (at your option) any later version.
15 *
16 *  This program is distributed in the hope that it will be useful,
17 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
18 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 *  GNU General Public License for more details.
20 *
21 *  You should have received a copy of the GNU General Public License
22 *  along with this program; if not, write to the Free Software
23 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
24 */
25
26
27#include <linux/kernel.h>
28#include <linux/module.h>
29#include <linux/init.h>
30#include <linux/types.h>
31#include <linux/proc_fs.h>
32#include <acpi.h>
33#include <bm.h>
34#include "ec.h"
35
36
37MODULE_AUTHOR("Andrew Grover");
38MODULE_DESCRIPTION("ACPI Component Architecture (CA) - Embedded Controller Driver");
39MODULE_LICENSE("GPL");
40
41extern struct proc_dir_entry	*bm_proc_root;
42
43
44/****************************************************************************
45 *
46 * FUNCTION:    ec_osl_init
47 *
48 * PARAMETERS:	<none>
49 *
50 * RETURN:	0: Success
51 *
52 * DESCRIPTION: Module initialization.
53 *
54 ****************************************************************************/
55
56static int __init
57ec_osl_init (void)
58{
59	acpi_status		status = AE_OK;
60
61	/* abort if no busmgr */
62	if (!bm_proc_root)
63		return -ENODEV;
64
65	status = ec_initialize();
66
67	return (ACPI_SUCCESS(status)) ? 0 : -ENODEV;
68}
69
70/****************************************************************************
71 *
72 * FUNCTION:    ec_osl_cleanup
73 *
74 * PARAMETERS:	<none>
75 *
76 * RETURN:	<none>
77 *
78 * DESCRIPTION: Module cleanup.
79 *
80 ****************************************************************************/
81
82static void __exit
83ec_osl_cleanup(void)
84{
85	ec_terminate();
86
87	return;
88}
89
90module_init(ec_osl_init);
91module_exit(ec_osl_cleanup);
92