昨晚在编译android4.2内核3.3版本的时候,在menuconfig中选择了eeti编译进内核,可是报错了
/home/arnd/linux-arm/drivers/input/touchscreen/eeti_ts.c: In function 'eeti_ts_irq_active':
/home/arnd/linux-arm/drivers/input/touchscreen/eeti_ts.c:65:2: error: implicit declaration of function 'irq_to_gpio' [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors
make[4]: *** [drivers/input/touchscreen/eeti_ts.o] Error 1
make[3]: *** [drivers/input/touchscreen] Error 2
make[2]: *** [drivers/input] Error 2
make[1]: *** [drivers] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [sub-make] Error 2
解决办法如下
修改3个文件
arch/arm/mach-pxa/raumfeld.c
drivers/input/touchscreen/eeti_ts.c
include/linux/input/eeti_ts.h
raumfeld.c文件
static struct eeti_ts_platform_data eeti_ts_pdata = {
.irq_active_high = 1,
+ .gpio = GPIO_TOUCH_IRQ,
};
static struct i2c_board_info raumfeld_controller_i2c_board_info __initdata = {
eeti_ts.c文件
struct input_dev *input;
struct work_struct work;
struct mutex mutex;
- int irq, irq_active_high;
+ int irq, gpio, irq_active_high;
};
#define EETI_TS_BITDEPTH (11)
static inline int eeti_ts_irq_active(struct eeti_ts_priv *priv)
{
- return gpio_get_value(irq_to_gpio(priv->irq)) == priv->irq_active_high;
+ return gpio_get_value(priv->gpio) == priv->irq_active_high;
}
pdata = client->dev.platform_data;
- if (pdata)
+ if (pdata) {
+ priv->gpio = pdata->gpio;
priv->irq_active_high = pdata->irq_active_high;
+ }
irq_flags = priv->irq_active_high ?
IRQF_TRIGGER_RISING : IRQF_TRIGGER_FALLING
eeti_ts.h文件
struct eeti_ts_platform_data {
unsigned int irq_active_high;
+ unsigned int gpio;
};
网络原文内容文本下载地址:
http://pan.baidu.com/s/1h7QQR