summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb/ttusb-dec/dec2000_frontend.c
diff options
context:
space:
mode:
authorAlex Woods <devnull@localhost>2003-07-12 00:00:05 +0000
committerAlex Woods <devnull@localhost>2003-07-12 00:00:05 +0000
commit0cc7d35a040aef25bc708d37b4ac67922cda8592 (patch)
treebfb6043510390e7951858a6eeef8e4506eb1bf0b /linux/drivers/media/dvb/ttusb-dec/dec2000_frontend.c
parent2d9644e7d5b953b53a7eed78af6fea55cfb4cff6 (diff)
downloadmediapointer-dvb-s2-0cc7d35a040aef25bc708d37b4ac67922cda8592.tar.gz
mediapointer-dvb-s2-0cc7d35a040aef25bc708d37b4ac67922cda8592.tar.bz2
Beautify code (hopefully - it's in the eye of the beholder after all)
Stop oops on redetection of dec after firmware upload
Diffstat (limited to 'linux/drivers/media/dvb/ttusb-dec/dec2000_frontend.c')
-rw-r--r--linux/drivers/media/dvb/ttusb-dec/dec2000_frontend.c60
1 files changed, 21 insertions, 39 deletions
diff --git a/linux/drivers/media/dvb/ttusb-dec/dec2000_frontend.c b/linux/drivers/media/dvb/ttusb-dec/dec2000_frontend.c
index fd07e7b4c..d8ef46d67 100644
--- a/linux/drivers/media/dvb/ttusb-dec/dec2000_frontend.c
+++ b/linux/drivers/media/dvb/ttusb-dec/dec2000_frontend.c
@@ -30,7 +30,6 @@ static int debug = 0;
#define dprintk if (debug) printk
static struct dvb_frontend_info dec2000_frontend_info = {
-
name: "TechnoTrend/Hauppauge DEC-2000-t Frontend",
type: FE_OFDM,
frequency_min: 51000000,
@@ -41,13 +40,11 @@ static struct dvb_frontend_info dec2000_frontend_info = {
FE_CAN_QAM_16 | FE_CAN_QAM_64 | FE_CAN_QAM_AUTO |
FE_CAN_TRANSMISSION_MODE_AUTO | FE_CAN_GUARD_INTERVAL_AUTO |
FE_CAN_HIERARCHY_AUTO,
-
};
-static int
-dec2000_frontend_ioctl(struct dvb_frontend *fe, unsigned int cmd, void *arg)
+static int dec2000_frontend_ioctl(struct dvb_frontend *fe, unsigned int cmd,
+ void *arg)
{
-
dprintk("%s\n", __FUNCTION__);
switch (cmd) {
@@ -58,51 +55,49 @@ dec2000_frontend_ioctl(struct dvb_frontend *fe, unsigned int cmd, void *arg)
sizeof (struct dvb_frontend_info));
break;
- case FE_READ_STATUS:{
- fe_status_t *status = (fe_status_t *) arg;
+ case FE_READ_STATUS: {
+ fe_status_t *status = (fe_status_t *)arg;
dprintk("%s: FE_READ_STATUS\n", __FUNCTION__);
- *status =
- FE_HAS_SIGNAL | FE_HAS_VITERBI | FE_HAS_SYNC |
- FE_HAS_CARRIER | FE_HAS_LOCK;
+ *status = FE_HAS_SIGNAL | FE_HAS_VITERBI |
+ FE_HAS_SYNC | FE_HAS_CARRIER | FE_HAS_LOCK;
break;
}
- case FE_READ_BER:{
- u32 *ber = (u32 *) arg;
+ case FE_READ_BER: {
+ u32 *ber = (u32 *)arg;
dprintk("%s: FE_READ_BER\n", __FUNCTION__);
*ber = 0;
return -ENOSYS;
break;
}
- case FE_READ_SIGNAL_STRENGTH:{
+ case FE_READ_SIGNAL_STRENGTH: {
dprintk("%s: FE_READ_SIGNAL_STRENGTH\n", __FUNCTION__);
- *(s32 *) arg = 0xFF;
+ *(s32 *)arg = 0xFF;
return -ENOSYS;
break;
}
case FE_READ_SNR:
dprintk("%s: FE_READ_SNR\n", __FUNCTION__);
- *(s32 *) arg = 0;
+ *(s32 *)arg = 0;
return -ENOSYS;
break;
case FE_READ_UNCORRECTED_BLOCKS:
dprintk("%s: FE_READ_UNCORRECTED_BLOCKS\n", __FUNCTION__);
- *(u32 *) arg = 0;
+ *(u32 *)arg = 0;
return -ENOSYS;
break;
case FE_SET_FRONTEND:{
struct dvb_frontend_parameters *p =
- (struct dvb_frontend_parameters *) arg;
- u8 b[] =
- { 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xff,
- 0x00, 0x00, 0x00, 0xff };
+ (struct dvb_frontend_parameters *)arg;
+ u8 b[] = { 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
+ 0x00, 0xff, 0x00, 0x00, 0x00, 0xff };
u32 freq;
- struct i2c_msg msg = { addr: 0x71, flags: 0, len:20 };
+ struct i2c_msg msg = { addr: 0x71, flags: 0, len:20 };
dprintk("%s: FE_SET_FRONTEND\n", __FUNCTION__);
@@ -143,47 +138,34 @@ dec2000_frontend_ioctl(struct dvb_frontend *fe, unsigned int cmd, void *arg)
}
return 0;
-
}
-static int
-dec2000_frontend_attach(struct dvb_i2c_bus *i2c)
+static int dec2000_frontend_attach(struct dvb_i2c_bus *i2c)
{
-
dprintk("%s\n", __FUNCTION__);
dvb_register_frontend(dec2000_frontend_ioctl, i2c, NULL,
&dec2000_frontend_info);
return 0;
-
}
-static void
-dec2000_frontend_detach(struct dvb_i2c_bus *i2c)
+static void dec2000_frontend_detach(struct dvb_i2c_bus *i2c)
{
-
dprintk("%s\n", __FUNCTION__);
dvb_unregister_frontend(dec2000_frontend_ioctl, i2c);
-
}
-static int __init
-dec2000_frontend_init(void)
+static int __init dec2000_frontend_init(void)
{
-
return dvb_register_i2c_device(THIS_MODULE, dec2000_frontend_attach,
dec2000_frontend_detach);
-
}
-static void __exit
-dec2000_frontend_exit(void)
+static void __exit dec2000_frontend_exit(void)
{
-
dvb_unregister_i2c_device(dec2000_frontend_attach);
-
}
module_init(dec2000_frontend_init);