ec_osl.c
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:2k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

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