Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
054c1c45
Commit
054c1c45
authored
May 16, 2014
by
Rafael J. Wysocki
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'acpi-proc' into acpi-battery
parents
d6d211db
3afcb96f
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
451 additions
and
1 deletion
+451
-1
drivers/acpi/Kconfig
drivers/acpi/Kconfig
+17
-0
drivers/acpi/Makefile
drivers/acpi/Makefile
+1
-0
drivers/acpi/battery.c
drivers/acpi/battery.c
+328
-1
drivers/acpi/cm_sbs.c
drivers/acpi/cm_sbs.c
+105
-0
No files found.
drivers/acpi/Kconfig
View file @
054c1c45
...
@@ -47,6 +47,23 @@ config ACPI_SLEEP
...
@@ -47,6 +47,23 @@ config ACPI_SLEEP
depends on SUSPEND || HIBERNATION
depends on SUSPEND || HIBERNATION
default y
default y
config ACPI_PROCFS_POWER
bool "Deprecated power /proc/acpi directories"
depends on PROC_FS
help
For backwards compatibility, this option allows
deprecated power /proc/acpi/ directories to exist, even when
they have been replaced by functions in /sys.
The deprecated directories (and their replacements) include:
/proc/acpi/battery/* (/sys/class/power_supply/*)
/proc/acpi/ac_adapter/* (sys/class/power_supply/*)
This option has no effect on /proc/acpi/ directories
and functions, which do not yet exist in /sys
This option, together with the proc directories, will be
deleted in the future.
Say N to delete power /proc/acpi/ directories that have moved to /sys/
config ACPI_EC_DEBUGFS
config ACPI_EC_DEBUGFS
tristate "EC read/write access through /sys/kernel/debug/ec"
tristate "EC read/write access through /sys/kernel/debug/ec"
default n
default n
...
...
drivers/acpi/Makefile
View file @
054c1c45
...
@@ -47,6 +47,7 @@ acpi-y += sysfs.o
...
@@ -47,6 +47,7 @@ acpi-y += sysfs.o
acpi-$(CONFIG_X86)
+=
acpi_cmos_rtc.o
acpi-$(CONFIG_X86)
+=
acpi_cmos_rtc.o
acpi-$(CONFIG_DEBUG_FS)
+=
debugfs.o
acpi-$(CONFIG_DEBUG_FS)
+=
debugfs.o
acpi-$(CONFIG_ACPI_NUMA)
+=
numa.o
acpi-$(CONFIG_ACPI_NUMA)
+=
numa.o
acpi-$(CONFIG_ACPI_PROCFS_POWER)
+=
cm_sbs.o
ifdef
CONFIG_ACPI_VIDEO
ifdef
CONFIG_ACPI_VIDEO
acpi-y
+=
video_detect.o
acpi-y
+=
video_detect.o
endif
endif
...
...
drivers/acpi/battery.c
View file @
054c1c45
This diff is collapsed.
Click to expand it.
drivers/acpi/cm_sbs.c
0 → 100644
View file @
054c1c45
/*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/acpi.h>
#include <linux/types.h>
#include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include <acpi/acpi_bus.h>
#include <acpi/acpi_drivers.h>
#define PREFIX "ACPI: "
ACPI_MODULE_NAME
(
"cm_sbs"
);
#define ACPI_AC_CLASS "ac_adapter"
#define ACPI_BATTERY_CLASS "battery"
#define _COMPONENT ACPI_SBS_COMPONENT
static
struct
proc_dir_entry
*
acpi_ac_dir
;
static
struct
proc_dir_entry
*
acpi_battery_dir
;
static
DEFINE_MUTEX
(
cm_sbs_mutex
);
static
int
lock_ac_dir_cnt
;
static
int
lock_battery_dir_cnt
;
struct
proc_dir_entry
*
acpi_lock_ac_dir
(
void
)
{
mutex_lock
(
&
cm_sbs_mutex
);
if
(
!
acpi_ac_dir
)
acpi_ac_dir
=
proc_mkdir
(
ACPI_AC_CLASS
,
acpi_root_dir
);
if
(
acpi_ac_dir
)
{
lock_ac_dir_cnt
++
;
}
else
{
printk
(
KERN_ERR
PREFIX
"Cannot create %s
\n
"
,
ACPI_AC_CLASS
);
}
mutex_unlock
(
&
cm_sbs_mutex
);
return
acpi_ac_dir
;
}
EXPORT_SYMBOL
(
acpi_lock_ac_dir
);
void
acpi_unlock_ac_dir
(
struct
proc_dir_entry
*
acpi_ac_dir_param
)
{
mutex_lock
(
&
cm_sbs_mutex
);
if
(
acpi_ac_dir_param
)
lock_ac_dir_cnt
--
;
if
(
lock_ac_dir_cnt
==
0
&&
acpi_ac_dir_param
&&
acpi_ac_dir
)
{
remove_proc_entry
(
ACPI_AC_CLASS
,
acpi_root_dir
);
acpi_ac_dir
=
NULL
;
}
mutex_unlock
(
&
cm_sbs_mutex
);
}
EXPORT_SYMBOL
(
acpi_unlock_ac_dir
);
struct
proc_dir_entry
*
acpi_lock_battery_dir
(
void
)
{
mutex_lock
(
&
cm_sbs_mutex
);
if
(
!
acpi_battery_dir
)
{
acpi_battery_dir
=
proc_mkdir
(
ACPI_BATTERY_CLASS
,
acpi_root_dir
);
}
if
(
acpi_battery_dir
)
{
lock_battery_dir_cnt
++
;
}
else
{
printk
(
KERN_ERR
PREFIX
"Cannot create %s
\n
"
,
ACPI_BATTERY_CLASS
);
}
mutex_unlock
(
&
cm_sbs_mutex
);
return
acpi_battery_dir
;
}
EXPORT_SYMBOL
(
acpi_lock_battery_dir
);
void
acpi_unlock_battery_dir
(
struct
proc_dir_entry
*
acpi_battery_dir_param
)
{
mutex_lock
(
&
cm_sbs_mutex
);
if
(
acpi_battery_dir_param
)
lock_battery_dir_cnt
--
;
if
(
lock_battery_dir_cnt
==
0
&&
acpi_battery_dir_param
&&
acpi_battery_dir
)
{
remove_proc_entry
(
ACPI_BATTERY_CLASS
,
acpi_root_dir
);
acpi_battery_dir
=
NULL
;
}
mutex_unlock
(
&
cm_sbs_mutex
);
return
;
}
EXPORT_SYMBOL
(
acpi_unlock_battery_dir
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment