Skip to content

Commit

Permalink
V4L/DVB (4757): Cx88: determine whether or not to use external adc
Browse files Browse the repository at this point in the history
Some cx88-blackbird boards use an external adc, but not necessarily
for all inputs.  Thus, this needs to be configurable on the card level
for each input.
This patch allows for the usage of the external adc to be determined
by a bit setting in the cx88_input struct for cards based on the cx88
blackbird design.

Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
  • Loading branch information
Michael Krufky authored and Mauro Carvalho Chehab committed Dec 10, 2006
1 parent 5b26c82 commit f24546a
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 13 deletions.
16 changes: 16 additions & 0 deletions drivers/media/video/cx88/cx88-cards.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,18 +281,22 @@ struct cx88_board cx88_boards[] = {
.type = CX88_VMUX_TELEVISION,
.vmux = 0,
.gpio0 = 0x0000bde2,
.extadc = 1,
},{
.type = CX88_VMUX_COMPOSITE1,
.vmux = 1,
.gpio0 = 0x0000bde6,
.extadc = 1,
},{
.type = CX88_VMUX_SVIDEO,
.vmux = 2,
.gpio0 = 0x0000bde6,
.extadc = 1,
}},
.radio = {
.type = CX88_RADIO,
.gpio0 = 0x0000bd62,
.extadc = 1,
},
.mpeg = CX88_MPEG_BLACKBIRD,
},
Expand Down Expand Up @@ -523,6 +527,7 @@ struct cx88_board cx88_boards[] = {
.input = {{
.type = CX88_VMUX_TELEVISION,
.vmux = 0,
.extadc = 1,
}},
.mpeg = CX88_MPEG_BLACKBIRD,
},
Expand Down Expand Up @@ -646,18 +651,22 @@ struct cx88_board cx88_boards[] = {
.type = CX88_VMUX_TELEVISION,
.vmux = 0,
.gpio0 = 0x00009d80,
.extadc = 1,
},{
.type = CX88_VMUX_COMPOSITE1,
.vmux = 1,
.gpio0 = 0x00009d76,
.extadc = 1,
},{
.type = CX88_VMUX_SVIDEO,
.vmux = 2,
.gpio0 = 0x00009d76,
.extadc = 1,
}},
.radio = {
.type = CX88_RADIO,
.gpio0 = 0x00009d00,
.extadc = 1,
},
.mpeg = CX88_MPEG_BLACKBIRD,
},
Expand Down Expand Up @@ -790,19 +799,23 @@ struct cx88_board cx88_boards[] = {
.type = CX88_VMUX_COMPOSITE1,
.vmux = 0,
.gpio0 = 0x0000cd73,
.extadc = 1,
},{
.type = CX88_VMUX_SVIDEO,
.vmux = 1,
.gpio0 = 0x0000cd73,
.extadc = 1,
},{
.type = CX88_VMUX_TELEVISION,
.vmux = 3,
.gpio0 = 0x0000cdb3,
.extadc = 1,
}},
.radio = {
.type = CX88_RADIO,
.vmux = 2,
.gpio0 = 0x0000cdf3,
.extadc = 1,
},
.mpeg = CX88_MPEG_BLACKBIRD,
},
Expand Down Expand Up @@ -1293,14 +1306,17 @@ struct cx88_board cx88_boards[] = {
.type = CX88_VMUX_TELEVISION,
.vmux = 0,
.gpio0 = 0xe780,
.extadc = 1,
},{
.type = CX88_VMUX_COMPOSITE1,
.vmux = 1,
.gpio0 = 0xe780,
.extadc = 1,
},{
.type = CX88_VMUX_SVIDEO,
.vmux = 2,
.gpio0 = 0xe780,
.extadc = 1,
}},
/* fixme: Add radio support */
.mpeg = CX88_MPEG_DVB | CX88_MPEG_BLACKBIRD,
Expand Down
13 changes: 0 additions & 13 deletions drivers/media/video/cx88/cx88-tvaudio.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,19 +143,6 @@ static void set_audio_finish(struct cx88_core *core, u32 ctl)
cx88_start_audio_dma(core);

if (cx88_boards[core->board].mpeg & CX88_MPEG_BLACKBIRD) {
/* sets sound input from external adc */
switch (core->board) {
case CX88_BOARD_HAUPPAUGE_ROSLYN:
case CX88_BOARD_KWORLD_MCE200_DELUXE:
case CX88_BOARD_KWORLD_HARDWARE_MPEG_TV_XPERT:
case CX88_BOARD_PIXELVIEW_PLAYTV_P7000:
case CX88_BOARD_ASUS_PVR_416:
cx_clear(AUD_CTL, EN_I2SIN_ENABLE);
break;
default:
cx_set(AUD_CTL, EN_I2SIN_ENABLE);
}

cx_write(AUD_I2SINPUTCNTL, 4);
cx_write(AUD_BAUDRATE, 1);
/* 'pass-thru mode': this enables the i2s output to the mpeg encoder */
Expand Down
8 changes: 8 additions & 0 deletions drivers/media/video/cx88/cx88-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,14 @@ static int video_mux(struct cx88_core *core, unsigned int input)
cx_clear(MO_FILTER_ODD, 0x00002020);
break;
}

if (cx88_boards[core->board].mpeg & CX88_MPEG_BLACKBIRD) {
/* sets sound input from external adc */
if (INPUT(input)->extadc)
cx_set(AUD_CTL, EN_I2SIN_ENABLE);
else
cx_clear(AUD_CTL, EN_I2SIN_ENABLE);
}
return 0;
}

Expand Down
1 change: 1 addition & 0 deletions drivers/media/video/cx88/cx88.h
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ struct cx88_input {
enum cx88_itype type;
unsigned int vmux;
u32 gpio0, gpio1, gpio2, gpio3;
unsigned int extadc:1;
};

struct cx88_board {
Expand Down

0 comments on commit f24546a

Please sign in to comment.