on 977 add mpu config and update mpu code

This commit is contained in:
ywj
2014-04-04 10:52:17 +08:00
parent 8b8c76a7ab
commit 68b6dfca6b
58 changed files with 3137 additions and 479 deletions

View File

@@ -303,7 +303,7 @@
compatible = "nxp,pcf8563";
reg = <0x51>;
};
/*
sensor@1d {
compatible = "gs_mma8452";
reg = <0x1d>;
@@ -312,7 +312,9 @@
irq_enable = <1>;
poll_delay_ms = <30>;
layout = <8>;
status = "disabled";
};
sensor@0d {
compatible = "ak8975";
reg = <0x0d>;
@@ -321,7 +323,9 @@
irq_enable = <1>;
poll_delay_ms = <30>;
layout = <1>;
status = "disabled";
};
*/
sensor@10 {
compatible = "ls_cm3218";
reg = <0x10>;
@@ -331,7 +335,45 @@
poll_delay_ms = <30>;
layout = <1>;
};
mpu6050:mpu@68{
compatible = "mpu6050";
reg = <0x68>;
mpu-int_config = <0x10>;
mpu-level_shifter = <0>;
mpu-orientation = <1 0 0 0 1 0 0 0 1>;
orientation-x= <1>;
orientation-y= <0>;
orientation-z= <1>;
irq-gpio = <&gpio8 GPIO_A0 IRQ_TYPE_LEVEL_LOW>;
mpu-debug = <1>;
};
/*
ak8963:compass@0d{
compatible = "ak8963";
reg = <0x0d>;
compass-bus = <0>;
compass-adapt_num = <0>;
compass-orientation = <1 0 0 0 1 0 0 0 1>;
orientation-x= <0>;
orientation-y= <0>;
orientation-z= <1>;
compass-debug = <1>;
status = "disabled";
};
*/
ak8975:compass@0d{
compatible = "ak8975";
reg = <0x0d>;
compass-bus = <0>;
compass-adapt_num = <0>;
compass-orientation = <1 0 0 0 1 0 0 0 1>;
orientation-x= <1>;
orientation-y= <0>;
orientation-z= <1>;
compass-debug = <1>;
};
};
&i2c2 {

1
drivers/misc/Kconfig Normal file → Executable file
View File

@@ -534,6 +534,7 @@ config SRAM
source "drivers/misc/c2port/Kconfig"
source "drivers/misc/eeprom/Kconfig"
source "drivers/misc/cb710/Kconfig"
source "drivers/misc/inv_mpu/Kconfig"
source "drivers/misc/ti-st/Kconfig"
source "drivers/misc/lis3lv02d/Kconfig"
source "drivers/misc/carma/Kconfig"

1
drivers/misc/Makefile Normal file → Executable file
View File

@@ -53,4 +53,5 @@ obj-$(CONFIG_ALTERA_STAPL) +=altera-stapl/
obj-$(CONFIG_INTEL_MEI) += mei/
obj-$(CONFIG_VMWARE_VMCI) += vmw_vmci/
obj-$(CONFIG_LATTICE_ECP3_CONFIG) += lattice-ecp3-config.o
obj-y += inv_mpu/
obj-$(CONFIG_SRAM) += sram.o

1
drivers/misc/inv_mpu/Kconfig Normal file → Executable file
View File

@@ -9,6 +9,7 @@ config MPU_SENSORS_TIMERIRQ
menuconfig: INV_SENSORS
tristate "Motion Processing Unit"
depends on I2C
default n
if INV_SENSORS

0
drivers/misc/inv_mpu/Makefile Normal file → Executable file
View File

0
drivers/misc/inv_mpu/README Normal file → Executable file
View File

0
drivers/misc/inv_mpu/accel/Kconfig Normal file → Executable file
View File

0
drivers/misc/inv_mpu/accel/Makefile Normal file → Executable file
View File

0
drivers/misc/inv_mpu/accel/adxl34x.c Normal file → Executable file
View File

4
drivers/misc/inv_mpu/accel/bma150.c Normal file → Executable file
View File

@@ -25,7 +25,7 @@
* @file bma150.c
* @brief Accelerometer setup and handling methods for Bosch BMA150.
*/
#define DEBUG
/* -------------------------------------------------------------------------- */
#include <linux/i2c.h>
#include <linux/module.h>
@@ -671,7 +671,7 @@ static int bma150_mod_probe(struct i2c_client *client,
struct bma150_mod_private_data *private_data;
int result = 0;
dev_info(&client->adapter->dev, "%s: %s,0x%x\n", __func__, devid->name,(unsigned int)client);
dev_info(&client->adapter->dev, "%s: %s\n", __func__, devid->name);
if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) {
result = -ENODEV;

16
drivers/misc/inv_mpu/accel/bma222.c Normal file → Executable file
View File

@@ -51,8 +51,6 @@
#define BMA222_PWR_REG (0x11)
#define BMA222_SOFTRESET_REG (0x14)
#define BMA222_INTTERUPTSET_REG (0x17)
#define BMA222_STATUS_RDY_MASK (0x80)
#define BMA222_FSR_MASK (0x0F)
#define BMA222_ODR_MASK (0x1F)
@@ -337,8 +335,6 @@ static int bma222_get_config(void *mlsl_handle,
break;
case MPU_SLAVE_CONFIG_IRQ_SUSPEND:
case MPU_SLAVE_CONFIG_IRQ_RESUME:
//zwp,TODO,need to add irq config???
return INV_SUCCESS;
default:
return INV_ERROR_FEATURE_NOT_IMPLEMENTED;
};
@@ -394,8 +390,6 @@ static int bma222_config(void *mlsl_handle,
*((long *)data->data));
case MPU_SLAVE_CONFIG_IRQ_SUSPEND:
case MPU_SLAVE_CONFIG_IRQ_RESUME:
//zwp,TODO,need to add irq config???
return INV_SUCCESS;
default:
return INV_ERROR_FEATURE_NOT_IMPLEMENTED;
};
@@ -512,18 +506,14 @@ static int bma222_read(void *mlsl_handle,
unsigned char *data)
{
int result = INV_SUCCESS;
/* result = inv_serial_read(mlsl_handle, pdata->address,
result = inv_serial_read(mlsl_handle, pdata->address,
BMA222_STATUS_REG, 1, data);
if (data[0] & BMA222_STATUS_RDY_MASK) {
*/
result = inv_serial_read(mlsl_handle, pdata->address,
slave->read_reg, slave->read_len, data);
return result;
/* } else{
} else
return INV_ERROR_ACCEL_DATA_NOT_READY;
}
*/
}
static struct ext_slave_descr bma222_descr = {
@@ -565,7 +555,7 @@ static int bma222_mod_probe(struct i2c_client *client,
struct ext_slave_platform_data *pdata;
struct bma222_mod_private_data *private_data;
int result = 0;
printk("%s,++++++++++++++++++++\n",__FUNCTION__);
dev_info(&client->adapter->dev, "%s: %s\n", __func__, devid->name);
if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) {

0
drivers/misc/inv_mpu/accel/bma250.c Normal file → Executable file
View File

0
drivers/misc/inv_mpu/accel/cma3000.c Normal file → Executable file
View File

0
drivers/misc/inv_mpu/accel/kxsd9.c Normal file → Executable file
View File

0
drivers/misc/inv_mpu/accel/lis331.c Normal file → Executable file
View File

0
drivers/misc/inv_mpu/accel/lis3dh.c Normal file → Executable file
View File

0
drivers/misc/inv_mpu/accel/lsm303dlx_a.c Normal file → Executable file
View File

0
drivers/misc/inv_mpu/accel/mma8450.c Normal file → Executable file
View File

0
drivers/misc/inv_mpu/accel/mma845x.c Normal file → Executable file
View File

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More