Firefly开源社区

打印 上一主题 下一主题

关于spi ioctr函数问题,求教

23

积分

0

威望

0

贡献

技术小白

积分
23

关于spi ioctr函数问题,求教

发表于 2016-1-20 10:15:13      浏览:7549 | 回复:3        打印      只看该作者   [复制链接] 楼主
现象:
我在spi驱动中的 file_operations s中有如下定义:

static const struct file_operations spidev_fops = {
        .owner =        THIS_MODULE,
        /* REVISIT switch to aio primitives, so that userspace
         * gets more complete API coverage.  It'll simplify things
         * too, except for the locking.
         */
        .write =        spidev_write,
        .read =                spidev_read,
        .unlocked_ioctl = spidev_ioctl,
        .compat_ioctl = spidev_compat_ioctl,
        .open =                spidev_open,
        .release =        spidev_release,
        .llseek =        no_llseek,
};

应用程序中调用:

compat_ioctl(handle_spi1dev, SPI_IOC_WR_BITS_PER_WORD,&cmd)


在编译时出现: linux/spi/spi.h:没有那个文件或目录?


请问,我如何才能调用驱动中定义的compat_ioctl?
回复

使用道具 举报

发表于 2016-1-20 10:20:34        只看该作者  沙发
看看在kernel/linux/spi/spi.h有没有,这个函数。或者使用grep来找函数,然后把找到这个函数的头文件加进去试试
暴走的创客!
回复

使用道具 举报

553

积分

1

威望

3

贡献

技术大神

Rank: 3Rank: 3

积分
553
发表于 2016-5-10 16:32:23        只看该作者  板凳
你的spidev_write,在用户空间调用的时候,有没有出现问题?
回复

使用道具 举报

553

积分

1

威望

3

贡献

技术大神

Rank: 3Rank: 3

积分
553
发表于 2016-5-10 16:33:04        只看该作者  地板
你的spidev_write,在用户空间调用的时候,有没有出现问题?你用spi来作什么的?
回复

使用道具 举报

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

本版积分规则

友情链接 : 爱板网 电子发烧友论坛 云汉电子社区 粤ICP备14022046号-2
快速回复 返回顶部 返回列表