LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* problem opening I2C device on MPC8260
@ 2005-03-12  7:57 Vijay Padiyar
  2005-03-12 13:54 ` Yuli Barcohen
  0 siblings, 1 reply; 2+ messages in thread
From: Vijay Padiyar @ 2005-03-12  7:57 UTC (permalink / raw)
  To: Yuli Barcohen, LinuxPPC Support

Hi there

I am running Linux-2.6.10 with BusyBox 1.0 on an MPC8260-based target. I'm
having problems opening the I2C controller device on the MPC8260.

I have now included I2C support in the kernel by setting the following
options:

CONFIG_I2C=y
CONFIG_I2C_CHARDEV=y

CONFIG_I2C_ALGOBIT=y

None of the options under "I2C Hardware Bus support" and "Hardware Sensor
Chip support" are set. Do I need to enable any of these for MPC8260?

I have also mounted the Sysfs filesystem using 'mount -t sysfs sysfs /sys'.
When the kernel boots up, I can see the following message:

"i2c /dev entries driver"

which is from the I2C module initialization function i2c_dev_init() in
i2c-dev.c. This means that the I2C module has been loaded and initialized
correctly. However, the /sys/class/i2c-dev folder is found to be *empty*.

I have also created the following I2C device files in my /dev folder:

mknod i2c-0 c 89 0
mknod i2c0 c 89 0
mknod i2c-1 c 89 1
mknod i2c1 c 89 1

When I try to open the I2C device from a user program in root mode, I get an
error and the value of errno is ENODEV.

if ((fd = open("/dev/i2c-0", O_RDWR)) < 0)
{
    printf ("Error: ");

    if (errno == ENODEV)
        printf ("No such device!\n");
}

Please tell me what I could be doing wrong? Is there anything I've missed in
setting up my configuration to use I2C? Is there anything more I need to do?

Regards

Vijay Padiyar

http://www.vijaypadiyar.eu.tf

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: problem opening I2C device on MPC8260
  2005-03-12  7:57 problem opening I2C device on MPC8260 Vijay Padiyar
@ 2005-03-12 13:54 ` Yuli Barcohen
  0 siblings, 0 replies; 2+ messages in thread
From: Yuli Barcohen @ 2005-03-12 13:54 UTC (permalink / raw)
  To: Vijay Padiyar; +Cc: LinuxPPC Support

>>>>> Vijay Padiyar writes:

...

    Vijay> When I try to open the I2C device from a user program in root
    Vijay> mode, I get an error and the value of errno is ENODEV.

...

This means that there is no I2C controller driver in your
kernel. Probably you use stock kernel which does not contain driver for
CPM I2C. You have to look for a custom kernel (I can offer Arabella
Linux) or try to apply one of the patches which were posted in the past.

Best regards,
-- 
========================================================================
 Yuli Barcohen       | Phone +972-9-765-1788 |  Software Project Leader
 yuli@arabellasw.com | Fax   +972-9-765-7494 | Arabella Software, Israel
========================================================================

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-03-12 13:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-12  7:57 problem opening I2C device on MPC8260 Vijay Padiyar
2005-03-12 13:54 ` Yuli Barcohen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox