summaryrefslogtreecommitdiff
path: root/v4l_experimental/pvrusb2
diff options
context:
space:
mode:
authorMike Isely <isely@pobox.com>2006-02-22 23:47:36 -0600
committerMike Isely <isely@pobox.com>2006-02-22 23:47:36 -0600
commiteb9221b1b87ce87b3d22458d78fa0b6d2dd848c7 (patch)
treeea2d53e41507af16937f01115cefeb43dd95da07 /v4l_experimental/pvrusb2
parente3ac0002e5f30d492444f7d6e221c634c07b8d83 (diff)
downloadmediapointer-dvb-s2-eb9221b1b87ce87b3d22458d78fa0b6d2dd848c7.tar.gz
mediapointer-dvb-s2-eb9221b1b87ce87b3d22458d78fa0b6d2dd848c7.tar.bz2
Implement LOG_STATUS in pvrusb2
From: Mike Isely <isely@pobox.com> Implement VIDIOC_LOG_STATUS ioctl() to the application. Implement generation of VIDIOC_LOG_STATUS to the modules. Implement trigger of VIDIOC_LOG_STATUS from sysfs when user cats a few key files, to help with debugging. Signed-off-by: Mike Isely <isely@pobox.com>
Diffstat (limited to 'v4l_experimental/pvrusb2')
-rw-r--r--v4l_experimental/pvrusb2/pvrusb2-hdw-internal.h4
-rw-r--r--v4l_experimental/pvrusb2/pvrusb2-hdw.c10
-rw-r--r--v4l_experimental/pvrusb2/pvrusb2-hdw.h3
-rw-r--r--v4l_experimental/pvrusb2/pvrusb2-i2c-chips-v4l2.c5
-rw-r--r--v4l_experimental/pvrusb2/pvrusb2-i2c-cmd-v4l2.c21
-rw-r--r--v4l_experimental/pvrusb2/pvrusb2-i2c-cmd-v4l2.h1
-rw-r--r--v4l_experimental/pvrusb2/pvrusb2-sysfs.c1
-rw-r--r--v4l_experimental/pvrusb2/pvrusb2-v4l2.c6
8 files changed, 50 insertions, 1 deletions
diff --git a/v4l_experimental/pvrusb2/pvrusb2-hdw-internal.h b/v4l_experimental/pvrusb2/pvrusb2-hdw-internal.h
index 9543414e5..12934d3a4 100644
--- a/v4l_experimental/pvrusb2/pvrusb2-hdw-internal.h
+++ b/v4l_experimental/pvrusb2/pvrusb2-hdw-internal.h
@@ -176,6 +176,10 @@ struct pvr2_hdw {
// Which subsystems are manipulated to enable streaming
unsigned long subsys_stream_mask;
+ // True if there is a request to trigger logging of state in each
+ // module.
+ int log_requested;
+
/* Tuner / frequency control stuff */
unsigned int tuner_type;
int tuner_updated;
diff --git a/v4l_experimental/pvrusb2/pvrusb2-hdw.c b/v4l_experimental/pvrusb2/pvrusb2-hdw.c
index 940f105c2..a2620e421 100644
--- a/v4l_experimental/pvrusb2/pvrusb2-hdw.c
+++ b/v4l_experimental/pvrusb2/pvrusb2-hdw.c
@@ -1707,6 +1707,16 @@ struct pvr2_stream *pvr2_hdw_get_video_stream(struct pvr2_hdw *hp)
}
+void pvr2_hdw_trigger_module_log(struct pvr2_hdw *hdw)
+{
+ LOCK_TAKE(hdw->big_lock); do {
+ hdw->log_requested = !0;
+ pvr2_i2c_core_check_stale(hdw);
+ hdw->log_requested = 0;
+ pvr2_i2c_core_sync(hdw);
+ } while (0); LOCK_GIVE(hdw->big_lock);
+}
+
void pvr2_hdw_cpufw_set_enabled(struct pvr2_hdw *hdw, int enable_flag)
{
int ret;
diff --git a/v4l_experimental/pvrusb2/pvrusb2-hdw.h b/v4l_experimental/pvrusb2/pvrusb2-hdw.h
index 9683d8d7c..af70b7545 100644
--- a/v4l_experimental/pvrusb2/pvrusb2-hdw.h
+++ b/v4l_experimental/pvrusb2/pvrusb2-hdw.h
@@ -390,6 +390,9 @@ struct pvr2_hdw_debug_info {
void pvr2_hdw_get_debug_info(const struct pvr2_hdw *hdw,
struct pvr2_hdw_debug_info *);
+/* Cause modules to log their state once */
+void pvr2_hdw_trigger_module_log(struct pvr2_hdw *hdw);
+
/* Cause encoder firmware to be uploaded into the device. This is normally
done autonomously, but the interface is exported here because it is also
a debugging aid. */
diff --git a/v4l_experimental/pvrusb2/pvrusb2-i2c-chips-v4l2.c b/v4l_experimental/pvrusb2/pvrusb2-i2c-chips-v4l2.c
index 6faff5276..2d97653d5 100644
--- a/v4l_experimental/pvrusb2/pvrusb2-i2c-chips-v4l2.c
+++ b/v4l_experimental/pvrusb2/pvrusb2-i2c-chips-v4l2.c
@@ -37,6 +37,7 @@
#define OP_FREQ 3
#define OP_AUDIORATE 4
#define OP_SIZE 5
+#define OP_LOG 6
static const struct pvr2_i2c_op * const ops[] = {
[OP_STANDARD] = &pvr2_i2c_op_v4l2_standard,
@@ -44,6 +45,7 @@ static const struct pvr2_i2c_op * const ops[] = {
[OP_VOLUME] = &pvr2_i2c_op_v4l2_volume,
[OP_FREQ] = &pvr2_i2c_op_v4l2_frequency,
[OP_SIZE] = &pvr2_i2c_op_v4l2_size,
+ [OP_LOG] = &pvr2_i2c_op_v4l2_log,
};
void pvr2_i2c_probe(struct pvr2_hdw *hdw,struct pvr2_i2c_client *cp)
@@ -54,7 +56,8 @@ void pvr2_i2c_probe(struct pvr2_hdw *hdw,struct pvr2_i2c_client *cp)
(1 << OP_BCSH) |
(1 << OP_VOLUME) |
(1 << OP_FREQ) |
- (1 << OP_SIZE));
+ (1 << OP_SIZE) |
+ (1 << OP_LOG));
if (id == I2C_DRIVERID_MSP3400) {
if (pvr2_i2c_msp3400_setup(hdw,cp)) {
diff --git a/v4l_experimental/pvrusb2/pvrusb2-i2c-cmd-v4l2.c b/v4l_experimental/pvrusb2/pvrusb2-i2c-cmd-v4l2.c
index 34babe0fb..69864782b 100644
--- a/v4l_experimental/pvrusb2/pvrusb2-i2c-cmd-v4l2.c
+++ b/v4l_experimental/pvrusb2/pvrusb2-i2c-cmd-v4l2.c
@@ -218,6 +218,27 @@ const struct pvr2_i2c_op pvr2_i2c_op_v4l2_size = {
};
+static void do_log(struct pvr2_hdw *hdw)
+{
+ pvr2_trace(PVR2_TRACE_CHIPS,"i2c v4l2 do_log()");
+ pvr2_i2c_core_cmd(hdw,VIDIOC_LOG_STATUS,0);
+
+}
+
+
+static int check_log(struct pvr2_hdw *hdw)
+{
+ return hdw->log_requested != 0;
+}
+
+
+const struct pvr2_i2c_op pvr2_i2c_op_v4l2_log = {
+ .check = check_log,
+ .update = do_log,
+ .name = "v4l2_log",
+};
+
+
/*
Stuff for Emacs to see, in order to encourage consistent editing style:
*** Local Variables: ***
diff --git a/v4l_experimental/pvrusb2/pvrusb2-i2c-cmd-v4l2.h b/v4l_experimental/pvrusb2/pvrusb2-i2c-cmd-v4l2.h
index 7222d780b..fa0a3af7e 100644
--- a/v4l_experimental/pvrusb2/pvrusb2-i2c-cmd-v4l2.h
+++ b/v4l_experimental/pvrusb2/pvrusb2-i2c-cmd-v4l2.h
@@ -31,6 +31,7 @@ extern const struct pvr2_i2c_op pvr2_i2c_op_v4l2_bcsh;
extern const struct pvr2_i2c_op pvr2_i2c_op_v4l2_volume;
extern const struct pvr2_i2c_op pvr2_i2c_op_v4l2_frequency;
extern const struct pvr2_i2c_op pvr2_i2c_op_v4l2_size;
+extern const struct pvr2_i2c_op pvr2_i2c_op_v4l2_log;
#endif /* __PVRUSB2_CMD_V4L2_H */
diff --git a/v4l_experimental/pvrusb2/pvrusb2-sysfs.c b/v4l_experimental/pvrusb2/pvrusb2-sysfs.c
index 17c50d31c..f665e79f9 100644
--- a/v4l_experimental/pvrusb2/pvrusb2-sysfs.c
+++ b/v4l_experimental/pvrusb2/pvrusb2-sysfs.c
@@ -766,6 +766,7 @@ static ssize_t debuginfo_show(struct class_device *class_dev,char *buf)
struct pvr2_sysfs *sfp;
sfp = (struct pvr2_sysfs *)class_dev->class_data;
if (!sfp) return -EINVAL;
+ pvr2_hdw_trigger_module_log(sfp->channel.hdw);
return pvr2_debugifc_print_info(sfp->channel.hdw,buf,PAGE_SIZE);
}
diff --git a/v4l_experimental/pvrusb2/pvrusb2-v4l2.c b/v4l_experimental/pvrusb2/pvrusb2-v4l2.c
index 4640ca726..4beea06b0 100644
--- a/v4l_experimental/pvrusb2/pvrusb2-v4l2.c
+++ b/v4l_experimental/pvrusb2/pvrusb2-v4l2.c
@@ -839,6 +839,12 @@ static int pvr2_v4l2_do_ioctl(struct inode *inode, struct file *file,
break;
}
+ case VIDIOC_LOG_STATUS:
+ {
+ pvr2_hdw_trigger_module_log(hdw);
+ break;
+ }
+
default :
ret = v4l_compat_translate_ioctl(inode,file,cmd,
arg,pvr2_v4l2_do_ioctl);