Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
f35257a3
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
f35257a3
编写于
3月 11, 2014
作者:
P
Patrik Jakobsson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
drm/gma500: Unify _get_core_freq for cdv and psb
Signed-off-by:
N
Patrik Jakobsson
<
patrik.r.jakobsson@gmail.com
>
上级
778e26de
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
82 addition
and
78 deletion
+82
-78
drivers/gpu/drm/gma500/Makefile
drivers/gpu/drm/gma500/Makefile
+1
-0
drivers/gpu/drm/gma500/cdv_device.c
drivers/gpu/drm/gma500/cdv_device.c
+2
-38
drivers/gpu/drm/gma500/gma_device.c
drivers/gpu/drm/gma500/gma_device.c
+56
-0
drivers/gpu/drm/gma500/gma_device.h
drivers/gpu/drm/gma500/gma_device.h
+21
-0
drivers/gpu/drm/gma500/psb_device.c
drivers/gpu/drm/gma500/psb_device.c
+2
-40
未找到文件。
drivers/gpu/drm/gma500/Makefile
浏览文件 @
f35257a3
...
...
@@ -17,6 +17,7 @@ gma500_gfx-y += \
power.o
\
psb_drv.o
\
gma_display.o
\
gma_device.o
\
psb_intel_display.o
\
psb_intel_lvds.o
\
psb_intel_modes.o
\
...
...
drivers/gpu/drm/gma500/cdv_device.c
浏览文件 @
f35257a3
...
...
@@ -26,6 +26,7 @@
#include "psb_intel_reg.h"
#include "intel_bios.h"
#include "cdv_device.h"
#include "gma_device.h"
#define VGA_SR_INDEX 0x3c4
#define VGA_SR_DATA 0x3c5
...
...
@@ -426,43 +427,6 @@ static int cdv_power_up(struct drm_device *dev)
return
0
;
}
/* FIXME ? - shared with Poulsbo */
static
void
cdv_get_core_freq
(
struct
drm_device
*
dev
)
{
uint32_t
clock
;
struct
pci_dev
*
pci_root
=
pci_get_bus_and_slot
(
0
,
0
);
struct
drm_psb_private
*
dev_priv
=
dev
->
dev_private
;
pci_write_config_dword
(
pci_root
,
0xD0
,
0xD0050300
);
pci_read_config_dword
(
pci_root
,
0xD4
,
&
clock
);
pci_dev_put
(
pci_root
);
switch
(
clock
&
0x07
)
{
case
0
:
dev_priv
->
core_freq
=
100
;
break
;
case
1
:
dev_priv
->
core_freq
=
133
;
break
;
case
2
:
dev_priv
->
core_freq
=
150
;
break
;
case
3
:
dev_priv
->
core_freq
=
178
;
break
;
case
4
:
dev_priv
->
core_freq
=
200
;
break
;
case
5
:
case
6
:
case
7
:
dev_priv
->
core_freq
=
266
;
break
;
default:
dev_priv
->
core_freq
=
0
;
}
}
static
void
cdv_hotplug_work_func
(
struct
work_struct
*
work
)
{
struct
drm_psb_private
*
dev_priv
=
container_of
(
work
,
struct
drm_psb_private
,
...
...
@@ -618,7 +582,7 @@ static int cdv_chip_setup(struct drm_device *dev)
if
(
pci_enable_msi
(
dev
->
pdev
))
dev_warn
(
dev
->
dev
,
"Enabling MSI failed!
\n
"
);
dev_priv
->
regmap
=
cdv_regmap
;
cdv
_get_core_freq
(
dev
);
gma
_get_core_freq
(
dev
);
psb_intel_opregion_init
(
dev
);
psb_intel_init_bios
(
dev
);
cdv_hotplug_enable
(
dev
,
false
);
...
...
drivers/gpu/drm/gma500/gma_device.c
0 → 100644
浏览文件 @
f35257a3
/**************************************************************************
* Copyright (c) 2011, Intel Corporation.
* All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope 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.
*
**************************************************************************/
#include <drm/drmP.h>
#include "psb_drv.h"
void
gma_get_core_freq
(
struct
drm_device
*
dev
)
{
uint32_t
clock
;
struct
pci_dev
*
pci_root
=
pci_get_bus_and_slot
(
0
,
0
);
struct
drm_psb_private
*
dev_priv
=
dev
->
dev_private
;
/*pci_write_config_dword(pci_root, 0xD4, 0x00C32004);*/
/*pci_write_config_dword(pci_root, 0xD0, 0xE0033000);*/
pci_write_config_dword
(
pci_root
,
0xD0
,
0xD0050300
);
pci_read_config_dword
(
pci_root
,
0xD4
,
&
clock
);
pci_dev_put
(
pci_root
);
switch
(
clock
&
0x07
)
{
case
0
:
dev_priv
->
core_freq
=
100
;
break
;
case
1
:
dev_priv
->
core_freq
=
133
;
break
;
case
2
:
dev_priv
->
core_freq
=
150
;
break
;
case
3
:
dev_priv
->
core_freq
=
178
;
break
;
case
4
:
dev_priv
->
core_freq
=
200
;
break
;
case
5
:
case
6
:
case
7
:
dev_priv
->
core_freq
=
266
;
break
;
default:
dev_priv
->
core_freq
=
0
;
}
}
drivers/gpu/drm/gma500/gma_device.h
0 → 100644
浏览文件 @
f35257a3
/**************************************************************************
* Copyright (c) 2011, Intel Corporation.
* All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope 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.
*
**************************************************************************/
#ifndef _GMA_DEVICE_H
#define _GMA_DEVICE_H
extern
void
gma_get_core_freq
(
struct
drm_device
*
dev
);
#endif
drivers/gpu/drm/gma500/psb_device.c
浏览文件 @
f35257a3
...
...
@@ -26,6 +26,7 @@
#include "psb_intel_reg.h"
#include "intel_bios.h"
#include "psb_device.h"
#include "gma_device.h"
static
int
psb_output_init
(
struct
drm_device
*
dev
)
{
...
...
@@ -257,45 +258,6 @@ static int psb_power_up(struct drm_device *dev)
return
0
;
}
static
void
psb_get_core_freq
(
struct
drm_device
*
dev
)
{
uint32_t
clock
;
struct
pci_dev
*
pci_root
=
pci_get_bus_and_slot
(
0
,
0
);
struct
drm_psb_private
*
dev_priv
=
dev
->
dev_private
;
/*pci_write_config_dword(pci_root, 0xD4, 0x00C32004);*/
/*pci_write_config_dword(pci_root, 0xD0, 0xE0033000);*/
pci_write_config_dword
(
pci_root
,
0xD0
,
0xD0050300
);
pci_read_config_dword
(
pci_root
,
0xD4
,
&
clock
);
pci_dev_put
(
pci_root
);
switch
(
clock
&
0x07
)
{
case
0
:
dev_priv
->
core_freq
=
100
;
break
;
case
1
:
dev_priv
->
core_freq
=
133
;
break
;
case
2
:
dev_priv
->
core_freq
=
150
;
break
;
case
3
:
dev_priv
->
core_freq
=
178
;
break
;
case
4
:
dev_priv
->
core_freq
=
200
;
break
;
case
5
:
case
6
:
case
7
:
dev_priv
->
core_freq
=
266
;
break
;
default:
dev_priv
->
core_freq
=
0
;
}
}
/* Poulsbo */
static
const
struct
psb_offset
psb_regmap
[
2
]
=
{
{
...
...
@@ -352,7 +314,7 @@ static int psb_chip_setup(struct drm_device *dev)
{
struct
drm_psb_private
*
dev_priv
=
dev
->
dev_private
;
dev_priv
->
regmap
=
psb_regmap
;
psb
_get_core_freq
(
dev
);
gma
_get_core_freq
(
dev
);
gma_intel_setup_gmbus
(
dev
);
psb_intel_opregion_init
(
dev
);
psb_intel_init_bios
(
dev
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录