netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jean Delvare <khali@linux-fr.org>
To: Ben Hutchings <bhutchings@solarflare.com>,
	Jeff Garzik <jgarzik@redhat.com>
Cc: netdev@vger.kernel.org, Linux I2C <i2c@lm-sensors.org>
Subject: SFC driver implements its own I2C support
Date: Tue, 13 May 2008 10:33:25 +0200	[thread overview]
Message-ID: <20080513103325.1ab317cf@hyperion.delvare> (raw)

Hi Ben, hi Jeff,

My attention was brought to the drivers/net/sfc/i2c-direct.c file which
appeared recently in the Linux kernel. Apparently this is a custom
implementation of I2C support, including software bit-banging. All this
is already available in the Linux kernel in:
  drivers/i2c/i2c-core.c
  drivers/i2c/algos/i2c-algo-bit.c
So it really doesn't make sense to duplicate the code in the sfc
network driver.

Can you please get rid of this custom I2C implementation and use the
standard one? It should be really easy, all you have to do is include
<linux/i2c.h> and <linux/i2c-algo-bit.h>, pack your SDA and SCL get/set
functions in a struct i2c_algo_bit_data, and call i2c_bit_add_bus() on
it. See drivers/video/intelfb/intelfb_i2c.c (or any framebuffer driver
with I2C/DDC support) for an example.

Using the standard I2C implementation will give you access to all the
i2c debugging tools, user-space access to the I2C bus if needed, and
compatibility with all the Linux i2c device drivers, including hardware
monitoring and GPIO drivers which apparently the SFC hardware uses.

Thanks,
-- 
Jean Delvare

             reply	other threads:[~2008-05-13  8:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-13  8:33 Jean Delvare [this message]
2008-05-14 21:58 ` SFC driver implements its own I2C support Ben Hutchings
2008-05-15  9:24   ` Jean Delvare
2008-05-15 12:04     ` Michael Brown
2008-05-15 12:39       ` Jean Delvare
2008-05-15 12:58         ` [i2c] " Wolfram Sang
2008-05-15 14:52         ` Michael Brown
2008-05-15 12:03   ` [i2c] " Riku Voipio

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=20080513103325.1ab317cf@hyperion.delvare \
    --to=khali@linux-fr.org \
    --cc=bhutchings@solarflare.com \
    --cc=i2c@lm-sensors.org \
    --cc=jgarzik@redhat.com \
    --cc=netdev@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).