mirror of
https://github.com/hardkernel/linux.git
synced 2026-04-13 00:50:39 +09:00
path mpu code
This commit is contained in:
4
drivers/misc/Kconfig
Executable file → Normal file
4
drivers/misc/Kconfig
Executable file → Normal file
@@ -300,10 +300,6 @@ config MU509
|
||||
bool "MU509 modem control driver"
|
||||
default n
|
||||
|
||||
config RK29_NEWTON
|
||||
bool "RK29_NEWTON misc driver"
|
||||
default n
|
||||
|
||||
source "drivers/misc/c2port/Kconfig"
|
||||
source "drivers/misc/eeprom/Kconfig"
|
||||
source "drivers/misc/cb710/Kconfig"
|
||||
|
||||
2
drivers/misc/Makefile
Executable file → Normal file
2
drivers/misc/Makefile
Executable file → Normal file
@@ -35,5 +35,3 @@ obj-$(CONFIG_STE) += ste.o
|
||||
obj-$(CONFIG_RK29_SUPPORT_MODEM) += rk29_modem/
|
||||
obj-$(CONFIG_GPS_GNS7560) += gps/
|
||||
obj-y += mpu3050/
|
||||
obj-$(CONFIG_RK29_NEWTON) += newton.o
|
||||
|
||||
|
||||
0
drivers/misc/mpu3050/Kconfig
Executable file → Normal file
0
drivers/misc/mpu3050/Kconfig
Executable file → Normal file
0
drivers/misc/mpu3050/Makefile
Executable file → Normal file
0
drivers/misc/mpu3050/Makefile
Executable file → Normal file
0
drivers/misc/mpu3050/README
Executable file → Normal file
0
drivers/misc/mpu3050/README
Executable file → Normal file
0
drivers/misc/mpu3050/accel/adxl346.c
Executable file → Normal file
0
drivers/misc/mpu3050/accel/adxl346.c
Executable file → Normal file
0
drivers/misc/mpu3050/accel/bma150.c
Executable file → Normal file
0
drivers/misc/mpu3050/accel/bma150.c
Executable file → Normal file
0
drivers/misc/mpu3050/accel/bma222.c
Executable file → Normal file
0
drivers/misc/mpu3050/accel/bma222.c
Executable file → Normal file
0
drivers/misc/mpu3050/accel/cma3000.c
Executable file → Normal file
0
drivers/misc/mpu3050/accel/cma3000.c
Executable file → Normal file
0
drivers/misc/mpu3050/accel/kxsd9.c
Executable file → Normal file
0
drivers/misc/mpu3050/accel/kxsd9.c
Executable file → Normal file
0
drivers/misc/mpu3050/accel/kxtf9.c
Executable file → Normal file
0
drivers/misc/mpu3050/accel/kxtf9.c
Executable file → Normal file
0
drivers/misc/mpu3050/accel/lis331.c
Executable file → Normal file
0
drivers/misc/mpu3050/accel/lis331.c
Executable file → Normal file
0
drivers/misc/mpu3050/accel/lis3dh.c
Executable file → Normal file
0
drivers/misc/mpu3050/accel/lis3dh.c
Executable file → Normal file
0
drivers/misc/mpu3050/accel/lsm303a.c
Executable file → Normal file
0
drivers/misc/mpu3050/accel/lsm303a.c
Executable file → Normal file
0
drivers/misc/mpu3050/accel/mantis.c
Executable file → Normal file
0
drivers/misc/mpu3050/accel/mantis.c
Executable file → Normal file
0
drivers/misc/mpu3050/accel/mma8450.c
Executable file → Normal file
0
drivers/misc/mpu3050/accel/mma8450.c
Executable file → Normal file
4
drivers/misc/mpu3050/accel/mma845x.c
Executable file → Normal file
4
drivers/misc/mpu3050/accel/mma845x.c
Executable file → Normal file
@@ -35,11 +35,11 @@
|
||||
#include <linux/module.h>
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
//#include <stdlib.h>
|
||||
#include "mpu.h"
|
||||
#include "mlsl.h"
|
||||
#include "mlos.h"
|
||||
#include <string.h>
|
||||
//#include <string.h>
|
||||
|
||||
#include <log.h>
|
||||
#undef MPL_LOG_TAG
|
||||
|
||||
0
drivers/misc/mpu3050/compass/ak8975.c
Executable file → Normal file
0
drivers/misc/mpu3050/compass/ak8975.c
Executable file → Normal file
0
drivers/misc/mpu3050/compass/ami306.c
Executable file → Normal file
0
drivers/misc/mpu3050/compass/ami306.c
Executable file → Normal file
0
drivers/misc/mpu3050/compass/ami30x.c
Executable file → Normal file
0
drivers/misc/mpu3050/compass/ami30x.c
Executable file → Normal file
0
drivers/misc/mpu3050/compass/hmc5883.c
Executable file → Normal file
0
drivers/misc/mpu3050/compass/hmc5883.c
Executable file → Normal file
0
drivers/misc/mpu3050/compass/hscdtd002b.c
Executable file → Normal file
0
drivers/misc/mpu3050/compass/hscdtd002b.c
Executable file → Normal file
0
drivers/misc/mpu3050/compass/hscdtd004a.c
Executable file → Normal file
0
drivers/misc/mpu3050/compass/hscdtd004a.c
Executable file → Normal file
0
drivers/misc/mpu3050/compass/lsm303m.c
Executable file → Normal file
0
drivers/misc/mpu3050/compass/lsm303m.c
Executable file → Normal file
0
drivers/misc/mpu3050/compass/mmc314x.c
Executable file → Normal file
0
drivers/misc/mpu3050/compass/mmc314x.c
Executable file → Normal file
0
drivers/misc/mpu3050/compass/yas529-kernel.c
Executable file → Normal file
0
drivers/misc/mpu3050/compass/yas529-kernel.c
Executable file → Normal file
0
drivers/misc/mpu3050/compass/yas530-kernel.c
Executable file → Normal file
0
drivers/misc/mpu3050/compass/yas530-kernel.c
Executable file → Normal file
0
drivers/misc/mpu3050/compass/yas530.c
Executable file → Normal file
0
drivers/misc/mpu3050/compass/yas530.c
Executable file → Normal file
0
drivers/misc/mpu3050/log.h
Executable file → Normal file
0
drivers/misc/mpu3050/log.h
Executable file → Normal file
0
drivers/misc/mpu3050/mldl_cfg.c
Executable file → Normal file
0
drivers/misc/mpu3050/mldl_cfg.c
Executable file → Normal file
0
drivers/misc/mpu3050/mldl_cfg.h
Executable file → Normal file
0
drivers/misc/mpu3050/mldl_cfg.h
Executable file → Normal file
0
drivers/misc/mpu3050/mlos-kernel.c
Executable file → Normal file
0
drivers/misc/mpu3050/mlos-kernel.c
Executable file → Normal file
0
drivers/misc/mpu3050/mlos.h
Executable file → Normal file
0
drivers/misc/mpu3050/mlos.h
Executable file → Normal file
0
drivers/misc/mpu3050/mlsl-kernel.c
Executable file → Normal file
0
drivers/misc/mpu3050/mlsl-kernel.c
Executable file → Normal file
0
drivers/misc/mpu3050/mlsl.h
Executable file → Normal file
0
drivers/misc/mpu3050/mlsl.h
Executable file → Normal file
0
drivers/misc/mpu3050/mltypes.h
Executable file → Normal file
0
drivers/misc/mpu3050/mltypes.h
Executable file → Normal file
0
drivers/misc/mpu3050/mpu-dev.c
Executable file → Normal file
0
drivers/misc/mpu3050/mpu-dev.c
Executable file → Normal file
0
drivers/misc/mpu3050/mpu-i2c.c
Executable file → Normal file
0
drivers/misc/mpu3050/mpu-i2c.c
Executable file → Normal file
0
drivers/misc/mpu3050/mpu-i2c.h
Executable file → Normal file
0
drivers/misc/mpu3050/mpu-i2c.h
Executable file → Normal file
27
drivers/misc/mpu3050/mpuirq.c
Executable file → Normal file
27
drivers/misc/mpu3050/mpuirq.c
Executable file → Normal file
@@ -29,6 +29,8 @@
|
||||
#include <linux/i2c-dev.h>
|
||||
#include <linux/workqueue.h>
|
||||
#include <linux/poll.h>
|
||||
#include <linux/gpio.h>
|
||||
#include <mach/gpio.h>
|
||||
|
||||
#include <linux/errno.h>
|
||||
#include <linux/fs.h>
|
||||
@@ -72,6 +74,9 @@ static int mpuirq_open(struct inode *inode, struct file *file)
|
||||
"%s current->pid %d\n", __func__, current->pid);
|
||||
mpuirq_dev_data.pid = current->pid;
|
||||
file->private_data = &mpuirq_dev_data;
|
||||
/* we could do some checking on the flags supplied by "open" */
|
||||
/* i.e. O_NONBLOCK */
|
||||
/* -> set some flag to disable interruptible_sleep_on in mpuirq_read */
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -274,10 +279,24 @@ int mpuirq_init(struct i2c_client *mpu_client)
|
||||
flags = IRQF_TRIGGER_FALLING;
|
||||
else
|
||||
flags = IRQF_TRIGGER_RISING;
|
||||
|
||||
res =
|
||||
request_irq(mpuirq_dev_data.irq, mpuirq_handler, flags,
|
||||
interface, &mpuirq_dev_data.irq);
|
||||
/* mpu irq register xxm*/
|
||||
res = gpio_request(mpuirq_dev_data.irq, "mpu3050_int");
|
||||
if(res)
|
||||
{
|
||||
printk("failed to request mpu3050_int GPIO %d\n",
|
||||
gpio_to_irq(mpuirq_dev_data.irq));
|
||||
return res;
|
||||
}
|
||||
res = gpio_direction_input(mpuirq_dev_data.irq);
|
||||
if(res)
|
||||
{
|
||||
printk("failed to set mpu3050_int GPIO input\n");
|
||||
return res;
|
||||
}
|
||||
printk("gpio_to_irq(mpuirq_dev_data.irq) == %d \r\n",
|
||||
gpio_to_irq(mpuirq_dev_data.irq));
|
||||
res =request_irq(gpio_to_irq(mpuirq_dev_data.irq), mpuirq_handler, flags,
|
||||
interface,&mpuirq_dev_data.irq);
|
||||
if (res) {
|
||||
dev_err(&mpu_client->adapter->dev,
|
||||
"myirqtest: cannot register IRQ %d\n",
|
||||
|
||||
0
drivers/misc/mpu3050/mpuirq.h
Executable file → Normal file
0
drivers/misc/mpu3050/mpuirq.h
Executable file → Normal file
23
drivers/misc/mpu3050/slaveirq.c
Executable file → Normal file
23
drivers/misc/mpu3050/slaveirq.c
Executable file → Normal file
@@ -28,6 +28,8 @@
|
||||
#include <linux/i2c.h>
|
||||
#include <linux/i2c-dev.h>
|
||||
#include <linux/poll.h>
|
||||
#include <linux/gpio.h>
|
||||
#include <mach/gpio.h>
|
||||
|
||||
#include <linux/errno.h>
|
||||
#include <linux/fs.h>
|
||||
@@ -225,10 +227,25 @@ int slaveirq_init(struct i2c_adapter *slave_adapter,
|
||||
data->data_ready = 0;
|
||||
data->timeout = 0;
|
||||
|
||||
/* mpu irq register xxm*/
|
||||
res = gpio_request(data->irq, name);
|
||||
if(res)
|
||||
{
|
||||
printk("failed to request %s GPIO %d\n",
|
||||
name,data->irq);
|
||||
return res;
|
||||
}
|
||||
res = gpio_direction_input(data->irq);
|
||||
if(res)
|
||||
{
|
||||
printk("failed to set %s GPIO input\n",name);
|
||||
return res;
|
||||
}
|
||||
printk("%s registing irq == %d \r\n",name,gpio_to_irq(data->irq));
|
||||
//gpio_pull_updown(data->irq, GPIOPullUp);
|
||||
//gpio_set_value(data->irq,GPIO_HIGH);
|
||||
init_waitqueue_head(&data->slaveirq_wait);
|
||||
|
||||
res = request_irq(data->irq, slaveirq_handler, IRQF_TRIGGER_RISING,
|
||||
data->dev.name, data);
|
||||
res = request_irq(gpio_to_irq(data->irq), slaveirq_handler, IRQF_TRIGGER_FALLING,data->dev.name, data);
|
||||
|
||||
if (res) {
|
||||
dev_err(&slave_adapter->dev,
|
||||
|
||||
0
drivers/misc/mpu3050/slaveirq.h
Executable file → Normal file
0
drivers/misc/mpu3050/slaveirq.h
Executable file → Normal file
0
drivers/misc/mpu3050/timerirq.c
Executable file → Normal file
0
drivers/misc/mpu3050/timerirq.c
Executable file → Normal file
0
drivers/misc/mpu3050/timerirq.h
Executable file → Normal file
0
drivers/misc/mpu3050/timerirq.h
Executable file → Normal file
0
include/linux/mpu.h
Executable file → Normal file
0
include/linux/mpu.h
Executable file → Normal file
0
include/linux/mpu3050.h
Executable file → Normal file
0
include/linux/mpu3050.h
Executable file → Normal file
0
include/linux/mpu6000.h
Executable file → Normal file
0
include/linux/mpu6000.h
Executable file → Normal file
Reference in New Issue
Block a user