Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Linux-御风守护者
linux
提交
c3cef3f3
L
linux
项目概览
Linux-御风守护者
/
linux
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c3cef3f3
编写于
8月 20, 2007
作者:
R
Russell King
提交者:
Russell King
10月 12, 2007
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[ARM] pxa: update pxa i2c driver to use clk support
Signed-off-by:
N
Russell King
<
rmk+kernel@arm.linux.org.uk
>
上级
72e3524c
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
25 addition
and
20 deletion
+25
-20
drivers/i2c/busses/i2c-pxa.c
drivers/i2c/busses/i2c-pxa.c
+25
-20
未找到文件。
drivers/i2c/busses/i2c-pxa.c
浏览文件 @
c3cef3f3
...
...
@@ -31,6 +31,8 @@
#include <linux/interrupt.h>
#include <linux/i2c-pxa.h>
#include <linux/platform_device.h>
#include <linux/err.h>
#include <linux/clk.h>
#include <asm/hardware.h>
#include <asm/irq.h>
...
...
@@ -48,6 +50,7 @@ struct pxa_i2c {
unsigned
int
slave_addr
;
struct
i2c_adapter
adap
;
struct
clk
*
clk
;
#ifdef CONFIG_I2C_PXA_SLAVE
struct
i2c_slave_client
*
slave
;
#endif
...
...
@@ -869,6 +872,12 @@ static int i2c_pxa_probe(struct platform_device *dev)
sprintf
(
i2c
->
adap
.
name
,
"pxa_i2c-i2c.%u"
,
dev
->
id
);
i2c
->
clk
=
clk_get
(
&
dev
->
dev
,
"I2CCLK"
);
if
(
IS_ERR
(
i2c
->
clk
))
{
ret
=
PTR_ERR
(
i2c
->
clk
);
goto
eclk
;
}
i2c
->
reg_base
=
ioremap
(
res
->
start
,
res_len
(
res
));
if
(
!
i2c
->
reg_base
)
{
ret
=
-
EIO
;
...
...
@@ -889,22 +898,19 @@ static int i2c_pxa_probe(struct platform_device *dev)
}
#endif
clk_enable
(
i2c
->
clk
);
#ifdef CONFIG_PXA27x
switch
(
dev
->
id
)
{
case
0
:
#ifdef CONFIG_PXA27x
pxa_gpio_mode
(
GPIO117_I2CSCL_MD
);
pxa_gpio_mode
(
GPIO118_I2CSDA_MD
);
#endif
pxa_set_cken
(
CKEN_I2C
,
1
);
break
;
#ifdef CONFIG_PXA27x
case
1
:
local_irq_disable
();
PCFR
|=
PCFR_PI2CEN
;
local_irq_enable
();
pxa_set_cken
(
CKEN_PWRI2C
,
1
);
#endif
}
#endif
ret
=
request_irq
(
irq
,
i2c_pxa_handler
,
IRQF_DISABLED
,
i2c
->
adap
.
name
,
i2c
);
...
...
@@ -948,19 +954,18 @@ static int i2c_pxa_probe(struct platform_device *dev)
eadapt:
free_irq
(
irq
,
i2c
);
ereqirq:
switch
(
dev
->
id
)
{
case
0
:
pxa_set_cken
(
CKEN_I2C
,
0
);
break
;
clk_disable
(
i2c
->
clk
);
#ifdef CONFIG_PXA27x
case
1
:
pxa_set_cken
(
CKEN_PWRI2C
,
0
);
if
(
dev
->
id
==
1
)
{
local_irq_disable
();
PCFR
&=
~
PCFR_PI2CEN
;
local_irq_enable
();
#endif
}
#endif
eremap:
clk_put
(
i2c
->
clk
);
eclk:
kfree
(
i2c
);
emalloc:
release_mem_region
(
res
->
start
,
res_len
(
res
));
...
...
@@ -975,18 +980,18 @@ static int i2c_pxa_remove(struct platform_device *dev)
i2c_del_adapter
(
&
i2c
->
adap
);
free_irq
(
i2c
->
irq
,
i2c
);
switch
(
dev
->
id
)
{
c
ase
0
:
pxa_set_cken
(
CKEN_I2C
,
0
);
break
;
c
lk_disable
(
i2c
->
clk
);
clk_put
(
i2c
->
clk
);
#ifdef CONFIG_PXA27x
case
1
:
pxa_set_cken
(
CKEN_PWRI2C
,
0
);
if
(
dev
->
id
==
1
)
{
local_irq_disable
();
PCFR
&=
~
PCFR_PI2CEN
;
local_irq_enable
();
#endif
}
#endif
release_mem_region
(
i2c
->
iobase
,
i2c
->
iosize
);
kfree
(
i2c
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录