diff options
Diffstat (limited to 'drivers/media/video/tvaudio.c')
-rw-r--r-- | drivers/media/video/tvaudio.c | 44 |
1 files changed, 6 insertions, 38 deletions
diff --git a/drivers/media/video/tvaudio.c b/drivers/media/video/tvaudio.c index 226bf3565ac9..0869bafc2b56 100644 --- a/drivers/media/video/tvaudio.c +++ b/drivers/media/video/tvaudio.c | |||
@@ -35,7 +35,7 @@ | |||
35 | #include <media/tvaudio.h> | 35 | #include <media/tvaudio.h> |
36 | #include <media/v4l2-device.h> | 36 | #include <media/v4l2-device.h> |
37 | #include <media/v4l2-chip-ident.h> | 37 | #include <media/v4l2-chip-ident.h> |
38 | #include <media/v4l2-i2c-drv-legacy.h> | 38 | #include <media/v4l2-i2c-drv.h> |
39 | 39 | ||
40 | #include <media/i2c-addr.h> | 40 | #include <media/i2c-addr.h> |
41 | 41 | ||
@@ -136,20 +136,6 @@ static inline struct CHIPSTATE *to_state(struct v4l2_subdev *sd) | |||
136 | return container_of(sd, struct CHIPSTATE, sd); | 136 | return container_of(sd, struct CHIPSTATE, sd); |
137 | } | 137 | } |
138 | 138 | ||
139 | /* ---------------------------------------------------------------------- */ | ||
140 | /* i2c addresses */ | ||
141 | |||
142 | static unsigned short normal_i2c[] = { | ||
143 | I2C_ADDR_TDA8425 >> 1, | ||
144 | I2C_ADDR_TEA6300 >> 1, | ||
145 | I2C_ADDR_TEA6420 >> 1, | ||
146 | I2C_ADDR_TDA9840 >> 1, | ||
147 | I2C_ADDR_TDA985x_L >> 1, | ||
148 | I2C_ADDR_TDA985x_H >> 1, | ||
149 | I2C_ADDR_TDA9874 >> 1, | ||
150 | I2C_ADDR_PIC16C54 >> 1, | ||
151 | I2C_CLIENT_END }; | ||
152 | I2C_CLIENT_INSMOD; | ||
153 | 139 | ||
154 | /* ---------------------------------------------------------------------- */ | 140 | /* ---------------------------------------------------------------------- */ |
155 | /* i2c I/O functions */ | 141 | /* i2c I/O functions */ |
@@ -1795,17 +1781,18 @@ static int tvaudio_queryctrl(struct v4l2_subdev *sd, struct v4l2_queryctrl *qc) | |||
1795 | return -EINVAL; | 1781 | return -EINVAL; |
1796 | } | 1782 | } |
1797 | 1783 | ||
1798 | static int tvaudio_s_routing(struct v4l2_subdev *sd, const struct v4l2_routing *rt) | 1784 | static int tvaudio_s_routing(struct v4l2_subdev *sd, |
1785 | u32 input, u32 output, u32 config) | ||
1799 | { | 1786 | { |
1800 | struct CHIPSTATE *chip = to_state(sd); | 1787 | struct CHIPSTATE *chip = to_state(sd); |
1801 | struct CHIPDESC *desc = chip->desc; | 1788 | struct CHIPDESC *desc = chip->desc; |
1802 | 1789 | ||
1803 | if (!(desc->flags & CHIP_HAS_INPUTSEL)) | 1790 | if (!(desc->flags & CHIP_HAS_INPUTSEL)) |
1804 | return 0; | 1791 | return 0; |
1805 | if (rt->input >= 4) | 1792 | if (input >= 4) |
1806 | return -EINVAL; | 1793 | return -EINVAL; |
1807 | /* There are four inputs: tuner, radio, extern and intern. */ | 1794 | /* There are four inputs: tuner, radio, extern and intern. */ |
1808 | chip->input = rt->input; | 1795 | chip->input = input; |
1809 | if (chip->muted) | 1796 | if (chip->muted) |
1810 | return 0; | 1797 | return 0; |
1811 | chip_write_masked(chip, desc->inputreg, | 1798 | chip_write_masked(chip, desc->inputreg, |
@@ -1918,11 +1905,6 @@ static int tvaudio_g_chip_ident(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ide | |||
1918 | return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_TVAUDIO, 0); | 1905 | return v4l2_chip_ident_i2c_client(client, chip, V4L2_IDENT_TVAUDIO, 0); |
1919 | } | 1906 | } |
1920 | 1907 | ||
1921 | static int tvaudio_command(struct i2c_client *client, unsigned cmd, void *arg) | ||
1922 | { | ||
1923 | return v4l2_subdev_command(i2c_get_clientdata(client), cmd, arg); | ||
1924 | } | ||
1925 | |||
1926 | /* ----------------------------------------------------------------------- */ | 1908 | /* ----------------------------------------------------------------------- */ |
1927 | 1909 | ||
1928 | static const struct v4l2_subdev_core_ops tvaudio_core_ops = { | 1910 | static const struct v4l2_subdev_core_ops tvaudio_core_ops = { |
@@ -1930,12 +1912,12 @@ static const struct v4l2_subdev_core_ops tvaudio_core_ops = { | |||
1930 | .queryctrl = tvaudio_queryctrl, | 1912 | .queryctrl = tvaudio_queryctrl, |
1931 | .g_ctrl = tvaudio_g_ctrl, | 1913 | .g_ctrl = tvaudio_g_ctrl, |
1932 | .s_ctrl = tvaudio_s_ctrl, | 1914 | .s_ctrl = tvaudio_s_ctrl, |
1915 | .s_std = tvaudio_s_std, | ||
1933 | }; | 1916 | }; |
1934 | 1917 | ||
1935 | static const struct v4l2_subdev_tuner_ops tvaudio_tuner_ops = { | 1918 | static const struct v4l2_subdev_tuner_ops tvaudio_tuner_ops = { |
1936 | .s_radio = tvaudio_s_radio, | 1919 | .s_radio = tvaudio_s_radio, |
1937 | .s_frequency = tvaudio_s_frequency, | 1920 | .s_frequency = tvaudio_s_frequency, |
1938 | .s_std = tvaudio_s_std, | ||
1939 | .s_tuner = tvaudio_s_tuner, | 1921 | .s_tuner = tvaudio_s_tuner, |
1940 | .s_tuner = tvaudio_g_tuner, | 1922 | .s_tuner = tvaudio_g_tuner, |
1941 | }; | 1923 | }; |
@@ -2088,17 +2070,6 @@ static int tvaudio_remove(struct i2c_client *client) | |||
2088 | return 0; | 2070 | return 0; |
2089 | } | 2071 | } |
2090 | 2072 | ||
2091 | static int tvaudio_legacy_probe(struct i2c_adapter *adap) | ||
2092 | { | ||
2093 | /* don't attach on saa7146 based cards, | ||
2094 | because dedicated drivers are used */ | ||
2095 | if ((adap->id == I2C_HW_SAA7146)) | ||
2096 | return 0; | ||
2097 | if (adap->class & I2C_CLASS_TV_ANALOG) | ||
2098 | return 1; | ||
2099 | return 0; | ||
2100 | } | ||
2101 | |||
2102 | /* This driver supports many devices and the idea is to let the driver | 2073 | /* This driver supports many devices and the idea is to let the driver |
2103 | detect which device is present. So rather than listing all supported | 2074 | detect which device is present. So rather than listing all supported |
2104 | devices here, we pretend to support a single, fake device type. */ | 2075 | devices here, we pretend to support a single, fake device type. */ |
@@ -2110,10 +2081,7 @@ MODULE_DEVICE_TABLE(i2c, tvaudio_id); | |||
2110 | 2081 | ||
2111 | static struct v4l2_i2c_driver_data v4l2_i2c_data = { | 2082 | static struct v4l2_i2c_driver_data v4l2_i2c_data = { |
2112 | .name = "tvaudio", | 2083 | .name = "tvaudio", |
2113 | .driverid = I2C_DRIVERID_TVAUDIO, | ||
2114 | .command = tvaudio_command, | ||
2115 | .probe = tvaudio_probe, | 2084 | .probe = tvaudio_probe, |
2116 | .remove = tvaudio_remove, | 2085 | .remove = tvaudio_remove, |
2117 | .legacy_probe = tvaudio_legacy_probe, | ||
2118 | .id_table = tvaudio_id, | 2086 | .id_table = tvaudio_id, |
2119 | }; | 2087 | }; |