summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/saa6752hs.c
diff options
context:
space:
mode:
authorGerd Knorr <devnull@localhost>2004-10-13 10:38:59 +0000
committerGerd Knorr <devnull@localhost>2004-10-13 10:38:59 +0000
commitedd4507a9edff255a67ce707442560a4ec4b3b14 (patch)
treed7c709acacb87b01d70340692df17aebcfbe2913 /linux/drivers/media/video/saa6752hs.c
parentc391a6857f19bd7eb8b9a40dc238242c34332f7a (diff)
downloadmediapointer-dvb-s2-edd4507a9edff255a67ce707442560a4ec4b3b14.tar.gz
mediapointer-dvb-s2-edd4507a9edff255a67ce707442560a4ec4b3b14.tar.bz2
- kill trailing whitespaces.
Diffstat (limited to 'linux/drivers/media/video/saa6752hs.c')
-rw-r--r--linux/drivers/media/video/saa6752hs.c94
1 files changed, 47 insertions, 47 deletions
diff --git a/linux/drivers/media/video/saa6752hs.c b/linux/drivers/media/video/saa6752hs.c
index bfe47f293..915d418bd 100644
--- a/linux/drivers/media/video/saa6752hs.c
+++ b/linux/drivers/media/video/saa6752hs.c
@@ -43,7 +43,7 @@ enum saa6752hs_command {
SAA6752HS_COMMAND_RECONFIGURE = 4,
SAA6752HS_COMMAND_SLEEP = 5,
SAA6752HS_COMMAND_RECONFIGURE_FORCE = 6,
-
+
SAA6752HS_COMMAND_MAX
};
@@ -53,24 +53,24 @@ enum saa6752hs_command {
static u8 PAT[] = {
0xc2, // i2c register
0x00, // table number for encoder
-
+
0x47, // sync
0x40, 0x00, // transport_error_indicator(0), payload_unit_start(1), transport_priority(0), pid(0)
0x10, // transport_scrambling_control(00), adaptation_field_control(01), continuity_counter(0)
-
+
0x00, // PSI pointer to start of table
-
+
0x00, // tid(0)
0xb0, 0x0d, // section_syntax_indicator(1), section_length(13)
-
+
0x00, 0x01, // transport_stream_id(1)
-
+
0xc1, // version_number(0), current_next_indicator(1)
-
+
0x00, 0x00, // section_number(0), last_section_number(0)
0x00, 0x01, // program_number(1)
-
+
0xe0, 0x10, // PMT PID(0x10)
0x76, 0xf1, 0x44, 0xd1 // CRC32
@@ -79,29 +79,29 @@ static u8 PAT[] = {
static u8 PMT[] = {
0xc2, // i2c register
0x01, // table number for encoder
-
+
0x47, // sync
0x40, 0x10, // transport_error_indicator(0), payload_unit_start(1), transport_priority(0), pid(0x10)
0x10, // transport_scrambling_control(00), adaptation_field_control(01), continuity_counter(0)
-
+
0x00, // PSI pointer to start of table
-
+
0x02, // tid(2)
0xb0, 0x17, // section_syntax_indicator(1), section_length(23)
0x00, 0x01, // program_number(1)
-
+
0xc1, // version_number(0), current_next_indicator(1)
-
+
0x00, 0x00, // section_number(0), last_section_number(0)
-
+
0xe1, 0x04, // PCR_PID (0x104)
-
+
0xf0, 0x00, // program_info_length(0)
-
+
0x02, 0xe1, 0x00, 0xf0, 0x00, // video stream type(2), pid(0x100)
0x04, 0xe1, 0x03, 0xf0, 0x00, // audio stream type(4), pid(0x103)
-
+
0xa1, 0xca, 0x0f, 0x82 // CRC32
};
@@ -113,7 +113,7 @@ static struct mpeg_params mpeg_params_template =
.total_bitrate = 6000,
};
-
+
/* ---------------------------------------------------------------------- */
@@ -129,11 +129,11 @@ static int saa6752hs_chip_command(struct i2c_client* client,
case SAA6752HS_COMMAND_RESET:
buf[0] = 0x00;
break;
-
+
case SAA6752HS_COMMAND_STOP:
buf[0] = 0x03;
break;
-
+
case SAA6752HS_COMMAND_START:
buf[0] = 0x02;
break;
@@ -141,11 +141,11 @@ static int saa6752hs_chip_command(struct i2c_client* client,
case SAA6752HS_COMMAND_PAUSE:
buf[0] = 0x04;
break;
-
+
case SAA6752HS_COMMAND_RECONFIGURE:
buf[0] = 0x05;
break;
-
+
case SAA6752HS_COMMAND_SLEEP:
buf[0] = 0x06;
break;
@@ -153,11 +153,11 @@ static int saa6752hs_chip_command(struct i2c_client* client,
case SAA6752HS_COMMAND_RECONFIGURE_FORCE:
buf[0] = 0x07;
break;
-
+
default:
- return -EINVAL;
+ return -EINVAL;
}
-
+
// set it and wait for it to be so
i2c_master_send(client, buf, 1);
timeout = jiffies + HZ * 3;
@@ -173,14 +173,14 @@ static int saa6752hs_chip_command(struct i2c_client* client,
status = -ETIMEDOUT;
break;
}
-
+
// wait a bit
msleep(10);
}
// delay a bit to let encoder settle
msleep(50);
-
+
// done
return status;
}
@@ -190,12 +190,12 @@ static int saa6752hs_set_bitrate(struct i2c_client* client,
struct mpeg_params* params)
{
u8 buf[3];
-
+
// set the bitrate mode
buf[0] = 0x71;
buf[1] = params->bitrate_mode;
i2c_master_send(client, buf, 2);
-
+
// set the video bitrate
if (params->bitrate_mode == MPEG_BITRATE_MODE_VBR) {
// set the target bitrate
@@ -216,24 +216,24 @@ static int saa6752hs_set_bitrate(struct i2c_client* client,
buf[2] = params->video_target_bitrate & 0xff;
i2c_master_send(client, buf, 3);
}
-
+
// set the audio bitrate
buf[0] = 0x94;
buf[1] = params->audio_bitrate;
i2c_master_send(client, buf, 2);
-
+
// set the total bitrate
buf[0] = 0xb1;
buf[1] = params->total_bitrate >> 8;
buf[2] = params->total_bitrate & 0xff;
i2c_master_send(client, buf, 3);
-
+
return 0;
}
static int saa6752hs_init(struct i2c_client* client, struct mpeg_params* params)
-{
+{
unsigned char buf[3];
void *data;
@@ -251,41 +251,41 @@ static int saa6752hs_init(struct i2c_client* client, struct mpeg_params* params)
return -EINVAL;
if (params->bitrate_mode == MPEG_BITRATE_MODE_MAX &&
params->video_target_bitrate <= params->video_max_bitrate)
- return -EINVAL;
+ return -EINVAL;
}
-
+
// Set GOP structure {3, 13}
buf[0] = 0x72;
buf[1] = 0x03;
buf[2] = 0x0D;
i2c_master_send(client,buf,3);
-
+
// Set minimum Q-scale {4}
buf[0] = 0x82;
buf[1] = 0x04;
i2c_master_send(client,buf,2);
-
+
// Set maximum Q-scale {12}
buf[0] = 0x83;
buf[1] = 0x0C;
i2c_master_send(client,buf,2);
-
+
// Set Output Protocol
buf[0] = 0xD0;
buf[1] = 0x01;
i2c_master_send(client,buf,2);
-
+
// Set video output stream format {TS}
buf[0] = 0xB0;
buf[1] = 0x05;
i2c_master_send(client,buf,2);
-
+
// Set Audio PID {0x103}
buf[0] = 0xC1;
buf[1] = 0x01;
buf[2] = 0x03;
i2c_master_send(client,buf,3);
-
+
// setup bitrate settings
data = i2c_get_clientdata(client);
if (params) {
@@ -295,18 +295,18 @@ static int saa6752hs_init(struct i2c_client* client, struct mpeg_params* params)
// parameters were not supplied. use the previous set
saa6752hs_set_bitrate(client, (struct mpeg_params*) data);
}
-
+
// Send SI tables
i2c_master_send(client,PAT,sizeof(PAT));
i2c_master_send(client,PMT,sizeof(PMT));
-
+
// mute then unmute audio. This removes buzzing artefacts
buf[0] = 0xa4;
buf[1] = 1;
i2c_master_send(client, buf, 2);
buf[1] = 0;
i2c_master_send(client, buf, 2);
-
+
// start it going
saa6752hs_chip_command(client, SAA6752HS_COMMAND_START);
@@ -332,14 +332,14 @@ static int saa6752hs_attach(struct i2c_adapter *adap, int addr,
return -ENOMEM;
memcpy(client,&client_template,sizeof(struct i2c_client));
strlcpy(client->name, "saa6752hs", sizeof(client->name));
-
+
if (NULL == (params = kmalloc(sizeof(struct mpeg_params), GFP_KERNEL)))
return -ENOMEM;
memcpy(params,&mpeg_params_template,sizeof(struct mpeg_params));
i2c_set_clientdata(client, params);
i2c_attach_client(client);
-
+
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
MOD_INC_USE_COUNT;
#endif
@@ -388,7 +388,7 @@ saa6752hs_command(struct i2c_client *client, unsigned int cmd, void *arg)
/* nothing */
break;
}
-
+
return 0;
}