Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
7e23772f
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
7e23772f
编写于
2月 02, 2007
作者:
L
Len Brown
浏览文件
操作
浏览文件
下载
差异文件
Pull video into test branch
上级
bcd8b54f
2f3d000a
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
70 addition
and
3 deletion
+70
-3
drivers/acpi/Kconfig
drivers/acpi/Kconfig
+1
-1
drivers/acpi/video.c
drivers/acpi/video.c
+69
-2
未找到文件。
drivers/acpi/Kconfig
浏览文件 @
7e23772f
...
...
@@ -107,7 +107,7 @@ config ACPI_BUTTON
config ACPI_VIDEO
tristate "Video"
depends on X86
depends on X86
&& BACKLIGHT_CLASS_DEVICE
help
This driver implement the ACPI Extensions For Display Adapters
for integrated graphics devices on motherboard, as specified in
...
...
drivers/acpi/video.c
浏览文件 @
7e23772f
...
...
@@ -32,6 +32,7 @@
#include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include <linux/backlight.h>
#include <asm/uaccess.h>
#include <acpi/acpi_bus.h>
...
...
@@ -56,6 +57,7 @@
#define ACPI_VIDEO_HEAD_INVALID (~0u - 1)
#define ACPI_VIDEO_HEAD_END (~0u)
#define MAX_NAME_LEN 20
#define _COMPONENT ACPI_VIDEO_COMPONENT
ACPI_MODULE_NAME
(
"acpi_video"
)
...
...
@@ -142,11 +144,11 @@ struct acpi_video_device_cap {
u8
_ADR
:
1
;
/*Return the unique ID */
u8
_BCL
:
1
;
/*Query list of brightness control levels supported */
u8
_BCM
:
1
;
/*Set the brightness level */
u8
_BQC
:
1
;
/* Get current brightness level */
u8
_DDC
:
1
;
/*Return the EDID for this device */
u8
_DCS
:
1
;
/*Return status of output device */
u8
_DGS
:
1
;
/*Query graphics state */
u8
_DSS
:
1
;
/*Device state set */
u8
_reserved
:
1
;
};
struct
acpi_video_device_brightness
{
...
...
@@ -163,6 +165,8 @@ struct acpi_video_device {
struct
acpi_video_bus
*
video
;
struct
acpi_device
*
dev
;
struct
acpi_video_device_brightness
*
brightness
;
struct
backlight_device
*
backlight
;
struct
backlight_properties
*
data
;
};
/* bus */
...
...
@@ -257,11 +261,35 @@ static void acpi_video_device_bind(struct acpi_video_bus *video,
struct
acpi_video_device
*
device
);
static
int
acpi_video_device_enumerate
(
struct
acpi_video_bus
*
video
);
static
int
acpi_video_switch_output
(
struct
acpi_video_bus
*
video
,
int
event
);
static
int
acpi_video_device_lcd_set_level
(
struct
acpi_video_device
*
device
,
int
level
);
static
int
acpi_video_device_lcd_get_level_current
(
struct
acpi_video_device
*
device
,
unsigned
long
*
level
);
static
int
acpi_video_get_next_level
(
struct
acpi_video_device
*
device
,
u32
level_current
,
u32
event
);
static
void
acpi_video_switch_brightness
(
struct
acpi_video_device
*
device
,
int
event
);
/*backlight device sysfs support*/
static
int
acpi_video_get_brightness
(
struct
backlight_device
*
bd
)
{
unsigned
long
cur_level
;
struct
acpi_video_device
*
vd
=
(
struct
acpi_video_device
*
)
class_get_devdata
(
&
bd
->
class_dev
);
acpi_video_device_lcd_get_level_current
(
vd
,
&
cur_level
);
return
(
int
)
cur_level
;
}
static
int
acpi_video_set_brightness
(
struct
backlight_device
*
bd
)
{
int
request_level
=
bd
->
props
->
brightness
;
struct
acpi_video_device
*
vd
=
(
struct
acpi_video_device
*
)
class_get_devdata
(
&
bd
->
class_dev
);
acpi_video_device_lcd_set_level
(
vd
,
request_level
);
return
0
;
}
/* --------------------------------------------------------------------------
Video Management
-------------------------------------------------------------------------- */
...
...
@@ -499,6 +527,7 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device)
acpi_integer
status
;
acpi_handle
h_dummy1
;
int
i
;
u32
max_level
=
0
;
union
acpi_object
*
obj
=
NULL
;
struct
acpi_video_device_brightness
*
br
=
NULL
;
...
...
@@ -514,6 +543,8 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device)
if
(
ACPI_SUCCESS
(
acpi_get_handle
(
device
->
dev
->
handle
,
"_BCM"
,
&
h_dummy1
)))
{
device
->
cap
.
_BCM
=
1
;
}
if
(
ACPI_SUCCESS
(
acpi_get_handle
(
device
->
dev
->
handle
,
"_BQC"
,
&
h_dummy1
)))
device
->
cap
.
_BQC
=
1
;
if
(
ACPI_SUCCESS
(
acpi_get_handle
(
device
->
dev
->
handle
,
"_DDC"
,
&
h_dummy1
)))
{
device
->
cap
.
_DDC
=
1
;
}
...
...
@@ -550,6 +581,8 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device)
continue
;
}
br
->
levels
[
count
]
=
(
u32
)
o
->
integer
.
value
;
if
(
br
->
levels
[
count
]
>
max_level
)
max_level
=
br
->
levels
[
count
];
count
++
;
}
out:
...
...
@@ -568,6 +601,37 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device)
kfree
(
obj
);
if
(
device
->
cap
.
_BCL
&&
device
->
cap
.
_BCM
&&
device
->
cap
.
_BQC
){
unsigned
long
tmp
;
static
int
count
=
0
;
char
*
name
;
struct
backlight_properties
*
acpi_video_data
;
name
=
kzalloc
(
MAX_NAME_LEN
,
GFP_KERNEL
);
if
(
!
name
)
return
;
acpi_video_data
=
kzalloc
(
sizeof
(
struct
backlight_properties
),
GFP_KERNEL
);
if
(
!
acpi_video_data
){
kfree
(
name
);
return
;
}
acpi_video_data
->
owner
=
THIS_MODULE
;
acpi_video_data
->
get_brightness
=
acpi_video_get_brightness
;
acpi_video_data
->
update_status
=
acpi_video_set_brightness
;
sprintf
(
name
,
"acpi_video%d"
,
count
++
);
device
->
data
=
acpi_video_data
;
acpi_video_data
->
max_brightness
=
max_level
;
acpi_video_device_lcd_get_level_current
(
device
,
&
tmp
);
acpi_video_data
->
brightness
=
(
int
)
tmp
;
device
->
backlight
=
backlight_device_register
(
name
,
NULL
,
device
,
acpi_video_data
);
kfree
(
name
);
}
return
;
}
...
...
@@ -1588,7 +1652,10 @@ static int acpi_video_bus_put_one_device(struct acpi_video_device *device)
status
=
acpi_remove_notify_handler
(
device
->
dev
->
handle
,
ACPI_DEVICE_NOTIFY
,
acpi_video_device_notify
);
if
(
device
->
backlight
){
backlight_device_unregister
(
device
->
backlight
);
kfree
(
device
->
data
);
}
return
0
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录