Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
5e16e3f0
cloud-kernel
项目概览
openanolis
/
cloud-kernel
大约 1 年 前同步成功
通知
158
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5e16e3f0
编写于
7月 22, 2007
作者:
L
Len Brown
浏览文件
操作
浏览文件
下载
差异文件
Pull video into release branch
上级
dcb76f88
f70ac0e9
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
93 addition
and
39 deletion
+93
-39
drivers/acpi/Kconfig
drivers/acpi/Kconfig
+1
-1
drivers/acpi/video.c
drivers/acpi/video.c
+82
-38
drivers/video/Kconfig
drivers/video/Kconfig
+7
-0
drivers/video/Makefile
drivers/video/Makefile
+3
-0
未找到文件。
drivers/acpi/Kconfig
浏览文件 @
5e16e3f0
...
...
@@ -118,7 +118,7 @@ config ACPI_BUTTON
config ACPI_VIDEO
tristate "Video"
depends on X86 && BACKLIGHT_CLASS_DEVICE
depends on X86 && BACKLIGHT_CLASS_DEVICE
&& VIDEO_OUTPUT_CONTROL
help
This driver implement the ACPI Extensions For Display Adapters
for integrated graphics devices on motherboard, as specified in
...
...
drivers/acpi/video.c
浏览文件 @
5e16e3f0
...
...
@@ -33,6 +33,7 @@
#include <linux/seq_file.h>
#include <linux/backlight.h>
#include <linux/video_output.h>
#include <asm/uaccess.h>
#include <acpi/acpi_bus.h>
...
...
@@ -169,6 +170,7 @@ struct acpi_video_device {
struct
acpi_device
*
dev
;
struct
acpi_video_device_brightness
*
brightness
;
struct
backlight_device
*
backlight
;
struct
output_device
*
output_dev
;
};
/* bus */
...
...
@@ -272,6 +274,10 @@ 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
);
static
int
acpi_video_device_get_state
(
struct
acpi_video_device
*
device
,
unsigned
long
*
state
);
static
int
acpi_video_output_get
(
struct
output_device
*
od
);
static
int
acpi_video_device_set_state
(
struct
acpi_video_device
*
device
,
int
state
);
/*backlight device sysfs support*/
static
int
acpi_video_get_brightness
(
struct
backlight_device
*
bd
)
...
...
@@ -297,6 +303,28 @@ static struct backlight_ops acpi_backlight_ops = {
.
update_status
=
acpi_video_set_brightness
,
};
/*video output device sysfs support*/
static
int
acpi_video_output_get
(
struct
output_device
*
od
)
{
unsigned
long
state
;
struct
acpi_video_device
*
vd
=
(
struct
acpi_video_device
*
)
class_get_devdata
(
&
od
->
class_dev
);
acpi_video_device_get_state
(
vd
,
&
state
);
return
(
int
)
state
;
}
static
int
acpi_video_output_set
(
struct
output_device
*
od
)
{
unsigned
long
state
=
od
->
request_state
;
struct
acpi_video_device
*
vd
=
(
struct
acpi_video_device
*
)
class_get_devdata
(
&
od
->
class_dev
);
return
acpi_video_device_set_state
(
vd
,
state
);
}
static
struct
output_properties
acpi_output_properties
=
{
.
set_state
=
acpi_video_output_set
,
.
get_status
=
acpi_video_output_get
,
};
/* --------------------------------------------------------------------------
Video Management
-------------------------------------------------------------------------- */
...
...
@@ -531,7 +559,6 @@ acpi_video_bus_DOS(struct acpi_video_bus *video, int bios_flag, int lcd_flag)
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
;
...
...
@@ -565,50 +592,55 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device)
device
->
cap
.
_DSS
=
1
;
}
status
=
acpi_video_device_lcd_query_levels
(
device
,
&
obj
);
if
(
obj
&&
obj
->
type
==
ACPI_TYPE_PACKAGE
&&
obj
->
package
.
count
>=
2
)
{
int
count
=
0
;
union
acpi_object
*
o
;
br
=
kzalloc
(
sizeof
(
*
br
),
GFP_KERNEL
);
if
(
!
br
)
{
printk
(
KERN_ERR
"can't allocate memory
\n
"
);
}
else
{
br
->
levels
=
kmalloc
(
obj
->
package
.
count
*
sizeof
*
(
br
->
levels
),
GFP_KERNEL
);
if
(
!
br
->
levels
)
goto
out
;
for
(
i
=
0
;
i
<
obj
->
package
.
count
;
i
++
)
{
o
=
(
union
acpi_object
*
)
&
obj
->
package
.
elements
[
i
];
if
(
o
->
type
!=
ACPI_TYPE_INTEGER
)
{
printk
(
KERN_ERR
PREFIX
"Invalid data
\n
"
);
continue
;
}
br
->
levels
[
count
]
=
(
u32
)
o
->
integer
.
value
;
if
(
br
->
levels
[
count
]
>
max_level
)
max_level
=
br
->
levels
[
count
];
count
++
;
}
out:
if
(
count
<
2
)
{
kfree
(
br
->
levels
);
kfree
(
br
);
if
(
ACPI_SUCCESS
(
acpi_video_device_lcd_query_levels
(
device
,
&
obj
)))
{
if
(
obj
->
package
.
count
>=
2
)
{
int
count
=
0
;
union
acpi_object
*
o
;
br
=
kzalloc
(
sizeof
(
*
br
),
GFP_KERNEL
);
if
(
!
br
)
{
printk
(
KERN_ERR
"can't allocate memory
\n
"
);
}
else
{
br
->
count
=
count
;
device
->
brightness
=
br
;
ACPI_DEBUG_PRINT
((
ACPI_DB_INFO
,
"found %d brightness levels
\n
"
,
count
));
br
->
levels
=
kmalloc
(
obj
->
package
.
count
*
sizeof
*
(
br
->
levels
),
GFP_KERNEL
);
if
(
!
br
->
levels
)
goto
out
;
for
(
i
=
0
;
i
<
obj
->
package
.
count
;
i
++
)
{
o
=
(
union
acpi_object
*
)
&
obj
->
package
.
elements
[
i
];
if
(
o
->
type
!=
ACPI_TYPE_INTEGER
)
{
printk
(
KERN_ERR
PREFIX
"Invalid data
\n
"
);
continue
;
}
br
->
levels
[
count
]
=
(
u32
)
o
->
integer
.
value
;
if
(
br
->
levels
[
count
]
>
max_level
)
max_level
=
br
->
levels
[
count
];
count
++
;
}
out:
if
(
count
<
2
)
{
kfree
(
br
->
levels
);
kfree
(
br
);
}
else
{
br
->
count
=
count
;
device
->
brightness
=
br
;
ACPI_DEBUG_PRINT
((
ACPI_DB_INFO
,
"found %d brightness levels
\n
"
,
count
));
}
}
}
}
else
{
ACPI_DEBUG_PRINT
((
ACPI_DB_INFO
,
"Could not query available LCD brightness level
\n
"
));
}
kfree
(
obj
);
if
(
device
->
cap
.
_BCL
&&
device
->
cap
.
_BCM
&&
device
->
cap
.
_BQC
){
if
(
device
->
cap
.
_BCL
&&
device
->
cap
.
_BCM
&&
device
->
cap
.
_BQC
&&
max_level
>
0
){
unsigned
long
tmp
;
static
int
count
=
0
;
char
*
name
;
...
...
@@ -626,6 +658,17 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device)
kfree
(
name
);
}
if
(
device
->
cap
.
_DCS
&&
device
->
cap
.
_DSS
){
static
int
count
=
0
;
char
*
name
;
name
=
kzalloc
(
MAX_NAME_LEN
,
GFP_KERNEL
);
if
(
!
name
)
return
;
sprintf
(
name
,
"acpi_video%d"
,
count
++
);
device
->
output_dev
=
video_output_register
(
name
,
NULL
,
device
,
&
acpi_output_properties
);
kfree
(
name
);
}
return
;
}
...
...
@@ -1669,6 +1712,7 @@ static int acpi_video_bus_put_one_device(struct acpi_video_device *device)
ACPI_DEVICE_NOTIFY
,
acpi_video_device_notify
);
backlight_device_unregister
(
device
->
backlight
);
video_output_unregister
(
device
->
output_dev
);
return
0
;
}
...
...
drivers/video/Kconfig
浏览文件 @
5e16e3f0
...
...
@@ -12,6 +12,13 @@ config VGASTATE
tristate
default n
config VIDEO_OUTPUT_CONTROL
tristate "Lowlevel video output switch controls"
default m
help
This framework adds support for low-level control of the video
output switch.
config FB
tristate "Support for frame buffer devices"
---help---
...
...
drivers/video/Makefile
浏览文件 @
5e16e3f0
...
...
@@ -123,3 +123,6 @@ obj-$(CONFIG_FB_OF) += offb.o
# the test framebuffer is last
obj-$(CONFIG_FB_VIRTUAL)
+=
vfb.o
#video output switch sysfs driver
obj-$(CONFIG_VIDEO_OUTPUT_CONTROL)
+=
output.o
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录