summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2007-10-17 11:40:22 -0200
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-10-17 11:40:22 -0200
commitc6b71147f1371e784ded6481d60962132c3bd7d3 (patch)
tree7d5f3d63aff2024b990f5386dcf6aa5aa3334886 /linux
parent0ac81e8228715c26c7dbd6e57ea910f570741774 (diff)
parent66439930c41982012b1fdf0913120a1317019df3 (diff)
downloadmediapointer-dvb-s2-c6b71147f1371e784ded6481d60962132c3bd7d3.tar.gz
mediapointer-dvb-s2-c6b71147f1371e784ded6481d60962132c3bd7d3.tar.bz2
merge: http://linuxtv.org/hg/~tap/kernel-sync
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux')
-rw-r--r--linux/drivers/media/video/pvrusb2/pvrusb2-encoder.c6
-rw-r--r--linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h11
-rw-r--r--linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c3
-rw-r--r--linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c22
4 files changed, 36 insertions, 6 deletions
diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-encoder.c b/linux/drivers/media/video/pvrusb2/pvrusb2-encoder.c
index 4abee970c..7a27dece2 100644
--- a/linux/drivers/media/video/pvrusb2/pvrusb2-encoder.c
+++ b/linux/drivers/media/video/pvrusb2/pvrusb2-encoder.c
@@ -231,6 +231,11 @@ static int pvr2_encoder_cmd(void *ctxt,
LOCK_TAKE(hdw->ctl_lock); do {
+ if (!hdw->flag_encoder_ok) {
+ ret = -EIO;
+ break;
+ }
+
retry_flag = 0;
try_count++;
ret = 0;
@@ -295,6 +300,7 @@ static int pvr2_encoder_cmd(void *ctxt,
ret = -EBUSY;
}
if (ret) {
+ hdw->flag_encoder_ok = 0;
pvr2_trace(
PVR2_TRACE_ERROR_LEGS,
"Giving up on command."
diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h
index d8ac8e783..fbe5d46d6 100644
--- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h
+++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h
@@ -241,11 +241,12 @@ struct pvr2_hdw {
unsigned int cmd_debug_write_len; //
unsigned int cmd_debug_read_len; //
- int flag_ok; // device in known good state
- int flag_disconnected; // flag_ok == 0 due to disconnect
- int flag_init_ok; // true if structure is fully initialized
- int flag_streaming_enabled; // true if streaming should be on
- int fw1_state; // current situation with fw1
+ int flag_ok; /* device in known good state */
+ int flag_disconnected; /* flag_ok == 0 due to disconnect */
+ int flag_init_ok; /* true if structure is fully initialized */
+ int flag_streaming_enabled; /* true if streaming should be on */
+ int fw1_state; /* current situation with fw1 */
+ int flag_encoder_ok; /* True if encoder is healthy */
int flag_decoder_is_tuned;
diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c
index 91f27facb..328bd1ba6 100644
--- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c
+++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c
@@ -1258,6 +1258,8 @@ int pvr2_upload_firmware2(struct pvr2_hdw *hdw)
time we configure the encoder, then we'll fully configure it. */
hdw->enc_cur_valid = 0;
+ hdw->flag_encoder_ok = 0;
+
/* First prepare firmware loading */
ret |= pvr2_write_register(hdw, 0x0048, 0xffffffff); /*interrupt mask*/
ret |= pvr2_hdw_gpio_chg_dir(hdw,0xffffffff,0x00000088); /*gpio dir*/
@@ -1356,6 +1358,7 @@ int pvr2_upload_firmware2(struct pvr2_hdw *hdw)
pvr2_trace(PVR2_TRACE_ERROR_LEGS,
"firmware2 upload post-proc failure");
} else {
+ hdw->flag_encoder_ok = !0;
hdw->subsys_enabled_mask |= (1<<PVR2_SUBSYS_B_ENC_FIRMWARE);
}
return ret;
diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c b/linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c
index 285002603..22c9db395 100644
--- a/linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c
+++ b/linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c
@@ -699,11 +699,19 @@ static void pvr2_sysfs_class_release(struct class *class)
}
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
+static void pvr2_sysfs_release(struct class_device *class_dev)
+{
+ pvr2_sysfs_trace("Releasing class_dev id=%p",class_dev);
+ kfree(class_dev);
+}
+#else
static void pvr2_sysfs_release(struct device *class_dev)
{
pvr2_sysfs_trace("Releasing class_dev id=%p",class_dev);
kfree(class_dev);
}
+#endif
static void class_dev_destroy(struct pvr2_sysfs *sfp)
@@ -906,6 +914,15 @@ struct pvr2_sysfs *pvr2_sysfs_create(struct pvr2_context *mp,
}
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
+static int pvr2_sysfs_hotplug(struct class_device *cd,char **envp,
+ int numenvp,char *buf,int size)
+{
+ /* Even though we don't do anything here, we still need this function
+ because sysfs will still try to call it. */
+ return 0;
+}
+#else
static int pvr2_sysfs_hotplug(struct device *cd,char **envp,
int numenvp,char *buf,int size)
{
@@ -913,6 +930,7 @@ static int pvr2_sysfs_hotplug(struct device *cd,char **envp,
because sysfs will still try to call it. */
return 0;
}
+#endif
struct pvr2_sysfs_class *pvr2_sysfs_class_create(void)
{
@@ -922,13 +940,15 @@ struct pvr2_sysfs_class *pvr2_sysfs_class_create(void)
pvr2_sysfs_trace("Creating pvr2_sysfs_class id=%p",clp);
clp->class.name = "pvrusb2";
clp->class.class_release = pvr2_sysfs_class_release;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,13)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
clp->class.release = pvr2_sysfs_release;
#else
clp->class.dev_release = pvr2_sysfs_release;
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16)
clp->class.hotplug = pvr2_sysfs_hotplug;
+#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
+ clp->class.uevent = pvr2_sysfs_hotplug;
#else
clp->class.dev_uevent = pvr2_sysfs_hotplug;
#endif