Discussion:
[OpenWrt-Devel] i2c device not in /dev
Baptiste Clenet
2015-09-14 17:28:31 UTC
Permalink
Hi,

I'm using a MT7628 chip and I try to implement an I2C device which
will use i2c-ralink adapter. I registered my i2c device with
module_i2c_driver(i2c_device_driver);

I can see it on my bus:
./sys/bus/i2c/drivers/i2c_device_driver
But it doesn't appear in /dev.

What am I doing wrong?

Regards,
--
Baptiste
John Crispin
2015-09-14 17:47:08 UTC
Permalink
Post by Baptiste Clenet
Hi,
I'm using a MT7628 chip and I try to implement an I2C device which
will use i2c-ralink adapter. I registered my i2c device with
module_i2c_driver(i2c_device_driver);
./sys/bus/i2c/drivers/i2c_device_driver
But it doesn't appear in /dev.
What am I doing wrong?
Regards,
you are missing CONFIG_I2C_CHARDEV in the kernel config

John
Daniel Golle
2015-09-14 18:09:53 UTC
Permalink
Post by John Crispin
Post by Baptiste Clenet
Hi,
I'm using a MT7628 chip and I try to implement an I2C device which
will use i2c-ralink adapter. I registered my i2c device with
module_i2c_driver(i2c_device_driver);
./sys/bus/i2c/drivers/i2c_device_driver
But it doesn't appear in /dev.
What am I doing wrong?
Regards,
you are missing CONFIG_I2C_CHARDEV in the kernel config
or maybe i2c-dev isn't loaded? try
modprobe i2c-dev
John Crispin
2015-09-14 18:17:13 UTC
Permalink
Post by Daniel Golle
Post by John Crispin
Post by Baptiste Clenet
Hi,
I'm using a MT7628 chip and I try to implement an I2C device which
will use i2c-ralink adapter. I registered my i2c device with
module_i2c_driver(i2c_device_driver);
./sys/bus/i2c/drivers/i2c_device_driver
But it doesn't appear in /dev.
What am I doing wrong?
Regards,
you are missing CONFIG_I2C_CHARDEV in the kernel config
or maybe i2c-dev isn't loaded? try
modprobe i2c-dev
i2c-dev is part of i2c-core if that symbol is selected. i2c-core uses
AutoLoad and not AutoProbe so it should always load.

John
Baptiste Clenet
2015-09-15 11:57:04 UTC
Permalink
Post by John Crispin
Post by Daniel Golle
Post by John Crispin
Post by Baptiste Clenet
Hi,
I'm using a MT7628 chip and I try to implement an I2C device which
will use i2c-ralink adapter. I registered my i2c device with
module_i2c_driver(i2c_device_driver);
./sys/bus/i2c/drivers/i2c_device_driver
But it doesn't appear in /dev.
What am I doing wrong?
Regards,
you are missing CONFIG_I2C_CHARDEV in the kernel config
or maybe i2c-dev isn't loaded? try
modprobe i2c-dev
i2c-dev is part of i2c-core if that symbol is selected. i2c-core uses
AutoLoad and not AutoProbe so it should always load.
Thnaks for the answer.

i2c-dev and i2c-core are loaded as well as i2c-ralink and my i2c
driver. How to add CONFIG_I2C_CHARDEV? I added it in
/target/linux/ramips config file of my board but it hasn't changed
anything. How may I check that the config has really been added?

By the way, is there a similar CONFIG for SPI, like CONFIG_SPI_CHARDEV ?
Post by John Crispin
John
_______________________________________________
openwrt-devel mailing list
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
--
Baptiste
Baptiste Clenet
2015-09-15 15:32:29 UTC
Permalink
Post by Baptiste Clenet
Post by John Crispin
Post by Daniel Golle
Post by John Crispin
Post by Baptiste Clenet
Hi,
I'm using a MT7628 chip and I try to implement an I2C device which
will use i2c-ralink adapter. I registered my i2c device with
module_i2c_driver(i2c_device_driver);
./sys/bus/i2c/drivers/i2c_device_driver
But it doesn't appear in /dev.
What am I doing wrong?
Regards,
you are missing CONFIG_I2C_CHARDEV in the kernel config
or maybe i2c-dev isn't loaded? try
modprobe i2c-dev
i2c-dev is part of i2c-core if that symbol is selected. i2c-core uses
AutoLoad and not AutoProbe so it should always load.
Thnaks for the answer.
i2c-dev and i2c-core are loaded as well as i2c-ralink and my i2c
driver. How to add CONFIG_I2C_CHARDEV? I added it in
/target/linux/ramips config file of my board but it hasn't changed
anything. How may I check that the config has really been added?
By the way, is there a similar CONFIG for SPI, like CONFIG_SPI_CHARDEV ?
Post by John Crispin
John
_______________________________________________
openwrt-devel mailing list
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
--
Baptiste
Actually, here is my configuration:
I've got my driver in /sys/bus/i2c/drivers
Nothing in /sys/bus/i2c/devices
Nothing in /sys/class/i2c-dev as well.

Concerning CONFIG_I2C_CHARDEV, it seems that it is automatically added
with i2c-core so it should be compiled in my distrib. (Do you know how
I can check?)

Cheers,
--
Baptiste
Baptiste Clenet
2015-09-16 19:46:08 UTC
Permalink
Works now! Think the .dts wasn't taken into account correctly.
Post by Baptiste Clenet
Post by Baptiste Clenet
Post by John Crispin
Post by Daniel Golle
Post by John Crispin
Post by Baptiste Clenet
Hi,
I'm using a MT7628 chip and I try to implement an I2C device which
will use i2c-ralink adapter. I registered my i2c device with
module_i2c_driver(i2c_device_driver);
./sys/bus/i2c/drivers/i2c_device_driver
But it doesn't appear in /dev.
What am I doing wrong?
Regards,
you are missing CONFIG_I2C_CHARDEV in the kernel config
or maybe i2c-dev isn't loaded? try
modprobe i2c-dev
i2c-dev is part of i2c-core if that symbol is selected. i2c-core uses
AutoLoad and not AutoProbe so it should always load.
Thnaks for the answer.
i2c-dev and i2c-core are loaded as well as i2c-ralink and my i2c
driver. How to add CONFIG_I2C_CHARDEV? I added it in
/target/linux/ramips config file of my board but it hasn't changed
anything. How may I check that the config has really been added?
By the way, is there a similar CONFIG for SPI, like CONFIG_SPI_CHARDEV ?
Post by John Crispin
John
_______________________________________________
openwrt-devel mailing list
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
--
Baptiste
I've got my driver in /sys/bus/i2c/drivers
Nothing in /sys/bus/i2c/devices
Nothing in /sys/class/i2c-dev as well.
Concerning CONFIG_I2C_CHARDEV, it seems that it is automatically added
with i2c-core so it should be compiled in my distrib. (Do you know how
I can check?)
Cheers,
--
Baptiste
The probleme was not in my driver file but in the adapter file,
i2c-dev.h was not included.
--
Baptiste
Loading...