在3.2中没有spi_read/spi_write, 更改为了spi_write_then_read, 好用惨了
驱动程序adt7320_driver.c
#include <linux/init.h>
#include <linux/module.h>
#include <linux/ioctl.h>
#include <linux/fs.h>
#include <linux/device.h>
#include <linux/err.h>
#include <linux/list.h>
#include <linux/errno.h>
#include <linux/mutex.h>
#include <linux/slab.h>
#include <linux/compat.h>
#include <linux/spi/spi.h>
#include <linux/spi/spidev.h>
#include <asm/uaccess.h>
#define Contin_Mode 0x00
#define OneShot_Mode 0x01
#define SPS1_Mode 0x02
#define ShutDown_Mode 0x03
#define Bit16_Mode 1
#define Bit13_Mode 0
#define CMDREAD 1
#define CMDWRITE 0
#define STATUS_REG 0x00
#define CONFIG_REG 0x01
#define TEMPVAL_REG 0x02
#define ID_REG 0x03
#define TCRIT_REG 0x04
#define THYST_REG 0x05
#define THIGH_REG 0x06
#define TLOW_REG 0x07
#define Dummy_Byte 0x5A
#define INIT 0x1
#define RESET 0x0
#define SPIDEV_MAJOR 153
static struct class *adt7320_class;
static struct spi_device *adt7320_spi_device;
static char rx_buf[5] = {0}, tx_buf[5] = {0};
/*
adt7301
adt7302
adt7310
adt7316
*/
/***************************************************************************