Skip to content

Commit facd236

Browse files
Hans VerkuilMauro Carvalho Chehab
authored andcommitted
[media] cx88: remove g_chip_ident
Remove g_chip_ident from cx88. Also remove the v4l2-chip-ident.h include. The board code used defines from v4l2-chip-ident.h to tell the driver which audio chip is used. Replace this with a cx88-specific enum. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Cc: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
1 parent 37c1d2e commit facd236

3 files changed

Lines changed: 14 additions & 27 deletions

File tree

‎drivers/media/pci/cx88/cx88-cards.c‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,7 @@ static const struct cx88_board cx88_boards[] = {
744744
.tuner_addr = ADDR_UNSET,
745745
.radio_addr = ADDR_UNSET,
746746
/* Some variants use a tda9874 and so need the tvaudio module. */
747-
.audio_chip = V4L2_IDENT_TVAUDIO,
747+
.audio_chip = CX88_AUDIO_TVAUDIO,
748748
.input = {{
749749
.type = CX88_VMUX_TELEVISION,
750750
.vmux = 0,
@@ -976,7 +976,7 @@ static const struct cx88_board cx88_boards[] = {
976976
.radio_type = UNSET,
977977
.tuner_addr = ADDR_UNSET,
978978
.radio_addr = ADDR_UNSET,
979-
.audio_chip = V4L2_IDENT_WM8775,
979+
.audio_chip = CX88_AUDIO_WM8775,
980980
.i2sinputcntl = 2,
981981
.input = {{
982982
.type = CX88_VMUX_DVB,
@@ -1014,7 +1014,7 @@ static const struct cx88_board cx88_boards[] = {
10141014
.radio_type = UNSET,
10151015
.tuner_addr = ADDR_UNSET,
10161016
.radio_addr = ADDR_UNSET,
1017-
.audio_chip = V4L2_IDENT_WM8775,
1017+
.audio_chip = CX88_AUDIO_WM8775,
10181018
.input = {{
10191019
.type = CX88_VMUX_DVB,
10201020
.vmux = 0,
@@ -1376,7 +1376,7 @@ static const struct cx88_board cx88_boards[] = {
13761376
.tuner_addr = ADDR_UNSET,
13771377
.radio_addr = ADDR_UNSET,
13781378
.tda9887_conf = TDA9887_PRESENT,
1379-
.audio_chip = V4L2_IDENT_WM8775,
1379+
.audio_chip = CX88_AUDIO_WM8775,
13801380
.input = {{
13811381
.type = CX88_VMUX_TELEVISION,
13821382
.vmux = 0,
@@ -1461,7 +1461,7 @@ static const struct cx88_board cx88_boards[] = {
14611461
.tuner_addr = ADDR_UNSET,
14621462
.radio_addr = ADDR_UNSET,
14631463
.tda9887_conf = TDA9887_PRESENT,
1464-
.audio_chip = V4L2_IDENT_WM8775,
1464+
.audio_chip = CX88_AUDIO_WM8775,
14651465
/*
14661466
* gpio0 as reported by Mike Crash <mike AT mikecrash.com>
14671467
*/
@@ -1929,7 +1929,7 @@ static const struct cx88_board cx88_boards[] = {
19291929
.tuner_addr = ADDR_UNSET,
19301930
.radio_addr = ADDR_UNSET,
19311931
.tda9887_conf = TDA9887_PRESENT,
1932-
.audio_chip = V4L2_IDENT_WM8775,
1932+
.audio_chip = CX88_AUDIO_WM8775,
19331933
/*
19341934
* GPIO0 (WINTV2000)
19351935
*

‎drivers/media/pci/cx88/cx88-video.c‎

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1353,24 +1353,12 @@ static int vidioc_s_frequency (struct file *file, void *priv,
13531353
return cx88_set_freq(core, f);
13541354
}
13551355

1356-
static int vidioc_g_chip_ident(struct file *file, void *priv,
1357-
struct v4l2_dbg_chip_ident *chip)
1358-
{
1359-
if (!v4l2_chip_match_host(&chip->match))
1360-
return -EINVAL;
1361-
chip->revision = 0;
1362-
chip->ident = V4L2_IDENT_UNKNOWN;
1363-
return 0;
1364-
}
1365-
13661356
#ifdef CONFIG_VIDEO_ADV_DEBUG
13671357
static int vidioc_g_register (struct file *file, void *fh,
13681358
struct v4l2_dbg_register *reg)
13691359
{
13701360
struct cx88_core *core = ((struct cx8800_fh*)fh)->dev->core;
13711361

1372-
if (!v4l2_chip_match_host(&reg->match))
1373-
return -EINVAL;
13741362
/* cx2388x has a 24-bit register space */
13751363
reg->val = cx_read(reg->reg & 0xffffff);
13761364
reg->size = 4;
@@ -1382,8 +1370,6 @@ static int vidioc_s_register (struct file *file, void *fh,
13821370
{
13831371
struct cx88_core *core = ((struct cx8800_fh*)fh)->dev->core;
13841372

1385-
if (!v4l2_chip_match_host(&reg->match))
1386-
return -EINVAL;
13871373
cx_write(reg->reg & 0xffffff, reg->val);
13881374
return 0;
13891375
}
@@ -1578,7 +1564,6 @@ static const struct v4l2_ioctl_ops video_ioctl_ops = {
15781564
.vidioc_s_frequency = vidioc_s_frequency,
15791565
.vidioc_subscribe_event = v4l2_ctrl_subscribe_event,
15801566
.vidioc_unsubscribe_event = v4l2_event_unsubscribe,
1581-
.vidioc_g_chip_ident = vidioc_g_chip_ident,
15821567
#ifdef CONFIG_VIDEO_ADV_DEBUG
15831568
.vidioc_g_register = vidioc_g_register,
15841569
.vidioc_s_register = vidioc_s_register,
@@ -1612,7 +1597,6 @@ static const struct v4l2_ioctl_ops vbi_ioctl_ops = {
16121597
.vidioc_s_tuner = vidioc_s_tuner,
16131598
.vidioc_g_frequency = vidioc_g_frequency,
16141599
.vidioc_s_frequency = vidioc_s_frequency,
1615-
.vidioc_g_chip_ident = vidioc_g_chip_ident,
16161600
#ifdef CONFIG_VIDEO_ADV_DEBUG
16171601
.vidioc_g_register = vidioc_g_register,
16181602
.vidioc_s_register = vidioc_s_register,
@@ -1643,7 +1627,6 @@ static const struct v4l2_ioctl_ops radio_ioctl_ops = {
16431627
.vidioc_s_frequency = vidioc_s_frequency,
16441628
.vidioc_subscribe_event = v4l2_ctrl_subscribe_event,
16451629
.vidioc_unsubscribe_event = v4l2_event_unsubscribe,
1646-
.vidioc_g_chip_ident = vidioc_g_chip_ident,
16471630
#ifdef CONFIG_VIDEO_ADV_DEBUG
16481631
.vidioc_g_register = vidioc_g_register,
16491632
.vidioc_s_register = vidioc_s_register,
@@ -1794,7 +1777,7 @@ static int cx8800_initdev(struct pci_dev *pci_dev,
17941777

17951778
/* load and configure helper modules */
17961779

1797-
if (core->board.audio_chip == V4L2_IDENT_WM8775) {
1780+
if (core->board.audio_chip == CX88_AUDIO_WM8775) {
17981781
struct i2c_board_info wm8775_info = {
17991782
.type = "wm8775",
18001783
.addr = 0x36 >> 1,
@@ -1815,7 +1798,7 @@ static int cx8800_initdev(struct pci_dev *pci_dev,
18151798
}
18161799
}
18171800

1818-
if (core->board.audio_chip == V4L2_IDENT_TVAUDIO) {
1801+
if (core->board.audio_chip == CX88_AUDIO_TVAUDIO) {
18191802
/* This probes for a tda9874 as is used on some
18201803
Pixelview Ultra boards. */
18211804
v4l2_i2c_new_subdev(&core->v4l2_dev, &core->i2c_adap,

‎drivers/media/pci/cx88/cx88.h‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
#include <media/tuner.h>
3131
#include <media/tveeprom.h>
3232
#include <media/videobuf-dma-sg.h>
33-
#include <media/v4l2-chip-ident.h>
3433
#include <media/cx2341x.h>
3534
#include <media/videobuf-dvb.h>
3635
#include <media/ir-kbd-i2c.h>
@@ -259,6 +258,11 @@ struct cx88_input {
259258
unsigned int audioroute:4;
260259
};
261260

261+
enum cx88_audio_chip {
262+
CX88_AUDIO_WM8775,
263+
CX88_AUDIO_TVAUDIO,
264+
};
265+
262266
struct cx88_board {
263267
const char *name;
264268
unsigned int tuner_type;
@@ -269,7 +273,7 @@ struct cx88_board {
269273
struct cx88_input input[MAX_CX88_INPUT];
270274
struct cx88_input radio;
271275
enum cx88_board_type mpeg;
272-
unsigned int audio_chip;
276+
enum cx88_audio_chip audio_chip;
273277
int num_frontends;
274278

275279
/* Used for I2S devices */

0 commit comments

Comments
 (0)