[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20161103151848.GD1768@lunn.ch>
Date: Thu, 3 Nov 2016 16:18:48 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Tom Lendacky <thomas.lendacky@....com>
Cc: netdev@...r.kernel.org, Florian Fainelli <f.fainelli@...il.com>,
David Miller <davem@...emloft.net>
Subject: Re: [PATCH net-next v1 17/21] amd-xgbe: Add I2C support for
determining SFP media types
> There are a couple of things about this. Russel's work isn't part of
> the kernel yet so I can't make use of it.
Well, you could guide it into the kernel. Part of it has already made
the way in. And i know of other platforms which would benefit from it.
> Additionally, the I2C device is integrated into the IP of the
> network device with register addresses being offsets of the network
> device BAR so I'm not sure how I would go about getting it setup in
> order to use the i2c infrastructure.
Have you looked at the core i2c stuff? All you need is an
i2c_algorithim structure:
http://lxr.free-electrons.com/source/include/linux/i2c.h#L407
and an i2c_adaptor structure:
http://lxr.free-electrons.com/source/include/linux/i2c.h#L532
and then you can call i2c_add_adapter() to register your i2c bus with
the i2c core. Embedded such an i2c driver inside another driver is not
a problem.
Andrew
Powered by blists - more mailing lists