android_kernel_motorola_sm6225/drivers/media/dvb/dvb-usb/digitv.h
Trent Piepho 4ce1567892 V4L/DVB (5777): Dvb-pll digitv dvb-usb: Eliminate last user of dvb_pll_configure
The last user of dvb_pll_configure was the dvb-usb function
dvb_usb_tuner_calc_regs(), which was nothing more than a wrapper around
dvb_pll_configure().  It's just a copy of the functionality provided by
the tuner_ops calc_regs method, and can be deleted.

There were two users of dvb_usb_tuner_calc_regs().
One was dvb_usb_tuner_set_params_i2c(), which is converted to use
fe->ops.tuner_ops.calc_regs().

The other was the digitv driver.  This driver can use one of two demods,
mt352 or nxt6000.  

For the mt352, the driver would set tuner_ops.calc_regs to 
dvb_usb_tuner_calc_regs().  

We can just attach dvb_pll and use the tuner_ops.calc_regs() provided by 
that module. For the nxt600, the driver would set tuner_ops.set_params 
to digitv_nxt6000_tuner_set_params.  

That function would in turn use dvb_usb_tuner_calc_regs().

We convert it to use tuner_ops.calc_regs() instead, and use 
dvb_pll_attach.

The digitv_tuner_attach() needs to know which frontend was attached by 
digitv_frontend_attach(), since the nxt6000 needs tuner_ops.set_params() 
to be overridden with digitv_nxt6000_tuner_set_params().

So, to do this a digitv_state that says which frontend was used is added 
to the dvb_usb_device private state field.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-07-18 14:24:15 -03:00

69 lines
1.5 KiB
C

#ifndef _DVB_USB_DIGITV_H_
#define _DVB_USB_DIGITV_H_
#define DVB_USB_LOG_PREFIX "digitv"
#include "dvb-usb.h"
struct digitv_state {
int is_nxt6000;
};
extern int dvb_usb_digitv_debug;
#define deb_rc(args...) dprintk(dvb_usb_digitv_debug,0x01,args)
/* protocol (from usblogging and the SDK:
*
* Always 7 bytes bulk message(s) for controlling
*
* First byte describes the command. Reads are 2 consecutive transfer (as always).
*
* General structure:
*
* write or first message of a read:
* <cmdbyte> VV <len> B0 B1 B2 B3
*
* second message of a read
* <cmdbyte> VV <len> R0 R1 R2 R3
*
* whereas 0 < len <= 4
*
* I2C address is stored somewhere inside the device.
*
* 0x01 read from EEPROM
* VV = offset; B* = 0; R* = value(s)
*
* 0x02 read register of the COFDM
* VV = register; B* = 0; R* = value(s)
*
* 0x05 write register of the COFDM
* VV = register; B* = value(s);
*
* 0x06 write to the tuner (only for NXT6000)
* VV = 0; B* = PLL data; len = 4;
*
* 0x03 read remote control
* VV = 0; B* = 0; len = 4; R* = key
*
* 0x07 write to the remote (don't know why one should this, resetting ?)
* VV = 0; B* = key; len = 4;
*
* 0x08 write remote type
* VV = 0; B[0] = 0x01, len = 4
*
* 0x09 write device init
* TODO
*/
#define USB_READ_EEPROM 1
#define USB_READ_COFDM 2
#define USB_WRITE_COFDM 5
#define USB_WRITE_TUNER 6
#define USB_READ_REMOTE 3
#define USB_WRITE_REMOTE 7
#define USB_WRITE_REMOTE_TYPE 8
#define USB_DEV_INIT 9
#endif