aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2009-03-03 12:36:55 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-04-06 20:44:00 -0400
commit95b14fb23b543e0a9213b4ba3cc4fc640d9e453f (patch)
tree262291eaf367022b9d2f12cb35a3e424cf8460af
parent149783b58170da0b7ebe9e86995f8cb350f33b6d (diff)
V4L/DVB (10953): cx25840: Fix CodingStyle errors introduced by the last patch
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/video/cx25840/cx25840-audio.c42
-rw-r--r--drivers/media/video/cx25840/cx25840-core.c80
-rw-r--r--drivers/media/video/cx25840/cx25840-firmware.c14
3 files changed, 63 insertions, 73 deletions
diff --git a/drivers/media/video/cx25840/cx25840-audio.c b/drivers/media/video/cx25840/cx25840-audio.c
index d2faeaa79759..2f846f5e0f9f 100644
--- a/drivers/media/video/cx25840/cx25840-audio.c
+++ b/drivers/media/video/cx25840/cx25840-audio.c
@@ -45,12 +45,11 @@ static int set_audclk_freq(struct i2c_client *client, u32 freq)
45 } 45 }
46 46
47 if (!state->is_cx231xx) { 47 if (!state->is_cx231xx) {
48 /* VID_PLL and AUX_PLL */
49 cx25840_write4(client, 0x108, 0x1006040f);
48 50
49 /* VID_PLL and AUX_PLL */ 51 /* AUX_PLL_FRAC */
50 cx25840_write4(client, 0x108, 0x1006040f); 52 cx25840_write4(client, 0x110, 0x01bb39ee);
51
52 /* AUX_PLL_FRAC */
53 cx25840_write4(client, 0x110, 0x01bb39ee);
54 } 53 }
55 54
56 if (state->is_cx25836) 55 if (state->is_cx25836)
@@ -70,7 +69,6 @@ static int set_audclk_freq(struct i2c_client *client, u32 freq)
70 } 69 }
71 70
72 if (!state->is_cx231xx) { 71 if (!state->is_cx231xx) {
73
74 /* VID_PLL and AUX_PLL */ 72 /* VID_PLL and AUX_PLL */
75 cx25840_write4(client, 0x108, 0x1009040f); 73 cx25840_write4(client, 0x108, 0x1009040f);
76 74
@@ -95,12 +93,11 @@ static int set_audclk_freq(struct i2c_client *client, u32 freq)
95 } 93 }
96 94
97 if (!state->is_cx231xx) { 95 if (!state->is_cx231xx) {
96 /* VID_PLL and AUX_PLL */
97 cx25840_write4(client, 0x108, 0x100a040f);
98 98
99 /* VID_PLL and AUX_PLL */ 99 /* AUX_PLL_FRAC */
100 cx25840_write4(client, 0x108, 0x100a040f); 100 cx25840_write4(client, 0x110, 0x0098d6e5);
101
102 /* AUX_PLL_FRAC */
103 cx25840_write4(client, 0x110, 0x0098d6e5);
104 } 101 }
105 102
106 if (state->is_cx25836) 103 if (state->is_cx25836)
@@ -122,12 +119,11 @@ static int set_audclk_freq(struct i2c_client *client, u32 freq)
122 } 119 }
123 120
124 if (!state->is_cx231xx) { 121 if (!state->is_cx231xx) {
122 /* VID_PLL and AUX_PLL */
123 cx25840_write4(client, 0x108, 0x1e08040f);
125 124
126 /* VID_PLL and AUX_PLL */ 125 /* AUX_PLL_FRAC */
127 cx25840_write4(client, 0x108, 0x1e08040f); 126 cx25840_write4(client, 0x110, 0x012a0869);
128
129 /* AUX_PLL_FRAC */
130 cx25840_write4(client, 0x110, 0x012a0869);
131 } 127 }
132 128
133 if (state->is_cx25836) 129 if (state->is_cx25836)
@@ -154,12 +150,11 @@ static int set_audclk_freq(struct i2c_client *client, u32 freq)
154 150
155 151
156 if (!state->is_cx231xx) { 152 if (!state->is_cx231xx) {
153 /* VID_PLL and AUX_PLL */
154 cx25840_write4(client, 0x108, 0x1809040f);
157 155
158 /* VID_PLL and AUX_PLL */ 156 /* AUX_PLL_FRAC */
159 cx25840_write4(client, 0x108, 0x1809040f); 157 cx25840_write4(client, 0x110, 0x00ec6bd6);
160
161 /* AUX_PLL_FRAC */
162 cx25840_write4(client, 0x110, 0x00ec6bd6);
163 } 158 }
164 159
165 if (state->is_cx25836) 160 if (state->is_cx25836)
@@ -247,10 +242,9 @@ void cx25840_audio_set_path(struct i2c_client *client)
247 /* deassert soft reset */ 242 /* deassert soft reset */
248 cx25840_and_or(client, 0x810, ~0x1, 0x00); 243 cx25840_and_or(client, 0x810, ~0x1, 0x00);
249 244
250 if (state->is_cx23885 || state->is_cx231xx) { 245 /* Ensure the controller is running when we exit */
251 /* Ensure the controller is running when we exit */ 246 if (state->is_cx23885 || state->is_cx231xx)
252 cx25840_and_or(client, 0x803, ~0x10, 0x10); 247 cx25840_and_or(client, 0x803, ~0x10, 0x10);
253 }
254} 248}
255 249
256static int get_volume(struct i2c_client *client) 250static int get_volume(struct i2c_client *client)
diff --git a/drivers/media/video/cx25840/cx25840-core.c b/drivers/media/video/cx25840/cx25840-core.c
index 9108f74c0f71..a6d9bdbe7a9d 100644
--- a/drivers/media/video/cx25840/cx25840-core.c
+++ b/drivers/media/video/cx25840/cx25840-core.c
@@ -374,15 +374,12 @@ static void cx231xx_initialize(struct i2c_client *client)
374 /* DIF Src phase inc */ 374 /* DIF Src phase inc */
375 cx25840_write4(client, 0x340, 0x0df7df83); 375 cx25840_write4(client, 0x340, 0x0df7df83);
376 376
377
378 /* Luma */ 377 /* Luma */
379 cx25840_write4(client, 0x414, 0x00107d12); 378 cx25840_write4(client, 0x414, 0x00107d12);
380 379
381 /* Chroma */ 380 /* Chroma */
382 cx25840_write4(client, 0x420, 0x3d008282); 381 cx25840_write4(client, 0x420, 0x3d008282);
383 382
384
385
386 /* ADC2 input select */ 383 /* ADC2 input select */
387 cx25840_write(client, 0x102, 0x10); 384 cx25840_write(client, 0x102, 0x10);
388 385
@@ -395,7 +392,6 @@ static void cx231xx_initialize(struct i2c_client *client)
395 /* White crush, Chroma AGC & Chroma Killer enabled */ 392 /* White crush, Chroma AGC & Chroma Killer enabled */
396 cx25840_write(client, 0x401, 0xe8); 393 cx25840_write(client, 0x401, 0xe8);
397 394
398
399 /* Do the firmware load in a work handler to prevent. 395 /* Do the firmware load in a work handler to prevent.
400 Otherwise the kernel is blocked waiting for the 396 Otherwise the kernel is blocked waiting for the
401 bit-banging i2c interface to finish uploading the 397 bit-banging i2c interface to finish uploading the
@@ -489,42 +485,42 @@ void cx25840_std_setup(struct i2c_client *client)
489 } 485 }
490 486
491 /* DEBUG: Displays configured PLL frequency */ 487 /* DEBUG: Displays configured PLL frequency */
492 if (!state->is_cx231xx) { 488 if (!state->is_cx231xx) {
493 pll_int = cx25840_read(client, 0x108); 489 pll_int = cx25840_read(client, 0x108);
494 pll_frac = cx25840_read4(client, 0x10c) & 0x1ffffff; 490 pll_frac = cx25840_read4(client, 0x10c) & 0x1ffffff;
495 pll_post = cx25840_read(client, 0x109); 491 pll_post = cx25840_read(client, 0x109);
496 v4l_dbg(1, cx25840_debug, client,
497 "PLL regs = int: %u, frac: %u, post: %u\n",
498 pll_int, pll_frac, pll_post);
499
500 if (pll_post) {
501 int fin, fsc;
502 int pll = (28636363L * ((((u64)pll_int) << 25L) + pll_frac)) >> 25L;
503
504 pll /= pll_post;
505 v4l_dbg(1, cx25840_debug, client, "PLL = %d.%06d MHz\n",
506 pll / 1000000, pll % 1000000);
507 v4l_dbg(1, cx25840_debug, client, "PLL/8 = %d.%06d MHz\n",
508 pll / 8000000, (pll / 8) % 1000000);
509
510 fin = ((u64)src_decimation * pll) >> 12;
511 v4l_dbg(1, cx25840_debug, client,
512 "ADC Sampling freq = %d.%06d MHz\n",
513 fin / 1000000, fin % 1000000);
514
515 fsc = (((u64)sc) * pll) >> 24L;
516 v4l_dbg(1, cx25840_debug, client, 492 v4l_dbg(1, cx25840_debug, client,
517 "Chroma sub-carrier freq = %d.%06d MHz\n", 493 "PLL regs = int: %u, frac: %u, post: %u\n",
518 fsc / 1000000, fsc % 1000000); 494 pll_int, pll_frac, pll_post);
519 495
520 v4l_dbg(1, cx25840_debug, client, "hblank %i, hactive %i, " 496 if (pll_post) {
521 "vblank %i, vactive %i, vblank656 %i, src_dec %i, " 497 int fin, fsc;
522 "burst 0x%02x, luma_lpf %i, uv_lpf %i, comb 0x%02x, " 498 int pll = (28636363L * ((((u64)pll_int) << 25L) + pll_frac)) >> 25L;
523 "sc 0x%06x\n", 499
524 hblank, hactive, vblank, vactive, vblank656, 500 pll /= pll_post;
525 src_decimation, burst, luma_lpf, uv_lpf, comb, sc); 501 v4l_dbg(1, cx25840_debug, client, "PLL = %d.%06d MHz\n",
502 pll / 1000000, pll % 1000000);
503 v4l_dbg(1, cx25840_debug, client, "PLL/8 = %d.%06d MHz\n",
504 pll / 8000000, (pll / 8) % 1000000);
505
506 fin = ((u64)src_decimation * pll) >> 12;
507 v4l_dbg(1, cx25840_debug, client,
508 "ADC Sampling freq = %d.%06d MHz\n",
509 fin / 1000000, fin % 1000000);
510
511 fsc = (((u64)sc) * pll) >> 24L;
512 v4l_dbg(1, cx25840_debug, client,
513 "Chroma sub-carrier freq = %d.%06d MHz\n",
514 fsc / 1000000, fsc % 1000000);
515
516 v4l_dbg(1, cx25840_debug, client, "hblank %i, hactive %i, "
517 "vblank %i, vactive %i, vblank656 %i, src_dec %i, "
518 "burst 0x%02x, luma_lpf %i, uv_lpf %i, comb 0x%02x, "
519 "sc 0x%06x\n",
520 hblank, hactive, vblank, vactive, vblank656,
521 src_decimation, burst, luma_lpf, uv_lpf, comb, sc);
522 }
526 } 523 }
527 }
528 524
529 /* Sets horizontal blanking delay and active lines */ 525 /* Sets horizontal blanking delay and active lines */
530 cx25840_write(client, 0x470, hblank); 526 cx25840_write(client, 0x470, hblank);
@@ -809,7 +805,7 @@ static int set_v4lstd(struct i2c_client *client)
809 805
810static int cx25840_s_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl) 806static int cx25840_s_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl)
811{ 807{
812 struct cx25840_state *state = to_state(sd); 808 struct cx25840_state *state = to_state(sd);
813 struct i2c_client *client = v4l2_get_subdevdata(sd); 809 struct i2c_client *client = v4l2_get_subdevdata(sd);
814 810
815 switch (ctrl->id) { 811 switch (ctrl->id) {
@@ -876,7 +872,7 @@ static int cx25840_s_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl)
876 872
877static int cx25840_g_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl) 873static int cx25840_g_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl)
878{ 874{
879 struct cx25840_state *state = to_state(sd); 875 struct cx25840_state *state = to_state(sd);
880 struct i2c_client *client = v4l2_get_subdevdata(sd); 876 struct i2c_client *client = v4l2_get_subdevdata(sd);
881 877
882 switch (ctrl->id) { 878 switch (ctrl->id) {
@@ -1208,7 +1204,7 @@ static int cx25840_init(struct v4l2_subdev *sd, u32 val)
1208 cx25836_initialize(client); 1204 cx25836_initialize(client);
1209 else if (state->is_cx23885) 1205 else if (state->is_cx23885)
1210 cx23885_initialize(client); 1206 cx23885_initialize(client);
1211 else if (state->is_cx231xx) 1207 else if (state->is_cx231xx)
1212 cx231xx_initialize(client); 1208 cx231xx_initialize(client);
1213 else 1209 else
1214 cx25840_initialize(client); 1210 cx25840_initialize(client);
@@ -1567,7 +1563,7 @@ static int cx25840_probe(struct i2c_client *client,
1567 state->c = client; 1563 state->c = client;
1568 state->is_cx25836 = ((device_id & 0xff00) == 0x8300); 1564 state->is_cx25836 = ((device_id & 0xff00) == 0x8300);
1569 state->is_cx23885 = (device_id == 0x0000) || (device_id == 0x1313); 1565 state->is_cx23885 = (device_id == 0x0000) || (device_id == 0x1313);
1570 state->is_cx231xx = (device_id == 0x5A3E); 1566 state->is_cx231xx = (device_id == 0x5a3e);
1571 state->vid_input = CX25840_COMPOSITE7; 1567 state->vid_input = CX25840_COMPOSITE7;
1572 state->aud_input = CX25840_AUDIO8; 1568 state->aud_input = CX25840_AUDIO8;
1573 state->audclk_freq = 48000; 1569 state->audclk_freq = 48000;
diff --git a/drivers/media/video/cx25840/cx25840-firmware.c b/drivers/media/video/cx25840/cx25840-firmware.c
index 1a5f7d0ead41..0df53b0d75d9 100644
--- a/drivers/media/video/cx25840/cx25840-firmware.c
+++ b/drivers/media/video/cx25840/cx25840-firmware.c
@@ -97,17 +97,17 @@ int cx25840_loadfw(struct i2c_client *client)
97 u8 buffer[FWSEND]; 97 u8 buffer[FWSEND];
98 const u8 *ptr; 98 const u8 *ptr;
99 int size, retval; 99 int size, retval;
100 int MAX_BUF_SIZE = FWSEND; 100 int MAX_BUF_SIZE = FWSEND;
101 101
102 if (state->is_cx23885) 102 if (state->is_cx23885)
103 firmware = FWFILE_CX23885; 103 firmware = FWFILE_CX23885;
104 else if ( state->is_cx231xx) 104 else if (state->is_cx231xx)
105 firmware = FWFILE_CX231XX; 105 firmware = FWFILE_CX231XX;
106 106
107 if( (state->is_cx231xx) && MAX_BUF_SIZE > 16) { 107 if ((state->is_cx231xx) && MAX_BUF_SIZE > 16) {
108 printk(" Firmware download size changed to 16 bytes max length\n"); 108 v4l_err(client, " Firmware download size changed to 16 bytes max length\n");
109 MAX_BUF_SIZE = 16; /* cx231xx cannot accept more than 16 bytes at a time */ 109 MAX_BUF_SIZE = 16; /* cx231xx cannot accept more than 16 bytes at a time */
110 } 110 }
111 111
112 if (request_firmware(&fw, firmware, FWDEV(client)) != 0) { 112 if (request_firmware(&fw, firmware, FWDEV(client)) != 0) {
113 v4l_err(client, "unable to open firmware %s\n", firmware); 113 v4l_err(client, "unable to open firmware %s\n", firmware);