summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video
diff options
context:
space:
mode:
authorMike Isely <isely@pobox.com>2006-03-25 16:35:33 -0600
committerMike Isely <isely@pobox.com>2006-03-25 16:35:33 -0600
commit79c5d3b305af947949689365801773a3aaa38eb9 (patch)
tree541ef54f889ad764e94816efe84e7a72e2aa1f99 /linux/drivers/media/video
parentf6b67636456135319f327797d28e8b8e6dd30181 (diff)
downloadmediapointer-dvb-s2-79c5d3b305af947949689365801773a3aaa38eb9.tar.gz
mediapointer-dvb-s2-79c5d3b305af947949689365801773a3aaa38eb9.tar.bz2
Tweaks to pvrusb2 init sequence
From: Mike Isely <isely@pobox.com> Rename a pvrusb2 function to reflect its true meaning, and tweak the driver initialization sequence so that the I2C adapter isn't started until after the hardware has been given a powerup command. Signed-off-by: Mike Isely <isely@pobox.com>
Diffstat (limited to 'linux/drivers/media/video')
-rw-r--r--linux/drivers/media/video/pvrusb2/pvrusb2-debugifc.c2
-rw-r--r--linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c11
-rw-r--r--linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h2
3 files changed, 9 insertions, 6 deletions
diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-debugifc.c b/linux/drivers/media/video/pvrusb2/pvrusb2-debugifc.c
index bcfe468eb..f5c267123 100644
--- a/linux/drivers/media/video/pvrusb2/pvrusb2-debugifc.c
+++ b/linux/drivers/media/video/pvrusb2/pvrusb2-debugifc.c
@@ -362,7 +362,7 @@ int pvr2_debugifc_do1cmd(struct pvr2_hdw *hdw,const char *buf,
} else if (debugifc_match_keyword(wptr,wlen,"bus")) {
pvr2_hdw_device_reset(hdw);
} else if (debugifc_match_keyword(wptr,wlen,"soft")) {
- return pvr2_hdw_cmd_soft_reset(hdw);
+ return pvr2_hdw_cmd_powerup(hdw);
} else if (debugifc_match_keyword(wptr,wlen,"deep")) {
return pvr2_hdw_cmd_deep_reset(hdw);
} else if (debugifc_match_keyword(wptr,wlen,"firmware")) {
diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c
index b87651e5a..6a729c4c7 100644
--- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c
+++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c
@@ -617,7 +617,6 @@ int pvr2_upload_firmware2(struct pvr2_hdw *hdw)
ret = 0;
/* First prepare firmware loading */
- ret |= pvr2_hdw_cmd_soft_reset(hdw);
ret |= pvr2_write_register(hdw, 0x0048, 0xffffffff); /*interrupt mask*/
ret |= pvr2_hdw_gpio_chg_dir(hdw,0xffffffff,0x00000088); /*gpio dir*/
ret |= pvr2_hdw_gpio_chg_out(hdw,0xffffffff,0x00000008); /*gpio output state*/
@@ -1093,7 +1092,7 @@ static void pvr2_hdw_setup_low(struct pvr2_hdw *hdw)
}
if (!pvr2_hdw_dev_ok(hdw)) return;
- pvr2_i2c_core_init(hdw);
+ pvr2_hdw_cmd_powerup(hdw);
if (!pvr2_hdw_dev_ok(hdw)) return;
if (pvr2_upload_firmware2(hdw)){
@@ -1102,6 +1101,10 @@ static void pvr2_hdw_setup_low(struct pvr2_hdw *hdw)
return;
}
+ // This step MUST happen after the earlier powerup step.
+ pvr2_i2c_core_init(hdw);
+ if (!pvr2_hdw_dev_ok(hdw)) return;
+
for (idx = 0; idx < PVR2_CID_COUNT; idx++) {
if (control_defs[idx].skip_init) continue;
pvr2_hdw_set_ctl_value_internal(
@@ -2405,11 +2408,11 @@ int pvr2_hdw_cmd_deep_reset(struct pvr2_hdw *hdw)
}
-int pvr2_hdw_cmd_soft_reset(struct pvr2_hdw *hdw)
+int pvr2_hdw_cmd_powerup(struct pvr2_hdw *hdw)
{
int status;
LOCK_TAKE(hdw->ctl_lock); do {
- pvr2_trace(PVR2_TRACE_INIT,"Requesting uproc soft reset");
+ pvr2_trace(PVR2_TRACE_INIT,"Requesting powerup");
hdw->cmd_buffer[0] = 0xde;
status = pvr2_send_request(hdw,hdw->cmd_buffer,1,0,0);
} while (0); LOCK_GIVE(hdw->ctl_lock);
diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h
index 667c95a27..69ad5e1b1 100644
--- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h
+++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h
@@ -358,7 +358,7 @@ void pvr2_hdw_device_reset(struct pvr2_hdw *);
int pvr2_hdw_cmd_deep_reset(struct pvr2_hdw *);
/* Execute simple reset command */
-int pvr2_hdw_cmd_soft_reset(struct pvr2_hdw *);
+int pvr2_hdw_cmd_powerup(struct pvr2_hdw *);
/* Stop / start video stream transport */
int pvr2_hdw_cmd_usbstream(struct pvr2_hdw *hdw,int runFl);