]> bbs.cooldavid.org Git - net-next-2.6.git/blame - drivers/staging/adis16255/adis16255.c
staging: iio: adis16240 driver
[net-next-2.6.git] / drivers / staging / adis16255 / adis16255.c
CommitLineData
3c034cce 1/*
2 * Analog Devices ADIS16250/ADIS16255 Low Power Gyroscope
3 *
4 * Written by: Matthias Brugger <m_brugger@web.de>
5 *
6 * Copyright (C) 2010 Fraunhofer Institute for Integrated Circuits
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the
20 * Free Software Foundation, Inc.,
21 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 */
23
24#include <linux/init.h>
25#include <linux/module.h>
26#include <linux/device.h>
27#include <linux/list.h>
28#include <linux/errno.h>
29#include <linux/mutex.h>
30#include <linux/slab.h>
31
32#include <linux/interrupt.h>
33#include <linux/sysfs.h>
34#include <linux/stat.h>
35#include <linux/delay.h>
36
37#include <linux/gpio.h>
38
39#include <linux/spi/spi.h>
40#include <linux/workqueue.h>
41
42#include "adis16255.h"
43
44#define ADIS_STATUS 0x3d
45#define ADIS_SMPL_PRD_MSB 0x37
46#define ADIS_SMPL_PRD_LSB 0x36
47#define ADIS_MSC_CTRL_MSB 0x35
48#define ADIS_MSC_CTRL_LSB 0x34
49#define ADIS_GPIO_CTRL 0x33
50#define ADIS_ALM_SMPL1 0x25
51#define ADIS_ALM_MAG1 0x21
52#define ADIS_GYRO_SCALE 0x17
53#define ADIS_GYRO_OUT 0x05
54#define ADIS_SUPPLY_OUT 0x03
55#define ADIS_ENDURANCE 0x01
56
57/*
58 * data structure for every sensor
59 *
60 * @dev: Driver model representation of the device.
61 * @spi: Pointer to the spi device which will manage i/o to spi bus.
62 * @data: Last read data from device.
63 * @irq_adis: GPIO Number of IRQ signal
64 * @irq: irq line manage by kernel
65