blob: 5466015346a10be27b191659ff285d20b7d195bc [file] [log] [blame]
Joonyoung Shimcc35bbd2009-08-09 14:23:35 -03001/*
2 * drivers/media/radio/si470x/radio-si470x-i2c.c
3 *
4 * I2C driver for radios with Silicon Labs Si470x FM Radio Receivers
5 *
Tobias Lorenz9dcb79c2009-08-10 18:44:14 -03006 * Copyright (c) 2009 Samsung Electronics Co.Ltd
Joonyoung Shimcc35bbd2009-08-09 14:23:35 -03007 * Author: Joonyoung Shim <jy0922.shim@samsung.com>
8 *
Tobias Lorenz9dcb79c2009-08-10 18:44:14 -03009 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
Joonyoung Shimcc35bbd2009-08-09 14:23:35 -030013 *
Tobias Lorenz9dcb79c2009-08-10 18:44:14 -030014 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
Joonyoung Shimcc35bbd2009-08-09 14:23:35 -030018 *
Tobias Lorenz9dcb79c2009-08-10 18:44:14 -030019 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Joonyoung Shimcc35bbd2009-08-09 14:23:35 -030022 */
23
Tobias Lorenz9dcb79c2009-08-10 18:44:14 -030024
Tobias Lorenz9dcb79c2009-08-10 18:44:14 -030025/* driver definitions */
26#define DRIVER_AUTHOR "Joonyoung Shim <jy0922.shim@samsung.com>";
Joonyoung Shimfe2137d2009-12-10 16:50:34 -030027#define DRIVER_KERNEL_VERSION KERNEL_VERSION(1, 0, 1)
Tobias Lorenz9dcb79c2009-08-10 18:44:14 -030028#define DRIVER_CARD "Silicon Labs Si470x FM Radio Receiver"
29#define DRIVER_DESC "I2C radio driver for Si470x FM Radio Receivers"
Joonyoung Shimfe2137d2009-12-10 16:50:34 -030030#define DRIVER_VERSION "1.0.1"
Tobias Lorenz9dcb79c2009-08-10 18:44:14 -030031
32/* kernel includes */
Joonyoung Shimcc35bbd2009-08-09 14:23:35 -030033#include <linux/i2c.h>
34#include <linux/delay.h>
Joonyoung Shimfe2137d2009-12-10 16:50:34 -030035#include <linux/interrupt.h>
Joonyoung Shimcc35bbd2009-08-09 14:23:35 -030036
37#include "radio-si470x.h"
38
Joonyoung Shimcc35bbd2009-08-09 14:23:35 -030039
Tobias Lorenz9dcb79c2009-08-10 18:44:14 -030040/* I2C Device ID List */
41static const struct i2c_device_id si470x_i2c_id[] = {
42 /* Generic Entry */
43 { "si470x", 0 },
44 /* Terminating entry */
45 { }
46};
47MODULE_DEVICE_TABLE(i2c, si470x_i2c_id);
48
49
50
51/**************************************************************************
52 * Module Parameters
53 **************************************************************************/
54
55/* Radio Nr */
56static int radio_nr = -1;
57module_param(radio_nr, int, 0444);
58MODULE_PARM_DESC(radio_nr, "Radio Nr");
59
Joonyoung Shimfe2137d2009-12-10 16:50:34 -030060/* RDS buffer blocks */
61static unsigned int rds_buf = 100;
62module_param(rds_buf, uint, 0444);
63MODULE_PARM_DESC(rds_buf, "RDS buffer entries: *100*");
64
65/* RDS maximum block errors */
66static unsigned short max_rds_errors = 1;
67/* 0 means 0 errors requiring correction */
68/* 1 means 1-2 errors requiring correction (used by original USBRadio.exe) */
69/* 2 means 3-5 errors requiring correction */
70/* 3 means 6+ errors or errors in checkword, correction not possible */
71module_param(max_rds_errors, ushort, 0644);
72MODULE_PARM_DESC(max_rds_errors, "RDS maximum block errors: *1*");
73
Tobias Lorenz9dcb79c2009-08-10 18:44:14 -030074
75
76/**************************************************************************
77 * I2C Definitions
78 **************************************************************************/
79
80/* Write starts with the upper byte of register 0x02 */
81#define WRITE_REG_NUM 8
82#define WRITE_INDEX(i) (i + 0x02)
83
84/* Read starts with the upper byte of register 0x0a */
Joonyoung Shimcc35bbd2009-08-09 14:23:35 -030085#define READ_REG_NUM RADIO_REGISTER_NUM
86#define READ_INDEX(i) ((i + RADIO_REGISTER_NUM - 0x0a) % READ_REG_NUM)
87
Joonyoung Shimcc35bbd2009-08-09 14:23:35 -030088
Joonyoung Shimcc35bbd2009-08-09 14:23:35 -030089
Tobias Lorenz9dcb79c2009-08-10 18:44:14 -030090/**************************************************************************
91 * General Driver Functions - REGISTERs
92 **************************************************************************/
Joonyoung Shimcc35bbd2009-08-09 14:23:35 -030093
Tobias Lorenz9dcb79c2009-08-10 18:44:14 -030094/*
95 * si470x_get_register - read register
96 */
Joonyoung Shimcc35bbd2009-08-09 14:23:35 -030097int si470x_get_register(struct si470x_device *radio, int regnr)
98{
99 u16 buf[READ_REG_NUM];
100 struct i2c_msg msgs[1] = {
101 { radio->client->addr, I2C_M_RD, sizeof(u16) * READ_REG_NUM,
102 (void *)buf },
103 };
104
105 if (i2c_transfer(radio->client->adapter, msgs, 1) != 1)
106 return -EIO;
107
108 radio->registers[regnr] = __be16_to_cpu(buf[READ_INDEX(regnr)]);
109
110 return 0;
111}
112
Joonyoung Shimcc35bbd2009-08-09 14:23:35 -0300113
Tobias Lorenz9dcb79c2009-08-10 18:44:14 -0300114/*
115 * si470x_set_register - write register
116 */
Joonyoung Shimcc35bbd2009-08-09 14:23:35 -0300117int si470x_set_register(struct si470x_device *radio, int regnr)
118{
119 int i;
120 u16 buf[WRITE_REG_NUM];
121 struct i2c_msg msgs[1] = {
122 { radio->client->addr, 0, sizeof(u16) * WRITE_REG_NUM,
123 (void *)buf },
124 };
125
126 for (i = 0; i < WRITE_REG_NUM; i++)
127 buf[i] = __cpu_to_be16(radio->registers[WRITE_INDEX(i)]);
128
129 if (i2c_transfer(radio->client->adapter, msgs, 1) != 1)
130 return -EIO;
131
132 return 0;
133}
134
Tobias Lorenz9dcb79c2009-08-10 18:44:14 -0300135
136
137/**************************************************************************
138 * General Driver Functions - ENTIRE REGISTERS
139 **************************************************************************/
140
141/*
142 * si470x_get_all_registers - read entire registers
143 */
144static int si470x_get_all_registers(struct si470x_device *radio)
145{
146 int i;
147 u16 buf[READ_REG_NUM];
148 struct i2c_msg msgs[1] = {
149 { radio->client->addr, I2C_M_RD, sizeof(u16) * READ_REG_NUM,
150 (void *)buf },
151 };
152
153 if (i2c_transfer(radio->client->adapter, msgs, 1) != 1)
154 return -EIO;
155
156 for (i = 0; i < READ_REG_NUM; i++)
157 radio->registers[i] = __be16_to_cpu(buf[READ_INDEX(i)]);
158
159 return 0;
160}
161
162
163
164/**************************************************************************
165 * General Driver Functions - DISCONNECT_CHECK
166 **************************************************************************/
167
168/*
169 * si470x_disconnect_check - check whether radio disconnects
170 */
Joonyoung Shimcc35bbd2009-08-09 14:23:35 -0300171int si470x_disconnect_check(struct si470x_device *radio)
172{
173 return 0;
174}
175
Tobias Lorenz9dcb79c2009-08-10 18:44:14 -0300176
177
178/**************************************************************************
179 * File Operations Interface
180 **************************************************************************/
181
182/*
183 * si470x_fops_open - file open
184 */
Joonyoung Shim1aa925c2009-12-10 16:49:34 -0300185int si470x_fops_open(struct file *file)
Joonyoung Shimcc35bbd2009-08-09 14:23:35 -0300186{
187 struct si470x_device *radio = video_drvdata(file);
188 int retval = 0;
189
190 mutex_lock(&radio->lock);
191 radio->users++;
192
Joonyoung Shimfe2137d2009-12-10 16:50:34 -0300193 if (radio->users == 1) {
Joonyoung Shimcc35bbd2009-08-09 14:23:35 -0300194 /* start radio */
195 retval = si470x_start(radio);
Joonyoung Shimfe2137d2009-12-10 16:50:34 -0300196 if (retval < 0)
197 goto done;
Tobias Lorenz9dcb79c2009-08-10 18:44:14 -0300198
Joonyoung Shimfe2137d2009-12-10 16:50:34 -0300199 /* enable RDS interrupt */
200 radio->registers[SYSCONFIG1] |= SYSCONFIG1_RDSIEN;
201 radio->registers[SYSCONFIG1] &= ~SYSCONFIG1_GPIO2;
202 radio->registers[SYSCONFIG1] |= 0x1 << 2;
203 retval = si470x_set_register(radio, SYSCONFIG1);
204 }
205
206done:
Joonyoung Shimcc35bbd2009-08-09 14:23:35 -0300207 mutex_unlock(&radio->lock);
Joonyoung Shimcc35bbd2009-08-09 14:23:35 -0300208 return retval;
209}
210
Tobias Lorenz9dcb79c2009-08-10 18:44:14 -0300211
212/*
213 * si470x_fops_release - file release
214 */
Joonyoung Shim1aa925c2009-12-10 16:49:34 -0300215int si470x_fops_release(struct file *file)
Joonyoung Shimcc35bbd2009-08-09 14:23:35 -0300216{
217 struct si470x_device *radio = video_drvdata(file);
218 int retval = 0;
219
220 /* safety check */
221 if (!radio)
222 return -ENODEV;
223
224 mutex_lock(&radio->lock);
225 radio->users--;
226 if (radio->users == 0)
227 /* stop radio */
228 retval = si470x_stop(radio);
Tobias Lorenz9dcb79c2009-08-10 18:44:14 -0300229
Joonyoung Shimcc35bbd2009-08-09 14:23:35 -0300230 mutex_unlock(&radio->lock);
231
232 return retval;
233}
234
Tobias Lorenz9dcb79c2009-08-10 18:44:14 -0300235
Tobias Lorenz9dcb79c2009-08-10 18:44:14 -0300236
237/**************************************************************************
238 * Video4Linux Interface
239 **************************************************************************/
240
241/*
242 * si470x_vidioc_querycap - query device capabilities
243 */
Joonyoung Shimcc35bbd2009-08-09 14:23:35 -0300244int si470x_vidioc_querycap(struct file *file, void *priv,
245 struct v4l2_capability *capability)
246{
247 strlcpy(capability->driver, DRIVER_NAME, sizeof(capability->driver));
248 strlcpy(capability->card, DRIVER_CARD, sizeof(capability->card));
249 capability->version = DRIVER_KERNEL_VERSION;
250 capability->capabilities = V4L2_CAP_HW_FREQ_SEEK |
251 V4L2_CAP_TUNER | V4L2_CAP_RADIO;
252
253 return 0;
254}
255
Tobias Lorenz9dcb79c2009-08-10 18:44:14 -0300256
257
258/**************************************************************************
259 * I2C Interface
260 **************************************************************************/
261
262/*
Joonyoung Shimfe2137d2009-12-10 16:50:34 -0300263 * si470x_i2c_interrupt_work - rds processing function
264 */
265static void si470x_i2c_interrupt_work(struct work_struct *work)
266{
267 struct si470x_device *radio = container_of(work,
268 struct si470x_device, radio_work);
269 unsigned char regnr;
270 unsigned char blocknum;
271 unsigned short bler; /* rds block errors */
272 unsigned short rds;
273 unsigned char tmpbuf[3];
274 int retval = 0;
275
276 /* safety checks */
277 if ((radio->registers[SYSCONFIG1] & SYSCONFIG1_RDS) == 0)
278 return;
279
280 /* Update RDS registers */
281 for (regnr = 0; regnr < RDS_REGISTER_NUM; regnr++) {
282 retval = si470x_get_register(radio, STATUSRSSI + regnr);
283 if (retval < 0)
284 return;
285 }
286
287 /* get rds blocks */
288 if ((radio->registers[STATUSRSSI] & STATUSRSSI_RDSR) == 0)
289 /* No RDS group ready, better luck next time */
290 return;
291
292 for (blocknum = 0; blocknum < 4; blocknum++) {
293 switch (blocknum) {
294 default:
295 bler = (radio->registers[STATUSRSSI] &
296 STATUSRSSI_BLERA) >> 9;
297 rds = radio->registers[RDSA];
298 break;
299 case 1:
300 bler = (radio->registers[READCHAN] &
301 READCHAN_BLERB) >> 14;
302 rds = radio->registers[RDSB];
303 break;
304 case 2:
305 bler = (radio->registers[READCHAN] &
306 READCHAN_BLERC) >> 12;
307 rds = radio->registers[RDSC];
308 break;
309 case 3:
310 bler = (radio->registers[READCHAN] &
311 READCHAN_BLERD) >> 10;
312 rds = radio->registers[RDSD];
313 break;
314 };
315
316 /* Fill the V4L2 RDS buffer */
317 put_unaligned_le16(rds, &tmpbuf);
318 tmpbuf[2] = blocknum; /* offset name */
319 tmpbuf[2] |= blocknum << 3; /* received offset */
320 if (bler > max_rds_errors)
321 tmpbuf[2] |= 0x80; /* uncorrectable errors */
322 else if (bler > 0)
323 tmpbuf[2] |= 0x40; /* corrected error(s) */
324
325 /* copy RDS block to internal buffer */
326 memcpy(&radio->buffer[radio->wr_index], &tmpbuf, 3);
327 radio->wr_index += 3;
328
329 /* wrap write pointer */
330 if (radio->wr_index >= radio->buf_size)
331 radio->wr_index = 0;
332
333 /* check for overflow */
334 if (radio->wr_index == radio->rd_index) {
335 /* increment and wrap read pointer */
336 radio->rd_index += 3;
337 if (radio->rd_index >= radio->buf_size)
338 radio->rd_index = 0;
339 }
340 }
341
342 if (radio->wr_index != radio->rd_index)
343 wake_up_interruptible(&radio->read_queue);
344}
345
346
347/*
348 * si470x_i2c_interrupt - interrupt handler
349 */
350static irqreturn_t si470x_i2c_interrupt(int irq, void *dev_id)
351{
352 struct si470x_device *radio = dev_id;
353
354 if (!work_pending(&radio->radio_work))
355 schedule_work(&radio->radio_work);
356
357 return IRQ_HANDLED;
358}
359
360
361/*
Tobias Lorenz9dcb79c2009-08-10 18:44:14 -0300362 * si470x_i2c_probe - probe for the device
363 */
Joonyoung Shimcc35bbd2009-08-09 14:23:35 -0300364static int __devinit si470x_i2c_probe(struct i2c_client *client,
365 const struct i2c_device_id *id)
366{
367 struct si470x_device *radio;
368 int retval = 0;
Tobias Lorenz9dcb79c2009-08-10 18:44:14 -0300369 unsigned char version_warning = 0;
Joonyoung Shimcc35bbd2009-08-09 14:23:35 -0300370
371 /* private data allocation and initialization */
372 radio = kzalloc(sizeof(struct si470x_device), GFP_KERNEL);
373 if (!radio) {
374 retval = -ENOMEM;
375 goto err_initial;
376 }
Joonyoung Shimfe2137d2009-12-10 16:50:34 -0300377
378 INIT_WORK(&radio->radio_work, si470x_i2c_interrupt_work);
Joonyoung Shimcc35bbd2009-08-09 14:23:35 -0300379 radio->users = 0;
Tobias Lorenz9dcb79c2009-08-10 18:44:14 -0300380 radio->client = client;
Joonyoung Shimcc35bbd2009-08-09 14:23:35 -0300381 mutex_init(&radio->lock);
382
383 /* video device allocation and initialization */
384 radio->videodev = video_device_alloc();
385 if (!radio->videodev) {
386 retval = -ENOMEM;
387 goto err_radio;
388 }
389 memcpy(radio->videodev, &si470x_viddev_template,
390 sizeof(si470x_viddev_template));
391 video_set_drvdata(radio->videodev, radio);
392
393 /* power up : need 110ms */
394 radio->registers[POWERCFG] = POWERCFG_ENABLE;
395 if (si470x_set_register(radio, POWERCFG) < 0) {
396 retval = -EIO;
397 goto err_all;
398 }
399 msleep(110);
400
Tobias Lorenz9dcb79c2009-08-10 18:44:14 -0300401 /* get device and chip versions */
Joonyoung Shimcc35bbd2009-08-09 14:23:35 -0300402 if (si470x_get_all_registers(radio) < 0) {
403 retval = -EIO;
Tobias Lorenz9dcb79c2009-08-10 18:44:14 -0300404 goto err_video;
Joonyoung Shimcc35bbd2009-08-09 14:23:35 -0300405 }
406 dev_info(&client->dev, "DeviceID=0x%4.4hx ChipID=0x%4.4hx\n",
407 radio->registers[DEVICEID], radio->registers[CHIPID]);
Tobias Lorenz9dcb79c2009-08-10 18:44:14 -0300408 if ((radio->registers[CHIPID] & CHIPID_FIRMWARE) < RADIO_FW_VERSION) {
409 dev_warn(&client->dev,
410 "This driver is known to work with "
411 "firmware version %hu,\n", RADIO_FW_VERSION);
412 dev_warn(&client->dev,
413 "but the device has firmware version %hu.\n",
414 radio->registers[CHIPID] & CHIPID_FIRMWARE);
415 version_warning = 1;
416 }
417
418 /* give out version warning */
419 if (version_warning == 1) {
420 dev_warn(&client->dev,
421 "If you have some trouble using this driver,\n");
422 dev_warn(&client->dev,
423 "please report to V4L ML at "
424 "linux-media@vger.kernel.org\n");
425 }
Joonyoung Shimcc35bbd2009-08-09 14:23:35 -0300426
427 /* set initial frequency */
428 si470x_set_freq(radio, 87.5 * FREQ_MUL); /* available in all regions */
429
Joonyoung Shimfe2137d2009-12-10 16:50:34 -0300430 /* rds buffer allocation */
431 radio->buf_size = rds_buf * 3;
432 radio->buffer = kmalloc(radio->buf_size, GFP_KERNEL);
433 if (!radio->buffer) {
434 retval = -EIO;
435 goto err_video;
436 }
437
438 /* rds buffer configuration */
439 radio->wr_index = 0;
440 radio->rd_index = 0;
441 init_waitqueue_head(&radio->read_queue);
442
443 retval = request_irq(client->irq, si470x_i2c_interrupt,
444 IRQF_TRIGGER_FALLING, DRIVER_NAME, radio);
445 if (retval) {
446 dev_err(&client->dev, "Failed to register interrupt\n");
447 goto err_rds;
448 }
449
Joonyoung Shimcc35bbd2009-08-09 14:23:35 -0300450 /* register video device */
Tobias Lorenz9dcb79c2009-08-10 18:44:14 -0300451 retval = video_register_device(radio->videodev, VFL_TYPE_RADIO,
452 radio_nr);
Joonyoung Shimcc35bbd2009-08-09 14:23:35 -0300453 if (retval) {
454 dev_warn(&client->dev, "Could not register video device\n");
455 goto err_all;
456 }
Joonyoung Shimcc35bbd2009-08-09 14:23:35 -0300457 i2c_set_clientdata(client, radio);
458
459 return 0;
460err_all:
Joonyoung Shimfe2137d2009-12-10 16:50:34 -0300461 free_irq(client->irq, radio);
462err_rds:
463 kfree(radio->buffer);
Tobias Lorenz9dcb79c2009-08-10 18:44:14 -0300464err_video:
Joonyoung Shimcc35bbd2009-08-09 14:23:35 -0300465 video_device_release(radio->videodev);
466err_radio:
467 kfree(radio);
468err_initial:
469 return retval;
470}
471
Tobias Lorenz9dcb79c2009-08-10 18:44:14 -0300472
473/*
474 * si470x_i2c_remove - remove the device
475 */
Joonyoung Shimcc35bbd2009-08-09 14:23:35 -0300476static __devexit int si470x_i2c_remove(struct i2c_client *client)
477{
478 struct si470x_device *radio = i2c_get_clientdata(client);
479
Joonyoung Shimfe2137d2009-12-10 16:50:34 -0300480 free_irq(client->irq, radio);
481 cancel_work_sync(&radio->radio_work);
Joonyoung Shimcc35bbd2009-08-09 14:23:35 -0300482 video_unregister_device(radio->videodev);
483 kfree(radio);
484 i2c_set_clientdata(client, NULL);
485
486 return 0;
487}
488
Joonyoung Shimcc35bbd2009-08-09 14:23:35 -0300489
Joonyoung Shimd1471f02009-12-10 16:52:50 -0300490#ifdef CONFIG_PM
491/*
492 * si470x_i2c_suspend - suspend the device
493 */
494static int si470x_i2c_suspend(struct i2c_client *client, pm_message_t mesg)
495{
496 struct si470x_device *radio = i2c_get_clientdata(client);
497
498 /* power down */
499 radio->registers[POWERCFG] |= POWERCFG_DISABLE;
500 if (si470x_set_register(radio, POWERCFG) < 0)
501 return -EIO;
502
503 return 0;
504}
505
506
507/*
508 * si470x_i2c_resume - resume the device
509 */
510static int si470x_i2c_resume(struct i2c_client *client)
511{
512 struct si470x_device *radio = i2c_get_clientdata(client);
513
514 /* power up : need 110ms */
515 radio->registers[POWERCFG] |= POWERCFG_ENABLE;
516 if (si470x_set_register(radio, POWERCFG) < 0)
517 return -EIO;
518 msleep(110);
519
520 return 0;
521}
522#else
523#define si470x_i2c_suspend NULL
524#define si470x_i2c_resume NULL
525#endif
526
527
Tobias Lorenz9dcb79c2009-08-10 18:44:14 -0300528/*
529 * si470x_i2c_driver - i2c driver interface
530 */
Joonyoung Shimcc35bbd2009-08-09 14:23:35 -0300531static struct i2c_driver si470x_i2c_driver = {
532 .driver = {
Tobias Lorenz9dcb79c2009-08-10 18:44:14 -0300533 .name = "si470x",
534 .owner = THIS_MODULE,
Joonyoung Shimcc35bbd2009-08-09 14:23:35 -0300535 },
Tobias Lorenz9dcb79c2009-08-10 18:44:14 -0300536 .probe = si470x_i2c_probe,
537 .remove = __devexit_p(si470x_i2c_remove),
Joonyoung Shimd1471f02009-12-10 16:52:50 -0300538 .suspend = si470x_i2c_suspend,
539 .resume = si470x_i2c_resume,
Tobias Lorenz9dcb79c2009-08-10 18:44:14 -0300540 .id_table = si470x_i2c_id,
Joonyoung Shimcc35bbd2009-08-09 14:23:35 -0300541};
542
Tobias Lorenz9dcb79c2009-08-10 18:44:14 -0300543
544
545/**************************************************************************
546 * Module Interface
547 **************************************************************************/
548
549/*
550 * si470x_i2c_init - module init
551 */
Joonyoung Shimcc35bbd2009-08-09 14:23:35 -0300552static int __init si470x_i2c_init(void)
553{
Tobias Lorenz9dcb79c2009-08-10 18:44:14 -0300554 printk(KERN_INFO DRIVER_DESC ", Version " DRIVER_VERSION "\n");
Joonyoung Shimcc35bbd2009-08-09 14:23:35 -0300555 return i2c_add_driver(&si470x_i2c_driver);
556}
Joonyoung Shimcc35bbd2009-08-09 14:23:35 -0300557
Tobias Lorenz9dcb79c2009-08-10 18:44:14 -0300558
559/*
560 * si470x_i2c_exit - module exit
561 */
Joonyoung Shimcc35bbd2009-08-09 14:23:35 -0300562static void __exit si470x_i2c_exit(void)
563{
564 i2c_del_driver(&si470x_i2c_driver);
565}
Tobias Lorenz9dcb79c2009-08-10 18:44:14 -0300566
567
568module_init(si470x_i2c_init);
Joonyoung Shimcc35bbd2009-08-09 14:23:35 -0300569module_exit(si470x_i2c_exit);
570
Joonyoung Shimcc35bbd2009-08-09 14:23:35 -0300571MODULE_LICENSE("GPL");
Tobias Lorenz9dcb79c2009-08-10 18:44:14 -0300572MODULE_AUTHOR(DRIVER_AUTHOR);
573MODULE_DESCRIPTION(DRIVER_DESC);
574MODULE_VERSION(DRIVER_VERSION);