Jay Zhang

mma8451 interrupt mode

Discussion created by Jay Zhang on Apr 24, 2012

On our customer board, we use mma8451(g-sensor) to do something. 

In the Linux BSP the driver is running with polling mode, I think it is less efficiency, so I want to change it to interrupt mode.

I set the register into interrupt mode, but I can't get interrupt when I move the sensor module, Is there any one had done this?

Attachment file is my driver.

In the board level file, I set this:

static struct i2c_board_info mxc_i2c0_board_info[] __initdata = {
{
.type = "mma8451",
.addr = 0x1C,
.irq = gpio_to_irq(MX53_SMD_ACCL_INT1_IN), //+++++add by Jay for g-sensor interrupt mode
},

...

//+++++add by Jay for g-sensor interrupt mode to get data
gpio_request(MX53_SMD_ACCL_INT1_IN, "gsensor-irq");
msleep(5);
gpio_direction_input(MX53_SMD_ACCL_INT1_IN);
//-----end add

Original Attachment has been moved to: 207-mxc_mma8451.c

Outcomes