diff options
| -rw-r--r-- | drivers/media/video/msp3400.c | 76 |
1 files changed, 20 insertions, 56 deletions
diff --git a/drivers/media/video/msp3400.c b/drivers/media/video/msp3400.c index 6cff06a7eab7..546e3f0067fe 100644 --- a/drivers/media/video/msp3400.c +++ b/drivers/media/video/msp3400.c | |||
| @@ -45,7 +45,6 @@ | |||
| 45 | #include <linux/errno.h> | 45 | #include <linux/errno.h> |
| 46 | #include <linux/slab.h> | 46 | #include <linux/slab.h> |
| 47 | #include <linux/i2c.h> | 47 | #include <linux/i2c.h> |
| 48 | #include <linux/videodev.h> | ||
| 49 | #include <linux/init.h> | 48 | #include <linux/init.h> |
| 50 | #include <linux/smp_lock.h> | 49 | #include <linux/smp_lock.h> |
| 51 | #include <linux/kthread.h> | 50 | #include <linux/kthread.h> |
| @@ -53,9 +52,26 @@ | |||
| 53 | #include <asm/semaphore.h> | 52 | #include <asm/semaphore.h> |
| 54 | #include <asm/pgtable.h> | 53 | #include <asm/pgtable.h> |
| 55 | 54 | ||
| 55 | #include <linux/videodev.h> | ||
| 56 | #include <media/audiochip.h> | 56 | #include <media/audiochip.h> |
| 57 | #include "msp3400.h" | 57 | #include "msp3400.h" |
| 58 | 58 | ||
| 59 | /* ---------------------------------------------------------------------- */ | ||
| 60 | |||
| 61 | #define I2C_MSP3400C 0x80 | ||
| 62 | #define I2C_MSP3400C_ALT 0x88 | ||
| 63 | |||
| 64 | #define I2C_MSP3400C_DEM 0x10 | ||
| 65 | #define I2C_MSP3400C_DFP 0x12 | ||
| 66 | |||
| 67 | /* Addresses to scan */ | ||
| 68 | static unsigned short normal_i2c[] = { | ||
| 69 | I2C_MSP3400C >> 1, | ||
| 70 | I2C_MSP3400C_ALT >> 1, | ||
| 71 | I2C_CLIENT_END | ||
| 72 | }; | ||
| 73 | I2C_CLIENT_INSMOD; | ||
| 74 | |||
| 59 | #define msp3400_dbg(fmt, arg...) \ | 75 | #define msp3400_dbg(fmt, arg...) \ |
| 60 | do { \ | 76 | do { \ |
| 61 | if (debug) \ | 77 | if (debug) \ |
| @@ -180,21 +196,6 @@ MODULE_PARM_DESC(standard, "Specify audio standard: 32 = NTSC, 64 = radio, Defau | |||
| 180 | MODULE_PARM_DESC(amsound, "Hardwire AM sound at 6.5Hz (France), FM can autoscan"); | 196 | MODULE_PARM_DESC(amsound, "Hardwire AM sound at 6.5Hz (France), FM can autoscan"); |
| 181 | MODULE_PARM_DESC(dolby, "Activates Dolby processsing"); | 197 | MODULE_PARM_DESC(dolby, "Activates Dolby processsing"); |
| 182 | 198 | ||
| 183 | /* ---------------------------------------------------------------------- */ | ||
| 184 | |||
| 185 | #define I2C_MSP3400C 0x80 | ||
| 186 | #define I2C_MSP3400C_ALT 0x88 | ||
| 187 | |||
| 188 | #define I2C_MSP3400C_DEM 0x10 | ||
| 189 | #define I2C_MSP3400C_DFP 0x12 | ||
| 190 | |||
| 191 | /* Addresses to scan */ | ||
| 192 | static unsigned short normal_i2c[] = { | ||
| 193 | I2C_MSP3400C >> 1, | ||
| 194 | I2C_MSP3400C_ALT >> 1, | ||
| 195 | I2C_CLIENT_END | ||
| 196 | }; | ||
| 197 | I2C_CLIENT_INSMOD; | ||
| 198 | 199 | ||
| 199 | MODULE_DESCRIPTION("device driver for msp34xx TV sound processor"); | 200 | MODULE_DESCRIPTION("device driver for msp34xx TV sound processor"); |
| 200 | MODULE_AUTHOR("Gerd Knorr"); | 201 | MODULE_AUTHOR("Gerd Knorr"); |
| @@ -713,8 +714,6 @@ msp3400c_print_mode(struct i2c_client *client) | |||
| 713 | } | 714 | } |
| 714 | } | 715 | } |
| 715 | 716 | ||
| 716 | #define MSP3400_MAX 4 | ||
| 717 | static struct i2c_client *msps[MSP3400_MAX]; | ||
| 718 | static void msp3400c_restore_dfp(struct i2c_client *client) | 717 | static void msp3400c_restore_dfp(struct i2c_client *client) |
| 719 | { | 718 | { |
| 720 | struct msp3400c *msp = i2c_get_clientdata(client); | 719 | struct msp3400c *msp = i2c_get_clientdata(client); |
| @@ -1563,40 +1562,6 @@ static void msp_wake_thread(struct i2c_client *client) | |||
| 1563 | wake_up_interruptible(&msp->wq); | 1562 | wake_up_interruptible(&msp->wq); |
| 1564 | } | 1563 | } |
| 1565 | 1564 | ||
| 1566 | static int msp_detach(struct i2c_client *client) | ||
| 1567 | { | ||
| 1568 | struct msp3400c *msp = i2c_get_clientdata(client); | ||
| 1569 | int i; | ||
| 1570 | |||
| 1571 | /* shutdown control thread */ | ||
| 1572 | if (msp->kthread) { | ||
| 1573 | msp->restart = 1; | ||
| 1574 | kthread_stop(msp->kthread); | ||
| 1575 | } | ||
| 1576 | msp3400c_reset(client); | ||
| 1577 | |||
| 1578 | /* update our own array */ | ||
| 1579 | for (i = 0; i < MSP3400_MAX; i++) { | ||
| 1580 | if (client == msps[i]) { | ||
| 1581 | msps[i] = NULL; | ||
| 1582 | break; | ||
| 1583 | } | ||
| 1584 | } | ||
| 1585 | |||
| 1586 | i2c_detach_client(client); | ||
| 1587 | |||
| 1588 | kfree(msp); | ||
| 1589 | kfree(client); | ||
| 1590 | return 0; | ||
| 1591 | } | ||
| 1592 | |||
| 1593 | static int msp_probe(struct i2c_adapter *adap) | ||
| 1594 | { | ||
| 1595 | if (adap->class & I2C_CLASS_TV_ANALOG) | ||
| 1596 | return i2c_probe(adap, &addr_data, msp_attach); | ||
| 1597 | return 0; | ||
| 1598 | } | ||
| 1599 | |||
| 1600 | /* ----------------------------------------------------------------------- */ | 1565 | /* ----------------------------------------------------------------------- */ |
| 1601 | 1566 | ||
| 1602 | static int mode_v4l2_to_v4l1(int rxsubchans) | 1567 | static int mode_v4l2_to_v4l1(int rxsubchans) |
| @@ -2147,8 +2112,7 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg) | |||
| 2147 | else | 2112 | else |
| 2148 | msp->i2s_mode=0; | 2113 | msp->i2s_mode=0; |
| 2149 | } | 2114 | } |
| 2150 | msp3400_dbg("Setting audio out on msp34xx to input %i, mode %i\n", | 2115 | msp3400_dbg("Setting audio out on msp34xx to input %i, mode %i\n",a->index,msp->i2s_mode); |
| 2151 | a->index,msp->i2s_mode); | ||
| 2152 | msp3400c_set_scart(client,msp->in_scart,a->index+1); | 2116 | msp3400c_set_scart(client,msp->in_scart,a->index+1); |
| 2153 | 2117 | ||
| 2154 | break; | 2118 | break; |
| @@ -2196,7 +2160,7 @@ static int msp_suspend(struct device * dev, pm_message_t state) | |||
| 2196 | { | 2160 | { |
| 2197 | struct i2c_client *client = container_of(dev, struct i2c_client, dev); | 2161 | struct i2c_client *client = container_of(dev, struct i2c_client, dev); |
| 2198 | 2162 | ||
| 2199 | msp3400_dbg("msp34xx: suspend\n"); | 2163 | msp3400_dbg("suspend\n"); |
| 2200 | msp3400c_reset(client); | 2164 | msp3400c_reset(client); |
| 2201 | return 0; | 2165 | return 0; |
| 2202 | } | 2166 | } |
| @@ -2205,7 +2169,7 @@ static int msp_resume(struct device * dev) | |||
| 2205 | { | 2169 | { |
| 2206 | struct i2c_client *client = container_of(dev, struct i2c_client, dev); | 2170 | struct i2c_client *client = container_of(dev, struct i2c_client, dev); |
| 2207 | 2171 | ||
| 2208 | msp3400_dbg("msp34xx: resume\n"); | 2172 | msp3400_dbg("resume\n"); |
| 2209 | msp_wake_thread(client); | 2173 | msp_wake_thread(client); |
| 2210 | return 0; | 2174 | return 0; |
| 2211 | } | 2175 | } |
