aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/pvrusb2/pvrusb2-hdw.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/pvrusb2/pvrusb2-hdw.c')
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-hdw.c85
1 files changed, 0 insertions, 85 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
index b0383153e3c..7c66779b1f4 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
@@ -30,8 +30,6 @@
30#include "pvrusb2-util.h" 30#include "pvrusb2-util.h"
31#include "pvrusb2-hdw.h" 31#include "pvrusb2-hdw.h"
32#include "pvrusb2-i2c-core.h" 32#include "pvrusb2-i2c-core.h"
33#include "pvrusb2-i2c-track.h"
34#include "pvrusb2-tuner.h"
35#include "pvrusb2-eeprom.h" 33#include "pvrusb2-eeprom.h"
36#include "pvrusb2-hdw-internal.h" 34#include "pvrusb2-hdw-internal.h"
37#include "pvrusb2-encoder.h" 35#include "pvrusb2-encoder.h"
@@ -313,7 +311,6 @@ static int pvr2_hdw_set_input(struct pvr2_hdw *hdw,int v);
313static void pvr2_hdw_state_sched(struct pvr2_hdw *); 311static void pvr2_hdw_state_sched(struct pvr2_hdw *);
314static int pvr2_hdw_state_eval(struct pvr2_hdw *); 312static int pvr2_hdw_state_eval(struct pvr2_hdw *);
315static void pvr2_hdw_set_cur_freq(struct pvr2_hdw *,unsigned long); 313static void pvr2_hdw_set_cur_freq(struct pvr2_hdw *,unsigned long);
316static void pvr2_hdw_worker_i2c(struct work_struct *work);
317static void pvr2_hdw_worker_poll(struct work_struct *work); 314static void pvr2_hdw_worker_poll(struct work_struct *work);
318static int pvr2_hdw_wait(struct pvr2_hdw *,int state); 315static int pvr2_hdw_wait(struct pvr2_hdw *,int state);
319static int pvr2_hdw_untrip_unlocked(struct pvr2_hdw *); 316static int pvr2_hdw_untrip_unlocked(struct pvr2_hdw *);
@@ -1676,10 +1673,6 @@ static const char *pvr2_get_state_name(unsigned int st)
1676 1673
1677static int pvr2_decoder_enable(struct pvr2_hdw *hdw,int enablefl) 1674static int pvr2_decoder_enable(struct pvr2_hdw *hdw,int enablefl)
1678{ 1675{
1679 if (hdw->decoder_ctrl) {
1680 hdw->decoder_ctrl->enable(hdw->decoder_ctrl->ctxt, enablefl);
1681 return 0;
1682 }
1683 /* Even though we really only care about the video decoder chip at 1676 /* Even though we really only care about the video decoder chip at
1684 this point, we'll broadcast stream on/off to all sub-devices 1677 this point, we'll broadcast stream on/off to all sub-devices
1685 anyway, just in case somebody else wants to hear the 1678 anyway, just in case somebody else wants to hear the
@@ -1704,21 +1697,6 @@ static int pvr2_decoder_enable(struct pvr2_hdw *hdw,int enablefl)
1704} 1697}
1705 1698
1706 1699
1707void pvr2_hdw_set_decoder(struct pvr2_hdw *hdw,struct pvr2_decoder_ctrl *ptr)
1708{
1709 if (hdw->decoder_ctrl == ptr) return;
1710 hdw->decoder_ctrl = ptr;
1711 if (hdw->decoder_ctrl && hdw->flag_decoder_missed) {
1712 hdw->flag_decoder_missed = 0;
1713 trace_stbit("flag_decoder_missed",
1714 hdw->flag_decoder_missed);
1715 pvr2_trace(PVR2_TRACE_ERROR_LEGS,
1716 "Decoder has appeared");
1717 pvr2_hdw_state_sched(hdw);
1718 }
1719}
1720
1721
1722int pvr2_hdw_get_state(struct pvr2_hdw *hdw) 1700int pvr2_hdw_get_state(struct pvr2_hdw *hdw)
1723{ 1701{
1724 return hdw->master_state; 1702 return hdw->master_state;
@@ -2052,7 +2030,6 @@ static int pvr2_hdw_load_subdev(struct pvr2_hdw *hdw,
2052 * and every other place where I can find examples of this, the 2030 * and every other place where I can find examples of this, the
2053 * "chipid" appears to just be the module name again. So here we 2031 * "chipid" appears to just be the module name again. So here we
2054 * just do the same thing. */ 2032 * just do the same thing. */
2055 hdw->i2c_adap.class = 0;
2056 if (i2ccnt == 1) { 2033 if (i2ccnt == 1) {
2057 pvr2_trace(PVR2_TRACE_INIT, 2034 pvr2_trace(PVR2_TRACE_INIT,
2058 "Module ID %u:" 2035 "Module ID %u:"
@@ -2070,7 +2047,6 @@ static int pvr2_hdw_load_subdev(struct pvr2_hdw *hdw,
2070 fname, fname, 2047 fname, fname,
2071 i2caddr); 2048 i2caddr);
2072 } 2049 }
2073 hdw->i2c_adap.class = I2C_CLASS_TV_ANALOG;
2074 2050
2075 if (!sd) { 2051 if (!sd) {
2076 pvr2_trace(PVR2_TRACE_ERROR_LEGS, 2052 pvr2_trace(PVR2_TRACE_ERROR_LEGS,
@@ -2084,11 +2060,6 @@ static int pvr2_hdw_load_subdev(struct pvr2_hdw *hdw,
2084 requires special handling. */ 2060 requires special handling. */
2085 sd->grp_id = mid; 2061 sd->grp_id = mid;
2086 2062
2087 /* If we have both old and new i2c layers enabled, make sure that
2088 old layer isn't also tracking this module. This is a debugging
2089 aid, in normal situations there's no reason for both mechanisms
2090 to be enabled. */
2091 pvr2_i2c_untrack_subdev(hdw, sd);
2092 pvr2_trace(PVR2_TRACE_INFO, "Attached sub-driver %s", fname); 2063 pvr2_trace(PVR2_TRACE_INFO, "Attached sub-driver %s", fname);
2093 2064
2094 2065
@@ -2204,7 +2175,6 @@ static void pvr2_hdw_setup_low(struct pvr2_hdw *hdw)
2204 } 2175 }
2205 2176
2206 // This step MUST happen after the earlier powerup step. 2177 // This step MUST happen after the earlier powerup step.
2207 pvr2_i2c_track_init(hdw);
2208 pvr2_i2c_core_init(hdw); 2178 pvr2_i2c_core_init(hdw);
2209 if (!pvr2_hdw_dev_ok(hdw)) return; 2179 if (!pvr2_hdw_dev_ok(hdw)) return;
2210 2180
@@ -2271,7 +2241,6 @@ static void pvr2_hdw_setup_low(struct pvr2_hdw *hdw)
2271 hdw->tuner_type); 2241 hdw->tuner_type);
2272 } 2242 }
2273 2243
2274 pvr2_i2c_core_check_stale(hdw);
2275 2244
2276 if (!pvr2_hdw_dev_ok(hdw)) return; 2245 if (!pvr2_hdw_dev_ok(hdw)) return;
2277 2246
@@ -2628,7 +2597,6 @@ struct pvr2_hdw *pvr2_hdw_create(struct usb_interface *intf,
2628 2597
2629 hdw->workqueue = create_singlethread_workqueue(hdw->name); 2598 hdw->workqueue = create_singlethread_workqueue(hdw->name);
2630 INIT_WORK(&hdw->workpoll,pvr2_hdw_worker_poll); 2599 INIT_WORK(&hdw->workpoll,pvr2_hdw_worker_poll);
2631 INIT_WORK(&hdw->worki2csync,pvr2_hdw_worker_i2c);
2632 2600
2633 pvr2_trace(PVR2_TRACE_INIT,"Driver unit number is %d, name is %s", 2601 pvr2_trace(PVR2_TRACE_INIT,"Driver unit number is %d, name is %s",
2634 hdw->unit_number,hdw->name); 2602 hdw->unit_number,hdw->name);
@@ -2731,11 +2699,7 @@ void pvr2_hdw_destroy(struct pvr2_hdw *hdw)
2731 pvr2_stream_destroy(hdw->vid_stream); 2699 pvr2_stream_destroy(hdw->vid_stream);
2732 hdw->vid_stream = NULL; 2700 hdw->vid_stream = NULL;
2733 } 2701 }
2734 if (hdw->decoder_ctrl) {
2735 hdw->decoder_ctrl->detach(hdw->decoder_ctrl->ctxt);
2736 }
2737 pvr2_i2c_core_done(hdw); 2702 pvr2_i2c_core_done(hdw);
2738 pvr2_i2c_track_done(hdw);
2739 v4l2_device_unregister(&hdw->v4l2_dev); 2703 v4l2_device_unregister(&hdw->v4l2_dev);
2740 pvr2_hdw_remove_usb_stuff(hdw); 2704 pvr2_hdw_remove_usb_stuff(hdw);
2741 mutex_lock(&pvr2_unit_mtx); do { 2705 mutex_lock(&pvr2_unit_mtx); do {
@@ -3238,12 +3202,6 @@ static int pvr2_hdw_commit_execute(struct pvr2_hdw *hdw)
3238 cx2341x_ext_ctrls(&hdw->enc_ctl_state, 0, &cs,VIDIOC_S_EXT_CTRLS); 3202 cx2341x_ext_ctrls(&hdw->enc_ctl_state, 0, &cs,VIDIOC_S_EXT_CTRLS);
3239 } 3203 }
3240 3204
3241 /* Scan i2c core at this point - before we clear all the dirty
3242 bits. Various parts of the i2c core will notice dirty bits as
3243 appropriate and arrange to broadcast or directly send updates to
3244 the client drivers in order to keep everything in sync */
3245 pvr2_i2c_core_check_stale(hdw);
3246
3247 if (hdw->active_stream_type != hdw->desired_stream_type) { 3205 if (hdw->active_stream_type != hdw->desired_stream_type) {
3248 /* Handle any side effects of stream config here */ 3206 /* Handle any side effects of stream config here */
3249 hdw->active_stream_type = hdw->desired_stream_type; 3207 hdw->active_stream_type = hdw->desired_stream_type;
@@ -3274,9 +3232,6 @@ static int pvr2_hdw_commit_execute(struct pvr2_hdw *hdw)
3274 cptr->info->clear_dirty(cptr); 3232 cptr->info->clear_dirty(cptr);
3275 } 3233 }
3276 3234
3277 /* Now execute i2c core update */
3278 pvr2_i2c_core_sync(hdw);
3279
3280 if ((hdw->pathway_state == PVR2_PATHWAY_ANALOG) && 3235 if ((hdw->pathway_state == PVR2_PATHWAY_ANALOG) &&
3281 hdw->state_encoder_run) { 3236 hdw->state_encoder_run) {
3282 /* If encoder isn't running or it can't be touched, then 3237 /* If encoder isn't running or it can't be touched, then
@@ -3305,15 +3260,6 @@ int pvr2_hdw_commit_ctl(struct pvr2_hdw *hdw)
3305} 3260}
3306 3261
3307 3262
3308static void pvr2_hdw_worker_i2c(struct work_struct *work)
3309{
3310 struct pvr2_hdw *hdw = container_of(work,struct pvr2_hdw,worki2csync);
3311 LOCK_TAKE(hdw->big_lock); do {
3312 pvr2_i2c_core_sync(hdw);
3313 } while (0); LOCK_GIVE(hdw->big_lock);
3314}
3315
3316
3317static void pvr2_hdw_worker_poll(struct work_struct *work) 3263static void pvr2_hdw_worker_poll(struct work_struct *work)
3318{ 3264{
3319 int fl = 0; 3265 int fl = 0;
@@ -3431,10 +3377,6 @@ void pvr2_hdw_trigger_module_log(struct pvr2_hdw *hdw)
3431 int nr = pvr2_hdw_get_unit_number(hdw); 3377 int nr = pvr2_hdw_get_unit_number(hdw);
3432 LOCK_TAKE(hdw->big_lock); do { 3378 LOCK_TAKE(hdw->big_lock); do {
3433 printk(KERN_INFO "pvrusb2: ================= START STATUS CARD #%d =================\n", nr); 3379 printk(KERN_INFO "pvrusb2: ================= START STATUS CARD #%d =================\n", nr);
3434 hdw->log_requested = !0;
3435 pvr2_i2c_core_check_stale(hdw);
3436 pvr2_i2c_core_sync(hdw);
3437 hdw->log_requested = 0;
3438 v4l2_device_call_all(&hdw->v4l2_dev, 0, core, log_status); 3380 v4l2_device_call_all(&hdw->v4l2_dev, 0, core, log_status);
3439 pvr2_trace(PVR2_TRACE_INFO,"cx2341x config:"); 3381 pvr2_trace(PVR2_TRACE_INFO,"cx2341x config:");
3440 cx2341x_log_status(&hdw->enc_ctl_state, "pvrusb2"); 3382 cx2341x_log_status(&hdw->enc_ctl_state, "pvrusb2");
@@ -4120,16 +4062,6 @@ int pvr2_hdw_cmd_decoder_reset(struct pvr2_hdw *hdw)
4120{ 4062{
4121 pvr2_trace(PVR2_TRACE_INIT, 4063 pvr2_trace(PVR2_TRACE_INIT,
4122 "Requesting decoder reset"); 4064 "Requesting decoder reset");
4123 if (hdw->decoder_ctrl) {
4124 if (!hdw->decoder_ctrl->force_reset) {
4125 pvr2_trace(PVR2_TRACE_INIT,
4126 "Unable to reset decoder: not implemented");
4127 return -ENOTTY;
4128 }
4129 hdw->decoder_ctrl->force_reset(hdw->decoder_ctrl->ctxt);
4130 return 0;
4131 } else {
4132 }
4133 if (hdw->decoder_client_id) { 4065 if (hdw->decoder_client_id) {
4134 v4l2_device_call_all(&hdw->v4l2_dev, hdw->decoder_client_id, 4066 v4l2_device_call_all(&hdw->v4l2_dev, hdw->decoder_client_id,
4135 core, reset, 0); 4067 core, reset, 0);
@@ -5138,7 +5070,6 @@ void pvr2_hdw_status_poll(struct pvr2_hdw *hdw)
5138 struct v4l2_tuner *vtp = &hdw->tuner_signal_info; 5070 struct v4l2_tuner *vtp = &hdw->tuner_signal_info;
5139 memset(vtp, 0, sizeof(*vtp)); 5071 memset(vtp, 0, sizeof(*vtp));
5140 hdw->tuner_signal_stale = 0; 5072 hdw->tuner_signal_stale = 0;
5141 pvr2_i2c_core_status_poll(hdw);
5142 /* Note: There apparently is no replacement for VIDIOC_CROPCAP 5073 /* Note: There apparently is no replacement for VIDIOC_CROPCAP
5143 using v4l2-subdev - therefore we can't support that AT ALL right 5074 using v4l2-subdev - therefore we can't support that AT ALL right
5144 now. (Of course, no sub-drivers seem to implement it either. 5075 now. (Of course, no sub-drivers seem to implement it either.
@@ -5253,7 +5184,6 @@ int pvr2_hdw_register_access(struct pvr2_hdw *hdw,
5253 int setFl, u64 *val_ptr) 5184 int setFl, u64 *val_ptr)
5254{ 5185{
5255#ifdef CONFIG_VIDEO_ADV_DEBUG 5186#ifdef CONFIG_VIDEO_ADV_DEBUG
5256 struct pvr2_i2c_client *cp;
5257 struct v4l2_dbg_register req; 5187 struct v4l2_dbg_register req;
5258 int stat = 0; 5188 int stat = 0;
5259 int okFl = 0; 5189 int okFl = 0;
@@ -5266,21 +5196,6 @@ int pvr2_hdw_register_access(struct pvr2_hdw *hdw,
5266 /* It would be nice to know if a sub-device answered the request */ 5196 /* It would be nice to know if a sub-device answered the request */
5267 v4l2_device_call_all(&hdw->v4l2_dev, 0, core, g_register, &req); 5197 v4l2_device_call_all(&hdw->v4l2_dev, 0, core, g_register, &req);
5268 if (!setFl) *val_ptr = req.val; 5198 if (!setFl) *val_ptr = req.val;
5269 if (!okFl) mutex_lock(&hdw->i2c_list_lock); do {
5270 list_for_each_entry(cp, &hdw->i2c_clients, list) {
5271 if (!v4l2_chip_match_i2c_client(
5272 cp->client,
5273 &req.match)) {
5274 continue;
5275 }
5276 stat = pvr2_i2c_client_cmd(
5277 cp,(setFl ? VIDIOC_DBG_S_REGISTER :
5278 VIDIOC_DBG_G_REGISTER),&req);
5279 if (!setFl) *val_ptr = req.val;
5280 okFl = !0;
5281 break;
5282 }
5283 } while (0); mutex_unlock(&hdw->i2c_list_lock);
5284 if (okFl) { 5199 if (okFl) {
5285 return stat; 5200 return stat;
5286 } 5201 }