Skip to content

Commit

Permalink
V4L/DVB (11176): pvrusb2: Tie in wm8775 sub-device handling
Browse files Browse the repository at this point in the history
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Mike Isely authored and Mauro Carvalho Chehab committed Mar 30, 2009
1 parent edb9dcb commit 5f6dae8
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 1 deletion.
1 change: 1 addition & 0 deletions drivers/media/video/pvrusb2/pvrusb2-devattr.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#define PVR2_CLIENT_ID_SAA7115 3
#define PVR2_CLIENT_ID_TUNER 4
#define PVR2_CLIENT_ID_CS53132A 5
#define PVR2_CLIENT_ID_WM8775 6

struct pvr2_device_client_desc {
/* One ovr PVR2_CLIENT_ID_xxxx */
Expand Down
4 changes: 3 additions & 1 deletion drivers/media/video/pvrusb2/pvrusb2-hdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include "pvrusb2-encoder.h"
#include "pvrusb2-debug.h"
#include "pvrusb2-fx2-cmd.h"
#include "pvrusb2-wm8775.h"

#define TV_MIN_FREQ 55250000L
#define TV_MAX_FREQ 850000000L
Expand Down Expand Up @@ -109,7 +110,7 @@ typedef void (*pvr2_subdev_update_func)(struct pvr2_hdw *,
struct v4l2_subdev *);

static const pvr2_subdev_update_func pvr2_module_update_functions[] = {
/* ????? */
[PVR2_CLIENT_ID_WM8775] = pvr2_wm8775_update,
};

static const char *module_names[] = {
Expand All @@ -118,6 +119,7 @@ static const char *module_names[] = {
[PVR2_CLIENT_ID_SAA7115] = "saa7115",
[PVR2_CLIENT_ID_TUNER] = "tuner",
[PVR2_CLIENT_ID_CS53132A] = "cs53132a",
[PVR2_CLIENT_ID_WM8775] = "wm8775",
};


Expand Down
26 changes: 26 additions & 0 deletions drivers/media/video/pvrusb2/pvrusb2-wm8775.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
#include <linux/errno.h>
#include <linux/slab.h>



struct pvr2_v4l_wm8775 {
struct pvr2_i2c_handler handler;
struct pvr2_i2c_client *client;
Expand Down Expand Up @@ -158,6 +160,30 @@ int pvr2_i2c_wm8775_setup(struct pvr2_hdw *hdw,struct pvr2_i2c_client *cp)
}


void pvr2_wm8775_update(struct pvr2_hdw *hdw, struct v4l2_subdev *sd)
{
if (hdw->input_dirty) {
struct v4l2_routing route;

memset(&route, 0, sizeof(route));

switch (hdw->input_val) {
case PVR2_CVAL_INPUT_RADIO:
route.input = 1;
break;
default:
/* All other cases just use the second input */
route.input = 2;
break;
}
pvr2_trace(PVR2_TRACE_CHIPS, "subdev wm8775"
" set_input(val=%d route=0x%x)",
hdw->input_val, route.input);

sd->ops->audio->s_routing(sd, &route);
}
}



/*
Expand Down
3 changes: 3 additions & 0 deletions drivers/media/video/pvrusb2/pvrusb2-wm8775.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
#include "pvrusb2-i2c-track.h"

int pvr2_i2c_wm8775_setup(struct pvr2_hdw *,struct pvr2_i2c_client *);
#include "pvrusb2-hdw-internal.h"

void pvr2_wm8775_update(struct pvr2_hdw *, struct v4l2_subdev *sd);


#endif /* __PVRUSB2_WM8775_H */
Expand Down

0 comments on commit 5f6dae8

Please sign in to comment.