[AIO] Kernel->support mma8452 gsensor

This commit is contained in:
lizs
2017-11-30 14:20:31 +08:00
committed by cjp
parent a64f417a76
commit 8d8b3a5afa
6 changed files with 17 additions and 5 deletions

View File

@ -38,8 +38,8 @@ EXTENDED_FONT_FOOTPRINT := true
MALLOC_IMPL := dlmalloc
# Sensors
BOARD_SENSOR_ST := false
BOARD_SENSOR_MPU := true
BOARD_SENSOR_ST := true
BOARD_SENSOR_MPU := false
BOARD_USES_GENERIC_INVENSENSE := false
# ------------ #

View File

@ -463,6 +463,16 @@
&i2c4 {
status = "okay";
sensor@1d {
compatible = "gs_mma8452";
reg = <0x1d>;
type = <SENSOR_TYPE_ACCEL>;
irq-gpio = <&gpio5 GPIO_C2 GPIO_ACTIVE_HIGH>;
irq_enable = <1>;
poll_delay_ms = <30>;
layout = <2>;
};
};
&i2c5 {

View File

@ -102,7 +102,7 @@
flip-y = <1>;
swap-xy = <0>;
};
/*
mpu6050:mpu@68{
status = "okay";
compatible = "mpu6050";
@ -116,6 +116,7 @@
irq-gpio = <&gpio5 GPIO_C2 GPIO_ACTIVE_LOW>;
mpu-debug = <0>;
};
*/
};
&pwm1 {

View File

@ -151,7 +151,7 @@
flip-y = <1>;
swap-xy = <0>;
};
/*
mpu6050:mpu@68{
status = "okay";
compatible = "mpu6050";
@ -165,6 +165,7 @@
irq-gpio = <&gpio5 GPIO_C2 GPIO_ACTIVE_LOW>;
mpu-debug = <0>;
};
*/
};
&pwm1 {

Binary file not shown.

View File

@ -684,7 +684,7 @@ static int mma8452_init_client(struct i2c_client *client)
}
gpio_pull_updown(client->irq, GPIOPullUp);
irq = gpio_to_irq(client->irq);
ret = request_irq(irq, mma8452_interrupt, IRQF_TRIGGER_LOW, client->dev.driver->name, mma8452);
ret = request_irq(irq, mma8452_interrupt, IRQF_TRIGGER_HIGH, client->dev.driver->name, mma8452);
mmaprintk("request irq is %d,ret is 0x%x\n",irq,ret);
if (ret ) {
gpio_free(client->irq);