Mauro Carvalho Chehab | 8573a9e | 2007-04-08 01:09:11 -0300 | [diff] [blame] | 1 | /* |
| 2 | * For Philips TEA5761 FM Chip |
| 3 | * I2C address is allways 0x20 (0x10 at 7-bit mode). |
| 4 | * |
| 5 | * Copyright (c) 2005-2007 Mauro Carvalho Chehab (mchehab@infradead.org) |
| 6 | * This code is placed under the terms of the GNUv2 General Public License |
| 7 | * |
| 8 | */ |
| 9 | |
| 10 | #include <linux/i2c.h> |
Mauro Carvalho Chehab | 8573a9e | 2007-04-08 01:09:11 -0300 | [diff] [blame] | 11 | #include <linux/delay.h> |
Hans Verkuil | 7f6adea | 2009-02-19 17:31:17 -0300 | [diff] [blame] | 12 | #include <linux/videodev2.h> |
Mauro Carvalho Chehab | 8573a9e | 2007-04-08 01:09:11 -0300 | [diff] [blame] | 13 | #include <media/tuner.h> |
Michael Krufky | 7ab10bf | 2007-08-27 21:23:40 -0300 | [diff] [blame] | 14 | #include "tuner-i2c.h" |
| 15 | #include "tea5761.h" |
Mauro Carvalho Chehab | 8573a9e | 2007-04-08 01:09:11 -0300 | [diff] [blame] | 16 | |
Douglas Schilling Landgraf | ff699e6 | 2008-04-22 14:41:48 -0300 | [diff] [blame] | 17 | static int debug; |
Michael Krufky | 7ab10bf | 2007-08-27 21:23:40 -0300 | [diff] [blame] | 18 | module_param(debug, int, 0644); |
| 19 | MODULE_PARM_DESC(debug, "enable verbose debug messages"); |
Mauro Carvalho Chehab | 8573a9e | 2007-04-08 01:09:11 -0300 | [diff] [blame] | 20 | |
Michael Krufky | db8a695 | 2007-08-21 01:24:42 -0300 | [diff] [blame] | 21 | struct tea5761_priv { |
| 22 | struct tuner_i2c_props i2c_props; |
Michael Krufky | 7ab10bf | 2007-08-27 21:23:40 -0300 | [diff] [blame] | 23 | |
| 24 | u32 frequency; |
Michael Krufky | db8a695 | 2007-08-21 01:24:42 -0300 | [diff] [blame] | 25 | }; |
| 26 | |
Mauro Carvalho Chehab | 8573a9e | 2007-04-08 01:09:11 -0300 | [diff] [blame] | 27 | /*****************************************************************************/ |
| 28 | |
| 29 | /*************************** |
| 30 | * TEA5761HN I2C registers * |
| 31 | ***************************/ |
| 32 | |
| 33 | /* INTREG - Read: bytes 0 and 1 / Write: byte 0 */ |
| 34 | |
| 35 | /* first byte for reading */ |
| 36 | #define TEA5761_INTREG_IFFLAG 0x10 |
| 37 | #define TEA5761_INTREG_LEVFLAG 0x8 |
| 38 | #define TEA5761_INTREG_FRRFLAG 0x2 |
| 39 | #define TEA5761_INTREG_BLFLAG 0x1 |
| 40 | |
| 41 | /* second byte for reading / byte for writing */ |
| 42 | #define TEA5761_INTREG_IFMSK 0x10 |
| 43 | #define TEA5761_INTREG_LEVMSK 0x8 |
| 44 | #define TEA5761_INTREG_FRMSK 0x2 |
| 45 | #define TEA5761_INTREG_BLMSK 0x1 |
| 46 | |
| 47 | /* FRQSET - Read: bytes 2 and 3 / Write: byte 1 and 2 */ |
| 48 | |
| 49 | /* First byte */ |
| 50 | #define TEA5761_FRQSET_SEARCH_UP 0x80 /* 1=Station search from botton to up */ |
| 51 | #define TEA5761_FRQSET_SEARCH_MODE 0x40 /* 1=Search mode */ |
| 52 | |
| 53 | /* Bits 0-5 for divider MSB */ |
| 54 | |
| 55 | /* Second byte */ |
| 56 | /* Bits 0-7 for divider LSB */ |
| 57 | |
| 58 | /* TNCTRL - Read: bytes 4 and 5 / Write: Bytes 3 and 4 */ |
| 59 | |
| 60 | /* first byte */ |
| 61 | |
| 62 | #define TEA5761_TNCTRL_PUPD_0 0x40 /* Power UP/Power Down MSB */ |
| 63 | #define TEA5761_TNCTRL_BLIM 0X20 /* 1= Japan Frequencies, 0= European frequencies */ |
| 64 | #define TEA5761_TNCTRL_SWPM 0x10 /* 1= software port is FRRFLAG */ |
| 65 | #define TEA5761_TNCTRL_IFCTC 0x08 /* 1= IF count time 15.02 ms, 0= IF count time 2.02 ms */ |
| 66 | #define TEA5761_TNCTRL_AFM 0x04 |
| 67 | #define TEA5761_TNCTRL_SMUTE 0x02 /* 1= Soft mute */ |
| 68 | #define TEA5761_TNCTRL_SNC 0x01 |
| 69 | |
| 70 | /* second byte */ |
| 71 | |
| 72 | #define TEA5761_TNCTRL_MU 0x80 /* 1=Hard mute */ |
| 73 | #define TEA5761_TNCTRL_SSL_1 0x40 |
| 74 | #define TEA5761_TNCTRL_SSL_0 0x20 |
| 75 | #define TEA5761_TNCTRL_HLSI 0x10 |
| 76 | #define TEA5761_TNCTRL_MST 0x08 /* 1 = mono */ |
| 77 | #define TEA5761_TNCTRL_SWP 0x04 |
| 78 | #define TEA5761_TNCTRL_DTC 0x02 /* 1 = deemphasis 50 us, 0 = deemphasis 75 us */ |
| 79 | #define TEA5761_TNCTRL_AHLSI 0x01 |
| 80 | |
| 81 | /* FRQCHECK - Read: bytes 6 and 7 */ |
| 82 | /* First byte */ |
| 83 | |
| 84 | /* Bits 0-5 for divider MSB */ |
| 85 | |
| 86 | /* Second byte */ |
| 87 | /* Bits 0-7 for divider LSB */ |
| 88 | |
| 89 | /* TUNCHECK - Read: bytes 8 and 9 */ |
| 90 | |
| 91 | /* First byte */ |
| 92 | #define TEA5761_TUNCHECK_IF_MASK 0x7e /* IF count */ |
| 93 | #define TEA5761_TUNCHECK_TUNTO 0x01 |
| 94 | |
| 95 | /* Second byte */ |
| 96 | #define TEA5761_TUNCHECK_LEV_MASK 0xf0 /* Level Count */ |
| 97 | #define TEA5761_TUNCHECK_LD 0x08 |
| 98 | #define TEA5761_TUNCHECK_STEREO 0x04 |
| 99 | |
| 100 | /* TESTREG - Read: bytes 10 and 11 / Write: bytes 5 and 6 */ |
| 101 | |
| 102 | /* All zero = no test mode */ |
| 103 | |
| 104 | /* MANID - Read: bytes 12 and 13 */ |
| 105 | |
| 106 | /* First byte - should be 0x10 */ |
| 107 | #define TEA5767_MANID_VERSION_MASK 0xf0 /* Version = 1 */ |
| 108 | #define TEA5767_MANID_ID_MSB_MASK 0x0f /* Manufacurer ID - should be 0 */ |
| 109 | |
| 110 | /* Second byte - Should be 0x2b */ |
| 111 | |
| 112 | #define TEA5767_MANID_ID_LSB_MASK 0xfe /* Manufacturer ID - should be 0x15 */ |
| 113 | #define TEA5767_MANID_IDAV 0x01 /* 1 = Chip has ID, 0 = Chip has no ID */ |
| 114 | |
| 115 | /* Chip ID - Read: bytes 14 and 15 */ |
| 116 | |
| 117 | /* First byte - should be 0x57 */ |
| 118 | |
| 119 | /* Second byte - should be 0x61 */ |
| 120 | |
| 121 | /*****************************************************************************/ |
| 122 | |
Mauro Carvalho Chehab | 8573a9e | 2007-04-08 01:09:11 -0300 | [diff] [blame] | 123 | #define FREQ_OFFSET 0 /* for TEA5767, it is 700 to give the right freq */ |
| 124 | static void tea5761_status_dump(unsigned char *buffer) |
| 125 | { |
| 126 | unsigned int div, frq; |
| 127 | |
| 128 | div = ((buffer[2] & 0x3f) << 8) | buffer[3]; |
| 129 | |
| 130 | frq = 1000 * (div * 32768 / 1000 + FREQ_OFFSET + 225) / 4; /* Freq in KHz */ |
| 131 | |
Michael Krufky | 2756665 | 2008-04-22 14:41:53 -0300 | [diff] [blame] | 132 | printk(KERN_INFO "tea5761: Frequency %d.%03d KHz (divider = 0x%04x)\n", |
Mauro Carvalho Chehab | 8573a9e | 2007-04-08 01:09:11 -0300 | [diff] [blame] | 133 | frq / 1000, frq % 1000, div); |
| 134 | } |
| 135 | |
| 136 | /* Freq should be specifyed at 62.5 Hz */ |
Michael Krufky | 7ab10bf | 2007-08-27 21:23:40 -0300 | [diff] [blame] | 137 | static int set_radio_freq(struct dvb_frontend *fe, |
| 138 | struct analog_parameters *params) |
Mauro Carvalho Chehab | 8573a9e | 2007-04-08 01:09:11 -0300 | [diff] [blame] | 139 | { |
Michael Krufky | 7ab10bf | 2007-08-27 21:23:40 -0300 | [diff] [blame] | 140 | struct tea5761_priv *priv = fe->tuner_priv; |
| 141 | unsigned int frq = params->frequency; |
Mauro Carvalho Chehab | 8573a9e | 2007-04-08 01:09:11 -0300 | [diff] [blame] | 142 | unsigned char buffer[7] = {0, 0, 0, 0, 0, 0, 0 }; |
| 143 | unsigned div; |
| 144 | int rc; |
| 145 | |
Michael Krufky | 7ab10bf | 2007-08-27 21:23:40 -0300 | [diff] [blame] | 146 | tuner_dbg("radio freq counter %d\n", frq); |
Mauro Carvalho Chehab | 8573a9e | 2007-04-08 01:09:11 -0300 | [diff] [blame] | 147 | |
Michael Krufky | 7ab10bf | 2007-08-27 21:23:40 -0300 | [diff] [blame] | 148 | if (params->mode == T_STANDBY) { |
Mauro Carvalho Chehab | 8573a9e | 2007-04-08 01:09:11 -0300 | [diff] [blame] | 149 | tuner_dbg("TEA5761 set to standby mode\n"); |
| 150 | buffer[5] |= TEA5761_TNCTRL_MU; |
| 151 | } else { |
| 152 | buffer[4] |= TEA5761_TNCTRL_PUPD_0; |
| 153 | } |
| 154 | |
| 155 | |
Michael Krufky | 7ab10bf | 2007-08-27 21:23:40 -0300 | [diff] [blame] | 156 | if (params->audmode == V4L2_TUNER_MODE_MONO) { |
Mauro Carvalho Chehab | 8573a9e | 2007-04-08 01:09:11 -0300 | [diff] [blame] | 157 | tuner_dbg("TEA5761 set to mono\n"); |
| 158 | buffer[5] |= TEA5761_TNCTRL_MST; |
Mauro Carvalho Chehab | 8573a9e | 2007-04-08 01:09:11 -0300 | [diff] [blame] | 159 | } else { |
| 160 | tuner_dbg("TEA5761 set to stereo\n"); |
| 161 | } |
| 162 | |
| 163 | div = (1000 * (frq * 4 / 16 + 700 + 225) ) >> 15; |
| 164 | buffer[1] = (div >> 8) & 0x3f; |
| 165 | buffer[2] = div & 0xff; |
| 166 | |
Michael Krufky | 7ab10bf | 2007-08-27 21:23:40 -0300 | [diff] [blame] | 167 | if (debug) |
Mauro Carvalho Chehab | 8573a9e | 2007-04-08 01:09:11 -0300 | [diff] [blame] | 168 | tea5761_status_dump(buffer); |
| 169 | |
Michael Krufky | db8a695 | 2007-08-21 01:24:42 -0300 | [diff] [blame] | 170 | if (7 != (rc = tuner_i2c_xfer_send(&priv->i2c_props, buffer, 7))) |
Mauro Carvalho Chehab | 8573a9e | 2007-04-08 01:09:11 -0300 | [diff] [blame] | 171 | tuner_warn("i2c i/o error: rc == %d (should be 5)\n", rc); |
Michael Krufky | 7ab10bf | 2007-08-27 21:23:40 -0300 | [diff] [blame] | 172 | |
| 173 | priv->frequency = frq * 125 / 2; |
| 174 | |
| 175 | return 0; |
Mauro Carvalho Chehab | 8573a9e | 2007-04-08 01:09:11 -0300 | [diff] [blame] | 176 | } |
| 177 | |
Michael Krufky | fd443f7 | 2007-08-31 16:39:57 -0300 | [diff] [blame] | 178 | static int tea5761_read_status(struct dvb_frontend *fe, char *buffer) |
Mauro Carvalho Chehab | 8573a9e | 2007-04-08 01:09:11 -0300 | [diff] [blame] | 179 | { |
Michael Krufky | 7ab10bf | 2007-08-27 21:23:40 -0300 | [diff] [blame] | 180 | struct tea5761_priv *priv = fe->tuner_priv; |
Michael Krufky | fd443f7 | 2007-08-31 16:39:57 -0300 | [diff] [blame] | 181 | int rc; |
Mauro Carvalho Chehab | 8573a9e | 2007-04-08 01:09:11 -0300 | [diff] [blame] | 182 | |
Michael Krufky | fd443f7 | 2007-08-31 16:39:57 -0300 | [diff] [blame] | 183 | memset(buffer, 0, 16); |
| 184 | if (16 != (rc = tuner_i2c_xfer_recv(&priv->i2c_props, buffer, 16))) { |
| 185 | tuner_warn("i2c i/o error: rc == %d (should be 16)\n", rc); |
| 186 | return -EREMOTEIO; |
| 187 | } |
Mauro Carvalho Chehab | 8573a9e | 2007-04-08 01:09:11 -0300 | [diff] [blame] | 188 | |
Michael Krufky | fd443f7 | 2007-08-31 16:39:57 -0300 | [diff] [blame] | 189 | return 0; |
Mauro Carvalho Chehab | 8573a9e | 2007-04-08 01:09:11 -0300 | [diff] [blame] | 190 | } |
| 191 | |
Michael Krufky | fd443f7 | 2007-08-31 16:39:57 -0300 | [diff] [blame] | 192 | static inline int tea5761_signal(struct dvb_frontend *fe, const char *buffer) |
Mauro Carvalho Chehab | 8573a9e | 2007-04-08 01:09:11 -0300 | [diff] [blame] | 193 | { |
Michael Krufky | 7ab10bf | 2007-08-27 21:23:40 -0300 | [diff] [blame] | 194 | struct tea5761_priv *priv = fe->tuner_priv; |
Mauro Carvalho Chehab | 8573a9e | 2007-04-08 01:09:11 -0300 | [diff] [blame] | 195 | |
Michael Krufky | fd443f7 | 2007-08-31 16:39:57 -0300 | [diff] [blame] | 196 | int signal = ((buffer[9] & TEA5761_TUNCHECK_LEV_MASK) << (13 - 4)); |
Mauro Carvalho Chehab | 8573a9e | 2007-04-08 01:09:11 -0300 | [diff] [blame] | 197 | |
Michael Krufky | fd443f7 | 2007-08-31 16:39:57 -0300 | [diff] [blame] | 198 | tuner_dbg("Signal strength: %d\n", signal); |
Mauro Carvalho Chehab | 8573a9e | 2007-04-08 01:09:11 -0300 | [diff] [blame] | 199 | |
Michael Krufky | fd443f7 | 2007-08-31 16:39:57 -0300 | [diff] [blame] | 200 | return signal; |
| 201 | } |
Mauro Carvalho Chehab | 8573a9e | 2007-04-08 01:09:11 -0300 | [diff] [blame] | 202 | |
Michael Krufky | fd443f7 | 2007-08-31 16:39:57 -0300 | [diff] [blame] | 203 | static inline int tea5761_stereo(struct dvb_frontend *fe, const char *buffer) |
| 204 | { |
| 205 | struct tea5761_priv *priv = fe->tuner_priv; |
| 206 | |
| 207 | int stereo = buffer[9] & TEA5761_TUNCHECK_STEREO; |
| 208 | |
| 209 | tuner_dbg("Radio ST GET = %02x\n", stereo); |
| 210 | |
| 211 | return (stereo ? V4L2_TUNER_SUB_STEREO : 0); |
Mauro Carvalho Chehab | 8573a9e | 2007-04-08 01:09:11 -0300 | [diff] [blame] | 212 | } |
| 213 | |
Michael Krufky | 7ab10bf | 2007-08-27 21:23:40 -0300 | [diff] [blame] | 214 | static int tea5761_get_status(struct dvb_frontend *fe, u32 *status) |
| 215 | { |
Michael Krufky | fd443f7 | 2007-08-31 16:39:57 -0300 | [diff] [blame] | 216 | unsigned char buffer[16]; |
Michael Krufky | 7ab10bf | 2007-08-27 21:23:40 -0300 | [diff] [blame] | 217 | |
| 218 | *status = 0; |
| 219 | |
Michael Krufky | fd443f7 | 2007-08-31 16:39:57 -0300 | [diff] [blame] | 220 | if (0 == tea5761_read_status(fe, buffer)) { |
| 221 | if (tea5761_signal(fe, buffer)) |
| 222 | *status = TUNER_STATUS_LOCKED; |
| 223 | if (tea5761_stereo(fe, buffer)) |
| 224 | *status |= TUNER_STATUS_STEREO; |
| 225 | } |
Michael Krufky | 7ab10bf | 2007-08-27 21:23:40 -0300 | [diff] [blame] | 226 | |
Michael Krufky | fd443f7 | 2007-08-31 16:39:57 -0300 | [diff] [blame] | 227 | return 0; |
| 228 | } |
| 229 | |
| 230 | static int tea5761_get_rf_strength(struct dvb_frontend *fe, u16 *strength) |
| 231 | { |
| 232 | unsigned char buffer[16]; |
| 233 | |
| 234 | *strength = 0; |
| 235 | |
| 236 | if (0 == tea5761_read_status(fe, buffer)) |
| 237 | *strength = tea5761_signal(fe, buffer); |
Michael Krufky | 7ab10bf | 2007-08-27 21:23:40 -0300 | [diff] [blame] | 238 | |
| 239 | return 0; |
| 240 | } |
| 241 | |
| 242 | int tea5761_autodetection(struct i2c_adapter* i2c_adap, u8 i2c_addr) |
Mauro Carvalho Chehab | 8573a9e | 2007-04-08 01:09:11 -0300 | [diff] [blame] | 243 | { |
| 244 | unsigned char buffer[16]; |
| 245 | int rc; |
Michael Krufky | 7ab10bf | 2007-08-27 21:23:40 -0300 | [diff] [blame] | 246 | struct tuner_i2c_props i2c = { .adap = i2c_adap, .addr = i2c_addr }; |
Mauro Carvalho Chehab | 8573a9e | 2007-04-08 01:09:11 -0300 | [diff] [blame] | 247 | |
Michael Krufky | db8a695 | 2007-08-21 01:24:42 -0300 | [diff] [blame] | 248 | if (16 != (rc = tuner_i2c_xfer_recv(&i2c, buffer, 16))) { |
Michael Krufky | 7ab10bf | 2007-08-27 21:23:40 -0300 | [diff] [blame] | 249 | printk(KERN_WARNING "it is not a TEA5761. Received %i chars.\n", rc); |
Mauro Carvalho Chehab | 867e835 | 2008-04-23 17:27:27 -0300 | [diff] [blame] | 250 | return -EINVAL; |
Mauro Carvalho Chehab | 8573a9e | 2007-04-08 01:09:11 -0300 | [diff] [blame] | 251 | } |
| 252 | |
Mauro Carvalho Chehab | 867e835 | 2008-04-23 17:27:27 -0300 | [diff] [blame] | 253 | if ((buffer[13] != 0x2b) || (buffer[14] != 0x57) || (buffer[15] != 0x061)) { |
| 254 | printk(KERN_WARNING "Manufacturer ID= 0x%02x, Chip ID = %02x%02x." |
| 255 | " It is not a TEA5761\n", |
| 256 | buffer[13], buffer[14], buffer[15]); |
| 257 | return -EINVAL; |
Mauro Carvalho Chehab | 8573a9e | 2007-04-08 01:09:11 -0300 | [diff] [blame] | 258 | } |
Mauro Carvalho Chehab | 867e835 | 2008-04-23 17:27:27 -0300 | [diff] [blame] | 259 | printk(KERN_WARNING "tea5761: TEA%02x%02x detected. " |
| 260 | "Manufacturer ID= 0x%02x\n", |
| 261 | buffer[14], buffer[15], buffer[13]); |
| 262 | |
Mauro Carvalho Chehab | 8573a9e | 2007-04-08 01:09:11 -0300 | [diff] [blame] | 263 | return 0; |
| 264 | } |
| 265 | |
Michael Krufky | 7ab10bf | 2007-08-27 21:23:40 -0300 | [diff] [blame] | 266 | static int tea5761_release(struct dvb_frontend *fe) |
Michael Krufky | db8a695 | 2007-08-21 01:24:42 -0300 | [diff] [blame] | 267 | { |
Michael Krufky | 7ab10bf | 2007-08-27 21:23:40 -0300 | [diff] [blame] | 268 | kfree(fe->tuner_priv); |
| 269 | fe->tuner_priv = NULL; |
| 270 | |
| 271 | return 0; |
Michael Krufky | db8a695 | 2007-08-21 01:24:42 -0300 | [diff] [blame] | 272 | } |
| 273 | |
Michael Krufky | 7ab10bf | 2007-08-27 21:23:40 -0300 | [diff] [blame] | 274 | static int tea5761_get_frequency(struct dvb_frontend *fe, u32 *frequency) |
| 275 | { |
| 276 | struct tea5761_priv *priv = fe->tuner_priv; |
| 277 | *frequency = priv->frequency; |
| 278 | return 0; |
| 279 | } |
| 280 | |
| 281 | static struct dvb_tuner_ops tea5761_tuner_ops = { |
| 282 | .info = { |
| 283 | .name = "tea5761", // Philips TEA5761HN FM Radio |
| 284 | }, |
| 285 | .set_analog_params = set_radio_freq, |
| 286 | .release = tea5761_release, |
| 287 | .get_frequency = tea5761_get_frequency, |
| 288 | .get_status = tea5761_get_status, |
Michael Krufky | fd443f7 | 2007-08-31 16:39:57 -0300 | [diff] [blame] | 289 | .get_rf_strength = tea5761_get_rf_strength, |
Michael Krufky | e407cd5 | 2007-06-06 16:16:29 -0300 | [diff] [blame] | 290 | }; |
| 291 | |
Michael Krufky | 7ab10bf | 2007-08-27 21:23:40 -0300 | [diff] [blame] | 292 | struct dvb_frontend *tea5761_attach(struct dvb_frontend *fe, |
| 293 | struct i2c_adapter* i2c_adap, |
| 294 | u8 i2c_addr) |
Mauro Carvalho Chehab | 8573a9e | 2007-04-08 01:09:11 -0300 | [diff] [blame] | 295 | { |
Michael Krufky | db8a695 | 2007-08-21 01:24:42 -0300 | [diff] [blame] | 296 | struct tea5761_priv *priv = NULL; |
Mauro Carvalho Chehab | 8573a9e | 2007-04-08 01:09:11 -0300 | [diff] [blame] | 297 | |
Marcin Slusarz | 4277106 | 2008-05-11 19:51:07 -0300 | [diff] [blame] | 298 | if (tea5761_autodetection(i2c_adap, i2c_addr) != 0) |
Michael Krufky | 7ab10bf | 2007-08-27 21:23:40 -0300 | [diff] [blame] | 299 | return NULL; |
Mauro Carvalho Chehab | 8573a9e | 2007-04-08 01:09:11 -0300 | [diff] [blame] | 300 | |
Michael Krufky | db8a695 | 2007-08-21 01:24:42 -0300 | [diff] [blame] | 301 | priv = kzalloc(sizeof(struct tea5761_priv), GFP_KERNEL); |
| 302 | if (priv == NULL) |
Michael Krufky | 7ab10bf | 2007-08-27 21:23:40 -0300 | [diff] [blame] | 303 | return NULL; |
| 304 | fe->tuner_priv = priv; |
Michael Krufky | db8a695 | 2007-08-21 01:24:42 -0300 | [diff] [blame] | 305 | |
Michael Krufky | 7ab10bf | 2007-08-27 21:23:40 -0300 | [diff] [blame] | 306 | priv->i2c_props.addr = i2c_addr; |
| 307 | priv->i2c_props.adap = i2c_adap; |
Michael Krufky | 2756665 | 2008-04-22 14:41:53 -0300 | [diff] [blame] | 308 | priv->i2c_props.name = "tea5761"; |
Michael Krufky | db8a695 | 2007-08-21 01:24:42 -0300 | [diff] [blame] | 309 | |
Michael Krufky | 7ab10bf | 2007-08-27 21:23:40 -0300 | [diff] [blame] | 310 | memcpy(&fe->ops.tuner_ops, &tea5761_tuner_ops, |
| 311 | sizeof(struct dvb_tuner_ops)); |
Mauro Carvalho Chehab | 8573a9e | 2007-04-08 01:09:11 -0300 | [diff] [blame] | 312 | |
Michael Krufky | 7ab10bf | 2007-08-27 21:23:40 -0300 | [diff] [blame] | 313 | tuner_info("type set to %s\n", "Philips TEA5761HN FM Radio"); |
Mauro Carvalho Chehab | 8573a9e | 2007-04-08 01:09:11 -0300 | [diff] [blame] | 314 | |
Michael Krufky | 7ab10bf | 2007-08-27 21:23:40 -0300 | [diff] [blame] | 315 | return fe; |
Mauro Carvalho Chehab | 8573a9e | 2007-04-08 01:09:11 -0300 | [diff] [blame] | 316 | } |
Michael Krufky | 7ab10bf | 2007-08-27 21:23:40 -0300 | [diff] [blame] | 317 | |
| 318 | |
| 319 | EXPORT_SYMBOL_GPL(tea5761_attach); |
| 320 | EXPORT_SYMBOL_GPL(tea5761_autodetection); |
| 321 | |
| 322 | MODULE_DESCRIPTION("Philips TEA5761 FM tuner driver"); |
| 323 | MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@infradead.org>"); |
| 324 | MODULE_LICENSE("GPL"); |