Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linux-dvb] Re: NEWSTRUCT questions



Johannes Stezenbach writes:
 > On Wed, Oct 23, 2002 at 03:34:08PM +0200, Florian Schirmer wrote:
 > > My idea is to extend the dvb_i2c layer with some kind of gateway/bridge to the 
 > > linux i2c layer. dvb_i2c will try to probe its internal busses first and then 
 > > fallback to linux i2c if no devices could be attached.
 > > 
 > > Would you accept a patch for that? This will result in a dependency to the 
 > > i2c_core. If a dependency is not acceptable it is possible to make it a 
 > > compile time option.
 > 
 > Holger was mumbling something about a wrapper driver, like the one
 > Ralph mentions in his posting. But I don't know the details, so I
 > leave it up to Holger to answer that (tomorrow, Holger's taken the
 > day off).


If somebody wants to try this, below is the wrapper code.
Just call dvb_i2c_wrap_init() with a pointer to a I2C adapter 
structure and it will return a pointer to a struct dvb_i2c_bus.


Ralph


/****************************************************************************/

static int 
dvb_i2c_wrap_xfer(struct dvb_i2c_bus *i2c, struct i2c_msg msgs[], int num)
{
	return i2c_transfer(i2c->data, msgs, num);
}

static inline struct dvb_i2c_bus *
dvb_i2c_wrap_init(dvb_adapter_t *dvb, struct i2c_adapter *i2c, int id)
{
	return dvb_register_i2c_bus(dvb_i2c_wrap_xfer, i2c, dvb, id);
}

static inline void 
dvb_i2c_wrap_release(struct dvb_i2c_bus *i2c)
{
	dvb_unregister_i2c_bus(i2c->xfer, i2c->adapter, i2c->id);
}

/****************************************************************************/



-- 
Info:
To unsubscribe send a mail to listar@linuxtv.org with "unsubscribe linux-dvb" as subject.



Home | Main Index | Thread Index