summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb/ttpci
diff options
context:
space:
mode:
authorJohannes Stezenbach <devnull@localhost>2004-11-21 18:15:22 +0000
committerJohannes Stezenbach <devnull@localhost>2004-11-21 18:15:22 +0000
commit0903d7779f169bfd43f62d210c736360d7bb5a6c (patch)
tree2c4f4d7191f09bfe686d564ee89352d8d8ba0532 /linux/drivers/media/dvb/ttpci
parent2872ec5a377b4a0d8a1ca57d25313d865904b590 (diff)
downloadmediapointer-dvb-s2-0903d7779f169bfd43f62d210c736360d7bb5a6c.tar.gz
mediapointer-dvb-s2-0903d7779f169bfd43f62d210c736360d7bb5a6c.tar.bz2
remove superflous casts, and other misc. minor cleanups (no functional change)
Diffstat (limited to 'linux/drivers/media/dvb/ttpci')
-rw-r--r--linux/drivers/media/dvb/ttpci/av7110.c145
1 files changed, 73 insertions, 72 deletions
diff --git a/linux/drivers/media/dvb/ttpci/av7110.c b/linux/drivers/media/dvb/ttpci/av7110.c
index af1336d28..4294ea92f 100644
--- a/linux/drivers/media/dvb/ttpci/av7110.c
+++ b/linux/drivers/media/dvb/ttpci/av7110.c
@@ -108,7 +108,7 @@ static int av7110_num = 0;
static void init_av7110_av(struct av7110 *av7110)
{
- struct saa7146_dev *dev=av7110->dev;
+ struct saa7146_dev *dev = av7110->dev;
/* set internal volume control to maximum */
av7110->adac_type = DVB_ADAC_TI;
@@ -129,9 +129,9 @@ static void init_av7110_av(struct av7110 *av7110)
i2c_writereg(av7110, 0x20, 0x03, 0x00);
i2c_writereg(av7110, 0x20, 0x04, 0x00);
- /**
- * some special handling for the Siemens DVB-C cards...
- */
+ /**
+ * some special handling for the Siemens DVB-C cards...
+ */
} else if (0 == av7110_init_analog_module(av7110)) {
/* done. */
}
@@ -188,16 +188,17 @@ static int arm_thread(void *data)
dprintk(4, "%p\n",av7110);
- lock_kernel ();
- daemonize ("arm_mon");
- sigfillset (&current->blocked);
- unlock_kernel ();
+ lock_kernel();
+ daemonize("arm_mon");
+ sigfillset(&current->blocked);
+ unlock_kernel();
av7110->arm_thread = current;
- while (1) {
- timeout = wait_event_interruptible_timeout(av7110->arm_wait,0 != av7110->arm_rmmod, 5*HZ);
- if (-ERESTARTSYS == timeout || 0 != av7110->arm_rmmod) {
+ for (;;) {
+ timeout = wait_event_interruptible_timeout(av7110->arm_wait,
+ av7110->arm_rmmod, 5 * HZ);
+ if (-ERESTARTSYS == timeout || av7110->arm_rmmod) {
/* got signal or told to quit*/
break;
}
@@ -244,7 +245,7 @@ void av7110_setup_irc_config(struct av7110 *av7110, u32 ir_config)
{
static struct av7110 *last;
- dprintk(4, "%p\n",av7110);
+ dprintk(4, "%p\n", av7110);
if (!av7110)
av7110 = last;
@@ -290,11 +291,11 @@ static void IR_handle(struct av7110 *av7110, u32 ircom)
* IRQ handling
****************************************************************************/
-static inline int DvbDmxFilterCallback(u8 * buffer1, size_t buffer1_len,
- u8 * buffer2, size_t buffer2_len,
- struct dvb_demux_filter *dvbdmxfilter,
- enum dmx_success success,
- struct av7110 *av7110)
+static int DvbDmxFilterCallback(u8 *buffer1, size_t buffer1_len,
+ u8 *buffer2, size_t buffer2_len,
+ struct dvb_demux_filter *dvbdmxfilter,
+ enum dmx_success success,
+ struct av7110 *av7110)
{
if (!dvbdmxfilter->feed->demux->dmx.frontend)
return 0;
@@ -529,9 +530,9 @@ static void gpioirq (unsigned long data)
av7110->video_size.h = h_ar & 0xfff;
dprintk(8, "GPIO0 irq: DATA_MPEG_VIDEO_EVENT: w/h/ar = %u/%u/%u\n",
- av7110->video_size.w,
- av7110->video_size.h,
- av7110->video_size.aspect_ratio);
+ av7110->video_size.w,
+ av7110->video_size.h,
+ av7110->video_size.aspect_ratio);
event.type = VIDEO_EVENT_SIZE_CHANGED;
event.u.size.w = av7110->video_size.w;
@@ -604,13 +605,13 @@ static void gpioirq (unsigned long data)
len = 0;
if (av7110->debitype & 0x100) {
spin_lock(&av7110->aout.lock);
- len=av7110_pes_play(av7110->debi_virt, &av7110->aout, 2048);
+ len = av7110_pes_play(av7110->debi_virt, &av7110->aout, 2048);
spin_unlock(&av7110->aout.lock);
}
- if (len <=0 && (av7110->debitype & 0x200)
+ if (len <= 0 && (av7110->debitype & 0x200)
&&av7110->videostate.play_state != VIDEO_FREEZED) {
spin_lock(&av7110->avout.lock);
- len=av7110_pes_play(av7110->debi_virt, &av7110->avout, 2048);
+ len = av7110_pes_play(av7110->debi_virt, &av7110->avout, 2048);
spin_unlock(&av7110->avout.lock);
}
if (len <= 0) {
@@ -799,8 +800,8 @@ static int StartHWFilter(struct dvb_demux_filter *dvbdmxfilter)
u16 buf[20];
int ret, i;
u16 handle;
-// u16 mode=0x0320;
- u16 mode=0xb96a;
+// u16 mode = 0x0320;
+ u16 mode = 0xb96a;
dprintk(4, "%p\n", av7110);
@@ -945,7 +946,7 @@ static void dvb_feed_stop_pid(struct dvb_demux_feed *dvbdmxfeed)
static int av7110_start_feed(struct dvb_demux_feed *feed)
{
struct dvb_demux *demux = feed->demux;
- struct av7110 *av7110 = (struct av7110 *) demux->priv;
+ struct av7110 *av7110 = demux->priv;
dprintk(4, "%p\n", av7110);
@@ -1003,7 +1004,7 @@ static int av7110_start_feed(struct dvb_demux_feed *feed)
static int av7110_stop_feed(struct dvb_demux_feed *feed)
{
struct dvb_demux *demux = feed->demux;
- struct av7110 *av7110 = (struct av7110 *) demux->priv;
+ struct av7110 *av7110 = demux->priv;
dprintk(4, "%p\n", av7110);
@@ -1027,7 +1028,7 @@ static int av7110_stop_feed(struct dvb_demux_feed *feed)
if (feed->type == DMX_TYPE_SEC) {
int i;
- for (i=0; i<demux->filternum; i++)
+ for (i = 0; i<demux->filternum; i++)
if (demux->filter[i].state == DMX_STATE_GO &&
demux->filter[i].filter.parent == &feed->feed.sec) {
demux->filter[i].state = DMX_STATE_READY;
@@ -1128,18 +1129,20 @@ static int av7110_set_tone(struct dvb_frontend* fe, fe_sec_tone_mode_t tone)
return 0;
}
-static int av7110_diseqc_send_master_cmd(struct dvb_frontend* fe, struct dvb_diseqc_master_cmd* cmd)
+static int av7110_diseqc_send_master_cmd(struct dvb_frontend* fe,
+ struct dvb_diseqc_master_cmd* cmd)
{
- struct av7110* av7110 = (struct av7110*) fe->dvb->priv;
+ struct av7110* av7110 = fe->dvb->priv;
av7110_diseqc_send(av7110, cmd->msg_len, cmd->msg, -1);
return 0;
}
-static int av7110_diseqc_send_burst(struct dvb_frontend* fe, fe_sec_mini_cmd_t minicmd)
+static int av7110_diseqc_send_burst(struct dvb_frontend* fe,
+ fe_sec_mini_cmd_t minicmd)
{
- struct av7110* av7110 = (struct av7110*) fe->dvb->priv;
+ struct av7110* av7110 = fe->dvb->priv;
av7110_diseqc_send(av7110, 0, NULL, minicmd);
@@ -1232,7 +1235,8 @@ static void dvb_unregister(struct av7110 *av7110)
dvb_dmxdev_release(&av7110->dmxdev);
dvb_dmx_release(&av7110->demux);
- if (av7110->fe != NULL) dvb_unregister_frontend(av7110->fe);
+ if (av7110->fe != NULL)
+ dvb_unregister_frontend(av7110->fe);
dvb_unregister_device(av7110->osd_dev);
av7110_av_unregister(av7110);
av7110_ca_unregister(av7110);
@@ -1367,7 +1371,7 @@ static int get_firmware(struct av7110* av7110)
}
/* check if the firmware is available */
- av7110->bin_fw = (unsigned char*) vmalloc(fw->size);
+ av7110->bin_fw = (unsigned char *) vmalloc(fw->size);
if (NULL == av7110->bin_fw) {
dprintk(1, "out of memory\n");
release_firmware(fw);
@@ -1475,11 +1479,11 @@ static int alps_bsru6_set_symbol_rate(struct dvb_frontend* fe, u32 srate, u32 ra
else if (srate < 30000000) { aclk = 0xb6; bclk = 0x53; }
else if (srate < 45000000) { aclk = 0xb4; bclk = 0x51; }
- stv0299_writereg (fe, 0x13, aclk);
- stv0299_writereg (fe, 0x14, bclk);
- stv0299_writereg (fe, 0x1f, (ratio >> 16) & 0xff);
- stv0299_writereg (fe, 0x20, (ratio >> 8) & 0xff);
- stv0299_writereg (fe, 0x21, (ratio ) & 0xf0);
+ stv0299_writereg(fe, 0x13, aclk);
+ stv0299_writereg(fe, 0x14, bclk);
+ stv0299_writereg(fe, 0x1f, (ratio >> 16) & 0xff);
+ stv0299_writereg(fe, 0x20, (ratio >> 8) & 0xff);
+ stv0299_writereg(fe, 0x21, (ratio ) & 0xf0);
return 0;
}
@@ -1503,7 +1507,7 @@ static int alps_bsru6_pll_set(struct dvb_frontend* fe, struct dvb_frontend_param
if (params->frequency > 1530000) data[3] = 0xc0;
- ret = i2c_transfer (&av7110->i2c_adap, &msg, 1);
+ ret = i2c_transfer(&av7110->i2c_adap, &msg, 1);
if (ret != 1)
return -EIO;
return 0;
@@ -1528,7 +1532,7 @@ static struct stv0299_config alps_bsru6_config = {
static int alps_tdbe2_pll_set(struct dvb_frontend* fe, struct dvb_frontend_parameters* params)
{
- struct av7110* av7110 = (struct av7110*) fe->dvb->priv;
+ struct av7110* av7110 = fe->dvb->priv;
u32 div;
u8 data[4];
struct i2c_msg msg = { .addr = 0x62, .flags = 0, .buf = data, .len = sizeof(data) };
@@ -1540,7 +1544,7 @@ static int alps_tdbe2_pll_set(struct dvb_frontend* fe, struct dvb_frontend_param
data[2] = 0x85 | ((div >> 10) & 0x60);
data[3] = (params->frequency < 174000000 ? 0x88 : params->frequency < 470000000 ? 0x84 : 0x81);
- if (i2c_transfer (&av7110->i2c_adap, &msg, 1) != 1)
+ if (i2c_transfer(&av7110->i2c_adap, &msg, 1) != 1)
return -EIO;
return 0;
}
@@ -1556,9 +1560,10 @@ static struct ves1820_config alps_tdbe2_config = {
-static int grundig_29504_451_pll_set(struct dvb_frontend* fe, struct dvb_frontend_parameters* params)
+static int grundig_29504_451_pll_set(struct dvb_frontend* fe,
+ struct dvb_frontend_parameters* params)
{
- struct av7110* av7110 = (struct av7110*) fe->dvb->priv;
+ struct av7110* av7110 = fe->dvb->priv;
u32 div;
u8 data[4];
struct i2c_msg msg = { .addr = 0x61, .flags = 0, .buf = data, .len = sizeof(data) };
@@ -1569,7 +1574,7 @@ static int grundig_29504_451_pll_set(struct dvb_frontend* fe, struct dvb_fronten
data[2] = 0x8e;
data[3] = 0x00;
- if (i2c_transfer (&av7110->i2c_adap, &msg, 1) != 1)
+ if (i2c_transfer(&av7110->i2c_adap, &msg, 1) != 1)
return -EIO;
return 0;
}
@@ -1581,9 +1586,10 @@ static struct tda8083_config grundig_29504_451_config = {
-static int philips_cd1516_pll_set(struct dvb_frontend* fe, struct dvb_frontend_parameters* params)
+static int philips_cd1516_pll_set(struct dvb_frontend* fe,
+ struct dvb_frontend_parameters* params)
{
- struct av7110* av7110 = (struct av7110*) fe->dvb->priv;
+ struct av7110* av7110 = fe->dvb->priv;
u32 div;
u32 f = params->frequency;
u8 data[4];
@@ -1596,7 +1602,7 @@ static int philips_cd1516_pll_set(struct dvb_frontend* fe, struct dvb_frontend_p
data[2] = 0x8e;
data[3] = (f < 174000000 ? 0xa1 : f < 470000000 ? 0x92 : 0x34);
- if (i2c_transfer (&av7110->i2c_adap, &msg, 1) != 1)
+ if (i2c_transfer(&av7110->i2c_adap, &msg, 1) != 1)
return -EIO;
return 0;
}
@@ -1613,7 +1619,7 @@ static struct ves1820_config philips_cd1516_config = {
static int alps_tdlb7_pll_set(struct dvb_frontend* fe, struct dvb_frontend_parameters* params)
{
- struct av7110* av7110 = (struct av7110*) fe->dvb->priv;
+ struct av7110* av7110 = fe->dvb->priv;
u32 div, pwr;
u8 data[4];
struct i2c_msg msg = { .addr = 0x60, .flags = 0, .buf = data, .len = sizeof(data) };
@@ -1630,7 +1636,7 @@ static int alps_tdlb7_pll_set(struct dvb_frontend* fe, struct dvb_frontend_param
data[2] = 0x85;
data[3] = pwr << 6;
- if (i2c_transfer (&av7110->i2c_adap, &msg, 1) != 1)
+ if (i2c_transfer(&av7110->i2c_adap, &msg, 1) != 1)
return -EIO;
return 0;
}
@@ -1653,7 +1659,7 @@ static struct sp8870_config alps_tdlb7_config = {
static int nexusca_stv0297_pll_set(struct dvb_frontend* fe, struct dvb_frontend_parameters* params)
{
- struct av7110* av7110 = (struct av7110*) fe->dvb->priv;
+ struct av7110* av7110 = fe->dvb->priv;
u32 div;
u8 data[4];
struct i2c_msg msg = { .addr = 0x63, .flags = 0, .buf = data, .len = sizeof(data) };
@@ -1678,16 +1684,16 @@ static int nexusca_stv0297_pll_set(struct dvb_frontend* fe, struct dvb_frontend_
return -EINVAL;
stv0297_enable_plli2c(fe);
- if (i2c_transfer (&av7110->i2c_adap, &msg, 1) != 1) {
+ if (i2c_transfer(&av7110->i2c_adap, &msg, 1) != 1) {
printk("nexusca: pll transfer failed!\n");
return -EIO;
}
// wait for PLL lock
- for(i=0; i< 20; i++) {
+ for(i = 0; i < 20; i++) {
stv0297_enable_plli2c(fe);
- if (i2c_transfer (&av7110->i2c_adap, &readmsg, 1) == 1)
+ if (i2c_transfer(&av7110->i2c_adap, &readmsg, 1) == 1)
if (data[0] & 0x40) break;
msleep(10);
}
@@ -1731,7 +1737,7 @@ static void av7110_fe_lock_fix(struct av7110* av7110, fe_status_t status)
static int av7110_fe_init(struct dvb_frontend* fe)
{
- struct av7110* av7110 = (struct av7110*) fe->dvb->priv;
+ struct av7110* av7110 = fe->dvb->priv;
av7110_fe_lock_fix(av7110, 0);
return av7110->fe_init(fe);
@@ -1739,7 +1745,7 @@ static int av7110_fe_init(struct dvb_frontend* fe)
static int av7110_fe_read_status(struct dvb_frontend* fe, fe_status_t* status)
{
- struct av7110* av7110 = (struct av7110*) fe->dvb->priv;
+ struct av7110* av7110 = fe->dvb->priv;
int ret;
/* call the real implementation */
@@ -1756,15 +1762,16 @@ static int av7110_fe_read_status(struct dvb_frontend* fe, fe_status_t* status)
static int av7110_fe_diseqc_reset_overload(struct dvb_frontend* fe)
{
- struct av7110* av7110 = (struct av7110*) fe->dvb->priv;
+ struct av7110* av7110 = fe->dvb->priv;
av7110_fe_lock_fix(av7110, 0);
return av7110->fe_diseqc_reset_overload(fe);
}
-static int av7110_fe_diseqc_send_master_cmd(struct dvb_frontend* fe, struct dvb_diseqc_master_cmd* cmd)
+static int av7110_fe_diseqc_send_master_cmd(struct dvb_frontend* fe,
+ struct dvb_diseqc_master_cmd* cmd)
{
- struct av7110* av7110 = (struct av7110*) fe->dvb->priv;
+ struct av7110* av7110 = fe->dvb->priv;
av7110_fe_lock_fix(av7110, 0);
return av7110->fe_diseqc_send_master_cmd(fe, cmd);
@@ -1772,7 +1779,7 @@ static int av7110_fe_diseqc_send_master_cmd(struct dvb_frontend* fe, struct dvb_
static int av7110_fe_diseqc_send_burst(struct dvb_frontend* fe, fe_sec_mini_cmd_t minicmd)
{
- struct av7110* av7110 = (struct av7110*) fe->dvb->priv;
+ struct av7110* av7110 = fe->dvb->priv;
av7110_fe_lock_fix(av7110, 0);
return av7110->fe_diseqc_send_burst(fe, minicmd);
@@ -1780,7 +1787,7 @@ static int av7110_fe_diseqc_send_burst(struct dvb_frontend* fe, fe_sec_mini_cmd_
static int av7110_fe_set_tone(struct dvb_frontend* fe, fe_sec_tone_mode_t tone)
{
- struct av7110* av7110 = (struct av7110*) fe->dvb->priv;
+ struct av7110* av7110 = fe->dvb->priv;
av7110_fe_lock_fix(av7110, 0);
return av7110->fe_set_tone(fe, tone);
@@ -1788,7 +1795,7 @@ static int av7110_fe_set_tone(struct dvb_frontend* fe, fe_sec_tone_mode_t tone)
static int av7110_fe_set_voltage(struct dvb_frontend* fe, fe_sec_voltage_t voltage)
{
- struct av7110* av7110 = (struct av7110*) fe->dvb->priv;
+ struct av7110* av7110 = fe->dvb->priv;
av7110_fe_lock_fix(av7110, 0);
return av7110->fe_set_voltage(fe, voltage);
@@ -1796,7 +1803,7 @@ static int av7110_fe_set_voltage(struct dvb_frontend* fe, fe_sec_voltage_t volta
static int av7110_fe_dishnetwork_send_legacy_command(struct dvb_frontend* fe, unsigned int cmd)
{
- struct av7110* av7110 = (struct av7110*) fe->dvb->priv;
+ struct av7110* av7110 = fe->dvb->priv;
av7110_fe_lock_fix(av7110, 0);
return av7110->fe_dishnetwork_send_legacy_command(fe, cmd);
@@ -1820,9 +1827,8 @@ static void frontend_init(struct av7110 *av7110)
if (av7110->dev->pci->subsystem_vendor == 0x110a) {
switch(av7110->dev->pci->subsystem_device) {
case 0x0000: // Fujitsu/Siemens DVB-Cable (ves1820/Philips CD1516(??))
- av7110->fe = ves1820_attach(&philips_cd1516_config, &av7110->i2c_adap, read_pwm(av7110));
- if (av7110->fe)
- break;
+ av7110->fe = ves1820_attach(&philips_cd1516_config,
+ &av7110->i2c_adap, read_pwm(av7110));
break;
}
@@ -1864,15 +1870,11 @@ static void frontend_init(struct av7110 *av7110)
// ALPS TDLB7
av7110->fe = sp8870_attach(&alps_tdlb7_config, &av7110->i2c_adap);
- if (av7110->fe)
- break;
break;
case 0x0002: // Hauppauge/TT DVB-C premium rev2.X
av7110->fe = ves1820_attach(&alps_tdbe2_config, &av7110->i2c_adap, read_pwm(av7110));
- if (av7110->fe)
- break;
break;
case 0x000A: // Hauppauge/TT Nexus-CA rev1.X
@@ -2129,7 +2131,7 @@ static int av7110_detach (struct saa7146_dev* saa)
static void av7110_irq(struct saa7146_dev* dev, u32 *isr)
{
- struct av7110 *av7110 = (struct av7110*)dev->ext_priv;
+ struct av7110 *av7110 = dev->ext_priv;
if (*isr & MASK_19)
tasklet_schedule (&av7110->debi_tasklet);
@@ -2226,4 +2228,3 @@ MODULE_DESCRIPTION("driver for the SAA7146 based AV110 PCI DVB cards by "
"Siemens, Technotrend, Hauppauge");
MODULE_AUTHOR("Ralph Metzler, Marcus Metzler, others");
MODULE_LICENSE("GPL");
-