Re: Simultaneously access to one i2c/dev-interface from different process to different i2c devices

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The kernel can handle the i2c-dev interface very well from multiple process.

When you open a file descriptor (/dev/i2c-x) a new client is created
on the i2c adapter corresponding to the id of the i2c dev just opened.
The client data is allocated into the file descriptor's private data.
each possess should open its own i2c dev fd for each adapter that
needs to be accessed. (the fd should also be closed within the i2c
process call wrapper you write). The kernel takes care of all locking
and the i2c-bus driver schedules the message ques. Just be shure to
open the i2c-dev with the non-blocking flag, to prevent locking out
your other threads/process from opening the device.

- Danielle

On Wed, Nov 5, 2014 at 12:58 AM, Matthias Klein
<matthias.klein@xxxxxxxxxxx> wrote:
> Hello,
>
> is it possible from different processes to access different i2c devices on
> the same i2c bus/adapter using the i2c/dev-interface from userland?
>
> Or can the i2c/dev-interface only ne used from a single process?
>
>
> How does the simultaneously access to one adapter works for i2c device
> drivers inside the kernel?
> Do they fail on a simultaneously access, or do they wait until the i2c
> adapter is ready/free for use?
>
>
> Best regards,
> Matthias
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
- Danielle Costantino
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux