diff options
Diffstat (limited to 'v4l_experimental')
-rw-r--r-- | v4l_experimental/cx88-ivtv.c | 2 | ||||
-rw-r--r-- | v4l_experimental/dpl3518.c | 52 | ||||
-rw-r--r-- | v4l_experimental/firesat/avc_api.c | 182 | ||||
-rw-r--r-- | v4l_experimental/firesat/cmp.c | 18 | ||||
-rw-r--r-- | v4l_experimental/firesat/firesat-ci.c | 10 | ||||
-rw-r--r-- | v4l_experimental/firesat/firesat-rc.c | 6 | ||||
-rw-r--r-- | v4l_experimental/firesat/firesat.c | 332 | ||||
-rw-r--r-- | v4l_experimental/v3tv/i2c-voodoo3.c | 10 | ||||
-rw-r--r-- | v4l_experimental/v3tv/v3tv.c | 96 | ||||
-rw-r--r-- | v4l_experimental/v3tv/vpx3224.c | 24 | ||||
-rw-r--r-- | v4l_experimental/xc3028/convert.c | 2 | ||||
-rw-r--r-- | v4l_experimental/xc3028/xc3028.c | 62 |
12 files changed, 398 insertions, 398 deletions
diff --git a/v4l_experimental/cx88-ivtv.c b/v4l_experimental/cx88-ivtv.c index a747e2372..8247d4286 100644 --- a/v4l_experimental/cx88-ivtv.c +++ b/v4l_experimental/cx88-ivtv.c @@ -102,7 +102,7 @@ static unsigned int ivtv_translate_ioctl(unsigned int cmd) } static int ivtv_do_ioctl(struct inode *inode, struct file *file, - unsigned int cmd, void *arg) + unsigned int cmd, void *arg) { struct cx8802_fh *fh = file->private_data; struct cx8802_dev *dev = fh->dev; diff --git a/v4l_experimental/dpl3518.c b/v4l_experimental/dpl3518.c index a7df1f078..43533767e 100644 --- a/v4l_experimental/dpl3518.c +++ b/v4l_experimental/dpl3518.c @@ -96,27 +96,27 @@ MODULE_LICENSE("GPL"); static int dpl3518_reset(struct i2c_client *client) { - static char reset_off[3] = { 0x00, 0x80, 0x00 }; - static char reset_on[3] = { 0x00, 0x00, 0x00 }; + static char reset_off[3] = { 0x00, 0x80, 0x00 }; + static char reset_on[3] = { 0x00, 0x00, 0x00 }; - i2c_master_send(client,reset_off,3); /* ignore errors here */ - if (3 != i2c_master_send(client,reset_on, 3)) { + i2c_master_send(client,reset_off,3); /* ignore errors here */ + if (3 != i2c_master_send(client,reset_on, 3)) { printk(KERN_ERR "dpl3518: chip reset failed, penguin on i2c bus?\n"); return -1; } - return 0; + return 0; } static int dpl3518_write(struct i2c_client *client, int dev, int addr, int val) { int err; - unsigned char buffer[5]; + unsigned char buffer[5]; - buffer[0] = dev; - buffer[1] = addr >> 8; - buffer[2] = addr & 0xff; - buffer[3] = val >> 8; - buffer[4] = val & 0xff; + buffer[0] = dev; + buffer[1] = addr >> 8; + buffer[2] = addr & 0xff; + buffer[3] = val >> 8; + buffer[4] = val & 0xff; for (err = 0; err < 3;) { if (5 == i2c_master_send(client, buffer, 5)) @@ -248,9 +248,9 @@ static int dpl3518_attach(struct i2c_adapter *adap, int addr, client = kmalloc(sizeof *client,GFP_KERNEL); if (!client) return -ENOMEM; - memcpy(client,&client_template,sizeof(struct i2c_client)); - client->adapter = adap; - client->addr = addr; + memcpy(client,&client_template,sizeof(struct i2c_client)); + client->adapter = adap; + client->addr = addr; dpl = kmalloc(sizeof *dpl, GFP_KERNEL); if (NULL == dpl) @@ -306,8 +306,8 @@ static int dpl3518_dev_ioctl(struct inode *inode, struct file *file, dpl3518_reset(client); break; case DPL_IOC_VERSION: - if (put_user(DPL_VERSION_CODE, (int *) arg)) - ret = -EFAULT; + if (put_user(DPL_VERSION_CODE, (int *) arg)) + ret = -EFAULT; break; case DPL_IOC_INIT: dpl3518_ioc_init(client); @@ -325,8 +325,8 @@ static int dpl3518_dev_ioctl(struct inode *inode, struct file *file, dpl3518_setmode(client, (int) arg); break; case DPL_IOC_GET_MODE: - if (put_user(dpl_device->mode, (int *) arg)) - ret = -EFAULT; + if (put_user(dpl_device->mode, (int *) arg)) + ret = -EFAULT; break; case DPL_IOC_NOISE_MODE: dpl3518_setnoisemode(client, (int) arg); @@ -368,18 +368,18 @@ static struct i2c_driver driver = { #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,54) .owner = THIS_MODULE, #endif - .name = "i2c dpl3518 driver", - .id = I2C_DRIVERID_DPL3518, - .flags = I2C_DF_NOTIFY, - .attach_adapter = dpl3518_probe, - .detach_client = dpl3518_detach, + .name = "i2c dpl3518 driver", + .id = I2C_DRIVERID_DPL3518, + .flags = I2C_DF_NOTIFY, + .attach_adapter = dpl3518_probe, + .detach_client = dpl3518_detach, }; static struct i2c_client client_template = { - I2C_DEVNAME("dpl3518"), - .id = -1, - .driver = &driver + I2C_DEVNAME("dpl3518"), + .id = -1, + .driver = &driver }; static struct file_operations dpl3518_fops = diff --git a/v4l_experimental/firesat/avc_api.c b/v4l_experimental/firesat/avc_api.c index bff42413c..eb597eaa4 100644 --- a/v4l_experimental/firesat/avc_api.c +++ b/v4l_experimental/firesat/avc_api.c @@ -11,7 +11,7 @@ #include <ieee1394_transactions.h> #include <nodemgr.h> -#include <asm/byteorder.h> +#include <asm/byteorder.h> #include <linux/delay.h> #include "firesat.h" #include "avc_api.h" @@ -47,51 +47,51 @@ static int avc_down_timeout(atomic_t *done, int timeout) } static int __AVCWrite(struct firesat *firesat, const AVCCmdFrm *CmdFrm, AVCRspFrm *RspFrm) { - struct hpsb_packet *packet; + struct hpsb_packet *packet; struct node_entry *ne; - + ne = firesat->nodeentry; if(!ne) { printk("%s: lost node!\n",__FUNCTION__); return -EIO; } - + /* need all input data */ if(!firesat || !ne || !CmdFrm) return -EINVAL; - + // printk(KERN_INFO "AVCWrite command %x\n",CmdFrm->opcode); - + // for(k=0;k<CmdFrm->length;k++) // printk(KERN_INFO "CmdFrm[%d] = %08x\n", k, ((quadlet_t*)CmdFrm)[k]); - + packet=hpsb_make_writepacket(ne->host, ne->nodeid, COMMAND_REGISTER, (quadlet_t*)CmdFrm, CmdFrm->length); - + hpsb_set_packet_complete_task(packet, (void (*)(void*))avc_free_packet, packet); - + hpsb_node_fill_packet(ne, packet); - if(RspFrm) + if(RspFrm) atomic_set(&firesat->avc_reply_received, 0); if (hpsb_send_packet(packet) < 0) { - avc_free_packet(packet); - atomic_set(&firesat->avc_reply_received, 1); + avc_free_packet(packet); + atomic_set(&firesat->avc_reply_received, 1); return -EIO; } - + if(RspFrm) { - if(avc_down_timeout(&firesat->avc_reply_received,HZ/2)) { - printk("%s: timeout waiting for avc response\n",__FUNCTION__); - atomic_set(&firesat->avc_reply_received, 1); - return -ETIMEDOUT; - } - + if(avc_down_timeout(&firesat->avc_reply_received,HZ/2)) { + printk("%s: timeout waiting for avc response\n",__FUNCTION__); + atomic_set(&firesat->avc_reply_received, 1); + return -ETIMEDOUT; + } + memcpy(RspFrm,firesat->respfrm,firesat->resp_length); } - + return 0; } @@ -99,9 +99,9 @@ int AVCWrite(struct firesat*firesat, const AVCCmdFrm *CmdFrm, AVCRspFrm *RspFrm) int ret; if(down_interruptible(&firesat->avc_sem)) return -EINTR; - + ret = __AVCWrite(firesat, CmdFrm, RspFrm); - + up(&firesat->avc_sem); return ret; } @@ -111,7 +111,7 @@ DECLARE_TASKLET(schedule_remotecontrol, do_schedule_remotecontrol, 0); static void do_schedule_remotecontrol(unsigned long ignored) { struct firesat *firesat; - unsigned long flags; + unsigned long flags; spin_lock_irqsave(&firesat_list_lock, flags); list_for_each_entry(firesat,&firesat_list,list) { @@ -125,7 +125,7 @@ static void do_schedule_remotecontrol(unsigned long ignored) { tasklet_schedule(&schedule_remotecontrol); up(&firesat->avc_sem); - } + } } } spin_unlock_irqrestore(&firesat_list_lock, flags); @@ -135,8 +135,8 @@ int AVCRecv(struct firesat *firesat, u8 *data, size_t length) { // printk(KERN_INFO "%s\n",__FUNCTION__); // remote control handling - - AVCRspFrm *RspFrm = (AVCRspFrm*)data; + + AVCRspFrm *RspFrm = (AVCRspFrm*)data; if(/*RspFrm->length >= 8 && ###*/ ((RspFrm->operand[0] == SFE_VENDOR_DE_COMPANYID_0 && @@ -144,59 +144,59 @@ int AVCRecv(struct firesat *firesat, u8 *data, size_t length) { RspFrm->operand[2] == SFE_VENDOR_DE_COMPANYID_2) || (RspFrm->operand[0] == SFE_VENDOR_EL_COMPANYID_0 && RspFrm->operand[1] == SFE_VENDOR_EL_COMPANYID_1 && - RspFrm->operand[2] == SFE_VENDOR_EL_COMPANYID_2)) && + RspFrm->operand[2] == SFE_VENDOR_EL_COMPANYID_2)) && RspFrm->operand[3] == SFE_VENDOR_OPCODE_REGISTER_REMOTE_CONTROL) { if(RspFrm->resp == CHANGED) { // printk(KERN_INFO "%s: code = %02x %02x\n",__FUNCTION__,RspFrm->operand[4],RspFrm->operand[5]); firesat_got_remotecontrolcode((((u16)RspFrm->operand[4]) << 8) | ((u16)RspFrm->operand[5])); - // schedule + // schedule atomic_set(&firesat->reschedule_remotecontrol, 1); tasklet_schedule(&schedule_remotecontrol); } else if(RspFrm->resp != INTERIM) printk(KERN_INFO "%s: remote control result = %d\n",__FUNCTION__, RspFrm->resp); return 0; } - + if(atomic_read(&firesat->avc_reply_received) == 1) { printk("%s: received out-of-order AVC response, ignored\n",__FUNCTION__); return -EINVAL; } // AVCRspFrm *resp=(AVCRspFrm *)data; // int k; -/* +/* printk(KERN_INFO "resp=0x%x\n",resp->resp); printk(KERN_INFO "cts=0x%x\n",resp->cts); printk(KERN_INFO "suid=0x%x\n",resp->suid); printk(KERN_INFO "sutyp=0x%x\n",resp->sutyp); printk(KERN_INFO "opcode=0x%x\n",resp->opcode); printk(KERN_INFO "length=%d\n",resp->length); -*/ +*/ // for(k=0;k<2;k++) // printk(KERN_INFO "operand[%d]=%02x\n",k,resp->operand[k]); - + memcpy(firesat->respfrm,data,length); firesat->resp_length=length; atomic_set(&firesat->avc_reply_received, 1); - + return 0; } // tuning command for setting the relative LNB frequency (not supported by the AVC standard) static void AVCTuner_DSD_directcmd(struct firesat *firesat, struct dvb_frontend_parameters *params, AVCCmdFrm *CmdFrm) { memset(CmdFrm, 0, sizeof(AVCCmdFrm)); - + CmdFrm->cts = AVC; CmdFrm->ctype = CONTROL; CmdFrm->sutyp = 0x5; CmdFrm->suid = firesat->subunit; CmdFrm->opcode = VENDOR; - /* ### should check for elgato and use SFE_VENDOR_EL_COMPANYID_0 in this case */ - CmdFrm->operand[0]=SFE_VENDOR_DE_COMPANYID_0; - CmdFrm->operand[1]=SFE_VENDOR_DE_COMPANYID_1; - CmdFrm->operand[2]=SFE_VENDOR_DE_COMPANYID_2; + /* ### should check for elgato and use SFE_VENDOR_EL_COMPANYID_0 in this case */ + CmdFrm->operand[0]=SFE_VENDOR_DE_COMPANYID_0; + CmdFrm->operand[1]=SFE_VENDOR_DE_COMPANYID_1; + CmdFrm->operand[2]=SFE_VENDOR_DE_COMPANYID_2; CmdFrm->operand[3]=0x58; printk(KERN_INFO "%s: tuning to frequency %u\n",__FUNCTION__,params->frequency); @@ -207,7 +207,7 @@ static void AVCTuner_DSD_directcmd(struct firesat *firesat, struct dvb_frontend_ CmdFrm->operand[7] = params->frequency & 0xFF; printk(KERN_INFO "%s: symbol rate = %uBd\n",__FUNCTION__,params->u.qpsk.symbol_rate); - + CmdFrm->operand[8] = ((params->u.qpsk.symbol_rate/1000) >> 8) & 0xFF; CmdFrm->operand[9] = (params->u.qpsk.symbol_rate/1000) & 0xFF; @@ -233,7 +233,7 @@ static void AVCTuner_DSD_directcmd(struct firesat *firesat, struct dvb_frontend_ default: CmdFrm->operand[10] = 0x0; } - + if(firesat->voltage == 0xff) CmdFrm->operand[11] = 0xff; else @@ -242,7 +242,7 @@ static void AVCTuner_DSD_directcmd(struct firesat *firesat, struct dvb_frontend_ CmdFrm->operand[12] = 0xff; else CmdFrm->operand[12] = (firesat->tone==SEC_TONE_ON)?1:0; // band - + CmdFrm->length = 16; } @@ -251,9 +251,9 @@ int AVCTuner_DSD(struct firesat *firesat, struct dvb_frontend_parameters *params AVCRspFrm RspFrm; M_VALID_FLAGS flags; int k; - + // printk(KERN_INFO "%s\n", __FUNCTION__); - + if(firesat->type == FireSAT_DVB_S) AVCTuner_DSD_directcmd(firesat, params, &CmdFrm); else { @@ -290,15 +290,15 @@ int AVCTuner_DSD(struct firesat *firesat, struct dvb_frontend_parameters *params flags.Bits.reserved1 = 0; flags.Bits.Network_ID = 0; } - + memset(&CmdFrm, 0, sizeof(AVCCmdFrm)); - + CmdFrm.cts = AVC; CmdFrm.ctype = CONTROL; CmdFrm.sutyp = 0x5; CmdFrm.suid = firesat->subunit; CmdFrm.opcode = DSD; - + CmdFrm.operand[0] = 0; // source plug CmdFrm.operand[1] = 0xD2; // subfunction replace CmdFrm.operand[2] = 0x20; // system id = DVB @@ -306,7 +306,7 @@ int AVCTuner_DSD(struct firesat *firesat, struct dvb_frontend_parameters *params CmdFrm.operand[4] = (firesat->type == FireSAT_DVB_T)?0x0c:0x11; // system_specific_multiplex selection_length CmdFrm.operand[5] = flags.Valid_Word.ByteHi; // valid_flags [0] CmdFrm.operand[6] = flags.Valid_Word.ByteLo; // valid_flags [1] - + if(firesat->type == FireSAT_DVB_T) { CmdFrm.operand[7] = 0x0; CmdFrm.operand[8] = (params->frequency/10) >> 24; @@ -408,18 +408,18 @@ int AVCTuner_DSD(struct firesat *firesat, struct dvb_frontend_parameters *params default: break; } - + CmdFrm.operand[15] = 0x00; // network_ID[0] CmdFrm.operand[16] = 0x00; // network_ID[1] CmdFrm.operand[17] = 0x00; // Nr_of_dsd_sel_specs = 0 - > No PIDs are transmitted - + CmdFrm.length = 20; } else { CmdFrm.operand[7] = 0x00; CmdFrm.operand[8] = (((firesat->voltage==SEC_VOLTAGE_18)?0:1)<<6); /* 0 = H, 1 = V */ CmdFrm.operand[9] = 0x00; CmdFrm.operand[10] = 0x00; - + if(firesat->type == FireSAT_DVB_S) { /* ### relative frequency -> absolute frequency */ CmdFrm.operand[11] = (((params->frequency/4) >> 16) & 0xFF) | (2 << 6); @@ -430,11 +430,11 @@ int AVCTuner_DSD(struct firesat *firesat, struct dvb_frontend_parameters *params CmdFrm.operand[12] = ((params->frequency/4000) >> 8) & 0xFF; CmdFrm.operand[13] = (params->frequency/4000) & 0xFF; } - + CmdFrm.operand[14] = ((params->u.qpsk.symbol_rate/1000) >> 12) & 0xFF; CmdFrm.operand[15] = ((params->u.qpsk.symbol_rate/1000) >> 4) & 0xFF; CmdFrm.operand[16] = ((params->u.qpsk.symbol_rate/1000) << 4) & 0xF0; - + CmdFrm.operand[17] = 0x00; switch(params->u.qpsk.fec_inner) { case FEC_1_2: @@ -485,7 +485,7 @@ int AVCTuner_DSD(struct firesat *firesat, struct dvb_frontend_parameters *params CmdFrm.operand[20] = 0x00; CmdFrm.operand[21] = 0x00; CmdFrm.operand[22] = 0x00; // Nr_of_dsd_sel_specs = 0 - > No PIDs are transmitted - + CmdFrm.length=28; } } // AVCTuner_DSD_direct @@ -495,7 +495,7 @@ int AVCTuner_DSD(struct firesat *firesat, struct dvb_frontend_parameters *params // msleep(250); mdelay(500); - + if(status) *status=RspFrm.operand[2]; return 0; @@ -505,9 +505,9 @@ int AVCTuner_SetPIDs(struct firesat *firesat, unsigned char pidc, u16 pid[]) { AVCCmdFrm CmdFrm; AVCRspFrm RspFrm; int pos,k; - + printk(KERN_INFO "%s\n", __FUNCTION__); - + if(pidc > 16 && pidc != 0xFF) return -EINVAL; @@ -518,7 +518,7 @@ int AVCTuner_SetPIDs(struct firesat *firesat, unsigned char pidc, u16 pid[]) { CmdFrm.sutyp = 0x5; CmdFrm.suid = firesat->subunit; CmdFrm.opcode = DSD; - + CmdFrm.operand[0] = 0; // source plug CmdFrm.operand[1] = 0xD2; // subfunction replace CmdFrm.operand[2] = 0x20; // system id = DVB @@ -526,7 +526,7 @@ int AVCTuner_SetPIDs(struct firesat *firesat, unsigned char pidc, u16 pid[]) { CmdFrm.operand[4] = 0x11; // system_specific_multiplex selection_length CmdFrm.operand[5] = 0x00; // valid_flags [0] CmdFrm.operand[6] = 0x00; // valid_flags [1] - + if(firesat->type == FireSAT_DVB_T) { /* CmdFrm.operand[7] = 0x00; CmdFrm.operand[8] = 0x00;//(params->frequency/10) >> 24; @@ -536,7 +536,7 @@ int AVCTuner_SetPIDs(struct firesat *firesat, unsigned char pidc, u16 pid[]) { CmdFrm.operand[12] = 0x00; CmdFrm.operand[13] = 0x00; CmdFrm.operand[14] = 0x00; - + CmdFrm.operand[15] = 0x00; // network_ID[0] CmdFrm.operand[16] = 0x00; // network_ID[1] */ CmdFrm.operand[17] = pidc; // Nr_of_dsd_sel_specs @@ -547,22 +547,22 @@ int AVCTuner_SetPIDs(struct firesat *firesat, unsigned char pidc, u16 pid[]) { CmdFrm.operand[8] = 0x00; CmdFrm.operand[9] = 0x00; CmdFrm.operand[10] = 0x00; - + CmdFrm.operand[11] = 0x00;//(((params->frequency/4) >> 16) & 0xFF) | (2 << 6); CmdFrm.operand[12] = 0x00;//((params->frequency/4) >> 8) & 0xFF; CmdFrm.operand[13] = 0x00;//(params->frequency/4) & 0xFF; - + CmdFrm.operand[14] = 0x00;//((params->u.qpsk.symbol_rate/1000) >> 12) & 0xFF; CmdFrm.operand[15] = 0x00;//((params->u.qpsk.symbol_rate/1000) >> 4) & 0xFF; CmdFrm.operand[16] = 0x00;//((params->u.qpsk.symbol_rate/1000) << 4) & 0xF0; - + CmdFrm.operand[17] = 0x00; CmdFrm.operand[18] = 0x00; CmdFrm.operand[19] = 0x00; // modulation CmdFrm.operand[20] = 0x00; CmdFrm.operand[21] = 0x00;*/ CmdFrm.operand[22] = pidc; // Nr_of_dsd_sel_specs - + pos=23; } if(pidc != 0xFF) @@ -576,7 +576,7 @@ int AVCTuner_SetPIDs(struct firesat *firesat, unsigned char pidc, u16 pid[]) { } CmdFrm.length = pos+3; - + if((pos+3)%4) CmdFrm.length += 4 - ((pos+3)%4); @@ -584,14 +584,14 @@ int AVCTuner_SetPIDs(struct firesat *firesat, unsigned char pidc, u16 pid[]) { return k; mdelay(250); - + return 0; } int AVCIdentifySubunit(struct firesat *firesat, unsigned char *systemId, int *transport, int *has_ci) { AVCCmdFrm CmdFrm; AVCRspFrm RspFrm; - + memset(&CmdFrm,0,sizeof(AVCCmdFrm)); CmdFrm.cts = AVC; @@ -612,7 +612,7 @@ int AVCIdentifySubunit(struct firesat *firesat, unsigned char *systemId, int *tr if(AVCWrite(firesat,&CmdFrm,&RspFrm)<0) return -EIO; - + if(RspFrm.resp != STABLE && RspFrm.resp != ACCEPTED) { printk("%s: AVCWrite returned error code %d\n",__FUNCTION__,RspFrm.resp); return -EINVAL; @@ -649,15 +649,15 @@ int AVCTunerStatus(struct firesat *firesat, ANTENNA_INPUT_INFO *antenna_input_in int length; printk(KERN_INFO "%s\n", __FUNCTION__); - + memset(&CmdFrm, 0, sizeof(AVCCmdFrm)); - + CmdFrm.cts=AVC; CmdFrm.ctype=CONTROL; CmdFrm.sutyp=0x05; // tuner CmdFrm.suid=firesat->subunit; CmdFrm.opcode=READ_DESCRIPTOR; - + CmdFrm.operand[0]=DESCRIPTOR_TUNER_STATUS; CmdFrm.operand[1]=0xff; CmdFrm.operand[2]=0x00; @@ -669,7 +669,7 @@ int AVCTunerStatus(struct firesat *firesat, ANTENNA_INPUT_INFO *antenna_input_in //Absenden des AVC request und warten auf response if (AVCWrite(firesat,&CmdFrm,&RspFrm) < 0) return -EIO; - + if(RspFrm.resp != STABLE && RspFrm.resp != ACCEPTED) { printk("%s: AVCWrite returned code %d\n",__FUNCTION__,RspFrm.resp); return -EINVAL; @@ -678,7 +678,7 @@ int AVCTunerStatus(struct firesat *firesat, ANTENNA_INPUT_INFO *antenna_input_in length = (RspFrm.operand[3] << 8) + RspFrm.operand[4]; if(length == sizeof(ANTENNA_INPUT_INFO)) { - memcpy(antenna_input_info,&RspFrm.operand[7],length); + memcpy(antenna_input_info,&RspFrm.operand[7],length); return 0; } printk("%s: invalid info returned from AVC\n",__FUNCTION__); @@ -689,17 +689,17 @@ int AVCLNBControl(struct firesat *firesat, char voltage, char burst, char contto AVCCmdFrm CmdFrm; AVCRspFrm RspFrm; int i,j; - + printk(KERN_INFO "%s: voltage = %x, burst = %x, conttone = %x\n",__FUNCTION__,voltage,burst,conttone); - + memset(&CmdFrm, 0, sizeof(AVCCmdFrm)); - + CmdFrm.cts=AVC; CmdFrm.ctype=CONTROL; CmdFrm.sutyp=0x05; CmdFrm.suid=firesat->subunit; CmdFrm.opcode=VENDOR; - + /* ### should check for elgato and use SFE_VENDOR_EL_COMPANYID_0 in this case */ CmdFrm.operand[0]=SFE_VENDOR_DE_COMPANYID_0; CmdFrm.operand[1]=SFE_VENDOR_DE_COMPANYID_1; @@ -708,40 +708,40 @@ int AVCLNBControl(struct firesat *firesat, char voltage, char burst, char contto CmdFrm.operand[4]=voltage; CmdFrm.operand[5]=nrdiseq; - + i=6; - + for(j=0;j<nrdiseq;j++) { int k; printk(KERN_INFO "%s: diseq %d len %x\n",__FUNCTION__,j,diseqcmd[j].msg_len); CmdFrm.operand[i++]=diseqcmd[j].msg_len; - + for(k=0;k<diseqcmd[j].msg_len;k++) { printk(KERN_INFO "%s: diseq %d msg[%d] = %x\n",__FUNCTION__,j,k,diseqcmd[j].msg[k]); CmdFrm.operand[i++]=diseqcmd[j].msg[k]; } } - + CmdFrm.operand[i++]=burst; CmdFrm.operand[i++]=conttone; - + CmdFrm.length=i+3; if((i+3)%4) CmdFrm.length += 4 - ((i+3)%4); - + /* for(j=0;j<CmdFrm.length;j++) printk(KERN_INFO "%s: CmdFrm.operand[%d]=0x%x\n",__FUNCTION__,j,CmdFrm.operand[j]); - + printk(KERN_INFO "%s: cmdfrm.length = %u\n",__FUNCTION__,CmdFrm.length); */ if(AVCWrite(firesat,&CmdFrm,&RspFrm) < 0) return -EIO; - + if(RspFrm.resp != ACCEPTED) { printk("%s: AVCWrite returned code %d\n",__FUNCTION__,RspFrm.resp); return -EINVAL; } - + return 0; } @@ -780,7 +780,7 @@ int AVCSubUnitInfo(struct firesat*firesat, char *subunitcount) { } static int __AVCRegisterRemoteControl(struct firesat*firesat, int internal) { - AVCCmdFrm CmdFrm; + AVCCmdFrm CmdFrm; // printk(KERN_INFO "%s\n",__FUNCTION__); @@ -807,7 +807,7 @@ static int __AVCRegisterRemoteControl(struct firesat*firesat, int internal) { return -EIO; } else if(AVCWrite(firesat,&CmdFrm,NULL) < 0) - return -EIO; + return -EIO; return 0; } @@ -845,7 +845,7 @@ int AVCResetTPDU(struct firesat*firesat) { if(RspFrm.resp != STABLE) { printk("%s: AVCWrite returned error %d\n", __FUNCTION__, RspFrm.resp); return RspFrm.resp; - } + } return 0; } @@ -881,7 +881,7 @@ int AVCWriteTPDU(struct firesat*firesat, const char *tpdupacket, int length) { if(CmdFrm.length % 4) CmdFrm.length += 4 - (CmdFrm.length % 4); - + if(AVCWrite(firesat, &CmdFrm, &RspFrm) < 0) return -EIO; @@ -912,14 +912,14 @@ int AVCReadTPDU(struct firesat*firesat, char *tpdupacket, int *length) { // CmdFrm.operand[1] = SFE_VENDOR_EL_COMPANYID_1; CmdFrm.operand[1] = SFE_VENDOR_DE_COMPANYID_1; // CmdFrm.operand[2] = SFE_VENDOR_EL_COMPANYID_2; - CmdFrm.operand[2] = SFE_VENDOR_DE_COMPANYID_2; + CmdFrm.operand[2] = SFE_VENDOR_DE_COMPANYID_2; // CmdFrm.operand[3] = SFE_VENDOR_OPCODE_CI_READ_TPDU; CmdFrm.length = 8; if(AVCWrite(firesat, &CmdFrm, &RspFrm) < 0) return -EIO; - + if(RspFrm.resp != STABLE) { printk("%s: AVCWrite returned error %d\n",__FUNCTION__,RspFrm.resp); return RspFrm.resp; diff --git a/v4l_experimental/firesat/cmp.c b/v4l_experimental/firesat/cmp.c index c302a4127..29f8a7d3c 100644 --- a/v4l_experimental/firesat/cmp.c +++ b/v4l_experimental/firesat/cmp.c @@ -29,10 +29,10 @@ static int cmp_read(struct firesat *firesat, void *buffer, u64 addr, size_t leng int ret; if(down_interruptible(&firesat->avc_sem)) return -EINTR; - + ret = hpsb_read(firesat->host, firesat->nodeentry->nodeid, firesat->nodeentry->generation, addr, buffer, length); - + up(&firesat->avc_sem); return ret; } @@ -41,10 +41,10 @@ static int cmp_lock(struct firesat *firesat, quadlet_t *data, u64 addr, quadlet_ int ret; if(down_interruptible(&firesat->avc_sem)) return -EINTR; - + ret = hpsb_lock(firesat->host, firesat->nodeentry->nodeid, firesat->nodeentry->generation, addr, ext_tcode, data, arg); - + up(&firesat->avc_sem); return ret; } @@ -52,13 +52,13 @@ static int cmp_lock(struct firesat *firesat, quadlet_t *data, u64 addr, quadlet_ //try establishing a point-to-point connection (may be interrupted by a busreset int try_CMPEstablishPPconnection(struct firesat *firesat, int output_plug, int iso_channel) { unsigned int BWU; //bandwidth to allocate - + quadlet_t old_oPCR,test_oPCR = 0x0; u64 oPCR_address=0xfffff0000904ull+(output_plug << 2); int result=cmp_read(firesat, &test_oPCR, oPCR_address, 4); - + printk(KERN_INFO "%s: nodeid = %d\n",__FUNCTION__,firesat->nodeentry->nodeid); - + if (result < 0) { printk("%s: cannot read oPCR\n", __FUNCTION__); return result; @@ -100,7 +100,7 @@ int try_CMPEstablishPPconnection(struct firesat *firesat, int output_plug, int i printk(KERN_INFO "%s: trying compare_swap...\n",__FUNCTION__); printk(KERN_INFO "%s: oPCR_old: %08x, oPCR_new: %08x\n",__FUNCTION__, old_oPCR, new_oPCR); result=cmp_lock(firesat, &test_oPCR, oPCR_address, old_oPCR, 2); - + if (result < 0) { printk("%s: cannot compare_swap oPCR\n",__FUNCTION__); return result; @@ -131,7 +131,7 @@ int try_CMPBreakPPconnection(struct firesat *firesat, int output_plug,int iso_ch u64 oPCR_address=0xfffff0000904ull+(output_plug << 2); int result=cmp_read(firesat, &test_oPCR, oPCR_address, 4); - + printk(KERN_INFO "%s\n",__FUNCTION__); if (result < 0) { diff --git a/v4l_experimental/firesat/firesat-ci.c b/v4l_experimental/firesat/firesat-ci.c index 1fd96cf63..3d005cb56 100644 --- a/v4l_experimental/firesat/firesat-ci.c +++ b/v4l_experimental/firesat/firesat-ci.c @@ -11,7 +11,7 @@ static int firesat_ca_do_ioctl(struct inode *inode, struct file *file, unsigned int err; // printk(KERN_INFO "%s: ioctl %d\n",__FUNCTION__,cmd); - + switch(cmd) { case CA_RESET: err = AVCResetTPDU(firesat); @@ -67,7 +67,7 @@ static ssize_t firesat_ca_io_read(struct file *file, char __user *buf, size_t co struct firesat *firesat = (struct firesat*)((struct dvb_device*)file->private_data)->priv; char *data=kmalloc(count,GFP_KERNEL); // printk(KERN_INFO "%s: count = %d\n",__FUNCTION__,count); - int r=AVCReadTPDU(firesat, data, &count); + int r=AVCReadTPDU(firesat, data, &count); if(!r) { copy_to_user(buf,data,count); kfree(data); @@ -77,9 +77,9 @@ static ssize_t firesat_ca_io_read(struct file *file, char __user *buf, size_t co return 0; } -static int firesat_ca_io_open(struct inode *inode, struct file *file) { +static int firesat_ca_io_open(struct inode *inode, struct file *file) { printk(KERN_INFO "%s!\n",__FUNCTION__); - return dvb_generic_open(inode, file); + return dvb_generic_open(inode, file); } static int firesat_ca_io_release(struct inode *inode, struct file *file) { @@ -89,7 +89,7 @@ static int firesat_ca_io_release(struct inode *inode, struct file *file) { static unsigned int firesat_ca_io_poll(struct file *file, poll_table *wait) { // printk(KERN_INFO "%s!\n",__FUNCTION__); - return POLLIN; + return POLLIN; } static struct file_operations firesat_ca_fops = { diff --git a/v4l_experimental/firesat/firesat-rc.c b/v4l_experimental/firesat/firesat-rc.c index 8cc57573d..702f90f6c 100644 --- a/v4l_experimental/firesat/firesat-rc.c +++ b/v4l_experimental/firesat/firesat-rc.c @@ -49,7 +49,7 @@ int firesat_register_rc(void) { memset(&firesat_idev, 0, sizeof(firesat_idev)); firesat_idev.evbit[0] = BIT(EV_KEY); - + for(index=0;firesat_irtable[index] != 0; index++) set_bit(firesat_irtable[index], firesat_idev.keybit); @@ -65,7 +65,7 @@ int firesat_unregister_rc(void) { int firesat_got_remotecontrolcode(u16 code) { u16 keycode; - + if(code > 0x4500 && code < 0x4520) keycode = firesat_irtable[code - 0x4501]; else if(code > 0x453f && code < 0x4543) @@ -73,7 +73,7 @@ int firesat_got_remotecontrolcode(u16 code) { else { printk("%s: invalid key code 0x%04x\n",__FUNCTION__,code); return -EINVAL; - } + } input_report_key(&firesat_idev, keycode, 1); input_report_key(&firesat_idev, keycode, 0); diff --git a/v4l_experimental/firesat/firesat.c b/v4l_experimental/firesat/firesat.c index 167c5a709..dcf268702 100644 --- a/v4l_experimental/firesat/firesat.c +++ b/v4l_experimental/firesat/firesat.c @@ -44,111 +44,111 @@ static struct ieee1394_device_id firesat_id_table[] = { { .match_flags = /*IEEE1394_MATCH_VENDOR_ID |*/ IEEE1394_MATCH_MODEL_ID | IEEE1394_MATCH_SPECIFIER_ID | IEEE1394_MATCH_VERSION, - .model_id = 0x11, - .specifier_id = AVC_UNIT_SPEC_ID_ENTRY & 0xffffff, - .version = AVC_SW_VERSION_ENTRY & 0xffffff + .model_id = 0x11, + .specifier_id = AVC_UNIT_SPEC_ID_ENTRY & 0xffffff, + .version = AVC_SW_VERSION_ENTRY & 0xffffff }, { .match_flags = /*IEEE1394_MATCH_VENDOR_ID |*/ IEEE1394_MATCH_MODEL_ID | IEEE1394_MATCH_SPECIFIER_ID | IEEE1394_MATCH_VERSION, - .model_id = 0x12, - .specifier_id = AVC_UNIT_SPEC_ID_ENTRY & 0xffffff, - .version = AVC_SW_VERSION_ENTRY & 0xffffff + .model_id = 0x12, + .specifier_id = AVC_UNIT_SPEC_ID_ENTRY & 0xffffff, + .version = AVC_SW_VERSION_ENTRY & 0xffffff }, { .match_flags = /*IEEE1394_MATCH_VENDOR_ID |*/ IEEE1394_MATCH_MODEL_ID | IEEE1394_MATCH_SPECIFIER_ID | IEEE1394_MATCH_VERSION, // .vendor_id = FIRESAT_Vendor_ID & 0xffffff, // .vendor_id = 0x000000, - .model_id = 0x13, - .specifier_id = AVC_UNIT_SPEC_ID_ENTRY & 0xffffff, - .version = AVC_SW_VERSION_ENTRY & 0xffffff + .model_id = 0x13, + .specifier_id = AVC_UNIT_SPEC_ID_ENTRY & 0xffffff, + .version = AVC_SW_VERSION_ENTRY & 0xffffff }, { .match_flags = /*IEEE1394_MATCH_VENDOR_ID |*/ IEEE1394_MATCH_MODEL_ID | IEEE1394_MATCH_SPECIFIER_ID | IEEE1394_MATCH_VERSION, // .vendor_id = FIRESAT_Vendor_ID & 0xffffff, // .vendor_id = 0x000000, - .model_id = 0x14, - .specifier_id = AVC_UNIT_SPEC_ID_ENTRY & 0xffffff, - .version = AVC_SW_VERSION_ENTRY & 0xffffff + .model_id = 0x14, + .specifier_id = AVC_UNIT_SPEC_ID_ENTRY & 0xffffff, + .version = AVC_SW_VERSION_ENTRY & 0xffffff }, { .match_flags = /*IEEE1394_MATCH_VENDOR_ID |*/ IEEE1394_MATCH_MODEL_ID | IEEE1394_MATCH_SPECIFIER_ID | IEEE1394_MATCH_VERSION, // .vendor_id = FIRESAT_Vendor_ID & 0xffffff, // .vendor_id = 0x000000, - .model_id = 0x21, - .specifier_id = AVC_UNIT_SPEC_ID_ENTRY & 0xffffff, - .version = AVC_SW_VERSION_ENTRY & 0xffffff + .model_id = 0x21, + .specifier_id = AVC_UNIT_SPEC_ID_ENTRY & 0xffffff, + .version = AVC_SW_VERSION_ENTRY & 0xffffff }, { .match_flags = /*IEEE1394_MATCH_VENDOR_ID |*/ IEEE1394_MATCH_MODEL_ID | IEEE1394_MATCH_SPECIFIER_ID | IEEE1394_MATCH_VERSION, // .vendor_id = FIRESAT_Vendor_ID & 0xffffff, // .vendor_id = 0x000000, - .model_id = 0x22, - .specifier_id = AVC_UNIT_SPEC_ID_ENTRY & 0xffffff, - .version = AVC_SW_VERSION_ENTRY & 0xffffff + .model_id = 0x22, + .specifier_id = AVC_UNIT_SPEC_ID_ENTRY & 0xffffff, + .version = AVC_SW_VERSION_ENTRY & 0xffffff }, { .match_flags = /*IEEE1394_MATCH_VENDOR_ID |*/ IEEE1394_MATCH_MODEL_ID | IEEE1394_MATCH_SPECIFIER_ID | IEEE1394_MATCH_VERSION, // .vendor_id = FIRESAT_Vendor_ID & 0xffffff, // .vendor_id = 0x000000, - .model_id = 0x23, - .specifier_id = AVC_UNIT_SPEC_ID_ENTRY & 0xffffff, - .version = AVC_SW_VERSION_ENTRY & 0xffffff + .model_id = 0x23, + .specifier_id = AVC_UNIT_SPEC_ID_ENTRY & 0xffffff, + .version = AVC_SW_VERSION_ENTRY & 0xffffff }, { .match_flags = /*IEEE1394_MATCH_VENDOR_ID |*/ IEEE1394_MATCH_MODEL_ID | IEEE1394_MATCH_SPECIFIER_ID | IEEE1394_MATCH_VERSION, // .vendor_id = FIRESAT_Vendor_ID & 0xffffff, // .vendor_id = 0x000000, - .model_id = 0x24, - .specifier_id = AVC_UNIT_SPEC_ID_ENTRY & 0xffffff, - .version = AVC_SW_VERSION_ENTRY & 0xffffff + .model_id = 0x24, + .specifier_id = AVC_UNIT_SPEC_ID_ENTRY & 0xffffff, + .version = AVC_SW_VERSION_ENTRY & 0xffffff }, { .match_flags = /*IEEE1394_MATCH_VENDOR_ID |*/ IEEE1394_MATCH_MODEL_ID | IEEE1394_MATCH_SPECIFIER_ID | IEEE1394_MATCH_VERSION, // .vendor_id = FIRESAT_Vendor_ID & 0xffffff, // .vendor_id = 0x000000, - .model_id = 0x25, - .specifier_id = AVC_UNIT_SPEC_ID_ENTRY & 0xffffff, - .version = AVC_SW_VERSION_ENTRY & 0xffffff + .model_id = 0x25, + .specifier_id = AVC_UNIT_SPEC_ID_ENTRY & 0xffffff, + .version = AVC_SW_VERSION_ENTRY & 0xffffff }, { .match_flags = /*IEEE1394_MATCH_VENDOR_ID |*/ IEEE1394_MATCH_MODEL_ID | IEEE1394_MATCH_SPECIFIER_ID | IEEE1394_MATCH_VERSION, // .vendor_id = FIRESAT_Vendor_ID & 0xffffff, // .vendor_id = 0x000000, - .model_id = 0x26, - .specifier_id = AVC_UNIT_SPEC_ID_ENTRY & 0xffffff, - .version = AVC_SW_VERSION_ENTRY & 0xffffff + .model_id = 0x26, + .specifier_id = AVC_UNIT_SPEC_ID_ENTRY & 0xffffff, + .version = AVC_SW_VERSION_ENTRY & 0xffffff }, { .match_flags = /*IEEE1394_MATCH_VENDOR_ID |*/ IEEE1394_MATCH_MODEL_ID | IEEE1394_MATCH_SPECIFIER_ID | IEEE1394_MATCH_VERSION, // .vendor_id = FIRESAT_Vendor_ID & 0xffffff, // .vendor_id = 0x000000, - .model_id = 0x27, - .specifier_id = AVC_UNIT_SPEC_ID_ENTRY & 0xffffff, - .version = AVC_SW_VERSION_ENTRY & 0xffffff + .model_id = 0x27, + .specifier_id = AVC_UNIT_SPEC_ID_ENTRY & 0xffffff, + .version = AVC_SW_VERSION_ENTRY & 0xffffff }, { .match_flags = /*IEEE1394_MATCH_VENDOR_ID |*/ IEEE1394_MATCH_MODEL_ID | IEEE1394_MATCH_SPECIFIER_ID | IEEE1394_MATCH_VERSION, // .vendor_id = FIRESAT_Vendor_ID & 0xffffff, // .vendor_id = 0x000000, - .model_id = 0x34, - .specifier_id = AVC_UNIT_SPEC_ID_ENTRY & 0xffffff, - .version = AVC_SW_VERSION_ENTRY & 0xffffff + .model_id = 0x34, + .specifier_id = AVC_UNIT_SPEC_ID_ENTRY & 0xffffff, + .version = AVC_SW_VERSION_ENTRY & 0xffffff }, { .match_flags = /*IEEE1394_MATCH_VENDOR_ID |*/ IEEE1394_MATCH_MODEL_ID | IEEE1394_MATCH_SPECIFIER_ID | IEEE1394_MATCH_VERSION, // .vendor_id = FIRESAT_Vendor_ID & 0xffffff, // .vendor_id = 0x000000, - .model_id = 0x35, - .specifier_id = AVC_UNIT_SPEC_ID_ENTRY & 0xffffff, - .version = AVC_SW_VERSION_ENTRY & 0xffffff + .model_id = 0x35, + .specifier_id = AVC_UNIT_SPEC_ID_ENTRY & 0xffffff, + .version = AVC_SW_VERSION_ENTRY & 0xffffff }, { .match_flags = /*IEEE1394_MATCH_VENDOR_ID |*/ IEEE1394_MATCH_MODEL_ID | IEEE1394_MATCH_SPECIFIER_ID | IEEE1394_MATCH_VERSION, // .vendor_id = FIRESAT_Vendor_ID & 0xffffff, // .vendor_id = 0x000000, - .model_id = 0x36, - .specifier_id = AVC_UNIT_SPEC_ID_ENTRY & 0xffffff, - .version = AVC_SW_VERSION_ENTRY & 0xffffff + .model_id = 0x36, + .specifier_id = AVC_UNIT_SPEC_ID_ENTRY & 0xffffff, + .version = AVC_SW_VERSION_ENTRY & 0xffffff }, { } }; @@ -163,7 +163,7 @@ static void firesat_add_host (struct hpsb_host *host); static void firesat_remove_host (struct hpsb_host *host); static void firesat_host_reset(struct hpsb_host *host); static void iso_receive(struct hpsb_host *host, int channel, quadlet_t *data, - size_t length); + size_t length); static void fcp_request(struct hpsb_host *host, int nodeid, int direction, int cts, u8 *data, size_t length); @@ -187,7 +187,7 @@ static struct dvb_frontend_info firesat_S_frontend_info = { .symbol_rate_max = 40000000, .caps = FE_CAN_INVERSION_AUTO | FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 | FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | - FE_CAN_FEC_AUTO | FE_CAN_QPSK, + FE_CAN_FEC_AUTO | FE_CAN_QPSK, }; static struct dvb_frontend_info firesat_C_frontend_info = { @@ -217,18 +217,18 @@ static struct dvb_frontend_info firesat_T_frontend_info = { static void firesat_add_host (struct hpsb_host *host) { struct ti_ohci *ohci; // printk(KERN_INFO "FireSAT add_host (nodeid = 0x%x)\n",host->node_id); - + /* We only work with the OHCI-1394 driver */ if (strcmp(host->driver->name, OHCI1394_DRIVER_NAME)) return; - + ohci = (struct ti_ohci *)host->hostdata; - + if (!hpsb_create_hostinfo(&firesat_highlevel, host, 0)) { printk(KERN_ERR "Cannot allocate hostinfo\n"); return; } - + hpsb_set_hostinfo(&firesat_highlevel, host, ohci); hpsb_set_hostinfo_key(&firesat_highlevel, host, ohci->host->id); } @@ -243,65 +243,65 @@ static void firesat_host_reset(struct hpsb_host *host) { struct firewireheader { union { - struct { - unsigned char tcode:4; - unsigned char sy:4; - unsigned char tag:2; - unsigned char channel:6; - - unsigned char length_l; - unsigned char length_h; - } hdr; - unsigned long val; + struct { + unsigned char tcode:4; + unsigned char sy:4; + unsigned char tag:2; + unsigned char channel:6; + + unsigned char length_l; + unsigned char length_h; + } hdr; + unsigned long val; }; }; struct CIPHeader { union { - struct { - unsigned char syncbits:2; - unsigned char sid:6; - unsigned char dbs; - unsigned char fn:2; - unsigned char qpc:3; - unsigned char sph:1; - unsigned char rsv:2; - unsigned char dbc; - unsigned char syncbits2:2; - unsigned char fmt:6; - unsigned long fdf:24; - } cip; - unsigned long long val; + struct { + unsigned char syncbits:2; + unsigned char sid:6; + unsigned char dbs; + unsigned char fn:2; + unsigned char qpc:3; + unsigned char sph:1; + unsigned char rsv:2; + unsigned char dbc; + unsigned char syncbits2:2; + unsigned char fmt:6; + unsigned long fdf:24; + } cip; + unsigned long long val; }; }; struct MPEG2Header { union { - struct { - unsigned char sync; // must be 0x47 - unsigned char transport_error_indicator:1; - unsigned char payload_unit_start_indicator:1; - unsigned char transport_priority:1; - unsigned short pid:13; - unsigned char transport_scrambling_control:2; - unsigned char adaption_field_control:2; - unsigned char continuity_counter:4; - } hdr; - unsigned long val; + struct { + unsigned char sync; // must be 0x47 + unsigned char transport_error_indicator:1; + unsigned char payload_unit_start_indicator:1; + unsigned char transport_priority:1; + unsigned short pid:13; + unsigned char transport_scrambling_control:2; + unsigned char adaption_field_control:2; + unsigned char continuity_counter:4; + } hdr; + unsigned long val; }; }; static void iso_receive(struct hpsb_host *host, int channel, quadlet_t *data, - size_t length) { + size_t length) { // printk(KERN_INFO "FireSAT iso_receive: channel %d, length = %d\n", channel, length); - + if(length <= 12) return; // ignore empty packets else { struct firesat *firesat=NULL; struct firesat *firesat_entry; unsigned long flags; - + spin_lock_irqsave(&firesat_list_lock, flags); list_for_each_entry(firesat_entry,&firesat_list,list) { if(firesat_entry->host == host && firesat_entry->isochannel == channel) { @@ -310,15 +310,15 @@ static void iso_receive(struct hpsb_host *host, int channel, quadlet_t *data, } } spin_unlock_irqrestore(&firesat_list_lock, flags); - + if(firesat) { char *buf=((char*)data) + sizeof(struct firewireheader)+sizeof(struct CIPHeader); int count = (length-sizeof(struct CIPHeader)) / 192; - + // printk(KERN_INFO "%s: length = %u\n data[0] = %08x\n data[1] = %08x\n data[2] = %08x\n data[3] = %08x\n data[4] = %08x\n",__FUNCTION__, length, data[0],data[1],data[2],data[3],data[4]); - + while (count--) { - + if(buf[sizeof(quadlet_t) /*timestamp*/] == 0x47) dvb_dmx_swfilter_packet(&firesat->demux, &buf[sizeof(quadlet_t)]); else @@ -332,10 +332,10 @@ static void iso_receive(struct hpsb_host *host, int channel, quadlet_t *data, static void fcp_request(struct hpsb_host *host, int nodeid, int direction, int cts, u8 *data, size_t length) { // printk(KERN_INFO "FireSAT fcp_request length=%d\n",length); - if(length>0 && ((data[0] & 0xF0) >> 4) == 0) { + if(length>0 && ((data[0] & 0xF0) >> 4) == 0) { struct firesat *firesat=NULL; struct firesat *firesat_entry; - unsigned long flags; + unsigned long flags; spin_lock_irqsave(&firesat_list_lock, flags); list_for_each_entry(firesat_entry,&firesat_list,list) { @@ -356,7 +356,7 @@ static void fcp_request(struct hpsb_host *host, int nodeid, int direction, static int firesat_frontend_ioctl(struct dvb_frontend *frontend, unsigned int cmd, void *arg) { struct firesat *firesat=frontend->data; - + switch(cmd) { case FE_INIT: firesat->isochannel = firesat->adapter->num << 1 | (firesat->subunit & 0x1); // ### ask IRM @@ -401,13 +401,13 @@ static int firesat_frontend_ioctl(struct dvb_frontend *frontend, if(AVCTunerStatus(firesat,&info)) { return -EINVAL; } -// printk(KERN_INFO "%s: NoRF=%c\n",__FUNCTION__,info.NoRF?'y':'n'); +// printk(KERN_INFO "%s: NoRF=%c\n",__FUNCTION__,info.NoRF?'y':'n'); if(info.NoRF) *status = 0; else *status = *status = FE_HAS_SIGNAL | FE_HAS_VITERBI | FE_HAS_SYNC | FE_HAS_CARRIER | FE_HAS_LOCK; - + break; } case FE_READ_BER: { @@ -418,10 +418,10 @@ static int firesat_frontend_ioctl(struct dvb_frontend *frontend, if(AVCTunerStatus(firesat,&info)) { return -EINVAL; } - + // *ber = *(u32*)info.BER; /* might need some byte ordering correction */ *ber = ((info.BER[0] << 24) & 0xFF) | ((info.BER[1] << 16) & 0xFF) | ((info.BER[2] << 8) & 0xFF) | (info.BER[3] & 0xFF); - + break; } case FE_READ_SIGNAL_STRENGTH: { @@ -432,9 +432,9 @@ static int firesat_frontend_ioctl(struct dvb_frontend *frontend, if(AVCTunerStatus(firesat,&info)) { return -EINVAL; } - + *signal = info.SignalStrength; - + break; } case FE_READ_SNR: @@ -444,18 +444,18 @@ static int firesat_frontend_ioctl(struct dvb_frontend *frontend, struct dvb_frontend_parameters *p = (struct dvb_frontend_parameters *)arg; // printk(KERN_INFO "FE_GET_INFO\n"); - + // printk(KERN_INFO "%s: FE_SET_FRONTEND\n", __FUNCTION__); - + // printk(KERN_INFO " frequency->%d\n", p->frequency); // printk(KERN_INFO " symbol_rate->%d\n",p->u.qam.symbol_rate); // printk(KERN_INFO " inversion->%d\n", p->inversion); - + // if(AVCTuner_DSIT(firesat, 0/*###*/, p, NULL)) // return -EINVAL; if(AVCTuner_DSD(firesat, p, NULL) != ACCEPTED) return -EINVAL; - + break; } case FE_GET_FRONTEND: @@ -464,7 +464,7 @@ static int firesat_frontend_ioctl(struct dvb_frontend *frontend, default: return -EINVAL; } - + return 0; } @@ -472,10 +472,10 @@ static struct firesat_channel *firesat_channel_allocate(struct firesat *firesat) int k; printk(KERN_INFO "%s\n",__FUNCTION__); - + if(down_interruptible(&firesat->demux_sem)) return NULL; - + for(k=0;k<16;k++) { printk(KERN_INFO "%s: channel %d: active = %d, pid = 0x%x\n",__FUNCTION__,k,firesat->channel[k].active,firesat->channel[k].pid); if(firesat->channel[k].active == 0) { @@ -484,25 +484,25 @@ static struct firesat_channel *firesat_channel_allocate(struct firesat *firesat) return &firesat->channel[k]; } } - + up(&firesat->demux_sem); return NULL; // no more channels available } static int firesat_channel_collect(struct firesat *firesat, int *pidc, u16 pid[]) { int k, l=0; - + if(down_interruptible(&firesat->demux_sem)) return -EINTR; - + for(k=0;k<16;k++) if(firesat->channel[k].active == 1) pid[l++] = firesat->channel[k].pid; - + up(&firesat->demux_sem); - + *pidc = l; - + return 0; } @@ -523,7 +523,7 @@ static int firesat_start_feed(struct dvb_demux_feed *dvbdmxfeed) { u16 pids[16]; printk(KERN_INFO "%s (pid %u)\n",__FUNCTION__,dvbdmxfeed->pid); - + switch (dvbdmxfeed->type) { case DMX_TYPE_TS: case DMX_TYPE_SEC: @@ -549,30 +549,30 @@ static int firesat_start_feed(struct dvb_demux_feed *dvbdmxfeed) { } else { channel = firesat_channel_allocate(firesat); } - + if(!channel) { printk("%s: busy!\n",__FUNCTION__); return -EBUSY; } - + dvbdmxfeed->priv = channel; channel->dvbdmxfeed = dvbdmxfeed; channel->pid = dvbdmxfeed->pid; channel->type = dvbdmxfeed->type; channel->firesat = firesat; - + if(firesat_channel_collect(firesat, &pidc, pids)) { firesat_channel_release(firesat, channel); return -EINTR; } - + if((k=AVCTuner_SetPIDs(firesat, pidc, pids))) { firesat_channel_release(firesat, channel); printk("%s: AVCTuner failed with error %d\n",__FUNCTION__,k); return k; } - + return 0; } @@ -581,11 +581,11 @@ static int firesat_stop_feed(struct dvb_demux_feed *dvbdmxfeed) { struct firesat *firesat=(struct firesat*)demux->priv; int k, l=0; u16 pids[16]; - + printk(KERN_INFO "%s (pid %u)\n",__FUNCTION__,dvbdmxfeed->pid); - if (dvbdmxfeed->type == DMX_TYPE_TS && !((dvbdmxfeed->ts_type & TS_PACKET) && - (demux->dmx.frontend->source != DMX_MEMORY_FE))) { + if (dvbdmxfeed->type == DMX_TYPE_TS && !((dvbdmxfeed->ts_type & TS_PACKET) && + (demux->dmx.frontend->source != DMX_MEMORY_FE))) { if (dvbdmxfeed->ts_type & TS_DECODER) { if (dvbdmxfeed->pes_type >= DMX_TS_PES_OTHER || !demux->pesfilter[dvbdmxfeed->pes_type]) @@ -596,7 +596,7 @@ static int firesat_stop_feed(struct dvb_demux_feed *dvbdmxfeed) { if (!(dvbdmxfeed->ts_type & TS_DECODER && dvbdmxfeed->pes_type < DMX_TS_PES_OTHER)) { return 0; - } + } } if(down_interruptible(&firesat->demux_sem)) @@ -611,11 +611,11 @@ static int firesat_stop_feed(struct dvb_demux_feed *dvbdmxfeed) { up(&firesat->demux_sem); return k; } - + ((struct firesat_channel*)dvbdmxfeed->priv)->active = 0; up(&firesat->demux_sem); - + return 0; } @@ -631,16 +631,16 @@ static int firesat_probe(struct device *dev) { printk("%s: couldn't allocate memory.\n", __FUNCTION__); return -ENOMEM; } - + // printk(KERN_INFO "FireSAT: Detected device with GUID %08lx%04lx%04lx\n",(unsigned long)((ud->ne->guid)>>32),(unsigned long)(ud->ne->guid & 0xFFFF),(unsigned long)ud->ne->guid_vendor_id); printk(KERN_INFO "%s: loading device\n", __FUNCTION__); - + firesats[0]=NULL; firesats[1]=NULL; - + ud->device.driver_data = firesats; - - for(subunit=0;subunit<subunitcount;subunit++) { + + for(subunit=0;subunit<subunitcount;subunit++) { if (!(firesat = kmalloc(sizeof(struct firesat), GFP_KERNEL))) { printk("%s: couldn't allocate memory.\n", __FUNCTION__); kfree(firesats); @@ -660,12 +660,12 @@ static int firesat_probe(struct device *dev) { kfree(firesat); return -ENOMEM; } - + sema_init(&firesat->avc_sem, 1); atomic_set(&firesat->avc_reply_received, 1); sema_init(&firesat->demux_sem, 1); atomic_set(&firesat->reschedule_remotecontrol, 0); - + spin_lock_irqsave(&firesat_list_lock, flags); INIT_LIST_HEAD(&firesat->list); list_add_tail(&firesat->list, &firesat_list); @@ -727,18 +727,18 @@ static int firesat_probe(struct device *dev) { firesat->model_name, THIS_MODULE)) < 0) { printk("%s: dvb_register_adapter failed: error %d\n", __FUNCTION__, result); - + /* ### cleanup */ spin_lock_irqsave(&firesat_list_lock, flags); list_del(&firesat->list); spin_unlock_irqrestore(&firesat_list_lock, flags); kfree(firesat); - + return result; } - + firesat->demux.dmx.capabilities = 0/*DMX_TS_FILTERING | DMX_SECTION_FILTERING*/; - + firesat->demux.priv = (void *)firesat; firesat->demux.filternum = 16; firesat->demux.feednum = 16; @@ -746,82 +746,82 @@ static int firesat_probe(struct device *dev) { firesat->demux.stop_feed = firesat_stop_feed; firesat->demux.write_to_decoder = NULL; - + if ((result = dvb_dmx_init(&firesat->demux)) < 0) { printk("%s: dvb_dmx_init failed: error %d\n", __FUNCTION__, result); - + dvb_unregister_adapter(firesat->adapter); - + return result; } - + firesat->dmxdev.filternum = 16; firesat->dmxdev.demux = &firesat->demux.dmx; firesat->dmxdev.capabilities = 0; - + if ((result = dvb_dmxdev_init(&firesat->dmxdev, firesat->adapter)) < 0) { printk("%s: dvb_dmxdev_init failed: error %d\n", __FUNCTION__, result); - + dvb_dmx_release(&firesat->demux); dvb_unregister_adapter(firesat->adapter); - + return result; } - + firesat->frontend.source = DMX_FRONTEND_0; - + if ((result = firesat->demux.dmx.add_frontend(&firesat->demux.dmx, &firesat->frontend)) < 0) { printk("%s: dvb_dmx_init failed: error %d\n", __FUNCTION__, result); - + dvb_dmxdev_release(&firesat->dmxdev); dvb_dmx_release(&firesat->demux); dvb_unregister_adapter(firesat->adapter); - + return result; } - + if ((result = firesat->demux.dmx.connect_frontend(&firesat->demux.dmx, &firesat->frontend)) < 0) { printk("%s: dvb_dmx_init failed: error %d\n", __FUNCTION__, result); - + firesat->demux.dmx.remove_frontend(&firesat->demux.dmx, &firesat->frontend); dvb_dmxdev_release(&firesat->dmxdev); dvb_dmx_release(&firesat->demux); dvb_unregister_adapter(firesat->adapter); - + return result; } - + dvb_net_init(firesat->adapter, &firesat->dvbnet, &firesat->demux.dmx); - + if((result= dvb_register_frontend(firesat_frontend_ioctl,firesat->adapter,firesat,firesat->frontend_info,THIS_MODULE)) < 0) { printk("%s: dvb_register_frontend_new failed: error %d\n", __FUNCTION__, result); /* ### cleanup */ - + return result; } if(firesat->has_ci) firesat_ca_init(firesat); - + firesats[subunit] = firesat; } // loop fuer alle tuner am board if(firesats[0]) AVCRegisterRemoteControl(firesats[0]); - + return 0; } static int firesat_remove(struct device *dev) { struct unit_directory *ud=container_of(dev, struct unit_directory, device); struct firesat **firesats=ud->device.driver_data; - + if(firesats) { int k; for(k=0;k<2;k++) @@ -830,7 +830,7 @@ static int firesat_remove(struct device *dev) { if(firesats[k]->has_ci) firesat_ca_release(firesats[k]); dvb_unregister_frontend(firesat_frontend_ioctl,firesats[k]->adapter); - + dvb_net_release(&firesats[k]->dvbnet); firesats[k]->demux.dmx.close(&firesats[k]->demux.dmx); firesats[k]->demux.dmx.remove_frontend(&firesats[k]->demux.dmx, &firesats[k]->frontend); @@ -841,14 +841,14 @@ static int firesat_remove(struct device *dev) { spin_lock_irqsave(&firesat_list_lock, flags); list_del(&firesats[k]->list); spin_unlock_irqrestore(&firesat_list_lock, flags); - + kfree(firesats[k]->respfrm); kfree(firesats[k]); } kfree(firesats); } else printk("%s: can't get firesat handle\n",__FUNCTION__); - + printk(KERN_INFO "FireSAT: Removing device with vendor id 0x%x, model id 0x%x.\n",ud->vendor_id,ud->model_id); return 0; } @@ -858,7 +858,7 @@ static int firesat_update(struct unit_directory *ud) { struct firesat **firesats=ud->device.driver_data; int k; // loop over subunits - + for(k=0;k<2;k++) if(firesats[k]) { firesats[k]->nodeentry=ud->ne; @@ -877,8 +877,8 @@ static struct hpsb_protocol_driver firesat_driver = { .driver = { .name = "firesat", .bus = &ieee1394_bus_type, - .probe = firesat_probe, - .remove = firesat_remove, + .probe = firesat_probe, + .remove = firesat_remove, }, }; @@ -889,20 +889,20 @@ static int __init firesat_init(void) hpsb_register_highlevel(&firesat_highlevel); ret = hpsb_register_protocol(&firesat_driver); if(ret) { - printk(KERN_ERR "FireSAT: failed to register protocol\n"); - hpsb_unregister_highlevel(&firesat_highlevel); - return ret; + printk(KERN_ERR "FireSAT: failed to register protocol\n"); + hpsb_unregister_highlevel(&firesat_highlevel); + return ret; } if((ret=firesat_register_rc())) printk("%s: firesat_register_rc return error code %d (ignored)\n",__FUNCTION__,ret); - + return 0; } static void __exit firesat_exit(void){ firesat_unregister_rc(); - + hpsb_unregister_protocol(&firesat_driver); hpsb_unregister_highlevel(&firesat_highlevel); printk("FireSAT quit\n"); diff --git a/v4l_experimental/v3tv/i2c-voodoo3.c b/v4l_experimental/v3tv/i2c-voodoo3.c index 3ec720f78..d303a6a9c 100644 --- a/v4l_experimental/v3tv/i2c-voodoo3.c +++ b/v4l_experimental/v3tv/i2c-voodoo3.c @@ -1,11 +1,11 @@ /* voodoo3.c - Part of lm_sensors, Linux kernel modules for hardware - monitoring + monitoring Copyright (c) 1998, 1999 Frodo Looijaard <frodol@dds.nl>, Philip Edelbrock <phil@netroedge.com>, Ralph Metzler <rjkm@thp.uni-koeln.de>, and Mark D. Studebaker <mdsxyz123@yahoo.com> - + Based on code written by Ralph Metzler <rjkm@thp.uni-koeln.de> and Simon Vogl @@ -168,7 +168,7 @@ static struct i2c_algo_bit_data voo_i2c_bit_data = { static struct i2c_adapter voodoo3_i2c_adapter = { .owner = THIS_MODULE, - .class = I2C_CLASS_TV_ANALOG, + .class = I2C_CLASS_TV_ANALOG, .name = "I2C Voodoo3/Banshee adapter", .algo_data = &voo_i2c_bit_data, }; @@ -185,7 +185,7 @@ static struct i2c_algo_bit_data voo_ddc_bit_data = { static struct i2c_adapter voodoo3_ddc_adapter = { .owner = THIS_MODULE, - .class = I2C_CLASS_DDC, + .class = I2C_CLASS_DDC, .name = "DDC Voodoo3/Banshee adapter", .algo_data = &voo_ddc_bit_data, }; @@ -222,7 +222,7 @@ static int __devinit voodoo3_probe(struct pci_dev *dev, const struct pci_device_ static void __devexit voodoo3_remove(struct pci_dev *dev) { i2c_bit_del_bus(&voodoo3_i2c_adapter); - i2c_bit_del_bus(&voodoo3_ddc_adapter); + i2c_bit_del_bus(&voodoo3_ddc_adapter); iounmap(ioaddr); } diff --git a/v4l_experimental/v3tv/v3tv.c b/v4l_experimental/v3tv/v3tv.c index a29569c6a..6f105cb3b 100644 --- a/v4l_experimental/v3tv/v3tv.c +++ b/v4l_experimental/v3tv/v3tv.c @@ -321,21 +321,21 @@ static struct conf_struct voodoo3_init_reg[] = { static struct conf_struct Chromakey_Enable[] = { {V3REG_vidProcCfg, 1, 5, 5} }; -static struct conf_struct Horizontal_Decimation_Enable[] = +static struct conf_struct Horizontal_Decimation_Enable[] = { {V3REG_vidInFormat, 1, 20, 20} }; /* Horizontal Decimation enable */ -static struct conf_struct Horizontal_Decimation_Disable[] = +static struct conf_struct Horizontal_Decimation_Disable[] = { {V3REG_vidInFormat, 0, 20, 20} }; /* Horizontal Decimation disable */ -static struct conf_struct Vertical_Decimation_Enable[] = +static struct conf_struct Vertical_Decimation_Enable[] = { {V3REG_vidInFormat, 1, 21, 21} }; /* Vertical Decimation enable */ -static struct conf_struct Vertical_Decimation_Disable[] = +static struct conf_struct Vertical_Decimation_Disable[] = { {V3REG_vidInFormat, 0, 21, 21} }; /* Vertical Decimation enable */ -static struct conf_struct Horizontal_Magnification_Enable[] = +static struct conf_struct Horizontal_Magnification_Enable[] = { {V3REG_vidProcCfg, 1, 14, 14} }; /* Horizontal Scaling enable */ -static struct conf_struct Horizontal_Magnification_Disable[] = +static struct conf_struct Horizontal_Magnification_Disable[] = { {V3REG_vidProcCfg, 0, 14, 14} }; /* Horizontal Scaling disable */ -static struct conf_struct Vertical_Magnification_Enable[] = +static struct conf_struct Vertical_Magnification_Enable[] = { {V3REG_vidProcCfg, 1, 15, 15} }; /* Vertical Scaling enable */ -static struct conf_struct Vertical_Magnification_Disable[] = +static struct conf_struct Vertical_Magnification_Disable[] = { {V3REG_vidProcCfg, 0, 15, 15} }; /* Vertical Scaling disable */ static struct conf_struct Overlay_Disable[] = @@ -356,9 +356,9 @@ static struct conf_struct Overlay_Enable[] = { {V3REG_vidProcCfg, 0, 31, 31}, /* No overlay backend de-interlacing */ {V3REG_vidInFormat, 1, 14, 14}, /* VMI interface enable */ {V3REG_vidSerialParallelPort, 1, 0, 0} }; /* VMI host interface enable */ -static struct conf_struct Overlay_Filter_Off[] = { +static struct conf_struct Overlay_Filter_Off[] = { {V3REG_vidProcCfg, 0, 17, 16} }; /* overlay filter OFF */ -static struct conf_struct Overlay_Filter_On[] = { +static struct conf_struct Overlay_Filter_On[] = { {V3REG_vidProcCfg, 3, 17, 16} }; /* overlay filter ON */ static struct conf_struct Disable_VMI_Interrupt[] = { @@ -465,7 +465,7 @@ inline static void voodoo3_regor(unsigned int reg, unsigned int data, unsigned i if (!voodoo || !voodoo->io_base) return; - + reg_ptr = (unsigned int *) voodoo->io_base + reg; *reg_ptr = (*reg_ptr & ~mask) | (data & mask); } @@ -619,7 +619,7 @@ void inline *rvmalloc(signed long size) adr = (unsigned long)mem; while (size > 0) { page = kvirt_to_pa(adr); - mem_map_reserve(virt_to_page(__va(page))); + mem_map_reserve(virt_to_page(__va(page))); adr += PAGE_SIZE; size -= PAGE_SIZE; } @@ -636,7 +636,7 @@ void inline rvfree(void *mem, signed long size) adr = (unsigned long)mem; while (size > 0) { page = kvirt_to_pa(adr); - mem_map_unreserve(virt_to_page(__va(page))); + mem_map_unreserve(virt_to_page(__va(page))); adr += PAGE_SIZE; size -= PAGE_SIZE; } @@ -744,7 +744,7 @@ int v3tv_get_adapter(struct i2c_adapter *adapter) default: return 0; } -#endif +#endif if (debug) printk(KERN_INFO "v3tv: i2c_attach_client found adapter: %s\n", adapter->name); @@ -1364,7 +1364,7 @@ static int fbuffer_alloc() /* * This maps the vmalloced and reserved fbuffer to user space. * - * FIXME: + * FIXME: * - PAGE_READONLY should suffice!? * - remap_page_range is kind of inefficient for page by page remapping. * But e.g. pte_alloc() does not work in modules ... :-( @@ -1495,7 +1495,7 @@ static int get_control(struct voodoo_data *voodoo, struct v4l2_control *c) { struct video_audio va; int i; - + for (i = 0; i < V3TV_CTLS; i++) if (v3tv_ctls[i].id == c->id) break; @@ -1623,7 +1623,7 @@ static int v3tv_radio_do_ioctl(struct inode *inode, struct file *file, case VIDIOC_ENUMINPUT: { struct v4l2_input *i = arg; - + printk("v3tv: VIDIOC_ENUMINPUT %d.\n",i->index); if( i->index != 0 ) { return -EINVAL; @@ -1693,8 +1693,8 @@ static int v3tv_radio_do_ioctl(struct inode *inode, struct file *file, printk("v3tv: VIDIOC_QUERYCAP\n"); - strcpy(cap->driver,"v3tv radio"); - strcpy(cap->card,"Voodoo3 TV 3500"); + strcpy(cap->driver,"v3tv radio"); + strcpy(cap->card,"Voodoo3 TV 3500"); strcpy(cap->bus_info,"AGP Slot 0"); cap->version = KERNEL_VERSION(0,1,0); cap->capabilities = @@ -1801,7 +1801,7 @@ static int v3tv_radio_do_ioctl(struct inode *inode, struct file *file, return -EINVAL; if (unlikely(f->type != V4L2_TUNER_RADIO)) return -EINVAL; -#if 0 +#if 0 if (f->frequency < 45 * 16000) { // if (f->frequency < 696000) { printk ("v3tv: Radio program does not support the VIDEO_TUNER_LOW flag\n"); @@ -1953,7 +1953,7 @@ static int v3tv_radio_do_ioctl(struct inode *inode, struct file *file, printk ("v3tv: FIXME: VIDIOSAUDIO: Audio=%d\n", va.audio); - // FIXME. This should really be checked. + // FIXME. This should really be checked. // If only user programs respected it :-( return -EINVAL; } @@ -2028,9 +2028,9 @@ static int v3tv_radio_open(struct inode *inode, struct file *file) i2c_clients_command(voodoo->voodoo_i2c_adapter, TUNER_SET_TYPE_ADDR, &tun_setup); - } + } - i2c_clients_command(voodoo->voodoo_i2c_adapter, + i2c_clients_command(voodoo->voodoo_i2c_adapter, AUDC_SET_RADIO, &voodoo->tuner_type); // up(&voodoo->lock); @@ -2158,19 +2158,19 @@ static irqreturn_t v3tv_video_irq(int irq, void *dev_id, struct pt_regs *regs) voodoo->initialized &= ~I_irq; voodoo->decoder_enabled = 0; - i2c_clients_command(voodoo->voodoo_i2c_adapter, + i2c_clients_command(voodoo->voodoo_i2c_adapter, DECODER_ENABLE_OUTPUT, &voodoo->decoder_enabled); - struct video_audio va; + struct video_audio va; - i2c_clients_command(voodoo->voodoo_i2c_adapter, VIDIOCGAUDIO, &va); + i2c_clients_command(voodoo->voodoo_i2c_adapter, VIDIOCGAUDIO, &va); - va.volume = 0; - va.balance = 32768; - i2c_clients_command(voodoo->voodoo_i2c_adapter, VIDIOCSAUDIO, &va); + va.volume = 0; + va.balance = 32768; + i2c_clients_command(voodoo->voodoo_i2c_adapter, VIDIOCSAUDIO, &va); */ -/* Optionaly disable Video In. */ +/* Optionaly disable Video In. */ // v3tv_conf(VMI_Disable, CONF_SIZE(VMI_Disable)); break; } @@ -2225,7 +2225,7 @@ static int v3tv_video_open(struct inode *inode, struct file *file) if (debug) printk(KERN_DEBUG "v3tv: open minor=%d\n",minor); - if (voodoo->vbi_dev && + if (voodoo->vbi_dev && voodoo->vbi_dev->minor == minor) type = V4L2_BUF_TYPE_VBI_CAPTURE; if (voodoo->video_dev && @@ -2279,12 +2279,12 @@ static int v3tv_video_open(struct inode *inode, struct file *file) i2c_clients_command(voodoo->voodoo_i2c_adapter, TUNER_SET_TYPE_ADDR, &tun_setup); - } + } // struct video_audio va; // i2c_clients_command(voodoo->voodoo_i2c_adapter, VIDIOCGAUDIO, &va); - + // va.flags = VIDEO_AUDIO_MUTE; // va.volume = 65535; // va.balance = 32768; /* FIXME. This shouldn't be necessary */ @@ -2311,7 +2311,7 @@ static int v3tv_video_release(struct inode *inode, struct file *file) struct voodoo_data *voodoo_tv = file->private_data; if (voodoo_tv->initialized & I_irq) { - free_irq(voodoo_tv->dev->irq, voodoo_tv->dev); + free_irq(voodoo_tv->dev->irq, voodoo_tv->dev); voodoo_tv->initialized &= ~I_irq; } @@ -2337,7 +2337,7 @@ static int v3tv_video_release(struct inode *inode, struct file *file) return 0; } -/* No poll now +/* No poll now static int v4l_voodoo_poll (struct video_device*dev, structfile *file, struct poll_table *wait) @@ -2422,14 +2422,14 @@ static long v3tv_voodoo_read(struct video_device *dev, char *buf,unsigned long c current->state = TASK_RUNNING; return -ERESTARTSYS; } - schedule(); + schedule(); current->state = TASK_INTERRUPTIBLE; } remove_wait_queue(&capture_wait, &wait); current->state = TASK_RUNNING; - capture_ready = 0; + capture_ready = 0; ptr = (u8 *)buf; len=capture_w * 3 * capture_h; @@ -2585,7 +2585,7 @@ static int v3tv_video_do_ioctl(struct inode *inode, struct file *file, i2c_clients_command(voodoo_tv->voodoo_i2c_adapter, VIDIOCSCHAN, &vchan); - sarg = (voodoo_tv->channel) ? AUDIO_EXTERN_2 : + sarg = (voodoo_tv->channel) ? AUDIO_EXTERN_2 : AUDIO_TUNER; i2c_clients_command(voodoo_tv->voodoo_i2c_adapter, AUDC_SET_INPUT, &sarg); @@ -2615,7 +2615,7 @@ static int v3tv_video_do_ioctl(struct inode *inode, struct file *file, "contrast: 0x%04x colour: 0x%04x " "w: 0x%04x\n", voodoo_tv->picture_settings.brightness, - voodoo_tv->picture_settings.hue, + voodoo_tv->picture_settings.hue, voodoo_tv->picture_settings.contrast, voodoo_tv->picture_settings.colour, voodoo_tv->picture_settings.whiteness); @@ -2651,7 +2651,7 @@ static int v3tv_video_do_ioctl(struct inode *inode, struct file *file, /* Set picture parameters here */ if ((pic->palette != VIDEO_PALETTE_RGB565) && (pic->palette != VIDEO_PALETTE_RGB24) && - (pic->palette != VIDEO_PALETTE_RGB32)) + (pic->palette != VIDEO_PALETTE_RGB32)) v3tv_set_palette(pic); #else if (pic->palette != voodoo_tv->picture_settings.palette) { @@ -2840,7 +2840,7 @@ static int v3tv_video_do_ioctl(struct inode *inode, struct file *file, return 0; } case VIDIOCSTUNER: - { + { struct video_tuner *tuner_info = arg; if (tuner_info->tuner) /* Only tuner 0 */ @@ -2853,7 +2853,7 @@ static int v3tv_video_do_ioctl(struct inode *inode, struct file *file, DECODER_SET_NORM, &voodoo_tv->norm); return 0; - } + } case VIDIOCGFREQ: { @@ -3068,7 +3068,7 @@ static void v3tv_unregister_video(struct voodoo_data *voodoo) if (voodoo->video_dev) { if (-1 != voodoo->video_dev->minor) { printk("v3tv: unregistering device video%d (%d)\n", - voodoo->video_dev->minor & 0x1f, + voodoo->video_dev->minor & 0x1f, voodoo->video_dev->minor); video_unregister_device(voodoo->video_dev); } @@ -3078,7 +3078,7 @@ static void v3tv_unregister_video(struct voodoo_data *voodoo) if (voodoo->vbi_dev) { if (-1 != voodoo->vbi_dev->minor) { printk("v3tv: unregistering device vbi%d (%d)\n", - voodoo->vbi_dev->minor & 0x1f, + voodoo->vbi_dev->minor & 0x1f, voodoo->vbi_dev->minor); video_unregister_device(voodoo->vbi_dev); } @@ -3088,7 +3088,7 @@ static void v3tv_unregister_video(struct voodoo_data *voodoo) if (voodoo->radio_dev) { if (-1 != voodoo->radio_dev->minor) { printk("v3tv: unregistering device radio%d (%d)\n", - voodoo->radio_dev->minor & 0x1f, + voodoo->radio_dev->minor & 0x1f, voodoo->radio_dev->minor); video_unregister_device(voodoo->radio_dev); } @@ -3108,7 +3108,7 @@ static int __devinit v3tv_register_video(struct voodoo_data *voodoo) /* vbi */ voodoo->vbi_dev = &v3tv_vdev_vbi; - if (video_register_device(voodoo->vbi_dev,VFL_TYPE_VBI,vbi_nr)<0) + if (video_register_device(voodoo->vbi_dev,VFL_TYPE_VBI,vbi_nr)<0) goto err; printk(KERN_INFO "v3tv: registered device vbi%d (%d)\n", voodoo->vbi_dev->minor & 0x1f, voodoo->vbi_dev->minor); @@ -3135,7 +3135,7 @@ int v3tv_video_init(struct voodoo_data *voodoo) switch (voodoo->model) { case VOODOO3_MODEL_NTSC: printk(KERN_INFO "v3tv: NTSC model.\n"); - snprintf(voodoo->name, sizeof(voodoo->name), + snprintf(voodoo->name, sizeof(voodoo->name), "Voodoo3 TV 3500 %s", "NTSC"); voodoo->norm = VIDEO_MODE_NTSC; voodoo->tuner_type = TUNER_PHILIPS_NTSC; /* 2 */ @@ -3178,7 +3178,7 @@ int v3tv_video_init(struct voodoo_data *voodoo) i2c_clients_command(voodoo->voodoo_i2c_adapter, TUNER_SET_TYPE_ADDR, &tun_setup); - } + } voodoo->picture_settings.brightness = 0x8000; voodoo->picture_settings.hue = 0x8000; diff --git a/v4l_experimental/v3tv/vpx3224.c b/v4l_experimental/v3tv/vpx3224.c index 5e4a10694..fb5f05b79 100644 --- a/v4l_experimental/v3tv/vpx3224.c +++ b/v4l_experimental/v3tv/vpx3224.c @@ -1,4 +1,4 @@ -/* +/* * vpx3224d & vpx3225d video decoder driver version 0.0.1 * @@ -407,26 +407,26 @@ static const u16 init_ntsc[] = { static const u16 init_pal[] = { RFP_vbegin1, 0, /* Window 1 vertical begin */ // RFP_vbegin1, 23, /* Window 1 vertical begin */ - RFP_vlinesin1, 288 + 16, /* Vertical lines in (16 lines + RFP_vlinesin1, 288 + 16, /* Vertical lines in (16 lines * skipped by the VFE) */ RFP_vlinesout1, 288 + 16, /* Vertical lines out (16 lines * skipped by the VFE) */ RFP_hbeg1, 16, /* Horizontal begin */ RFP_hlen1, 768, /* Horizontal length */ - RFP_npix1, 784, /* Number of pixels + RFP_npix1, 784, /* Number of pixels * Must be >= Horizontal begin + Horizontal length */ RFP_sdt, 0, /* PAL B,G,H,I, */ }; static const u16 init_secam[] = { RFP_vbegin1, 23 - 16, /* Window 1 vertical begin */ - RFP_vlinesin1, 288 + 16, /* Vertical lines in (16 lines + RFP_vlinesin1, 288 + 16, /* Vertical lines in (16 lines * skipped by the VFE) */ - RFP_vlinesout1, 288 + 16, /* Vertical lines out (16 lines + RFP_vlinesout1, 288 + 16, /* Vertical lines out (16 lines * skipped by the VFE) */ RFP_hbeg1, 16, /* Horizontal begin */ RFP_hlen1, 768, /* Horizontal length */ - RFP_npix1, 784, /* Number of pixels + RFP_npix1, 784, /* Number of pixels * Must be >= Horizontal begin + Horizontal length */ RFP_sdt, 2, /* SECAM, */ }; @@ -447,7 +447,7 @@ static const u16 init_fp[] = { /* 16 reg-value pairs */ static const unsigned char init_common[] = { R_llc, 0, /* active mode, outputs enabled */ - R_driver_a, 0x24, /* Port A, PIXCLK, HF# & FE# + R_driver_a, 0x24, /* Port A, PIXCLK, HF# & FE# * stra1 = 100; stra2 = 100 */ R_driver_b, 0x20, /* Port B, HREF, VREF, PREF & * strb2 = 100 */ @@ -672,7 +672,7 @@ static int vpx3224_get_status(struct i2c_client *client) static int vpx3224_auto_norm(struct i2c_client *client) { /* * Auto is not supported by the vpx3224/5d. - * Scan the valid modes, read RFP_asr for score, pick the highest score. + * Scan the valid modes, read RFP_asr for score, pick the highest score. * With an NTSC M signal, there is no clear winner... */ DEB(printk (KERN_INFO "%s: Auto video mode detection not supported.\n", @@ -735,7 +735,7 @@ static int vpx3224_set_norm(struct i2c_client *client, int norm) break; /* case VIDEO_MODE_AUTO: norm = vpx3224_auto_norm(client); - break; + break; */ default: return -EINVAL; @@ -886,7 +886,7 @@ static int vpx3224_init_client(struct i2c_client *client) return res; /* * We cycle through the supported modes - * and read RFP_asr to see which is valid. + * and read RFP_asr to see which is valid. * restore this line to see output when module loads */ /* vpx3224_auto_norm(client); */ res = vpx3224_set_norm(client, VIDEO_MODE_NTSC); @@ -1209,8 +1209,8 @@ static int vpx3224_detect_client(struct i2c_adapter *adapter, int address, /* i2c_attach_client adds client to client->adapter->clients[] returns: - -EBUSY - -ENOMEM enlarge I2C_CLIENT_MAX */ + -EBUSY + -ENOMEM enlarge I2C_CLIENT_MAX */ res = i2c_attach_client(client); DEB2(printk(KERN_INFO "%s: i2c_attach_client returned %d\n", client->name, res)); diff --git a/v4l_experimental/xc3028/convert.c b/v4l_experimental/xc3028/convert.c index ca765f269..9d3be0c29 100644 --- a/v4l_experimental/xc3028/convert.c +++ b/v4l_experimental/xc3028/convert.c @@ -12,7 +12,7 @@ struct{ int length2; } xc_firmware[]={{"Terratec","\x2a\x03\xe5\xe0\x00\x07\xf4\xd0\x01\xc0\x70\xe0\x00\x07","\x2a\x00\xbc\xe0\x00\x07\xb0\xf1\x05\x01\x67\x82\x02\x82",2480,3890}, {"Terratec 2006-02-08","\x2a\x03\x9a\xe0\x00\x07\xf4\xd0\x01\xc0\x70\xe0\x00\x07","\x2a\x00\xcf\xe0\x00\x07\xb0\xf1\x05\x01\x78\x82\x02\x82",2632,3852}, - {"Hauppauge","\x2a\x03\xcc\xe0\x00\x07\xf4\xd0\x01\xc0\x70\xe0\x00\x07","\x2a\x00\xbe\xe0\x00\x07\xb9\xf1\x05\x01\x69\x82\x02\x82",2532,3886}}; + {"Hauppauge","\x2a\x03\xcc\xe0\x00\x07\xf4\xd0\x01\xc0\x70\xe0\x00\x07","\x2a\x00\xbe\xe0\x00\x07\xb9\xf1\x05\x01\x69\x82\x02\x82",2532,3886}}; int main(int argc, char **argv){ FILE *file; diff --git a/v4l_experimental/xc3028/xc3028.c b/v4l_experimental/xc3028/xc3028.c index d2936638e..5db6107eb 100644 --- a/v4l_experimental/xc3028/xc3028.c +++ b/v4l_experimental/xc3028/xc3028.c @@ -51,7 +51,7 @@ int xc3028_probe(struct i2c_client *c) static void xc3028_set_tv_freq(struct i2c_client *c, unsigned int freq){ // the frequency is just shifted and there's a 1:1 relation for all frequencies // E11 is Das Erste in Germany/Ulm all other channels match their frequency too - + unsigned char chanbuf[4]; freq<<=2; chanbuf[0]=0; @@ -84,7 +84,7 @@ int xc3028_init(struct i2c_client *c) // request firmware from /lib/firmware, note that the file got extracted by the convert application I wrote and which is available // on linuxtv.org / xc3028 - + ret = request_firmware(&fw, XC3028_DEFAULT_FIRMWARE, &t->i2c.dev); if (ret) { printk("xc3028: no firmware uploaded please check %s\n",XC3028_DEFAULT_FIRMWARE); @@ -94,7 +94,7 @@ int xc3028_init(struct i2c_client *c) firmware_size = fw->size; // small firmware check, both firmwares I have are between 6 and 7k bytes - + if(fw->size>7000||fw->size<6000){ printk("xc3028: wrong firmware provided!\n"); release_firmware(fw); @@ -111,7 +111,7 @@ int xc3028_init(struct i2c_client *c) } linebuffer[d++]=0x2a; - dev=c->adapter->algo_data; + dev=c->adapter->algo_data; // 0x08 is a GPIO address of the em28xx has to get replaced with something generic here @@ -122,23 +122,23 @@ int xc3028_init(struct i2c_client *c) // the firmware always starts with 0x2a + 0x40 bytes payload I use to add the offset of the first part // as the first line into the firmware binary - + while(i!=fw->size){ linebuffer[d++]=firmware[i]; if((d%64==0&&d!=0)||i==fwoff+txtlen){ i2c_master_send(c,linebuffer,d); if(i==(fwoff+txtlen)){ - i2c_master_send(c,"\x02\x02",2); - i2c_master_send(c,"\x02\x03",2); - i2c_master_send(c,"\x00\x8c",2); - i2c_master_send(c,"\x00\x00\x00\x00",4); + i2c_master_send(c,"\x02\x02",2); + i2c_master_send(c,"\x02\x03",2); + i2c_master_send(c,"\x00\x8c",2); + i2c_master_send(c,"\x00\x00\x00\x00",4); // another reset here dev->em28xx_write_regs(dev, 0x08, "\x6d", 1); mdelay(100); dev->em28xx_write_regs(dev, 0x08, "\x7d", 1); mdelay(100); - - } + + } linebuffer[0]=0x2a; d=1; } @@ -149,30 +149,30 @@ int xc3028_init(struct i2c_client *c) firmware[firmware_size-1]=0; release_firmware(fw); - + /* MAGIC VALUES */ - i2c_master_send(c,"\x13\x39",2); - i2c_master_send(c,"\x0c\x80\xf0\xf7\x3e\x75\xc1\x8a\xe4\x02\x00",11); - i2c_master_send(c,"\x05\x0f\xee\xaa\x5f\xea\x90",7); - i2c_master_send(c,"\x06\x00\x0a\x4d\x8c\xf2\xd8\xcf\x30\x79\x9f",11); - i2c_master_send(c,"\x0b\x0d\xa4\x6c",4); - i2c_master_send(c,"\x0a\x01\x67\x24\x40\x08\xc3\x20\x10\x64\x3c\xfa\xf7\xe1\x0c\x2c",0x10); - i2c_master_send(c,"\x09\x0b",0x2); - i2c_master_send(c,"\x10\x13",0x2); - i2c_master_send(c,"\x16\x12",0x2); - i2c_master_send(c,"\x1f\x02",0x2); - i2c_master_send(c,"\x21\x02",0x2); - i2c_master_send(c,"\x01\x02",0x2); - i2c_master_send(c,"\x2b\x10",0x2); - i2c_master_send(c,"\x02\x02",0x2); - i2c_master_send(c,"\x02\x03",0x2); - i2c_master_send(c,"\x00\x8c",0x2); + i2c_master_send(c,"\x13\x39",2); + i2c_master_send(c,"\x0c\x80\xf0\xf7\x3e\x75\xc1\x8a\xe4\x02\x00",11); + i2c_master_send(c,"\x05\x0f\xee\xaa\x5f\xea\x90",7); + i2c_master_send(c,"\x06\x00\x0a\x4d\x8c\xf2\xd8\xcf\x30\x79\x9f",11); + i2c_master_send(c,"\x0b\x0d\xa4\x6c",4); + i2c_master_send(c,"\x0a\x01\x67\x24\x40\x08\xc3\x20\x10\x64\x3c\xfa\xf7\xe1\x0c\x2c",0x10); + i2c_master_send(c,"\x09\x0b",0x2); + i2c_master_send(c,"\x10\x13",0x2); + i2c_master_send(c,"\x16\x12",0x2); + i2c_master_send(c,"\x1f\x02",0x2); + i2c_master_send(c,"\x21\x02",0x2); + i2c_master_send(c,"\x01\x02",0x2); + i2c_master_send(c,"\x2b\x10",0x2); + i2c_master_send(c,"\x02\x02",0x2); + i2c_master_send(c,"\x02\x03",0x2); + i2c_master_send(c,"\x00\x8c",0x2); #if 0 // if set video will mostly be black/white - if set_color is called instead the video will have color - i2c_master_send(c,"\x80\x01\x00\x00",0x4); - i2c_master_send(c,"\x00\x5e\x00\x29",0x4); - i2c_master_send(c,"\x2b\x1a",0x2); + i2c_master_send(c,"\x80\x01\x00\x00",0x4); + i2c_master_send(c,"\x00\x5e\x00\x29",0x4); + i2c_master_send(c,"\x2b\x1a",0x2); #endif xceive_set_color(c); t->set_tv_freq = xc3028_set_tv_freq; |