九鼎创展论坛中文版English
登录 | 立即注册 设为首页收藏本站 切换到宽版
查看: 3457|回复: 1
打印 上一主题 下一主题

如何配置SPI slave设备驱动加载?

[复制链接]
跳转到指定楼层
楼主
发表于 2016-11-1 09:59:14 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
我要将wk2124驱动程序添加到咱的x4418开发板上去,在kconfig里面配置
#
# There are lots of SPI device types, with sensors and memory
# being probably the most widely used ones.
#
comment "SPI Protocol Masters"

config SPI_SPIDEV
        tristate "User mode SPI device driver support"
        depends on EXPERIMENTAL
        help
          This supports user mode SPI protocol drivers.

          Note that this application programming interface is EXPERIMENTAL
          and hence SUBJECT TO CHANGE WITHOUT NOTICE while it stabilizes.

config SPI_TLE62X0
        tristate "Infineon TLE62X0 (for power switching)"
        depends on SYSFS
        help
          SPI driver for Infineon TLE62X0 series line driver chips,
          such as the TLE6220, TLE6230 and TLE6240.  This provides a
          sysfs interface, with each line presented as a kind of GPIO
          exposing both switch control and diagnostic feedback.
#hanping add wk2xxx_spi driver for config  +
config SPI_WK2XXX
        tristate "wk2xxx user mode spi device driver support"
        depends on EXPERIMENTAL
        help
           SPI device wk2xxx.
#hanping add wk2xxx_spi driver for config  -
#
# Add new SPI protocol masters in alphabetical order above this line
#

在makefile配置
obj-$(CONFIG_SPI_SPIDEV)                += spidev.o
obj-$(CONFIG_SPI_WK2XXX)        += spi-wk2xxx.o
用makemenuconfig配置后,将congfig文件覆盖x4418_defconfig.h文件,运行./mk -a后报错如下,
arch/arm/mach-s5p4418/prototype/module/nx_lvds.c:29:28: warning: conflicting types for built-in function 'pow' [enabled by default]
arch/arm/mach-s5p4418/prototype/module/nx_mlc.c: In function 'NX_MLC_GetExtendedColor':
arch/arm/mach-s5p4418/prototype/module/nx_mlc.c:1320:13: warning: 'bp[0]' may be used uninitialized in this function [-Wuninitialized]
arch/arm/mach-s5p4418/prototype/module/nx_mlc.c:1320:6: warning: 'bw[0]' may be used uninitialized in this function [-Wuninitialized]
  CC      arch/arm/mach-s5p4418/prototype/module/nx_rtc.o
  CC      drivers/spi/spi-wk2xxx.o
  CC      arch/arm/mach-s5p4418/prototype/module/nx_pwm.o
drivers/spi/spi-wk2xxx.c:31:22: fatal error: mach/map.h: No such file or directory
compilation terminated.
make[2]: *** [drivers/spi/spi-wk2xxx.o] Error 1
make[1]: *** [drivers/spi] Error 2
make[1]: *** Waiting for unfinished jobs....
  CC      arch/arm/mach-s5p4418/prototype/module/nx_hdmi.o
  LD      arch/arm/mach-s5p4418/built-in.o
make: *** [drivers] Error 2
make: *** Waiting for unfinished jobs....
这是什么原因呢?
在网上看,说是slave设备不需要加载到makefile里面,不加载进去,在配置的时候,不能想spidev一样进 入probe函数,现在请教大家,要如何配置才能加载设备并进入到spi-wk2xxx.c文件的probe函数呢?
回复

使用道具 举报

沙发
 楼主| 发表于 2016-11-1 18:21:16 | 只看该作者
问题已经解决:系统加载的文件里面,有的头文件没有在x4418开发板的文件对应位置,将其调整到对应位置,就不会报错,就可以加载到probe函数里面了。然后就是修改两个的配置问题。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|小黑屋|深圳市九鼎创展科技官方论坛 ( 粤ICP备11028681号-2  

GMT+8, 2024-7-1 18:01 , Processed in 0.019243 second(s), 17 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表