Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
d4e15bcd
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看板
提交
d4e15bcd
编写于
11月 05, 2007
作者:
M
Mauro Carvalho Chehab
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
V4L/DVB (12814): tm6000: fix eeprom reading on tm6000
Signed-off-by:
N
Mauro Carvalho Chehab
<
mchehab@redhat.com
>
上级
28cb88ca
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
34 addition
and
28 deletion
+34
-28
drivers/staging/tm6000/tm6000-i2c.c
drivers/staging/tm6000/tm6000-i2c.c
+34
-28
未找到文件。
drivers/staging/tm6000/tm6000-i2c.c
浏览文件 @
d4e15bcd
...
...
@@ -163,8 +163,8 @@ static int tm6000_i2c_xfer(struct i2c_adapter *i2c_adap,
}
static
int
tm6000_i2c_eeprom
(
struct
tm6000_core
*
dev
,
unsigned
char
*
eedata
,
int
len
)
static
int
tm6000_i2c_eeprom
(
struct
tm6000_core
*
dev
,
unsigned
char
*
eedata
,
int
len
)
{
int
i
,
rc
;
unsigned
char
*
p
=
eedata
;
...
...
@@ -172,24 +172,16 @@ static int tm6000_i2c_eeprom( struct tm6000_core *dev,
dev
->
i2c_client
.
addr
=
0xa0
>>
1
;
//006779: OUT: 000006 ms 089867 ms c0 0e a0 00 00 00 01 00 <<< 00
//006780: OUT: 000005 ms 089873 ms c0 10 a0 00 00 00 01 00 <<< 00
//006781: OUT: 000108 ms 089878 ms 40 0e a0 00 00 00 01 00 >>> 99
//006782: OUT: 000015 ms 089986 ms c0 0e a0 00 01 00 01 00 <<< 99
//006783: OUT: 000004 ms 090001 ms c0 0e a0 00 10 00 01 00 <<< 99
//006784: OUT: 000005 ms 090005 ms 40 10 a0 00 00 00 01 00 >>> 00
//006785: OUT: 000308 ms 090010 ms 40 0e a0 00 00 00 01 00 >>> 00
for
(
i
=
0
;
i
<
len
;
i
++
)
{
bytes
[
0x14
+
i
]
=
0
;
rc
=
i2c_master_recv
(
&
dev
->
i2c_client
,
p
,
1
);
if
(
rc
<
1
)
{
if
(
p
==
eedata
)
{
printk
(
KERN_WARNING
"%s doesn't have eeprom"
,
dev
->
name
);
}
else
{
bytes
[
16
]
=
'\0'
;
for
(
i
=
0
;
i
<
len
;
)
{
*
p
=
i
;
rc
=
tm6000_read_write_usb
(
dev
,
USB_DIR_IN
|
USB_TYPE_VENDOR
|
USB_RECIP_DEVICE
,
REQ_16_SET_GET_I2CSEQ
,
0xa0
|
i
<<
8
,
0
,
p
,
1
);
if
(
rc
<
1
)
{
if
(
p
==
eedata
)
goto
noeeprom
;
else
{
printk
(
KERN_WARNING
"%s: i2c eeprom read error (err=%d)
\n
"
,
dev
->
name
,
rc
);
...
...
@@ -200,21 +192,32 @@ static int tm6000_i2c_eeprom( struct tm6000_core *dev,
if
(
0
==
(
i
%
16
))
printk
(
KERN_INFO
"%s: i2c eeprom %02x:"
,
dev
->
name
,
i
);
printk
(
" %02x"
,
eedata
[
i
]);
if
((
eedata
[
i
]
>=
' '
)
&&
(
eedata
[
i
]
<=
'z'
))
{
bytes
[
i
%
16
]
=
eedata
[
i
];
if
((
eedata
[
i
]
>=
' '
)
&&
(
eedata
[
i
]
<=
'z'
))
{
bytes
[
i
%
16
]
=
eedata
[
i
];
}
else
{
bytes
[
i
%
16
]
=
'.'
;
}
if
(
15
==
(
i
%
16
))
{
bytes
[
i
%
16
]
=
'\0'
;
i
++
;
if
(
0
==
(
i
%
16
))
{
bytes
[
16
]
=
'\0'
;
printk
(
" %s
\n
"
,
bytes
);
}
}
if
((
i
%
16
)
!=
15
)
{
bytes
[
i
%
16
]
=
'\0'
;
printk
(
" %s
\n
"
,
bytes
);
if
(
0
!=
(
i
%
16
))
{
bytes
[
i
%
16
]
=
'\0'
;
for
(
i
%=
16
;
i
<
16
;
i
++
)
printk
(
" "
);
}
printk
(
" %s
\n
"
,
bytes
);
return
0
;
noeeprom:
printk
(
KERN_INFO
"%s: Huh, no eeprom present (err=%d)?
\n
"
,
dev
->
name
,
rc
);
return
rc
;
}
/* ----------------------------------------------------------- */
...
...
@@ -319,7 +322,6 @@ static int attach_inform(struct i2c_client *client)
{
struct
tm6000_core
*
dev
=
client
->
adapter
->
algo_data
;
struct
tuner_setup
tun_setup
;
unsigned
char
eedata
[
11
];
i2c_dprintk
(
1
,
"%s i2c attach [addr=0x%x,client=%s]
\n
"
,
client
->
driver
->
driver
.
name
,
client
->
addr
,
client
->
name
);
...
...
@@ -416,6 +418,8 @@ void tm6000_i2c_call_clients(struct tm6000_core *dev, unsigned int cmd, void *ar
*/
int
tm6000_i2c_register
(
struct
tm6000_core
*
dev
)
{
unsigned
char
eedata
[
256
];
dev
->
i2c_adap
=
tm6000_adap_template
;
dev
->
i2c_adap
.
dev
.
parent
=
&
dev
->
udev
->
dev
;
strcpy
(
dev
->
i2c_adap
.
name
,
dev
->
name
);
...
...
@@ -428,6 +432,8 @@ int tm6000_i2c_register(struct tm6000_core *dev)
if
(
i2c_scan
)
do_i2c_scan
(
dev
->
name
,
&
dev
->
i2c_client
);
tm6000_i2c_eeprom
(
dev
,
eedata
,
sizeof
(
eedata
));
return
0
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录