aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx25840/cx25840-core.c
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 /drivers/media/video/cx25840/cx25840-core.c
parent149783b58170da0b7ebe9e86995f8cb350f33b6d (diff)
V4L/DVB (10953): cx25840: Fix CodingStyle errors introduced by the last patch
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx25840/cx25840-core.c')
-rw-r--r--drivers/media/video/cx25840/cx25840-core.c80
1 files changed, 38 insertions, 42 deletions
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;