Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1485371 > unrolled thread

Re: [PATCH 3/3] i2c: expose adapter probe and remove probed functions

Started byWolfram Sang <wsa@the-dreams.de>
First post2016-09-16 23:10 +0200
Last post2016-09-16 23:10 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH 3/3] i2c: expose adapter probe and remove probed functions Wolfram Sang <wsa@the-dreams.de> - 2016-09-16 23:10 +0200
    Re: [PATCH 3/3] i2c: expose adapter probe and remove probed functions David Lechner <david@lechnology.com> - 2016-09-16 23:10 +0200

#1485371 — Re: [PATCH 3/3] i2c: expose adapter probe and remove probed functions

FromWolfram Sang <wsa@the-dreams.de>
Date2016-09-16 23:10 +0200
SubjectRe: [PATCH 3/3] i2c: expose adapter probe and remove probed functions
Message-ID<si8yt-1HA-9@gated-at.bofh.it>

[Multipart message — attachments visible in raw view] — view raw

> The intended use of these functions is for LEGO MINDSTORMS sensors. These
> are hot-plugable I2C devices. When a sensor is connected, i2c_adapter_probe()
> is called to automatically configure the sensor. When the sensor is
> disconnected, i2c_adapter_remove_probed() is called to remove the
> automatically configured device.

How do you detect the hot-plug events?

[toc] | [next] | [standalone]


#1485372

FromDavid Lechner <david@lechnology.com>
Date2016-09-16 23:10 +0200
Message-ID<si8yu-1HA-31@gated-at.bofh.it>
In reply to#1485371
On 09/16/2016 04:03 PM, Wolfram Sang wrote:
>
>> The intended use of these functions is for LEGO MINDSTORMS sensors. These
>> are hot-plugable I2C devices. When a sensor is connected, i2c_adapter_probe()
>> is called to automatically configure the sensor. When the sensor is
>> disconnected, i2c_adapter_remove_probed() is called to remove the
>> automatically configured device.
>
> How do you detect the hot-plug events?
>

There are "port" drivers that do this. An I2C adapter is assigned to 
each port via device-tree or platform data struct.

Port driver code if you are interested:
- 
https://github.com/ev3dev/lego-linux-drivers/blob/master/ev3/legoev3_ports_in.c
- 
https://github.com/ev3dev/lego-linux-drivers/blob/master/evb/evb_ports_in.c

In particular, here is where we call the new i2c_adapter_probe() 
function: 
https://github.com/ev3dev/lego-linux-drivers/blob/master/evb/evb_ports_in.c#L543

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web