From: David Lechner <david@lechnology.com>
To: Wolfram Sang <wsa@the-dreams.de>
Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] i2c: expose adapter probe and remove probed functions
Date: Fri, 16 Sep 2016 16:09:02 -0500 [thread overview]
Message-ID: <884a0040-7965-5384-5fe1-8204ba73ccb1@lechnology.com> (raw)
In-Reply-To: <20160916210315.GB2216@katana>
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
next prev parent reply other threads:[~2016-09-16 21:09 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-05 20:40 [PATCH 0/3] LEGO MINDSTORMS I2C support David Lechner
2016-09-05 20:40 ` [PATCH 1/3] i2c: Add class for LEGO MINDSTORMS sensors David Lechner
2016-09-06 19:01 ` Uwe Kleine-König
2016-09-05 20:40 ` [PATCH 2/3] i2c: Add special case for detecting LEGO devices David Lechner
2016-09-05 20:40 ` [PATCH 3/3] i2c: expose adapter probe and remove probed functions David Lechner
2016-09-16 21:03 ` Wolfram Sang
2016-09-16 21:09 ` David Lechner [this message]
2016-09-15 20:00 ` [PATCH 0/3] LEGO MINDSTORMS I2C support Wolfram Sang
2016-09-16 20:05 ` David Lechner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=884a0040-7965-5384-5fe1-8204ba73ccb1@lechnology.com \
--to=david@lechnology.com \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=wsa@the-dreams.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®