From: Jean Delvare <khali@linux-fr.org>
To: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: DRI@freedesktop.org,
Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
linux-i2c@vger.kernel.org,
Development <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH 3/7] i2c: export bit-banging algo functions
Date: Tue, 28 Feb 2012 09:06:52 +0100 [thread overview]
Message-ID: <20120228090652.627ac312@endymion.delvare> (raw)
In-Reply-To: <20120227225223.GB1050@phenom.ffwll.local>
On Mon, 27 Feb 2012 23:52:23 +0100, Daniel Vetter wrote:
> On Mon, Feb 27, 2012 at 11:20:40PM +0100, Jean Delvare wrote:
> > If you need to hot-switch between hardware and bit-banged I2C, I suggest
> > that you lock the bus while doing so, to avoid switching while a
> > transaction is in progress. This can be achieved with
> > i2c_lock_adapter() and i2c_unlock_adapter().
>
> The drm/i915 xfer function is currently protected by a single mutex
> (because the hw i2c controller can only be used on one bus at a time). So
> I think we're covered. Also we do the fallback in our xfer function when
> we notice that things don't quite work as they should, so we actually want
> to switch while a transfer is in progress. Dunno whether that's the best
> approach, but the current code is structured like this.
This seems perfectly sane.
> (...)
> I've noticed that the the bit-banging algo does some test upon
> registration but figured that it's not worth the fuss to add a new init
> function that avoids the registration.
Note that thanks to the way things are implemented in i2c-algo-bit,
you'd really only have to write a new wrapper around
__i2c_bit_add_bus(), so this is really only 1 line of code. That being
said, I am not insisting, it's really up to you.
--
Jean Delvare
next prev parent reply other threads:[~2012-02-28 8:06 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-14 21:37 [PATCH 1/7] drm/i915: add dev_priv to intel_gmbus Daniel Vetter
[not found] ` <1329255445-6312-1-git-send-email-daniel.vetter-/w4YWyX8dFk@public.gmane.org>
2012-02-14 21:37 ` [PATCH 2/7] drm/nouveau: do a better job at hiding the NIH i2c bit-banging algo Daniel Vetter
[not found] ` <1329255445-6312-2-git-send-email-daniel.vetter-/w4YWyX8dFk@public.gmane.org>
2012-02-27 17:25 ` Daniel Vetter
2012-02-14 21:37 ` [PATCH 3/7] i2c: export bit-banging algo functions Daniel Vetter
[not found] ` <1329255445-6312-3-git-send-email-daniel.vetter-/w4YWyX8dFk@public.gmane.org>
2012-02-27 17:27 ` Daniel Vetter
2012-02-27 22:20 ` Jean Delvare
[not found] ` <20120227232040.0476d508-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2012-02-27 22:52 ` Daniel Vetter
[not found] ` <20120227225223.GB1050-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
2012-02-27 23:39 ` [PATCH] " Daniel Vetter
[not found] ` <1330385979-19406-1-git-send-email-daniel.vetter-/w4YWyX8dFk@public.gmane.org>
2012-02-28 8:08 ` Jean Delvare
[not found] ` <20120228090817.1a95c28b-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2012-02-29 19:48 ` Daniel Vetter
2012-02-28 8:06 ` Jean Delvare [this message]
2012-02-14 21:37 ` [PATCH 4/7] drm/i915: merge struct intel_gpio into struct intel_gmbus Daniel Vetter
2012-02-14 21:37 ` [PATCH 5/7] drm/i915: merge gmbus and gpio i2c adpater into one Daniel Vetter
2012-02-14 21:37 ` [PATCH 6/7] drm/i915: i2c: unconditionally set up gpio fallback Daniel Vetter
[not found] ` <1329255445-6312-6-git-send-email-daniel.vetter-/w4YWyX8dFk@public.gmane.org>
2012-02-14 22:53 ` [PATCH] " Daniel Vetter
2012-02-14 23:47 ` [PATCH 6/7] " Eugeni Dodonov
[not found] ` <CAC7LmnvP0wUroQq6VJ3QeoWDy=WEk_UcfkKiuYx=hWZ8WT6tMQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-27 18:22 ` [PATCH] " Daniel Vetter
2012-02-27 18:29 ` Eugeni Dodonov
2012-02-14 21:37 ` [PATCH 7/7] drm/i915: reenable gmbus on gen3+ again Daniel Vetter
2012-02-27 17:53 ` [Intel-gfx] [PATCH 1/7] drm/i915: add dev_priv to intel_gmbus Eugeni Dodonov
[not found] ` <CAC7LmnupmYAs-+pUQw-wYh7+rzeK5wowDQKrmE7hh3j=pvHdvA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-29 19:56 ` Daniel Vetter
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=20120228090652.627ac312@endymion.delvare \
--to=khali@linux-fr.org \
--cc=DRI@freedesktop.org \
--cc=daniel.vetter@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=linux-i2c@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).