Mailing List archive

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

[linux-dvb] Re: Patch: current I2C trasnition broke KNC1 type cards



On Monday 21 June 2004 10:26, Kenneth Aafløy wrote:
> On Monday 21 June 2004 09:39, Uli Luckas wrote:
> > Am Montag, 21. Juni 2004 01:08 schrieb Kenneth Aafløy:
> > > Could not this be better handled by some binary identifyer for each
> > > cardtype? That is what it becomes after the string parsing at least.
> >
> > Well, that would be nice. But as far as I understand the drivers are
> > using the kernel I2C API where we don't pass any data directly to the
> > frontend. The frontend is attached by the kernel which passes struct
> > i2c_adapter. This is why an existing field from i2c_adapter has to be
> > abused here.
>
> Is not this what i2c_adapter->algo_data is for? Stuffing private data in,
> and as far as I can see it's unused.

Sorry for not waking up before typing, as the saa7146_dev is already available 
in i2c_adapter->dev->driver_data. There is a lot of common data in the 
structures av7110 and budget, below is a suggestion on how we might combine 
these two, and also get rid of the strcmp stuff all in one. I've not looked 
very hard at the ttusb_dec, ttusb, adapter (skystar2.c) structs, but I belive 
that they contain somthing like this in common too.

Kenneth

struct dvb_extension {
    char*				name;

#define BUDGET_TT				0
#define BUDGET_TT_HW_DISEQC		1
#define BUDGET_KNC1				2
#define BUDGET_PATCH			3
#define BUDGET_FS_ACTIVY		4
#define ....
    u32				id;

    struct dvb_device	dvb_dev;
    struct dvb_net		dvb_net;

    struct saa7146_dev	*dev;

    struct dvb_i2c_bus	*i2c_bus;
    struct i2c_adapter	i2c_adap;

    struct dmxdev		dmxdev;
    struct dvb_demux	demux;

    /* not sure on these, was not common in the first place,
     * but maybe they should be. */
    struct dvb_device	*video_dev;
    struct dvb_device	*audio_dev;
    struct dvb_device	*ca_dev;
    struct dvb_device	*osd_dev;

    struct dmx_frontend	hw_frontend;
    struct dmx_frontend	mem_frontend;

    struct dvb_adapter	*dvb_adapter;

    void				*ext_priv;
};





Home | Main Index | Thread Index