summaryrefslogtreecommitdiff
path: root/linux/drivers/media
diff options
context:
space:
mode:
authorMichael Hunold <devnull@localhost>2004-05-04 13:05:19 +0000
committerMichael Hunold <devnull@localhost>2004-05-04 13:05:19 +0000
commit9fb7fe73192cbe0f8f6d39b42e68c4b36a483408 (patch)
tree2e5b8596bcdbdbed5d23bddff57fdf245c4840b9 /linux/drivers/media
parent2a77e20acbf8325244b37b7ba29b6440c078d21b (diff)
downloadmediapointer-dvb-s2-9fb7fe73192cbe0f8f6d39b42e68c4b36a483408.tar.gz
mediapointer-dvb-s2-9fb7fe73192cbe0f8f6d39b42e68c4b36a483408.tar.bz2
- code cleanup, no functional changes
Diffstat (limited to 'linux/drivers/media')
-rw-r--r--linux/drivers/media/dvb/frontends/tda1004x.c59
1 files changed, 28 insertions, 31 deletions
diff --git a/linux/drivers/media/dvb/frontends/tda1004x.c b/linux/drivers/media/dvb/frontends/tda1004x.c
index e02981cd6..209c9fbc0 100644
--- a/linux/drivers/media/dvb/frontends/tda1004x.c
+++ b/linux/drivers/media/dvb/frontends/tda1004x.c
@@ -34,16 +34,8 @@
*/
-#include <linux/kernel.h>
-#include <linux/vmalloc.h>
-#include <linux/module.h>
#include <linux/init.h>
-#include <linux/string.h>
-#include <linux/slab.h>
-#include <linux/fs.h>
-#include <linux/unistd.h>
-#include <linux/fcntl.h>
-#include <linux/errno.h>
+#include <linux/module.h>
#include <linux/firmware.h>
/* fixme: add this to i2c-id.h */
@@ -168,27 +160,40 @@ static struct dvb_frontend_info tda10046h_info = {
FE_CAN_TRANSMISSION_MODE_AUTO | FE_CAN_GUARD_INTERVAL_AUTO
};
-
struct tda1004x_state {
u8 tda1004x_address;
u8 tuner_address;
- u8 initialised:1;
- u8 tuner_type:2;
- u8 fe_type:2;
+ u8 initialised;
+ u8 tuner_type;
+ u8 fe_type;
struct i2c_adapter *i2c;
struct dvb_adapter *dvb;
};
-
struct fwinfo {
int file_size;
int fw_offset;
int fw_size;
};
-static struct fwinfo tda10045h_fwinfo[] = { {.file_size = 286720,.fw_offset = 0x34cc5,.fw_size = 30555} };
+
+static struct fwinfo tda10045h_fwinfo[] = {
+ {
+ .file_size = 286720,
+ .fw_offset = 0x34cc5,
+ .fw_size = 30555
+ },
+};
+
static int tda10045h_fwinfo_count = sizeof(tda10045h_fwinfo) / sizeof(struct fwinfo);
-static struct fwinfo tda10046h_fwinfo[] = { {.file_size = 286720,.fw_offset = 0x3c4f9,.fw_size = 24479} };
+static struct fwinfo tda10046h_fwinfo[] = {
+ {
+ .file_size = 286720,
+ .fw_offset = 0x3c4f9,
+ .fw_size = 24479
+ }
+};
+
static int tda10046h_fwinfo_count = sizeof(tda10046h_fwinfo) / sizeof(struct fwinfo);
static int tda1004x_write_byte(struct i2c_adapter *i2c, struct tda1004x_state *tda_state, int reg, int data)
@@ -289,7 +294,6 @@ static int tda1004x_disable_tuner_i2c(struct i2c_adapter *i2c, struct tda1004x_s
return tda1004x_write_mask(i2c, tda_state, TDA1004X_CONFC4, 2, 0);
}
-
static int tda10045h_set_bandwidth(struct i2c_adapter *i2c,
struct tda1004x_state *tda_state,
fe_bandwidth_t bandwidth)
@@ -323,7 +327,6 @@ static int tda10045h_set_bandwidth(struct i2c_adapter *i2c,
return 0;
}
-
static int tda10046h_set_bandwidth(struct i2c_adapter *i2c,
struct tda1004x_state *tda_state,
fe_bandwidth_t bandwidth)
@@ -535,8 +538,6 @@ static int tda10045h_init(struct i2c_adapter *i2c, struct tda1004x_state *tda_st
return 0;
}
-
-
static int tda10046h_init(struct i2c_adapter *i2c, struct tda1004x_state *tda_state)
{
struct i2c_msg tuner_msg = {.addr = 0,.flags = 0,.buf = 0,.len = 0 };
@@ -586,8 +587,6 @@ static int tda10046h_init(struct i2c_adapter *i2c, struct tda1004x_state *tda_st
return 0;
}
-
-
static int tda1004x_encode_fec(int fec)
{
// convert known FEC values
@@ -967,7 +966,6 @@ static int tda1004x_set_fe(struct i2c_adapter *i2c,
return 0;
}
-
static int tda1004x_get_fe(struct i2c_adapter *i2c, struct tda1004x_state* tda_state, struct dvb_frontend_parameters *fe_params)
{
dprintk("%s\n", __FUNCTION__);
@@ -1074,7 +1072,6 @@ static int tda1004x_get_fe(struct i2c_adapter *i2c, struct tda1004x_state* tda_s
return 0;
}
-
static int tda1004x_read_status(struct i2c_adapter *i2c, struct tda1004x_state* tda_state, fe_status_t * fe_status)
{
int status;
@@ -1165,7 +1162,6 @@ static int tda1004x_read_signal_strength(struct i2c_adapter *i2c, struct tda1004
return 0;
}
-
static int tda1004x_read_snr(struct i2c_adapter *i2c, struct tda1004x_state* tda_state, u16 * snr)
{
int tmp;
@@ -1255,7 +1251,6 @@ static int tda1004x_sleep(struct i2c_adapter *i2c, struct tda1004x_state* tda_st
return 0;
}
-
static int tda1004x_ioctl(struct dvb_frontend *fe, unsigned int cmd, void *arg)
{
struct tda1004x_state *tda_state = (struct tda1004x_state *) fe->data;
@@ -1444,6 +1439,8 @@ static int attach_adapter(struct i2c_adapter *adapter)
const struct firmware *fw;
int ret;
+ dprintk ("%s\n", __FUNCTION__);
+
if (NULL == (client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL))) {
return -ENOMEM;
}
@@ -1513,10 +1510,12 @@ out:
return ret;
}
-
static int detach_client(struct i2c_client *client)
{
struct tda1004x_state *state = (struct tda1004x_state*)i2c_get_clientdata(client);
+
+ dprintk ("%s\n", __FUNCTION__);
+
dvb_unregister_frontend_new (tda1004x_ioctl, state->dvb);
i2c_detach_client(client);
BUG_ON(state->dvb);
@@ -1532,14 +1531,12 @@ static int command (struct i2c_client *client, unsigned int cmd, void *arg)
dprintk ("%s\n", __FUNCTION__);
switch (cmd) {
- case FE_REGISTER: {
+ case FE_REGISTER
state->dvb = (struct dvb_adapter*)arg;
break;
- }
- case FE_UNREGISTER: {
+ case FE_UNREGISTER:
state->dvb = NULL;
break;
- }
default:
return -EOPNOTSUPP;
}