aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2013-05-26 06:56:06 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-06-21 09:30:38 -0400
commitfacd23664f1d63c33fbc6da52261c8548ed3fbd4 (patch)
treed48f7a734ea47cec17f156c124ebf67de4d7c754
parent37c1d2e4098e48d9107858246027510efcfd7774 (diff)
[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>
-rw-r--r--drivers/media/pci/cx88/cx88-cards.c12
-rw-r--r--drivers/media/pci/cx88/cx88-video.c21
-rw-r--r--drivers/media/pci/cx88/cx88.h8
3 files changed, 14 insertions, 27 deletions
diff --git a/drivers/media/pci/cx88/cx88-cards.c b/drivers/media/pci/cx88/cx88-cards.c
index a87a0e19593e..e18a7ace08b1 100644
--- a/drivers/media/pci/cx88/cx88-cards.c
+++ b/drivers/media/pci/cx88/cx88-cards.c
@@ -744,7 +744,7 @@ static const struct cx88_board cx88_boards[] = {
744 .tuner_addr = ADDR_UNSET, 744 .tuner_addr = ADDR_UNSET,
745 .radio_addr = ADDR_UNSET, 745 .radio_addr = ADDR_UNSET,
746 /* Some variants use a tda9874 and so need the tvaudio module. */ 746 /* Some variants use a tda9874 and so need the tvaudio module. */
747 .audio_chip = V4L2_IDENT_TVAUDIO, 747 .audio_chip = CX88_AUDIO_TVAUDIO,
748 .input = {{ 748 .input = {{
749 .type = CX88_VMUX_TELEVISION, 749 .type = CX88_VMUX_TELEVISION,
750 .vmux = 0, 750 .vmux = 0,
@@ -976,7 +976,7 @@ static const struct cx88_board cx88_boards[] = {
976 .radio_type = UNSET, 976 .radio_type = UNSET,
977 .tuner_addr = ADDR_UNSET, 977 .tuner_addr = ADDR_UNSET,
978 .radio_addr = ADDR_UNSET, 978 .radio_addr = ADDR_UNSET,
979 .audio_chip = V4L2_IDENT_WM8775, 979 .audio_chip = CX88_AUDIO_WM8775,
980 .i2sinputcntl = 2, 980 .i2sinputcntl = 2,
981 .input = {{ 981 .input = {{
982 .type = CX88_VMUX_DVB, 982 .type = CX88_VMUX_DVB,
@@ -1014,7 +1014,7 @@ static const struct cx88_board cx88_boards[] = {
1014 .radio_type = UNSET, 1014 .radio_type = UNSET,
1015 .tuner_addr = ADDR_UNSET, 1015 .tuner_addr = ADDR_UNSET,
1016 .radio_addr = ADDR_UNSET, 1016 .radio_addr = ADDR_UNSET,
1017 .audio_chip = V4L2_IDENT_WM8775, 1017 .audio_chip = CX88_AUDIO_WM8775,
1018 .input = {{ 1018 .input = {{
1019 .type = CX88_VMUX_DVB, 1019 .type = CX88_VMUX_DVB,
1020 .vmux = 0, 1020 .vmux = 0,
@@ -1376,7 +1376,7 @@ static const struct cx88_board cx88_boards[] = {
1376 .tuner_addr = ADDR_UNSET, 1376 .tuner_addr = ADDR_UNSET,
1377 .radio_addr = ADDR_UNSET, 1377 .radio_addr = ADDR_UNSET,
1378 .tda9887_conf = TDA9887_PRESENT, 1378 .tda9887_conf = TDA9887_PRESENT,
1379 .audio_chip = V4L2_IDENT_WM8775, 1379 .audio_chip = CX88_AUDIO_WM8775,
1380 .input = {{ 1380 .input = {{
1381 .type = CX88_VMUX_TELEVISION, 1381 .type = CX88_VMUX_TELEVISION,
1382 .vmux = 0, 1382 .vmux = 0,
@@ -1461,7 +1461,7 @@ static const struct cx88_board cx88_boards[] = {
1461 .tuner_addr = ADDR_UNSET, 1461 .tuner_addr = ADDR_UNSET,
1462 .radio_addr = ADDR_UNSET, 1462 .radio_addr = ADDR_UNSET,
1463 .tda9887_conf = TDA9887_PRESENT, 1463 .tda9887_conf = TDA9887_PRESENT,
1464 .audio_chip = V4L2_IDENT_WM8775, 1464 .audio_chip = CX88_AUDIO_WM8775,
1465 /* 1465 /*
1466 * gpio0 as reported by Mike Crash <mike AT mikecrash.com> 1466 * gpio0 as reported by Mike Crash <mike AT mikecrash.com>
1467 */ 1467 */
@@ -1929,7 +1929,7 @@ static const struct cx88_board cx88_boards[] = {
1929 .tuner_addr = ADDR_UNSET, 1929 .tuner_addr = ADDR_UNSET,
1930 .radio_addr = ADDR_UNSET, 1930 .radio_addr = ADDR_UNSET,
1931 .tda9887_conf = TDA9887_PRESENT, 1931 .tda9887_conf = TDA9887_PRESENT,
1932 .audio_chip = V4L2_IDENT_WM8775, 1932 .audio_chip = CX88_AUDIO_WM8775,
1933 /* 1933 /*
1934 * GPIO0 (WINTV2000) 1934 * GPIO0 (WINTV2000)
1935 * 1935 *
diff --git a/drivers/media/pci/cx88/cx88-video.c b/drivers/media/pci/cx88/cx88-video.c
index c7a9be1065c0..5b26ece4aea5 100644
--- a/drivers/media/pci/cx88/cx88-video.c
+++ b/drivers/media/pci/cx88/cx88-video.c
@@ -1353,24 +1353,12 @@ static int vidioc_s_frequency (struct file *file, void *priv,
1353 return cx88_set_freq(core, f); 1353 return cx88_set_freq(core, f);
1354} 1354}
1355 1355
1356static 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
1366#ifdef CONFIG_VIDEO_ADV_DEBUG 1356#ifdef CONFIG_VIDEO_ADV_DEBUG
1367static int vidioc_g_register (struct file *file, void *fh, 1357static int vidioc_g_register (struct file *file, void *fh,
1368 struct v4l2_dbg_register *reg) 1358 struct v4l2_dbg_register *reg)
1369{ 1359{
1370 struct cx88_core *core = ((struct cx8800_fh*)fh)->dev->core; 1360 struct cx88_core *core = ((struct cx8800_fh*)fh)->dev->core;
1371 1361
1372 if (!v4l2_chip_match_host(&reg->match))
1373 return -EINVAL;
1374 /* cx2388x has a 24-bit register space */ 1362 /* cx2388x has a 24-bit register space */
1375 reg->val = cx_read(reg->reg & 0xffffff); 1363 reg->val = cx_read(reg->reg & 0xffffff);
1376 reg->size = 4; 1364 reg->size = 4;
@@ -1382,8 +1370,6 @@ static int vidioc_s_register (struct file *file, void *fh,
1382{ 1370{
1383 struct cx88_core *core = ((struct cx8800_fh*)fh)->dev->core; 1371 struct cx88_core *core = ((struct cx8800_fh*)fh)->dev->core;
1384 1372
1385 if (!v4l2_chip_match_host(&reg->match))
1386 return -EINVAL;
1387 cx_write(reg->reg & 0xffffff, reg->val); 1373 cx_write(reg->reg & 0xffffff, reg->val);
1388 return 0; 1374 return 0;
1389} 1375}
@@ -1578,7 +1564,6 @@ static const struct v4l2_ioctl_ops video_ioctl_ops = {
1578 .vidioc_s_frequency = vidioc_s_frequency, 1564 .vidioc_s_frequency = vidioc_s_frequency,
1579 .vidioc_subscribe_event = v4l2_ctrl_subscribe_event, 1565 .vidioc_subscribe_event = v4l2_ctrl_subscribe_event,
1580 .vidioc_unsubscribe_event = v4l2_event_unsubscribe, 1566 .vidioc_unsubscribe_event = v4l2_event_unsubscribe,
1581 .vidioc_g_chip_ident = vidioc_g_chip_ident,
1582#ifdef CONFIG_VIDEO_ADV_DEBUG 1567#ifdef CONFIG_VIDEO_ADV_DEBUG
1583 .vidioc_g_register = vidioc_g_register, 1568 .vidioc_g_register = vidioc_g_register,
1584 .vidioc_s_register = vidioc_s_register, 1569 .vidioc_s_register = vidioc_s_register,
@@ -1612,7 +1597,6 @@ static const struct v4l2_ioctl_ops vbi_ioctl_ops = {
1612 .vidioc_s_tuner = vidioc_s_tuner, 1597 .vidioc_s_tuner = vidioc_s_tuner,
1613 .vidioc_g_frequency = vidioc_g_frequency, 1598 .vidioc_g_frequency = vidioc_g_frequency,
1614 .vidioc_s_frequency = vidioc_s_frequency, 1599 .vidioc_s_frequency = vidioc_s_frequency,
1615 .vidioc_g_chip_ident = vidioc_g_chip_ident,
1616#ifdef CONFIG_VIDEO_ADV_DEBUG 1600#ifdef CONFIG_VIDEO_ADV_DEBUG
1617 .vidioc_g_register = vidioc_g_register, 1601 .vidioc_g_register = vidioc_g_register,
1618 .vidioc_s_register = vidioc_s_register, 1602 .vidioc_s_register = vidioc_s_register,
@@ -1643,7 +1627,6 @@ static const struct v4l2_ioctl_ops radio_ioctl_ops = {
1643 .vidioc_s_frequency = vidioc_s_frequency, 1627 .vidioc_s_frequency = vidioc_s_frequency,
1644 .vidioc_subscribe_event = v4l2_ctrl_subscribe_event, 1628 .vidioc_subscribe_event = v4l2_ctrl_subscribe_event,
1645 .vidioc_unsubscribe_event = v4l2_event_unsubscribe, 1629 .vidioc_unsubscribe_event = v4l2_event_unsubscribe,
1646 .vidioc_g_chip_ident = vidioc_g_chip_ident,
1647#ifdef CONFIG_VIDEO_ADV_DEBUG 1630#ifdef CONFIG_VIDEO_ADV_DEBUG
1648 .vidioc_g_register = vidioc_g_register, 1631 .vidioc_g_register = vidioc_g_register,
1649 .vidioc_s_register = vidioc_s_register, 1632 .vidioc_s_register = vidioc_s_register,
@@ -1794,7 +1777,7 @@ static int cx8800_initdev(struct pci_dev *pci_dev,
1794 1777
1795 /* load and configure helper modules */ 1778 /* load and configure helper modules */
1796 1779
1797 if (core->board.audio_chip == V4L2_IDENT_WM8775) { 1780 if (core->board.audio_chip == CX88_AUDIO_WM8775) {
1798 struct i2c_board_info wm8775_info = { 1781 struct i2c_board_info wm8775_info = {
1799 .type = "wm8775", 1782 .type = "wm8775",
1800 .addr = 0x36 >> 1, 1783 .addr = 0x36 >> 1,
@@ -1815,7 +1798,7 @@ static int cx8800_initdev(struct pci_dev *pci_dev,
1815 } 1798 }
1816 } 1799 }
1817 1800
1818 if (core->board.audio_chip == V4L2_IDENT_TVAUDIO) { 1801 if (core->board.audio_chip == CX88_AUDIO_TVAUDIO) {
1819 /* This probes for a tda9874 as is used on some 1802 /* This probes for a tda9874 as is used on some
1820 Pixelview Ultra boards. */ 1803 Pixelview Ultra boards. */
1821 v4l2_i2c_new_subdev(&core->v4l2_dev, &core->i2c_adap, 1804 v4l2_i2c_new_subdev(&core->v4l2_dev, &core->i2c_adap,
diff --git a/drivers/media/pci/cx88/cx88.h b/drivers/media/pci/cx88/cx88.h
index 51ce2c0e8bc1..afe0eaea81b4 100644
--- a/drivers/media/pci/cx88/cx88.h
+++ b/drivers/media/pci/cx88/cx88.h
@@ -30,7 +30,6 @@
30#include <media/tuner.h> 30#include <media/tuner.h>
31#include <media/tveeprom.h> 31#include <media/tveeprom.h>
32#include <media/videobuf-dma-sg.h> 32#include <media/videobuf-dma-sg.h>
33#include <media/v4l2-chip-ident.h>
34#include <media/cx2341x.h> 33#include <media/cx2341x.h>
35#include <media/videobuf-dvb.h> 34#include <media/videobuf-dvb.h>
36#include <media/ir-kbd-i2c.h> 35#include <media/ir-kbd-i2c.h>
@@ -259,6 +258,11 @@ struct cx88_input {
259 unsigned int audioroute:4; 258 unsigned int audioroute:4;
260}; 259};
261 260
261enum cx88_audio_chip {
262 CX88_AUDIO_WM8775,
263 CX88_AUDIO_TVAUDIO,
264};
265
262struct cx88_board { 266struct cx88_board {
263 const char *name; 267 const char *name;
264 unsigned int tuner_type; 268 unsigned int tuner_type;
@@ -269,7 +273,7 @@ struct cx88_board {
269 struct cx88_input input[MAX_CX88_INPUT]; 273 struct cx88_input input[MAX_CX88_INPUT];
270 struct cx88_input radio; 274 struct cx88_input radio;
271 enum cx88_board_type mpeg; 275 enum cx88_board_type mpeg;
272 unsigned int audio_chip; 276 enum cx88_audio_chip audio_chip;
273 int num_frontends; 277 int num_frontends;
274 278
275 /* Used for I2S devices */ 279 /* Used for I2S devices */