* Xilinx iic i2c bus interface GPIO support for i2c-mux in Linux.
@ 2012-02-08 19:46 Robin Holt
[not found] ` <20120208194615.GT14907-sJ/iWh9BUns@public.gmane.org>
0 siblings, 1 reply; 5+ messages in thread
From: Robin Holt @ 2012-02-08 19:46 UTC (permalink / raw)
To: linux-i2c-u79uwXL29TY76Z2rM5mHXA
Cc: Richard Röjfors, Ben Dooks, info-l7gf1WXxx3uGw+nKnLezzg,
Michael Lawnick, Jean Delvare, Rodolfo Giometti
We are using a Xilinx FPGA which implements a series of i2c bus
interfaces. We are planning on implementing a single-bit GPIO
(XIIC_GPO_REG_OFFSET) which is included in that logic block to act
as a MUX selector (also in the FPGA) between two separate i2c busses.
This will require a GPIO driver in the linux kernel.
Is it better to try and change the i2c-xiic.c code which already knows
about the GPO register to handle that additional GPIO or should we be
implementing the GPIO driver outside the i2c driver and then use the
standard i2c-mux support available in newer kernels?
Any guidance is welcome.
Thanks,
Robin Holt
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Xilinx iic i2c bus interface GPIO support for i2c-mux in Linux.
[not found] ` <20120208194615.GT14907-sJ/iWh9BUns@public.gmane.org>
@ 2012-02-08 19:54 ` Jean Delvare
[not found] ` <20120208205429.672c9092-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2012-02-13 23:12 ` Ben Dooks
1 sibling, 1 reply; 5+ messages in thread
From: Jean Delvare @ 2012-02-08 19:54 UTC (permalink / raw)
To: Robin Holt
Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA, Richard Röjfors, Ben Dooks,
info-l7gf1WXxx3uGw+nKnLezzg, Michael Lawnick, Rodolfo Giometti
Hi Robin,
On Wed, 8 Feb 2012 13:46:15 -0600, Robin Holt wrote:
> We are using a Xilinx FPGA which implements a series of i2c bus
> interfaces. We are planning on implementing a single-bit GPIO
> (XIIC_GPO_REG_OFFSET) which is included in that logic block to act
> as a MUX selector (also in the FPGA) between two separate i2c busses.
>
> This will require a GPIO driver in the linux kernel.
>
> Is it better to try and change the i2c-xiic.c code which already knows
> about the GPO register to handle that additional GPIO or should we be
> implementing the GPIO driver outside the i2c driver and then use the
> standard i2c-mux support available in newer kernels?
Both are possible. It depends if there are other GPIOs on your FPGA
which you will have to access from other drivers for other purposes. If
there are such other GPIOs then it certainly makes sense to have a
clean, separate gpio driver for your FPGA, and have all consumers bind
to it. If not, then I'd keep things simple and embed everything in
i2c-xiic.c, especially if the two i2c buses are truly separated and
there is no common trunk (i2c-mux would create 3 segments.)
--
Jean Delvare
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Xilinx iic i2c bus interface GPIO support for i2c-mux in Linux.
[not found] ` <20120208205429.672c9092-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
@ 2012-02-08 20:02 ` Robin Holt
[not found] ` <20120208200206.GW14907-sJ/iWh9BUns@public.gmane.org>
0 siblings, 1 reply; 5+ messages in thread
From: Robin Holt @ 2012-02-08 20:02 UTC (permalink / raw)
To: Jean Delvare
Cc: Robin Holt, linux-i2c-u79uwXL29TY76Z2rM5mHXA,
Richard Röjfors, Ben Dooks, info-l7gf1WXxx3uGw+nKnLezzg,
Michael Lawnick, Rodolfo Giometti
On Wed, Feb 08, 2012 at 08:54:29PM +0100, Jean Delvare wrote:
> Hi Robin,
>
> On Wed, 8 Feb 2012 13:46:15 -0600, Robin Holt wrote:
> > We are using a Xilinx FPGA which implements a series of i2c bus
> > interfaces. We are planning on implementing a single-bit GPIO
> > (XIIC_GPO_REG_OFFSET) which is included in that logic block to act
> > as a MUX selector (also in the FPGA) between two separate i2c busses.
> >
> > This will require a GPIO driver in the linux kernel.
> >
> > Is it better to try and change the i2c-xiic.c code which already knows
> > about the GPO register to handle that additional GPIO or should we be
> > implementing the GPIO driver outside the i2c driver and then use the
> > standard i2c-mux support available in newer kernels?
>
> Both are possible. It depends if there are other GPIOs on your FPGA
> which you will have to access from other drivers for other purposes. If
> there are such other GPIOs then it certainly makes sense to have a
> clean, separate gpio driver for your FPGA, and have all consumers bind
> to it. If not, then I'd keep things simple and embed everything in
> i2c-xiic.c, especially if the two i2c buses are truly separated and
> there is no common trunk (i2c-mux would create 3 segments.)
Do you know of any other examples of an i2c bus interface which provides
a built-in general purpose output for MUX selection? I am hoping for
some example of the "right" way to do this.
Thanks,
Robin
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Xilinx iic i2c bus interface GPIO support for i2c-mux in Linux.
[not found] ` <20120208200206.GW14907-sJ/iWh9BUns@public.gmane.org>
@ 2012-02-08 20:47 ` Jean Delvare
0 siblings, 0 replies; 5+ messages in thread
From: Jean Delvare @ 2012-02-08 20:47 UTC (permalink / raw)
To: Robin Holt
Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA, Richard Röjfors, Ben Dooks,
info-l7gf1WXxx3uGw+nKnLezzg, Michael Lawnick, Rodolfo Giometti
On Wed, 8 Feb 2012 14:02:06 -0600, Robin Holt wrote:
> On Wed, Feb 08, 2012 at 08:54:29PM +0100, Jean Delvare wrote:
> > Hi Robin,
> >
> > On Wed, 8 Feb 2012 13:46:15 -0600, Robin Holt wrote:
> > > We are using a Xilinx FPGA which implements a series of i2c bus
> > > interfaces. We are planning on implementing a single-bit GPIO
> > > (XIIC_GPO_REG_OFFSET) which is included in that logic block to act
> > > as a MUX selector (also in the FPGA) between two separate i2c busses.
> > >
> > > This will require a GPIO driver in the linux kernel.
> > >
> > > Is it better to try and change the i2c-xiic.c code which already knows
> > > about the GPO register to handle that additional GPIO or should we be
> > > implementing the GPIO driver outside the i2c driver and then use the
> > > standard i2c-mux support available in newer kernels?
> >
> > Both are possible. It depends if there are other GPIOs on your FPGA
> > which you will have to access from other drivers for other purposes. If
> > there are such other GPIOs then it certainly makes sense to have a
> > clean, separate gpio driver for your FPGA, and have all consumers bind
> > to it. If not, then I'd keep things simple and embed everything in
> > i2c-xiic.c, especially if the two i2c buses are truly separated and
> > there is no common trunk (i2c-mux would create 3 segments.)
>
> Do you know of any other examples of an i2c bus interface which provides
> a built-in general purpose output for MUX selection? I am hoping for
> some example of the "right" way to do this.
No, sorry. If I had to implement that, I would simply include the mux
configuration value in the private data structure attached to each i2c
bus, and the xfer function would start with switching the GPO to select
the right bus. The whole thing would be protected by a common mutex,
obviously.
--
Jean Delvare
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Xilinx iic i2c bus interface GPIO support for i2c-mux in Linux.
[not found] ` <20120208194615.GT14907-sJ/iWh9BUns@public.gmane.org>
2012-02-08 19:54 ` Jean Delvare
@ 2012-02-13 23:12 ` Ben Dooks
1 sibling, 0 replies; 5+ messages in thread
From: Ben Dooks @ 2012-02-13 23:12 UTC (permalink / raw)
To: Robin Holt
Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA, Richard Röjfors, Ben Dooks,
info-l7gf1WXxx3uGw+nKnLezzg, Michael Lawnick, Jean Delvare,
Rodolfo Giometti
On Wed, Feb 08, 2012 at 01:46:15PM -0600, Robin Holt wrote:
> We are using a Xilinx FPGA which implements a series of i2c bus
> interfaces. We are planning on implementing a single-bit GPIO
> (XIIC_GPO_REG_OFFSET) which is included in that logic block to act
> as a MUX selector (also in the FPGA) between two separate i2c busses.
>
> This will require a GPIO driver in the linux kernel.
There's already a general purpose GPIO driver so that should not be a
problem.
> Is it better to try and change the i2c-xiic.c code which already knows
> about the GPO register to handle that additional GPIO or should we be
> implementing the GPIO driver outside the i2c driver and then use the
> standard i2c-mux support available in newer kernels?
My feelings would be to try and use the standard i2c-mux support if
possible.
> Any guidance is welcome.
>
> Thanks,
> Robin Holt
> --
> To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-02-13 23:12 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-08 19:46 Xilinx iic i2c bus interface GPIO support for i2c-mux in Linux Robin Holt
[not found] ` <20120208194615.GT14907-sJ/iWh9BUns@public.gmane.org>
2012-02-08 19:54 ` Jean Delvare
[not found] ` <20120208205429.672c9092-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2012-02-08 20:02 ` Robin Holt
[not found] ` <20120208200206.GW14907-sJ/iWh9BUns@public.gmane.org>
2012-02-08 20:47 ` Jean Delvare
2012-02-13 23:12 ` Ben Dooks
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).