From eebe7e1788bdb98e2abbd035647864e70f2ac345 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Mon, 9 Jan 2006 15:25:15 -0200 Subject: [PATCH] --- yaml --- r: 17292 b: refs/heads/master c: cd43c3f60b73512744bb22fe27a266f611466827 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/media/video/tda9887.c | 2 +- trunk/drivers/media/video/tuner-core.c | 35 ++++++++++++++++++++++++++ 3 files changed, 37 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index f5c56bc4f564..b828b63f4b03 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 7865c44d8ae832d6fb6522862268c7bd7814fd44 +refs/heads/master: cd43c3f60b73512744bb22fe27a266f611466827 diff --git a/trunk/drivers/media/video/tda9887.c b/trunk/drivers/media/video/tda9887.c index 93bf10436b82..ae4029a07449 100644 --- a/trunk/drivers/media/video/tda9887.c +++ b/trunk/drivers/media/video/tda9887.c @@ -796,7 +796,7 @@ tda9887_command(struct i2c_client *client, unsigned int cmd, void *arg) } case VIDIOC_LOG_STATUS: { - tda9887_info("Data bytes: b=%02x c=%02x e=%02x\n", t->data[1], t->data[2], t->data[3]); + tda9887_info("Data bytes: b=0x%02x c=0x%02x e=0x%02x\n", t->data[1], t->data[2], t->data[3]); break; } default: diff --git a/trunk/drivers/media/video/tuner-core.c b/trunk/drivers/media/video/tuner-core.c index c13c7b95ef35..ae76113886fd 100644 --- a/trunk/drivers/media/video/tuner-core.c +++ b/trunk/drivers/media/video/tuner-core.c @@ -475,6 +475,38 @@ static inline int check_v4l2(struct tuner *t) return 0; } +static void tuner_status(struct i2c_client *client) +{ + struct tuner *t = i2c_get_clientdata(client); + unsigned long freq, freq_fraction; + const char *p; + + switch (t->mode) { + case V4L2_TUNER_RADIO: p = "radio"; break; + case V4L2_TUNER_ANALOG_TV: p = "analog TV"; break; + case V4L2_TUNER_DIGITAL_TV: p = "digital TV"; break; + default: p = "undefined"; break; + } + if (t->mode == V4L2_TUNER_RADIO) { + freq = t->freq / 16000; + freq_fraction = (t->freq % 16000) * 100 / 16000; + } else { + freq = t->freq / 16; + freq_fraction = (t->freq % 16) * 100 / 16; + } + tuner_info("Tuner mode: %s\n", p); + tuner_info("Frequency: %lu.%02lu MHz\n", freq, freq_fraction); + tuner_info("Standard: 0x%08llx\n", t->std); + if (t->mode == V4L2_TUNER_RADIO) { + if (t->has_signal) { + tuner_info("Signal strength: %d\n", t->has_signal(client)); + } + if (t->is_stereo) { + tuner_info("Stereo: %s\n", t->is_stereo(client) ? "yes" : "no"); + } + } +} + static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg) { struct tuner *t = i2c_get_clientdata(client); @@ -708,6 +740,9 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg) } break; } + case VIDIOC_LOG_STATUS: + tuner_status(client); + break; default: tuner_dbg("Unimplemented IOCTL 0x%08x(dir=%d,tp='%c',nr=%d,sz=%d)\n", cmd, _IOC_DIR(cmd), _IOC_TYPE(cmd),