2 * adis16400.c support Analog Devices ADIS16400/5
3 * 3d 2g Linear Accelerometers,
5 * 3d Magnetometers via SPI
7 * Copyright (c) 2009 Manuel Stahl <manuel.stahl@iis.fraunhofer.de>
8 * Copyright (c) 2007 Jonathan Cameron <jic23@cam.ac.uk>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
16 #include <linux/interrupt.h>
17 #include <linux/irq.h>
18 #include <linux/gpio.h>
19 #include <linux/delay.h>
20 #include <linux/mutex.h>
21 #include <linux/device.h>
22 #include <linux/kernel.h>
23 #include <linux/spi/spi.h>
25 #include <linux/sysfs.h>
26 #include <linux/list.h>
30 #include "../accel/accel.h"
31 #include "../adc/adc.h"
32 #include "../gyro/gyro.h"
33 #include "../magnetometer/magnet.h"
35 #include "adis16400.h"
37 #define DRIVER_NAME "adis16400"
39 /* At the moment the spi framework doesn't allow global setting of cs_change.
40 * It's in the likely to be added comment at the top of spi.h.
41 * This means that use cannot be made of spi_write etc.
45 * adis16400_spi_write_reg_8() - write single byte to a register
46 * @dev: device associated with child of actual device (iio_dev or iio_trig)
47 * @reg_address: the address of the register to be written
48 * @val: the value to write
50 static int adis16400_spi_write_reg_8(struct device
*dev
,
55 struct iio_dev
*indio_dev
= dev_get_drvdata(dev
);
56 struct adis16400_state
*st
= iio_dev_get_devdata(indio_dev
);
58 mutex_lock(&st
->buf_lock
);
59 st
->tx
[0] = ADIS16400_WRITE_REG(reg_address
);
62 ret
= spi_write(st
->us
, st
->tx
, 2);
63 mutex_unlock(&st
->buf_lock
);
69 * adis16400_spi_write_reg_16() - write 2 bytes to a pair of registers
70 * @dev: device associated with child of actual device (iio_dev or iio_trig)
71 * @reg_address: the address of the lower of the two registers. Second register
72 * is assumed to have address one greater.
73 * @val: value to be written
75 static int adis16400_spi_write_reg_16(struct device
*dev
,
80 struct spi_message msg
;
81 struct iio_dev
*indio_dev
= dev_get_drvdata(dev
);
82 struct adis16400_state
*st
= iio_dev_get_devdata(indio_dev
);
83 struct spi_transfer xfers
[] = {
97 mutex_lock(&st
->buf_lock
);
98 st
->tx
[0] = ADIS16400_WRITE_REG(lower_reg_address
);
99 st
->tx
[1] = value
& 0xFF;
100 st
->tx
[2] = ADIS16400_WRITE_REG(lower_reg_address
+ 1);
101 st
->tx
[3] = (value
>> 8) & 0xFF;
103 spi_message_init(&msg
);
104 spi_message_add_tail(&xfers
[0], &msg
);
105 spi_message_add_tail(&xfers
[1], &msg
);
106 ret
= spi_sync(st
->us
, &msg
);
107 mutex_unlock(&st
->buf_lock
);
113 * adis16400_spi_read_reg_16() - read 2 bytes from a 16-bit register
114 * @dev: device associated with child of actual device (iio_dev or iio_trig)
115 * @reg_address: the address of the lower of the two registers. Second register
116 * is assumed to have address one greater.
117 * @val: somewhere to pass back the value read
119 static int adis16400_spi_read_reg_16(struct device
*dev
,
120 u8 lower_reg_address
,
123 struct spi_message msg
;
124 struct iio_dev
*indio_dev
= dev_get_drvdata(dev
);
125 struct adis16400_state
*st
= iio_dev_get_devdata(indio_dev
);
127 struct spi_transfer xfers
[] = {
141 mutex_lock(&st
->buf_lock
);
142 st
->tx
[0] = ADIS16400_READ_REG(lower_reg_address
);
147 spi_message_init(&msg
);
148 spi_message_add_tail(&xfers
[0], &msg
);
149 spi_message_add_tail(&xfers
[1], &msg
);
150 ret
= spi_sync(st
->us
, &msg
);
152 dev_err(&st
->us
->dev
,
153 "problem when reading 16 bit register 0x%02X",
157 *val
= (st
->rx
[0] << 8) | st
->rx
[1];
160 mutex_unlock(&st
->buf_lock
);
165 * adis16400_spi_read_burst() - read all data registers
166 * @dev: device associated with child of actual device (iio_dev or iio_trig)
167 * @rx: somewhere to pass back the value read (min size is 24 bytes)
169 int adis16400_spi_read_burst(struct device
*dev
, u8
*rx
)
171 struct spi_message msg
;
172 struct iio_dev
*indio_dev
= dev_get_drvdata(dev
);
173 struct adis16400_state
*st
= iio_dev_get_devdata(indio_dev
);
174 u32 old_speed_hz
= st
->us
->max_speed_hz
;
177 struct spi_transfer xfers
[] = {
191 mutex_lock(&st
->buf_lock
);
192 st
->tx
[0] = ADIS16400_READ_REG(ADIS16400_GLOB_CMD
);
195 spi_message_init(&msg
);
196 spi_message_add_tail(&xfers
[0], &msg
);
197 spi_message_add_tail(&xfers
[1], &msg
);
199 st
->us
->max_speed_hz
= min(ADIS16400_SPI_BURST
, old_speed_hz
);
202 ret
= spi_sync(st
->us
, &msg
);
204 dev_err(&st
->us
->dev
, "problem when burst reading");
206 st
->us
->max_speed_hz
= old_speed_hz
;
208 mutex_unlock(&st
->buf_lock
);
212 static ssize_t
adis16400_spi_read_signed(struct device
*dev
,
213 struct device_attribute
*attr
,
219 unsigned shift
= 16 - bits
;
220 struct iio_dev_attr
*this_attr
= to_iio_dev_attr(attr
);
222 ret
= adis16400_spi_read_reg_16(dev
, this_attr
->address
, (u16
*)&val
);
226 if (val
& ADIS16400_ERROR_ACTIVE
)
227 adis16400_check_status(dev
);
228 val
= ((s16
)(val
<< shift
) >> shift
);
229 return sprintf(buf
, "%d\n", val
);
232 static ssize_t
adis16400_read_12bit_unsigned(struct device
*dev
,
233 struct device_attribute
*attr
,
238 struct iio_dev_attr
*this_attr
= to_iio_dev_attr(attr
);
240 ret
= adis16400_spi_read_reg_16(dev
, this_attr
->address
, &val
);
244 if (val
& ADIS16400_ERROR_ACTIVE
)
245 adis16400_check_status(dev
);
247 return sprintf(buf
, "%u\n", val
& 0x0FFF);
250 static ssize_t
adis16400_read_14bit_signed(struct device
*dev
,
251 struct device_attribute
*attr
,
254 struct iio_dev
*indio_dev
= dev_get_drvdata(dev
);
257 /* Take the iio_dev status lock */
258 mutex_lock(&indio_dev
->mlock
);
259 ret
= adis16400_spi_read_signed(dev
, attr
, buf
, 14);
260 mutex_unlock(&indio_dev
->mlock
);
265 static ssize_t
adis16400_read_12bit_signed(struct device
*dev
,
266 struct device_attribute
*attr
,
269 struct iio_dev
*indio_dev
= dev_get_drvdata(dev
);
272 /* Take the iio_dev status lock */
273 mutex_lock(&indio_dev
->mlock
);
274 ret
= adis16400_spi_read_signed(dev
, attr
, buf
, 12);
275 mutex_unlock(&indio_dev
->mlock
);
281 static ssize_t
adis16400_write_16bit(struct device
*dev
,
282 struct device_attribute
*attr
,
286 struct iio_dev_attr
*this_attr
= to_iio_dev_attr(attr
);
290 ret
= strict_strtol(buf
, 10, &val
);
293 ret
= adis16400_spi_write_reg_16(dev
, this_attr
->address
, val
);
296 return ret
? ret
: len
;
299 static ssize_t
adis16400_read_frequency(struct device
*dev
,
300 struct device_attribute
*attr
,
306 ret
= adis16400_spi_read_reg_16(dev
,
311 sps
= (t
& ADIS16400_SMPL_PRD_TIME_BASE
) ? 53 : 1638;
312 sps
/= (t
& ADIS16400_SMPL_PRD_DIV_MASK
) + 1;
313 len
= sprintf(buf
, "%d SPS\n", sps
);
317 static ssize_t
adis16400_write_frequency(struct device
*dev
,
318 struct device_attribute
*attr
,
322 struct iio_dev
*indio_dev
= dev_get_drvdata(dev
);
323 struct adis16400_state
*st
= iio_dev_get_devdata(indio_dev
);
328 ret
= strict_strtol(buf
, 10, &val
);
332 mutex_lock(&indio_dev
->mlock
);
337 t
&= ADIS16400_SMPL_PRD_DIV_MASK
;
338 if ((t
& ADIS16400_SMPL_PRD_DIV_MASK
) >= 0x0A)
339 st
->us
->max_speed_hz
= ADIS16400_SPI_SLOW
;
341 st
->us
->max_speed_hz
= ADIS16400_SPI_FAST
;
343 ret
= adis16400_spi_write_reg_8(dev
,
347 mutex_unlock(&indio_dev
->mlock
);
349 return ret
? ret
: len
;
352 static ssize_t
adis16400_write_reset(struct device
*dev
,
353 struct device_attribute
*attr
,
354 const char *buf
, size_t len
)
362 return adis16400_reset(dev
);
369 int adis16400_set_irq(struct device
*dev
, bool enable
)
373 ret
= adis16400_spi_read_reg_16(dev
, ADIS16400_MSC_CTRL
, &msc
);
377 msc
|= ADIS16400_MSC_CTRL_DATA_RDY_POL_HIGH
;
379 msc
|= ADIS16400_MSC_CTRL_DATA_RDY_EN
;
381 msc
&= ~ADIS16400_MSC_CTRL_DATA_RDY_EN
;
383 ret
= adis16400_spi_write_reg_16(dev
, ADIS16400_MSC_CTRL
, msc
);
391 int adis16400_reset(struct device
*dev
)
394 ret
= adis16400_spi_write_reg_8(dev
,
396 ADIS16400_GLOB_CMD_SW_RESET
);
398 dev_err(dev
, "problem resetting device");
403 /* Power down the device */
404 static int adis16400_stop_device(struct device
*dev
)
407 u16 val
= ADIS16400_SLP_CNT_POWER_OFF
;
409 ret
= adis16400_spi_write_reg_16(dev
, ADIS16400_SLP_CNT
, val
);
411 dev_err(dev
, "problem with turning device off: SLP_CNT");
416 static int adis16400_self_test(struct device
*dev
)
419 ret
= adis16400_spi_write_reg_16(dev
,
421 ADIS16400_MSC_CTRL_MEM_TEST
);
423 dev_err(dev
, "problem starting self test");
427 adis16400_check_status(dev
);
433 int adis16400_check_status(struct device
*dev
)
438 ret
= adis16400_spi_read_reg_16(dev
, ADIS16400_DIAG_STAT
, &status
);
441 dev_err(dev
, "Reading status failed\n");
445 if (status
& ADIS16400_DIAG_STAT_ZACCL_FAIL
)
446 dev_err(dev
, "Z-axis accelerometer self-test failure\n");
447 if (status
& ADIS16400_DIAG_STAT_YACCL_FAIL
)
448 dev_err(dev
, "Y-axis accelerometer self-test failure\n");
449 if (status
& ADIS16400_DIAG_STAT_XACCL_FAIL
)
450 dev_err(dev
, "X-axis accelerometer self-test failure\n");
451 if (status
& ADIS16400_DIAG_STAT_XGYRO_FAIL
)
452 dev_err(dev
, "X-axis gyroscope self-test failure\n");
453 if (status
& ADIS16400_DIAG_STAT_YGYRO_FAIL
)
454 dev_err(dev
, "Y-axis gyroscope self-test failure\n");
455 if (status
& ADIS16400_DIAG_STAT_ZGYRO_FAIL
)
456 dev_err(dev
, "Z-axis gyroscope self-test failure\n");
457 if (status
& ADIS16400_DIAG_STAT_ALARM2
)
458 dev_err(dev
, "Alarm 2 active\n");
459 if (status
& ADIS16400_DIAG_STAT_ALARM1
)
460 dev_err(dev
, "Alarm 1 active\n");
461 if (status
& ADIS16400_DIAG_STAT_FLASH_CHK
)
462 dev_err(dev
, "Flash checksum error\n");
463 if (status
& ADIS16400_DIAG_STAT_SELF_TEST
)
464 dev_err(dev
, "Self test error\n");
465 if (status
& ADIS16400_DIAG_STAT_OVERFLOW
)
466 dev_err(dev
, "Sensor overrange\n");
467 if (status
& ADIS16400_DIAG_STAT_SPI_FAIL
)
468 dev_err(dev
, "SPI failure\n");
469 if (status
& ADIS16400_DIAG_STAT_FLASH_UPT
)
470 dev_err(dev
, "Flash update failed\n");
471 if (status
& ADIS16400_DIAG_STAT_POWER_HIGH
)
472 dev_err(dev
, "Power supply above 5.25V\n");
473 if (status
& ADIS16400_DIAG_STAT_POWER_LOW
)
474 dev_err(dev
, "Power supply below 4.75V\n");
480 static int adis16400_initial_setup(struct adis16400_state
*st
)
483 u16 prod_id
, smp_prd
;
484 struct device
*dev
= &st
->indio_dev
->dev
;
486 /* use low spi speed for init */
487 st
->us
->max_speed_hz
= ADIS16400_SPI_SLOW
;
488 st
->us
->mode
= SPI_MODE_3
;
492 ret
= adis16400_set_irq(dev
, false);
494 dev_err(dev
, "disable irq failed");
500 /* Read status register to check the result */
501 ret
= adis16400_check_status(dev
);
503 adis16400_reset(dev
);
504 dev_err(dev
, "device not playing ball -> reset");
505 msleep(ADIS16400_STARTUP_DELAY
);
506 ret
= adis16400_check_status(dev
);
508 dev_err(dev
, "giving up");
513 ret
= adis16400_spi_read_reg_16(dev
, ADIS16400_PRODUCT_ID
, &prod_id
);
517 if (prod_id
!= ADIS16400_PRODUCT_ID_DEFAULT
)
518 dev_warn(dev
, "unknown product id");
520 printk(KERN_INFO DRIVER_NAME
": prod_id 0x%04x at CS%d (irq %d)\n",
521 prod_id
, st
->us
->chip_select
, st
->us
->irq
);
523 /* use high spi speed if possible */
524 ret
= adis16400_spi_read_reg_16(dev
, ADIS16400_SMPL_PRD
, &smp_prd
);
525 if (!ret
&& (smp_prd
& ADIS16400_SMPL_PRD_DIV_MASK
) < 0x0A) {
526 st
->us
->max_speed_hz
= ADIS16400_SPI_SLOW
;
536 static IIO_DEV_ATTR_ACCEL_X_OFFSET(S_IWUSR
| S_IRUGO
,
537 adis16400_read_12bit_signed
,
538 adis16400_write_16bit
,
539 ADIS16400_XACCL_OFF
);
541 static IIO_DEV_ATTR_ACCEL_Y_OFFSET(S_IWUSR
| S_IRUGO
,
542 adis16400_read_12bit_signed
,
543 adis16400_write_16bit
,
544 ADIS16400_YACCL_OFF
);
546 static IIO_DEV_ATTR_ACCEL_Z_OFFSET(S_IWUSR
| S_IRUGO
,
547 adis16400_read_12bit_signed
,
548 adis16400_write_16bit
,
549 ADIS16400_ZACCL_OFF
);
551 static IIO_DEV_ATTR_IN_NAMED_RAW(supply
, adis16400_read_14bit_signed
,
552 ADIS16400_SUPPLY_OUT
);
553 static IIO_CONST_ATTR(in_supply_scale
, "0.002418");
555 static IIO_DEV_ATTR_GYRO_X(adis16400_read_14bit_signed
,
556 ADIS16400_XGYRO_OUT
);
557 static IIO_DEV_ATTR_GYRO_Y(adis16400_read_14bit_signed
,
558 ADIS16400_YGYRO_OUT
);
559 static IIO_DEV_ATTR_GYRO_Z(adis16400_read_14bit_signed
,
560 ADIS16400_ZGYRO_OUT
);
561 static IIO_CONST_ATTR(gyro_scale
, "0.05 deg/s");
563 static IIO_DEV_ATTR_ACCEL_X(adis16400_read_14bit_signed
,
564 ADIS16400_XACCL_OUT
);
565 static IIO_DEV_ATTR_ACCEL_Y(adis16400_read_14bit_signed
,
566 ADIS16400_YACCL_OUT
);
567 static IIO_DEV_ATTR_ACCEL_Z(adis16400_read_14bit_signed
,
568 ADIS16400_ZACCL_OUT
);
569 static IIO_CONST_ATTR(accel_scale
, "0.00333 g");
571 static IIO_DEV_ATTR_MAGN_X(adis16400_read_14bit_signed
,
572 ADIS16400_XMAGN_OUT
);
573 static IIO_DEV_ATTR_MAGN_Y(adis16400_read_14bit_signed
,
574 ADIS16400_YMAGN_OUT
);
575 static IIO_DEV_ATTR_MAGN_Z(adis16400_read_14bit_signed
,
576 ADIS16400_ZMAGN_OUT
);
577 static IIO_CONST_ATTR(magn_scale
, "0.0005 Gs");
580 static IIO_DEV_ATTR_TEMP_RAW(adis16400_read_12bit_signed
);
581 static IIO_CONST_ATTR(temp_offset
, "198.16 K");
582 static IIO_CONST_ATTR(temp_scale
, "0.14 K");
584 static IIO_DEV_ATTR_IN_RAW(0, adis16400_read_12bit_unsigned
,
586 static IIO_CONST_ATTR(in0_scale
, "0.000806");
588 static IIO_DEV_ATTR_SAMP_FREQ(S_IWUSR
| S_IRUGO
,
589 adis16400_read_frequency
,
590 adis16400_write_frequency
);
592 static IIO_DEVICE_ATTR(reset
, S_IWUSR
, NULL
, adis16400_write_reset
, 0);
594 static IIO_CONST_ATTR_AVAIL_SAMP_FREQ("409 546 819 1638");
596 static IIO_CONST_ATTR(name
, "adis16400");
598 static struct attribute
*adis16400_event_attributes
[] = {
602 static struct attribute_group adis16400_event_attribute_group
= {
603 .attrs
= adis16400_event_attributes
,
606 static struct attribute
*adis16400_attributes
[] = {
607 &iio_dev_attr_accel_x_offset
.dev_attr
.attr
,
608 &iio_dev_attr_accel_y_offset
.dev_attr
.attr
,
609 &iio_dev_attr_accel_z_offset
.dev_attr
.attr
,
610 &iio_dev_attr_in_supply_raw
.dev_attr
.attr
,
611 &iio_const_attr_in_supply_scale
.dev_attr
.attr
,
612 &iio_dev_attr_gyro_x_raw
.dev_attr
.attr
,
613 &iio_dev_attr_gyro_y_raw
.dev_attr
.attr
,
614 &iio_dev_attr_gyro_z_raw
.dev_attr
.attr
,
615 &iio_const_attr_gyro_scale
.dev_attr
.attr
,
616 &iio_dev_attr_accel_x_raw
.dev_attr
.attr
,
617 &iio_dev_attr_accel_y_raw
.dev_attr
.attr
,
618 &iio_dev_attr_accel_z_raw
.dev_attr
.attr
,
619 &iio_const_attr_accel_scale
.dev_attr
.attr
,
620 &iio_dev_attr_magn_x_raw
.dev_attr
.attr
,
621 &iio_dev_attr_magn_y_raw
.dev_attr
.attr
,
622 &iio_dev_attr_magn_z_raw
.dev_attr
.attr
,
623 &iio_const_attr_magn_scale
.dev_attr
.attr
,
624 &iio_dev_attr_temp_raw
.dev_attr
.attr
,
625 &iio_const_attr_temp_offset
.dev_attr
.attr
,
626 &iio_const_attr_temp_scale
.dev_attr
.attr
,
627 &iio_dev_attr_in0_raw
.dev_attr
.attr
,
628 &iio_const_attr_in0_scale
.dev_attr
.attr
,
629 &iio_dev_attr_sampling_frequency
.dev_attr
.attr
,
630 &iio_const_attr_available_sampling_frequency
.dev_attr
.attr
,
631 &iio_dev_attr_reset
.dev_attr
.attr
,
632 &iio_const_attr_name
.dev_attr
.attr
,
636 static const struct attribute_group adis16400_attribute_group
= {
637 .attrs
= adis16400_attributes
,
640 static int __devinit
adis16400_probe(struct spi_device
*spi
)
642 int ret
, regdone
= 0;
643 struct adis16400_state
*st
= kzalloc(sizeof *st
, GFP_KERNEL
);
648 /* this is only used for removal purposes */
649 spi_set_drvdata(spi
, st
);
651 /* Allocate the comms buffers */
652 st
->rx
= kzalloc(sizeof(*st
->rx
)*ADIS16400_MAX_RX
, GFP_KERNEL
);
653 if (st
->rx
== NULL
) {
657 st
->tx
= kzalloc(sizeof(*st
->tx
)*ADIS16400_MAX_TX
, GFP_KERNEL
);
658 if (st
->tx
== NULL
) {
663 mutex_init(&st
->buf_lock
);
664 /* setup the industrialio driver allocated elements */
665 st
->indio_dev
= iio_allocate_device();
666 if (st
->indio_dev
== NULL
) {
671 st
->indio_dev
->dev
.parent
= &spi
->dev
;
672 st
->indio_dev
->num_interrupt_lines
= 1;
673 st
->indio_dev
->event_attrs
= &adis16400_event_attribute_group
;
674 st
->indio_dev
->attrs
= &adis16400_attribute_group
;
675 st
->indio_dev
->dev_data
= (void *)(st
);
676 st
->indio_dev
->driver_module
= THIS_MODULE
;
677 st
->indio_dev
->modes
= INDIO_DIRECT_MODE
;
679 ret
= adis16400_configure_ring(st
->indio_dev
);
683 ret
= iio_device_register(st
->indio_dev
);
685 goto error_unreg_ring_funcs
;
688 ret
= adis16400_initialize_ring(st
->indio_dev
->ring
);
690 printk(KERN_ERR
"failed to initialize the ring\n");
691 goto error_unreg_ring_funcs
;
694 if (spi
->irq
&& gpio_is_valid(irq_to_gpio(spi
->irq
)) > 0) {
695 #if 0 /* fixme: here we should support */
696 iio_init_work_cont(&st
->work_cont_thresh
,
698 adis16400_thresh_handler_bh_no_check
,
703 ret
= iio_register_interrupt_line(spi
->irq
,
709 goto error_uninitialize_ring
;
711 ret
= adis16400_probe_trigger(st
->indio_dev
);
713 goto error_unregister_line
;
716 /* Get the device into a sane initial state */
717 ret
= adis16400_initial_setup(st
);
719 goto error_remove_trigger
;
722 error_remove_trigger
:
723 if (st
->indio_dev
->modes
& INDIO_RING_TRIGGERED
)
724 adis16400_remove_trigger(st
->indio_dev
);
725 error_unregister_line
:
726 if (st
->indio_dev
->modes
& INDIO_RING_TRIGGERED
)
727 iio_unregister_interrupt_line(st
->indio_dev
, 0);
728 error_uninitialize_ring
:
729 adis16400_uninitialize_ring(st
->indio_dev
->ring
);
730 error_unreg_ring_funcs
:
731 adis16400_unconfigure_ring(st
->indio_dev
);
734 iio_device_unregister(st
->indio_dev
);
736 iio_free_device(st
->indio_dev
);
747 /* fixme, confirm ordering in this function */
748 static int adis16400_remove(struct spi_device
*spi
)
751 struct adis16400_state
*st
= spi_get_drvdata(spi
);
752 struct iio_dev
*indio_dev
= st
->indio_dev
;
754 ret
= adis16400_stop_device(&(indio_dev
->dev
));
758 flush_scheduled_work();
760 adis16400_remove_trigger(indio_dev
);
761 if (spi
->irq
&& gpio_is_valid(irq_to_gpio(spi
->irq
)) > 0)
762 iio_unregister_interrupt_line(indio_dev
, 0);
764 adis16400_uninitialize_ring(indio_dev
->ring
);
765 adis16400_unconfigure_ring(indio_dev
);
766 iio_device_unregister(indio_dev
);
777 static struct spi_driver adis16400_driver
= {
780 .owner
= THIS_MODULE
,
782 .probe
= adis16400_probe
,
783 .remove
= __devexit_p(adis16400_remove
),
786 static __init
int adis16400_init(void)
788 return spi_register_driver(&adis16400_driver
);
790 module_init(adis16400_init
);
792 static __exit
void adis16400_exit(void)
794 spi_unregister_driver(&adis16400_driver
);
796 module_exit(adis16400_exit
);
798 MODULE_AUTHOR("Manuel Stahl <manuel.stahl@iis.fraunhofer.de>");
799 MODULE_DESCRIPTION("Analog Devices ADIS16400/5 IMU SPI driver");
800 MODULE_LICENSE("GPL v2");