Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
dbe0580d
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看板
提交
dbe0580d
编写于
10月 28, 2005
作者:
L
Linus Torvalds
浏览文件
操作
浏览文件
下载
差异文件
Merge master.kernel.org:/home/rmk/linux-2.6-mmc
上级
20731945
19c1f3ca
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
91 addition
and
28 deletion
+91
-28
drivers/mmc/wbsd.c
drivers/mmc/wbsd.c
+91
-28
未找到文件。
drivers/mmc/wbsd.c
浏览文件 @
dbe0580d
...
...
@@ -1033,13 +1033,16 @@ static void wbsd_set_ios(struct mmc_host* mmc, struct mmc_ios* ios)
}
else
{
setup
&=
~
WBSD_DAT3_H
;
if
(
setup
&
WBSD_DAT3_H
)
{
setup
&=
~
WBSD_DAT3_H
;
/*
* We cannot resume card detection immediatly
* because of capacitance and delays in the chip.
*/
mod_timer
(
&
host
->
ignore_timer
,
jiffies
+
HZ
/
100
);
/*
* We cannot resume card detection immediatly
* because of capacitance and delays in the chip.
*/
mod_timer
(
&
host
->
ignore_timer
,
jiffies
+
HZ
/
100
);
}
}
wbsd_write_index
(
host
,
WBSD_IDX_SETUP
,
setup
);
...
...
@@ -1461,8 +1464,10 @@ static int __devinit wbsd_scan(struct wbsd_host* host)
{
id
=
0xFFFF
;
outb
(
unlock_codes
[
j
],
config_ports
[
i
]);
outb
(
unlock_codes
[
j
],
config_ports
[
i
]);
host
->
config
=
config_ports
[
i
];
host
->
unlock_code
=
unlock_codes
[
j
];
wbsd_unlock_config
(
host
);
outb
(
WBSD_CONF_ID_HI
,
config_ports
[
i
]);
id
=
inb
(
config_ports
[
i
]
+
1
)
<<
8
;
...
...
@@ -1470,13 +1475,13 @@ static int __devinit wbsd_scan(struct wbsd_host* host)
outb
(
WBSD_CONF_ID_LO
,
config_ports
[
i
]);
id
|=
inb
(
config_ports
[
i
]
+
1
);
wbsd_lock_config
(
host
);
for
(
k
=
0
;
k
<
sizeof
(
valid_ids
)
/
sizeof
(
int
);
k
++
)
{
if
(
id
==
valid_ids
[
k
])
{
host
->
chip_id
=
id
;
host
->
config
=
config_ports
[
i
];
host
->
unlock_code
=
unlock_codes
[
i
];
return
0
;
}
...
...
@@ -1487,13 +1492,14 @@ static int __devinit wbsd_scan(struct wbsd_host* host)
DBG
(
"Unknown hardware (id %x) found at %x
\n
"
,
id
,
config_ports
[
i
]);
}
outb
(
LOCK_CODE
,
config_ports
[
i
]);
}
release_region
(
config_ports
[
i
],
2
);
}
host
->
config
=
0
;
host
->
unlock_code
=
0
;
return
-
ENODEV
;
}
...
...
@@ -1699,8 +1705,10 @@ static void __devexit wbsd_release_resources(struct wbsd_host* host)
* Configure the resources the chip should use.
*/
static
void
__devinit
wbsd_chip_config
(
struct
wbsd_host
*
host
)
static
void
wbsd_chip_config
(
struct
wbsd_host
*
host
)
{
wbsd_unlock_config
(
host
);
/*
* Reset the chip.
*/
...
...
@@ -1733,16 +1741,20 @@ static void __devinit wbsd_chip_config(struct wbsd_host* host)
*/
wbsd_write_config
(
host
,
WBSD_CONF_ENABLE
,
1
);
wbsd_write_config
(
host
,
WBSD_CONF_POWER
,
0x20
);
wbsd_lock_config
(
host
);
}
/*
* Check that configured resources are correct.
*/
static
int
__devinit
wbsd_chip_validate
(
struct
wbsd_host
*
host
)
static
int
wbsd_chip_validate
(
struct
wbsd_host
*
host
)
{
int
base
,
irq
,
dma
;
wbsd_unlock_config
(
host
);
/*
* Select SD/MMC function.
*/
...
...
@@ -1758,6 +1770,8 @@ static int __devinit wbsd_chip_validate(struct wbsd_host* host)
dma
=
wbsd_read_config
(
host
,
WBSD_CONF_DRQ
);
wbsd_lock_config
(
host
);
/*
* Validate against given configuration.
*/
...
...
@@ -1771,6 +1785,20 @@ static int __devinit wbsd_chip_validate(struct wbsd_host* host)
return
1
;
}
/*
* Powers down the SD function
*/
static
void
wbsd_chip_poweroff
(
struct
wbsd_host
*
host
)
{
wbsd_unlock_config
(
host
);
wbsd_write_config
(
host
,
WBSD_CONF_DEVICE
,
DEVICE_SD
);
wbsd_write_config
(
host
,
WBSD_CONF_ENABLE
,
0
);
wbsd_lock_config
(
host
);
}
/*****************************************************************************\
* *
* Devices setup and shutdown *
...
...
@@ -1844,7 +1872,11 @@ static int __devinit wbsd_init(struct device* dev, int base, int irq, int dma,
*/
#ifdef CONFIG_PM
if
(
host
->
config
)
{
wbsd_unlock_config
(
host
);
wbsd_write_config
(
host
,
WBSD_CONF_PME
,
0xA0
);
wbsd_lock_config
(
host
);
}
#endif
/*
* Allow device to initialise itself properly.
...
...
@@ -1885,16 +1917,11 @@ static void __devexit wbsd_shutdown(struct device* dev, int pnp)
mmc_remove_host
(
mmc
);
/*
* Power down the SD/MMC function.
*/
if
(
!
pnp
)
{
/*
* Power down the SD/MMC function.
*/
wbsd_unlock_config
(
host
);
wbsd_write_config
(
host
,
WBSD_CONF_DEVICE
,
DEVICE_SD
);
wbsd_write_config
(
host
,
WBSD_CONF_ENABLE
,
0
);
wbsd_lock_config
(
host
);
}
wbsd_chip_poweroff
(
host
);
wbsd_release_resources
(
host
);
...
...
@@ -1955,23 +1982,59 @@ static void __devexit wbsd_pnp_remove(struct pnp_dev * dev)
*/
#ifdef CONFIG_PM
static
int
wbsd_suspend
(
struct
device
*
dev
,
pm_message_t
state
)
{
DBGF
(
"Not yet supported
\n
"
);
struct
mmc_host
*
mmc
=
dev_get_drvdata
(
dev
);
struct
wbsd_host
*
host
;
int
ret
;
if
(
!
mmc
)
return
0
;
DBG
(
"Suspending...
\n
"
);
ret
=
mmc_suspend_host
(
mmc
,
state
);
if
(
!
ret
)
return
ret
;
host
=
mmc_priv
(
mmc
);
wbsd_chip_poweroff
(
host
);
return
0
;
}
static
int
wbsd_resume
(
struct
device
*
dev
)
{
DBGF
(
"Not yet supported
\n
"
);
struct
mmc_host
*
mmc
=
dev_get_drvdata
(
dev
);
struct
wbsd_host
*
host
;
return
0
;
if
(
!
mmc
)
return
0
;
DBG
(
"Resuming...
\n
"
);
host
=
mmc_priv
(
mmc
);
wbsd_chip_config
(
host
);
/*
* Allow device to initialise itself properly.
*/
mdelay
(
5
);
wbsd_init_device
(
host
);
return
mmc_resume_host
(
mmc
);
}
#else
#else
/* CONFIG_PM */
#define wbsd_suspend NULL
#define wbsd_resume NULL
#endif
#endif
/* CONFIG_PM */
static
struct
platform_device
*
wbsd_device
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录