第一种方法:
文件1(drivers/mfd/Kconfig)中
删除depends on GENERIC_HARDIRQS && SPI_MASTER添加depends on GENERIC_HARDIRQS && SPI_MASTER && ARCH_PXA
文件2(/drivers/mfd/ezx-pcap.c)中
添加头文件#include <linux/gpio-pxa.h>
删除} while (gpio_get_value(irq_to_gpio(pcap->spi->irq)));
添加} while (gpio_get_value(pxa_irq_to_gpio(pcap->spi->irq)));
3:#include <linux/gpio-pxa.h> 可能需要自行复制gpio-pxa.h到内核源码 相应目录。例如:我的是复制到 /include/linux目录下。
第二种 方法:
先编译看下内核有没有问题,运行make命令出现下面的错误:
问题:drivers/input/touchscreen/eeti_ts.c:65: 错误: 隐式声明函数‘irq_to_gpio’
解决:重新make menuconfig,将driver中的输入设备->触摸设备中,将EETI选项不选,保存退出后,重新make
编译内核 出现过的错误:
问题1:
drivers/gpio/janz-ttl.c
implicit declaration of function 'iowrite16be'
解决方案:
添加宏定义:#define iowrite16be(v, addr) iowrite16(be16_to_cpu(v), (addr))
问题2:
drivers/char/s3c_mem.c中没有mach/map.h
解决方案:
去掉该文件中#include <mach/map.h>
问题3:
drivers/input/touchscreen/eeti_ts.c:65: error: implicit declaration of function 'irq_to_gpio'
解决方案:
a、raumfeld.c
static struct eeti_ts_platform_data eeti_ts_pdata = {
.irq_active_high = 1,
.gpio = GPIO_TOUCH_IRQ,//添加
};
b、/drivers/input/touchscreen/eeti_ts.c
struct eeti_ts_priv {
struct input_dev *input;
struct work_struct work;
struct mutex mutex;
int irq, irq_active_high;//删除
int irq, gpio, irq_active_high;//添加
};
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;//添加
}
if (pdata)
priv->irq_active_high = pdata->irq_active_high;
替换为
if (pdata) {
priv->gpio = pdata->gpio;
priv->irq_active_high = pdata->irq_active_high;
}
c、/include/linux/input/eeti_ts.h
struct eeti_ts_platform_data {
unsigned int irq_active_high;
unsigned int gpio;//添加
};
问题4:
drivers/mfd/ezx-pcap.c:205: error: implicit declaration of function 'irq_to_gpio'
解决方案:
这个因为没有找到解决的办法,所以就自己定义了这个变量
问题5:
drivers/mmc/core/mmc_ops.c:20:22: error: plat/cpu.h: No such file or directory
解决方案:
将头文件去掉
问题6:
drivers/mmc/host/sdhci.c中:S3C64XX_SDHCI_CONTROL4,S3C64XX_SDHCI_CONTROL4_BUSY未定义
解决方案:
头文件所在arch/arm/plat-samsung/include/plat/regs-sdhci.h中
实在不行就将定义拷过去
问题7:
drivers/scsi/osd/osd_initiator.c:67: error: size of array 'type name' is negative
解决方案:
注释掉报错的行,该内容定义以后并未被使用
问题8:
drivers/scsi/advansys.c:8376: error: implicit declaration of function 'dma_cache_sync'
解决方案:
该函数已经被放弃了,直接注释
问题9:
EABI版本不一致,链接失败
解决方案:
这个是由编译器版本过高导致的,在内核编译选项中选择Kernel Features中的Use the ARM EABI to compile the kernel
问题10:
drivers/staging/dt3155v4l/dt3155v4l.c:434: error: implicit declaration of function 'kzalloc'
解决方案:
添加头文件<linux/slab.h>
问题11:
drivers/staging/iio/accel/lis3l02dq_core.c:708: error: implicit declaration of function 'irq_to_gpio'
drivers/staging/iio/accel/lis3l02dq_ring.c:297: error: implicit declaration of function 'irq_to_gpio'
drivers/staging/iio/accel/sca3000_core.c:1169: error: implicit declaration of function 'irq_to_gpio'
drivers/staging/iio/imu/adis16400_core.c:822: error: implicit declaration of function 'irq_to_gpio'
解决方案:
这几个文件中的引用头文件中<linux/gpio.h>包含了该函数的定义
问题12:
drivers/staging/solo6x10/core.c:140: error: implicit declaration of function 'kzalloc'
drivers/staging/solo6x10/p2m.c:52: error: implicit declaration of function 'kzalloc'
drivers/staging/solo6x10/enc.c:101: error: implicit declaration of function 'kzalloc'
drivers/staging/solo6x10/g723.c:139: error: implicit declaration of function 'kzalloc'
解决方案:
添加头文件#include <linux/slab.h>
问题13:
drivers/staging/vme/bridges/vme_tsi148.c:130: error: implicit declaration of function 'ioread32be'
drivers/staging/vme/bridges/vme_tsi148.c:133: error: implicit declaration of function 'ioread32be'
drivers/tty/serial/uartlite.c:79: error: implicit declaration of function 'ioread32be'
drivers/tty/serial/uartlite.c:125: error: implicit declaration of function 'iowrite32be'
解决方案:
#define iowrite32be(v, addr) iowrite32(be32_to_cpu(v), (addr))
#define ioread32be(addr) be32_to_cpu(ioread32(addr))