How to enable IIO driver in 3.18 kernel
HI team, We are integrating one sensor driver in to LE platform. After adding sensor driver, it is creating device @ /sys/bus/iio/devices/iio:device0,1,2. Sensor driver makes use of IIO subsystem framework. We are not seeing iio device creation @ */dev/iio:device0*,1,2 I have enabled below configuration in the defconfing along with sensor configuration. CONFIG_IIO=y CONFIG_IIO_BUFFER=y CONFIG_IIO_BUFFER_CB=y CONFIG_IIO_KFIFO_BUF=y CONFIG_IIO_TRIGGERED_BUFFER=y CONFIG_IIO_TRIGGER=y CONFIG_IIO_CONSUMERS_PER_TRIGGER=2 I'm able to see kernel prints from"iio_device_register" function. Appreciate any pointers on this regard. Kernel version: 3.18 -- Regards Naresh Babu 09900139337
On Wed, 01 Jun 2016 08:19:20 +0530, Munagala Naresh said:
We are integrating one sensor driver in to LE platform. After adding sensor driver, it is creating device @ /sys/bus/iio/devices/iio:device0,1,2.
Sensor driver makes use of IIO subsystem framework. We are not seeing iio device creation @ */dev/iio:device0*,1,2
The kernel is creating your device in /sys. You need to either get udev knowing what to do to mknod the /dev entry, or check if your kernel config has: CONFIG_DEVTMPFS=y CONFIG_DEVTMPFS_MOUNT=y so the kernel takes care of it for you.
Thanks for the response.
From the "cat /proc/devices", I could see "iio" listed like this.
/ # cat /proc/devices cat /proc/devices Character devices: 1 mem 4 /dev/vc/0 4 tty 5 /dev/tty 5 /dev/console 5 /dev/ptmx ------ *250 iio* 251 pps ----- I could see few other deices @ /dev/xxxx. CONFIG_DEVTMPFS is not set in the def config. I will try it by adding "CONFIG_DEVTMPFS=y" and "CONFIG_DEVTMPFS_MOUNT=y". Thanks, Naresh On Wed, Jun 1, 2016 at 9:41 AM, <Valdis.Kletnieks@vt.edu> wrote:
On Wed, 01 Jun 2016 08:19:20 +0530, Munagala Naresh said:
We are integrating one sensor driver in to LE platform. After adding sensor driver, it is creating device @ /sys/bus/iio/devices/iio:device0,1,2.
Sensor driver makes use of IIO subsystem framework. We are not seeing iio device creation @ */dev/iio:device0*,1,2
The kernel is creating your device in /sys. You need to either get udev knowing what to do to mknod the /dev entry, or check if your kernel config has:
CONFIG_DEVTMPFS=y CONFIG_DEVTMPFS_MOUNT=y
so the kernel takes care of it for you.
-- Regards Naresh Babu 09900139337
On Wed, Jun 1, 2016 at 5:26 PM, Munagala Naresh <munagala.nareshbabu@gmail.com> wrote:
Thanks for the response.
From the "cat /proc/devices", I could see "iio" listed like this.
/ # cat /proc/devices cat /proc/devices Character devices: 1 mem 4 /dev/vc/0 4 tty 5 /dev/tty 5 /dev/console 5 /dev/ptmx ------ 250 iio 251 pps -----
I could see few other deices @ /dev/xxxx. CONFIG_DEVTMPFS is not set in the def config. I will try it by adding "CONFIG_DEVTMPFS=y" and "CONFIG_DEVTMPFS_MOUNT=y".
Please don't use top posting. You can look into /sys/bus/iio/devices/iio:device0/dev and get the MAJOR and MINOR, then create the device node manually, using: mknod /dev/iio:device0 c MAJOR MINOR Not sure why are you mentioning /proc/devices here. thanks, Daniel.
Thanks Daniel. After creating devices using mknod, it is working on expected lines. After reboot these devices are getting removed and I need to create them manually every time. Can you please suggest me the procedure to enable it programmatically ? I tried adding CONFIG_DEVTMPFS=y and CONFIG_DEVTMPFS_MOUNT=y in the def config, but no luck. Thanks Naresh On Wed, Jun 1, 2016 at 8:11 PM, Daniel Baluta <daniel.baluta@gmail.com> wrote:
On Wed, Jun 1, 2016 at 5:26 PM, Munagala Naresh <munagala.nareshbabu@gmail.com> wrote:
Thanks for the response.
From the "cat /proc/devices", I could see "iio" listed like this.
/ # cat /proc/devices cat /proc/devices Character devices: 1 mem 4 /dev/vc/0 4 tty 5 /dev/tty 5 /dev/console 5 /dev/ptmx ------ 250 iio 251 pps -----
I could see few other deices @ /dev/xxxx. CONFIG_DEVTMPFS is not set in the def config. I will try it by adding "CONFIG_DEVTMPFS=y" and "CONFIG_DEVTMPFS_MOUNT=y".
Please don't use top posting.
You can look into /sys/bus/iio/devices/iio:device0/dev and get the MAJOR and MINOR, then create the device node manually, using:
mknod /dev/iio:device0 c MAJOR MINOR
Not sure why are you mentioning /proc/devices here.
thanks, Daniel.
-- Regards Naresh Babu 09900139337
participants (3)
-
Daniel Baluta -
Munagala Naresh -
Valdis.Kletnieks@vt.edu