Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
53a33bde
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
14
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看板
提交
53a33bde
编写于
9月 19, 2011
作者:
J
Jean-Christophe PLAGNIOL-VILLARD
提交者:
Arnd Bergmann
11月 29, 2011
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ARM: at91/mmc: use gpio_is_valid to check the gpio
Signed-off-by:
N
Jean-Christophe PLAGNIOL-VILLARD
<
plagnioj@jcrosoft.com
>
上级
43d91483
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
15 addition
and
15 deletion
+15
-15
drivers/mmc/host/at91_mci.c
drivers/mmc/host/at91_mci.c
+15
-15
未找到文件。
drivers/mmc/host/at91_mci.c
浏览文件 @
53a33bde
...
@@ -741,7 +741,7 @@ static void at91_mci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
...
@@ -741,7 +741,7 @@ static void at91_mci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
at91_mci_write
(
host
,
AT91_MCI_MR
,
(
at91_mci_read
(
host
,
AT91_MCI_MR
)
&
~
AT91_MCI_CLKDIV
)
|
clkdiv
);
at91_mci_write
(
host
,
AT91_MCI_MR
,
(
at91_mci_read
(
host
,
AT91_MCI_MR
)
&
~
AT91_MCI_CLKDIV
)
|
clkdiv
);
/* maybe switch power to the card */
/* maybe switch power to the card */
if
(
host
->
board
->
vcc_pin
)
{
if
(
gpio_is_valid
(
host
->
board
->
vcc_pin
)
)
{
switch
(
ios
->
power_mode
)
{
switch
(
ios
->
power_mode
)
{
case
MMC_POWER_OFF
:
case
MMC_POWER_OFF
:
gpio_set_value
(
host
->
board
->
vcc_pin
,
0
);
gpio_set_value
(
host
->
board
->
vcc_pin
,
0
);
...
@@ -897,7 +897,7 @@ static int at91_mci_get_ro(struct mmc_host *mmc)
...
@@ -897,7 +897,7 @@ static int at91_mci_get_ro(struct mmc_host *mmc)
{
{
struct
at91mci_host
*
host
=
mmc_priv
(
mmc
);
struct
at91mci_host
*
host
=
mmc_priv
(
mmc
);
if
(
host
->
board
->
wp_pin
)
if
(
gpio_is_valid
(
host
->
board
->
wp_pin
)
)
return
!!
gpio_get_value
(
host
->
board
->
wp_pin
);
return
!!
gpio_get_value
(
host
->
board
->
wp_pin
);
/*
/*
* Board doesn't support read only detection; let the mmc core
* Board doesn't support read only detection; let the mmc core
...
@@ -991,21 +991,21 @@ static int __init at91_mci_probe(struct platform_device *pdev)
...
@@ -991,21 +991,21 @@ static int __init at91_mci_probe(struct platform_device *pdev)
* Reserve GPIOs ... board init code makes sure these pins are set
* Reserve GPIOs ... board init code makes sure these pins are set
* up as GPIOs with the right direction (input, except for vcc)
* up as GPIOs with the right direction (input, except for vcc)
*/
*/
if
(
host
->
board
->
det_pin
)
{
if
(
gpio_is_valid
(
host
->
board
->
det_pin
)
)
{
ret
=
gpio_request
(
host
->
board
->
det_pin
,
"mmc_detect"
);
ret
=
gpio_request
(
host
->
board
->
det_pin
,
"mmc_detect"
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
dev_dbg
(
&
pdev
->
dev
,
"couldn't claim card detect pin
\n
"
);
dev_dbg
(
&
pdev
->
dev
,
"couldn't claim card detect pin
\n
"
);
goto
fail4b
;
goto
fail4b
;
}
}
}
}
if
(
host
->
board
->
wp_pin
)
{
if
(
gpio_is_valid
(
host
->
board
->
wp_pin
)
)
{
ret
=
gpio_request
(
host
->
board
->
wp_pin
,
"mmc_wp"
);
ret
=
gpio_request
(
host
->
board
->
wp_pin
,
"mmc_wp"
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
dev_dbg
(
&
pdev
->
dev
,
"couldn't claim wp sense pin
\n
"
);
dev_dbg
(
&
pdev
->
dev
,
"couldn't claim wp sense pin
\n
"
);
goto
fail4
;
goto
fail4
;
}
}
}
}
if
(
host
->
board
->
vcc_pin
)
{
if
(
gpio_is_valid
(
host
->
board
->
vcc_pin
)
)
{
ret
=
gpio_request
(
host
->
board
->
vcc_pin
,
"mmc_vcc"
);
ret
=
gpio_request
(
host
->
board
->
vcc_pin
,
"mmc_vcc"
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
dev_dbg
(
&
pdev
->
dev
,
"couldn't claim vcc switch pin
\n
"
);
dev_dbg
(
&
pdev
->
dev
,
"couldn't claim vcc switch pin
\n
"
);
...
@@ -1057,7 +1057,7 @@ static int __init at91_mci_probe(struct platform_device *pdev)
...
@@ -1057,7 +1057,7 @@ static int __init at91_mci_probe(struct platform_device *pdev)
/*
/*
* Add host to MMC layer
* Add host to MMC layer
*/
*/
if
(
host
->
board
->
det_pin
)
{
if
(
gpio_is_valid
(
host
->
board
->
det_pin
)
)
{
host
->
present
=
!
gpio_get_value
(
host
->
board
->
det_pin
);
host
->
present
=
!
gpio_get_value
(
host
->
board
->
det_pin
);
}
}
else
else
...
@@ -1068,7 +1068,7 @@ static int __init at91_mci_probe(struct platform_device *pdev)
...
@@ -1068,7 +1068,7 @@ static int __init at91_mci_probe(struct platform_device *pdev)
/*
/*
* monitor card insertion/removal if we can
* monitor card insertion/removal if we can
*/
*/
if
(
host
->
board
->
det_pin
)
{
if
(
gpio_is_valid
(
host
->
board
->
det_pin
)
)
{
ret
=
request_irq
(
gpio_to_irq
(
host
->
board
->
det_pin
),
ret
=
request_irq
(
gpio_to_irq
(
host
->
board
->
det_pin
),
at91_mmc_det_irq
,
0
,
mmc_hostname
(
mmc
),
host
);
at91_mmc_det_irq
,
0
,
mmc_hostname
(
mmc
),
host
);
if
(
ret
)
if
(
ret
)
...
@@ -1087,13 +1087,13 @@ static int __init at91_mci_probe(struct platform_device *pdev)
...
@@ -1087,13 +1087,13 @@ static int __init at91_mci_probe(struct platform_device *pdev)
fail1:
fail1:
clk_put
(
host
->
mci_clk
);
clk_put
(
host
->
mci_clk
);
fail2:
fail2:
if
(
host
->
board
->
vcc_pin
)
if
(
gpio_is_valid
(
host
->
board
->
vcc_pin
)
)
gpio_free
(
host
->
board
->
vcc_pin
);
gpio_free
(
host
->
board
->
vcc_pin
);
fail3:
fail3:
if
(
host
->
board
->
wp_pin
)
if
(
gpio_is_valid
(
host
->
board
->
wp_pin
)
)
gpio_free
(
host
->
board
->
wp_pin
);
gpio_free
(
host
->
board
->
wp_pin
);
fail4:
fail4:
if
(
host
->
board
->
det_pin
)
if
(
gpio_is_valid
(
host
->
board
->
det_pin
)
)
gpio_free
(
host
->
board
->
det_pin
);
gpio_free
(
host
->
board
->
det_pin
);
fail4b:
fail4b:
if
(
host
->
buffer
)
if
(
host
->
buffer
)
...
@@ -1125,7 +1125,7 @@ static int __exit at91_mci_remove(struct platform_device *pdev)
...
@@ -1125,7 +1125,7 @@ static int __exit at91_mci_remove(struct platform_device *pdev)
dma_free_coherent
(
&
pdev
->
dev
,
MCI_BUFSIZE
,
dma_free_coherent
(
&
pdev
->
dev
,
MCI_BUFSIZE
,
host
->
buffer
,
host
->
physical_address
);
host
->
buffer
,
host
->
physical_address
);
if
(
host
->
board
->
det_pin
)
{
if
(
gpio_is_valid
(
host
->
board
->
det_pin
)
)
{
if
(
device_can_wakeup
(
&
pdev
->
dev
))
if
(
device_can_wakeup
(
&
pdev
->
dev
))
free_irq
(
gpio_to_irq
(
host
->
board
->
det_pin
),
host
);
free_irq
(
gpio_to_irq
(
host
->
board
->
det_pin
),
host
);
device_init_wakeup
(
&
pdev
->
dev
,
0
);
device_init_wakeup
(
&
pdev
->
dev
,
0
);
...
@@ -1140,9 +1140,9 @@ static int __exit at91_mci_remove(struct platform_device *pdev)
...
@@ -1140,9 +1140,9 @@ static int __exit at91_mci_remove(struct platform_device *pdev)
clk_disable
(
host
->
mci_clk
);
/* Disable the peripheral clock */
clk_disable
(
host
->
mci_clk
);
/* Disable the peripheral clock */
clk_put
(
host
->
mci_clk
);
clk_put
(
host
->
mci_clk
);
if
(
host
->
board
->
vcc_pin
)
if
(
gpio_is_valid
(
host
->
board
->
vcc_pin
)
)
gpio_free
(
host
->
board
->
vcc_pin
);
gpio_free
(
host
->
board
->
vcc_pin
);
if
(
host
->
board
->
wp_pin
)
if
(
gpio_is_valid
(
host
->
board
->
wp_pin
)
)
gpio_free
(
host
->
board
->
wp_pin
);
gpio_free
(
host
->
board
->
wp_pin
);
iounmap
(
host
->
baseaddr
);
iounmap
(
host
->
baseaddr
);
...
@@ -1163,7 +1163,7 @@ static int at91_mci_suspend(struct platform_device *pdev, pm_message_t state)
...
@@ -1163,7 +1163,7 @@ static int at91_mci_suspend(struct platform_device *pdev, pm_message_t state)
struct
at91mci_host
*
host
=
mmc_priv
(
mmc
);
struct
at91mci_host
*
host
=
mmc_priv
(
mmc
);
int
ret
=
0
;
int
ret
=
0
;
if
(
host
->
board
->
det_pin
&&
device_may_wakeup
(
&
pdev
->
dev
))
if
(
gpio_is_valid
(
host
->
board
->
det_pin
)
&&
device_may_wakeup
(
&
pdev
->
dev
))
enable_irq_wake
(
host
->
board
->
det_pin
);
enable_irq_wake
(
host
->
board
->
det_pin
);
if
(
mmc
)
if
(
mmc
)
...
@@ -1178,7 +1178,7 @@ static int at91_mci_resume(struct platform_device *pdev)
...
@@ -1178,7 +1178,7 @@ static int at91_mci_resume(struct platform_device *pdev)
struct
at91mci_host
*
host
=
mmc_priv
(
mmc
);
struct
at91mci_host
*
host
=
mmc_priv
(
mmc
);
int
ret
=
0
;
int
ret
=
0
;
if
(
host
->
board
->
det_pin
&&
device_may_wakeup
(
&
pdev
->
dev
))
if
(
gpio_is_valid
(
host
->
board
->
det_pin
)
&&
device_may_wakeup
(
&
pdev
->
dev
))
disable_irq_wake
(
host
->
board
->
det_pin
);
disable_irq_wake
(
host
->
board
->
det_pin
);
if
(
mmc
)
if
(
mmc
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录