Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: zoran: fix mixed case on vars

Use this small script to replace CamelCase and wrong case
on vars:

<script>
FILES=$(find "$1" -type f|grep -e '.c$' -e '.h$')
CAMEL_VARS=$(cat tags|perl -ne 'print "$1\n" if (m/^(\w*[A-Z]\w*[a-z]\w*)\s/)')
for i in $CAMEL_VARS; do
new=$(perl -e '
my $s = $ARGV[0];
$s =~ s{([^a-zA-Z]?)([A-Z]*)([A-Z])([a-z]?)}{
my $fc = pos($s)==0;
my ($p0,$p1,$p2,$p3) = ($1,lc$2,lc$3,$4);
my $t = $p0 || $fc ? $p0 : '_';
$t .= $p3 ? $p1 ? "${p1}_$p2$p3" : "$p2$p3" : "$p1$p2";
$t;
}ge;
print $s;' "$i")
for j in $FILES; do
sed -E "s,\b$i\b,$new,g" -i $j
done
done
for i in $(git grep "#define zr" drivers/staging/media/zoran/*.[ch]|perl -ne 'print "$1\n" if (m/#define\s+(zr\S+)/)'); do j=$(echo $i|tr [a-z] [A-Z]); sed "s,\b$i\b,$j,g" -i drivers/staging/media/zoran/*.[ch]; done
</script>

This should solve almost all warnings reported by checkpatch.pl
in strict mode.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

+350 -350
+1 -1
drivers/staging/media/zoran/videocodec.h
··· 218 218 }; 219 219 220 220 struct tvnorm { 221 - u16 Wt, Wa, HStart, HSyncStart, Ht, Ha, VStart; 221 + u16 wt, wa, h_start, h_sync_start, ht, ha, v_start; 222 222 }; 223 223 224 224 struct jpeg_com_marker {
+15 -15
drivers/staging/media/zoran/zoran.h
··· 45 45 46 46 #define ZR_DEVNAME(zr) ((zr)->name) 47 47 48 - #define BUZ_MAX_WIDTH (zr->timing->Wa) 49 - #define BUZ_MAX_HEIGHT (zr->timing->Ha) 48 + #define BUZ_MAX_WIDTH (zr->timing->wa) 49 + #define BUZ_MAX_HEIGHT (zr->timing->ha) 50 50 #define BUZ_MIN_WIDTH 32 /* never display less than 32 pixels */ 51 51 #define BUZ_MIN_HEIGHT 24 /* never display less than 24 rows */ 52 52 ··· 152 152 /* jpg-capture/-playback settings */ 153 153 struct zoran_jpg_settings { 154 154 int decimation; /* this bit is used to set everything to default */ 155 - int HorDcm, VerDcm, TmpDcm; /* capture decimation settings (TmpDcm=1 means both fields) */ 156 - int field_per_buff, odd_even; /* field-settings (odd_even=1 (+TmpDcm=1) means top-field-first) */ 155 + int hor_dcm, ver_dcm, tmp_dcm; /* capture decimation settings (tmp_dcm=1 means both fields) */ 156 + int field_per_buff, odd_even; /* field-settings (odd_even=1 (+tmp_dcm=1) means top-field-first) */ 157 157 int img_x, img_y, img_width, img_height; /* crop settings (subframe capture) */ 158 158 struct v4l2_jpegcompression jpg_comp; /* JPEG-specific capture settings */ 159 159 }; ··· 266 266 unsigned int ghost_int; 267 267 int intr_counter_GIRQ1; 268 268 int intr_counter_GIRQ0; 269 - int intr_counter_CodRepIRQ; 270 - int intr_counter_JPEGRepIRQ; 269 + int intr_counter_cod_rep_irq; 270 + int intr_counter_jpeg_rep_irq; 271 271 int field_counter; 272 - int IRQ1_in; 273 - int IRQ1_out; 274 - int JPEG_in; 275 - int JPEG_out; 272 + int irq1_in; 273 + int irq1_out; 274 + int jpeg_in; 275 + int jpeg_out; 276 276 int JPEG_0; 277 277 int JPEG_1; 278 - int END_event_missed; 279 - int JPEG_missed; 280 - int JPEG_error; 278 + int end_event_missed; 279 + int jpeg_missed; 280 + int jpeg_error; 281 281 int num_errors; 282 - int JPEG_max_missed; 283 - int JPEG_min_missed; 282 + int jpeg_max_missed; 283 + int jpeg_min_missed; 284 284 unsigned int prepared; 285 285 unsigned int queued; 286 286
+26 -26
drivers/staging/media/zoran/zoran_card.c
··· 266 266 } 267 267 268 268 // struct tvnorm { 269 - // u16 Wt, Wa, HStart, HSyncStart, Ht, Ha, VStart; 269 + // u16 wt, wa, h_start, h_sync_start, ht, ha, v_start; 270 270 // }; 271 271 272 272 static const struct tvnorm f50sqpixel = { 944, 768, 83, 880, 625, 576, 16 }; ··· 277 277 static const struct tvnorm f50ccir601_lml33 = { 864, 720, 75 + 34, 804, 625, 576, 18 }; 278 278 static const struct tvnorm f60ccir601_lml33 = { 858, 720, 57 + 34, 788, 525, 480, 16 }; 279 279 280 - /* The DC10 (57/16/50) uses VActive as HSync, so HStart must be 0 */ 280 + /* The DC10 (57/16/50) uses VActive as HSync, so h_start must be 0 */ 281 281 static const struct tvnorm f50sqpixel_dc10 = { 944, 768, 0, 880, 625, 576, 0 }; 282 282 static const struct tvnorm f60sqpixel_dc10 = { 780, 640, 0, 716, 525, 480, 12 }; 283 283 ··· 662 662 int err = 0, err0 = 0; 663 663 664 664 pci_dbg(zr->pci_dev, "%s - dec: %d, Hdcm: %d, Vdcm: %d, Tdcm: %d\n", 665 - __func__, settings->decimation, settings->HorDcm, 666 - settings->VerDcm, settings->TmpDcm); 665 + __func__, settings->decimation, settings->hor_dcm, 666 + settings->ver_dcm, settings->tmp_dcm); 667 667 pci_dbg(zr->pci_dev, "%s - x: %d, y: %d, w: %d, y: %d\n", __func__, 668 668 settings->img_x, settings->img_y, 669 669 settings->img_width, settings->img_height); ··· 671 671 switch (settings->decimation) { 672 672 case 1: 673 673 674 - settings->HorDcm = 1; 675 - settings->VerDcm = 1; 676 - settings->TmpDcm = 1; 674 + settings->hor_dcm = 1; 675 + settings->ver_dcm = 1; 676 + settings->tmp_dcm = 1; 677 677 settings->field_per_buff = 2; 678 678 settings->img_x = 0; 679 679 settings->img_y = 0; ··· 682 682 break; 683 683 case 2: 684 684 685 - settings->HorDcm = 2; 686 - settings->VerDcm = 1; 687 - settings->TmpDcm = 2; 685 + settings->hor_dcm = 2; 686 + settings->ver_dcm = 1; 687 + settings->tmp_dcm = 2; 688 688 settings->field_per_buff = 1; 689 689 settings->img_x = (BUZ_MAX_WIDTH == 720) ? 8 : 0; 690 690 settings->img_y = 0; ··· 700 700 break; 701 701 } 702 702 703 - settings->HorDcm = 4; 704 - settings->VerDcm = 2; 705 - settings->TmpDcm = 2; 703 + settings->hor_dcm = 4; 704 + settings->ver_dcm = 2; 705 + settings->tmp_dcm = 2; 706 706 settings->field_per_buff = 1; 707 707 settings->img_x = (BUZ_MAX_WIDTH == 720) ? 8 : 0; 708 708 settings->img_y = 0; ··· 714 714 715 715 /* We have to check the data the user has set */ 716 716 717 - if (settings->HorDcm != 1 && settings->HorDcm != 2 && 718 - (zr->card.type == DC10_NEW || settings->HorDcm != 4)) { 719 - settings->HorDcm = clamp(settings->HorDcm, 1, 2); 717 + if (settings->hor_dcm != 1 && settings->hor_dcm != 2 && 718 + (zr->card.type == DC10_NEW || settings->hor_dcm != 4)) { 719 + settings->hor_dcm = clamp(settings->hor_dcm, 1, 2); 720 720 err0++; 721 721 } 722 - if (settings->VerDcm != 1 && settings->VerDcm != 2) { 723 - settings->VerDcm = clamp(settings->VerDcm, 1, 2); 722 + if (settings->ver_dcm != 1 && settings->ver_dcm != 2) { 723 + settings->ver_dcm = clamp(settings->ver_dcm, 1, 2); 724 724 err0++; 725 725 } 726 - if (settings->TmpDcm != 1 && settings->TmpDcm != 2) { 727 - settings->TmpDcm = clamp(settings->TmpDcm, 1, 2); 726 + if (settings->tmp_dcm != 1 && settings->tmp_dcm != 2) { 727 + settings->tmp_dcm = clamp(settings->tmp_dcm, 1, 2); 728 728 err0++; 729 729 } 730 730 if (settings->field_per_buff != 1 && ··· 756 756 settings->img_y = BUZ_MAX_HEIGHT / 2 - settings->img_height; 757 757 err0++; 758 758 } 759 - if (settings->img_width % (16 * settings->HorDcm) != 0) { 760 - settings->img_width -= settings->img_width % (16 * settings->HorDcm); 759 + if (settings->img_width % (16 * settings->hor_dcm) != 0) { 760 + settings->img_width -= settings->img_width % (16 * settings->hor_dcm); 761 761 if (settings->img_width == 0) 762 - settings->img_width = 16 * settings->HorDcm; 762 + settings->img_width = 16 * settings->hor_dcm; 763 763 err0++; 764 764 } 765 - if (settings->img_height % (8 * settings->VerDcm) != 0) { 766 - settings->img_height -= settings->img_height % (8 * settings->VerDcm); 765 + if (settings->img_height % (8 * settings->ver_dcm) != 0) { 766 + settings->img_height -= settings->img_height % (8 * settings->ver_dcm); 767 767 if (settings->img_height == 0) 768 - settings->img_height = 8 * settings->VerDcm; 768 + settings->img_height = 8 * settings->ver_dcm; 769 769 err0++; 770 770 } 771 771
+121 -121
drivers/staging/media/zoran/zoran_device.c
··· 34 34 35 35 #define IRQ_MASK (ZR36057_ISR_GIRQ0 | \ 36 36 ZR36057_ISR_GIRQ1 | \ 37 - ZR36057_ISR_JPEGRepIRQ) 37 + ZR36057_ISR_JPEG_REP_IRQ) 38 38 39 39 static bool lml33dpath; /* default = 0 40 40 * 1 will use digital path in capture ··· 59 59 u32 reg; 60 60 61 61 reg = btread(ZR36057_VFESPFR); 62 - reg |= ZR36057_VFESPFR_LittleEndian; 63 - reg &= ~ZR36057_VFESPFR_VCLKPol; 64 - reg |= ZR36057_VFESPFR_ExtFl; 65 - reg |= ZR36057_VFESPFR_TopField; 62 + reg |= ZR36057_VFESPFR_LITTLE_ENDIAN; 63 + reg &= ~ZR36057_VFESPFR_VCLK_POL; 64 + reg |= ZR36057_VFESPFR_EXT_FL; 65 + reg |= ZR36057_VFESPFR_TOP_FIELD; 66 66 btwrite(reg, ZR36057_VFESPFR); 67 67 reg = btread(ZR36057_VDCR); 68 68 if (pci_pci_problems & PCIPCI_TRITON) 69 69 // || zr->revision < 1) // Revision 1 has also Triton support 70 - reg &= ~ZR36057_VDCR_Triton; 70 + reg &= ~ZR36057_VDCR_TRITON; 71 71 else 72 - reg |= ZR36057_VDCR_Triton; 72 + reg |= ZR36057_VDCR_TRITON; 73 73 btwrite(reg, ZR36057_VDCR); 74 74 } 75 75 ··· 108 108 { 109 109 u32 por; 110 110 111 - // while (((por = btread(ZR36057_POR)) & (ZR36057_POR_POPen | ZR36057_POR_POTime)) == ZR36057_POR_POPen) { 112 - while ((por = btread(ZR36057_POR)) & ZR36057_POR_POPen) { 111 + // while (((por = btread(ZR36057_POR)) & (ZR36057_POR_PO_PEN | ZR36057_POR_PO_TIME)) == ZR36057_POR_PO_PEN) { 112 + while ((por = btread(ZR36057_POR)) & ZR36057_POR_PO_PEN) { 113 113 /* wait for something to happen */ 114 114 /* TODO add timeout */ 115 115 } 116 - if ((por & ZR36057_POR_POTime) && !zr->card.gws_not_connected) { 116 + if ((por & ZR36057_POR_PO_TIME) && !zr->card.gws_not_connected) { 117 117 /* In LML33/BUZ \GWS line is not connected, so it has always timeout set */ 118 118 pci_info(zr->pci_dev, "pop timeout %08x\n", por); 119 119 return -1; ··· 128 128 u32 por; 129 129 130 130 por = 131 - ZR36057_POR_PODir | ZR36057_POR_POTime | ((guest & 7) << 20) | 131 + ZR36057_POR_PO_DIR | ZR36057_POR_PO_TIME | ((guest & 7) << 20) | 132 132 ((reg & 7) << 16) | (value & 0xFF); 133 133 btwrite(por, ZR36057_POR); 134 134 ··· 139 139 { 140 140 u32 por; 141 141 142 - por = ZR36057_POR_POTime | ((guest & 7) << 20) | ((reg & 7) << 16); 142 + por = ZR36057_POR_PO_TIME | ((guest & 7) << 20) | ((reg & 7) << 16); 143 143 btwrite(por, ZR36057_POR); 144 144 if (post_office_wait(zr) < 0) 145 145 return -1; ··· 258 258 259 259 switch (mode) { 260 260 case BUZ_MODE_MOTION_DECOMPRESS: 261 - btand(~ZR36057_VFESPFR_ExtFl, ZR36057_VFESPFR); 261 + btand(~ZR36057_VFESPFR_EXT_FL, ZR36057_VFESPFR); 262 262 reg = btread(ZR36057_VFEHCR); 263 263 if ((reg & (1 << 10)) && zr->card.type != LML33R10) 264 264 reg += ((1 << 10) | 1); ··· 271 271 if ((zr->norm & V4L2_STD_NTSC) || 272 272 (zr->card.type == LML33R10 && 273 273 (zr->norm & V4L2_STD_PAL))) 274 - btand(~ZR36057_VFESPFR_ExtFl, ZR36057_VFESPFR); 274 + btand(~ZR36057_VFESPFR_EXT_FL, ZR36057_VFESPFR); 275 275 else 276 - btor(ZR36057_VFESPFR_ExtFl, ZR36057_VFESPFR); 276 + btor(ZR36057_VFESPFR_EXT_FL, ZR36057_VFESPFR); 277 277 reg = btread(ZR36057_VFEHCR); 278 278 if (!(reg & (1 << 10)) && zr->card.type != LML33R10) 279 279 reg -= ((1 << 10) | 1); ··· 291 291 const struct zoran_format *format) 292 292 { 293 293 const struct tvnorm *tvn; 294 - unsigned int HStart, HEnd, VStart, VEnd; 294 + unsigned int h_start, HEnd, v_start, VEnd; 295 295 unsigned int DispMode; 296 296 unsigned int VidWinWid, VidWinHt; 297 297 unsigned int hcrop1, hcrop2, vcrop1, vcrop2; 298 - unsigned int Wa, We, Ha, He; 299 - unsigned int X, Y, HorDcm, VerDcm; 298 + unsigned int wa, We, ha, He; 299 + unsigned int X, Y, hor_dcm, ver_dcm; 300 300 u32 reg; 301 301 302 302 tvn = zr->timing; 303 303 304 - Wa = tvn->Wa; 305 - Ha = tvn->Ha; 304 + wa = tvn->wa; 305 + ha = tvn->ha; 306 306 307 307 pci_info(zr->pci_dev, "set_vfe() - width = %d, height = %d\n", video_width, video_height); 308 308 309 309 if (video_width < BUZ_MIN_WIDTH || 310 310 video_height < BUZ_MIN_HEIGHT || 311 - video_width > Wa || video_height > Ha) { 311 + video_width > wa || video_height > ha) { 312 312 pci_err(zr->pci_dev, "set_vfe: w=%d h=%d not valid\n", video_width, video_height); 313 313 return; 314 314 } ··· 317 317 318 318 /* horizontal */ 319 319 VidWinWid = video_width; 320 - X = DIV_ROUND_UP(VidWinWid * 64, tvn->Wa); 320 + X = DIV_ROUND_UP(VidWinWid * 64, tvn->wa); 321 321 We = (VidWinWid * 64) / X; 322 - HorDcm = 64 - X; 323 - hcrop1 = 2 * ((tvn->Wa - We) / 4); 324 - hcrop2 = tvn->Wa - We - hcrop1; 325 - HStart = tvn->HStart ? tvn->HStart : 1; 322 + hor_dcm = 64 - X; 323 + hcrop1 = 2 * ((tvn->wa - We) / 4); 324 + hcrop2 = tvn->wa - We - hcrop1; 325 + h_start = tvn->h_start ? tvn->h_start : 1; 326 326 /* (Ronald) Original comment: 327 327 * "| 1 Doesn't have any effect, tested on both a DC10 and a DC10+" 328 328 * this is false. It inverses chroma values on the LML33R10 (so Cr 329 329 * suddenly is shown as Cb and reverse, really cool effect if you 330 330 * want to see blue faces, not useful otherwise). So don't use |1. 331 - * However, the DC10 has '0' as HStart, but does need |1, so we 331 + * However, the DC10 has '0' as h_start, but does need |1, so we 332 332 * use a dirty check... 333 333 */ 334 - HEnd = HStart + tvn->Wa - 1; 335 - HStart += hcrop1; 334 + HEnd = h_start + tvn->wa - 1; 335 + h_start += hcrop1; 336 336 HEnd -= hcrop2; 337 - reg = ((HStart & ZR36057_VFEHCR_Hmask) << ZR36057_VFEHCR_HStart) 338 - | ((HEnd & ZR36057_VFEHCR_Hmask) << ZR36057_VFEHCR_HEnd); 337 + reg = ((h_start & ZR36057_VFEHCR_HMASK) << ZR36057_VFEHCR_H_START) 338 + | ((HEnd & ZR36057_VFEHCR_HMASK) << ZR36057_VFEHCR_H_END); 339 339 if (zr->card.vfe_pol.hsync_pol) 340 - reg |= ZR36057_VFEHCR_HSPol; 340 + reg |= ZR36057_VFEHCR_HS_POL; 341 341 btwrite(reg, ZR36057_VFEHCR); 342 342 343 343 /* Vertical */ 344 344 DispMode = !(video_height > BUZ_MAX_HEIGHT / 2); 345 345 VidWinHt = DispMode ? video_height : video_height / 2; 346 - Y = DIV_ROUND_UP(VidWinHt * 64 * 2, tvn->Ha); 346 + Y = DIV_ROUND_UP(VidWinHt * 64 * 2, tvn->ha); 347 347 He = (VidWinHt * 64) / Y; 348 - VerDcm = 64 - Y; 349 - vcrop1 = (tvn->Ha / 2 - He) / 2; 350 - vcrop2 = tvn->Ha / 2 - He - vcrop1; 351 - VStart = tvn->VStart; 352 - VEnd = VStart + tvn->Ha / 2; // - 1; FIXME SnapShot times out with -1 in 768*576 on the DC10 - LP 353 - VStart += vcrop1; 348 + ver_dcm = 64 - Y; 349 + vcrop1 = (tvn->ha / 2 - He) / 2; 350 + vcrop2 = tvn->ha / 2 - He - vcrop1; 351 + v_start = tvn->v_start; 352 + VEnd = v_start + tvn->ha / 2; // - 1; FIXME SnapShot times out with -1 in 768*576 on the DC10 - LP 353 + v_start += vcrop1; 354 354 VEnd -= vcrop2; 355 - reg = ((VStart & ZR36057_VFEVCR_Vmask) << ZR36057_VFEVCR_VStart) 356 - | ((VEnd & ZR36057_VFEVCR_Vmask) << ZR36057_VFEVCR_VEnd); 355 + reg = ((v_start & ZR36057_VFEVCR_VMASK) << ZR36057_VFEVCR_V_START) 356 + | ((VEnd & ZR36057_VFEVCR_VMASK) << ZR36057_VFEVCR_V_END); 357 357 if (zr->card.vfe_pol.vsync_pol) 358 - reg |= ZR36057_VFEVCR_VSPol; 358 + reg |= ZR36057_VFEVCR_VS_POL; 359 359 btwrite(reg, ZR36057_VFEVCR); 360 360 361 361 /* scaler and pixel format */ 362 362 reg = 0; 363 - reg |= (HorDcm << ZR36057_VFESPFR_HorDcm); 364 - reg |= (VerDcm << ZR36057_VFESPFR_VerDcm); 365 - reg |= (DispMode << ZR36057_VFESPFR_DispMode); 363 + reg |= (hor_dcm << ZR36057_VFESPFR_HOR_DCM); 364 + reg |= (ver_dcm << ZR36057_VFESPFR_VER_DCM); 365 + reg |= (DispMode << ZR36057_VFESPFR_DISP_MODE); 366 366 /* RJ: I don't know, why the following has to be the opposite 367 367 * of the corresponding ZR36060 setting, but only this way 368 368 * we get the correct colors when uncompressing to the screen */ 369 - //reg |= ZR36057_VFESPFR_VCLKPol; /**/ 369 + //reg |= ZR36057_VFESPFR_VCLK_POL; /**/ 370 370 /* RJ: Don't know if that is needed for NTSC also */ 371 371 if (!(zr->norm & V4L2_STD_NTSC)) 372 - reg |= ZR36057_VFESPFR_ExtFl; // NEEDED!!!!!!! Wolfgang 373 - reg |= ZR36057_VFESPFR_TopField; 374 - if (HorDcm >= 48) 375 - reg |= 3 << ZR36057_VFESPFR_HFilter; /* 5 tap filter */ 376 - else if (HorDcm >= 32) 377 - reg |= 2 << ZR36057_VFESPFR_HFilter; /* 4 tap filter */ 378 - else if (HorDcm >= 16) 379 - reg |= 1 << ZR36057_VFESPFR_HFilter; /* 3 tap filter */ 372 + reg |= ZR36057_VFESPFR_EXT_FL; // NEEDED!!!!!!! Wolfgang 373 + reg |= ZR36057_VFESPFR_TOP_FIELD; 374 + if (hor_dcm >= 48) 375 + reg |= 3 << ZR36057_VFESPFR_H_FILTER; /* 5 tap filter */ 376 + else if (hor_dcm >= 32) 377 + reg |= 2 << ZR36057_VFESPFR_H_FILTER; /* 4 tap filter */ 378 + else if (hor_dcm >= 16) 379 + reg |= 1 << ZR36057_VFESPFR_H_FILTER; /* 3 tap filter */ 380 380 381 381 reg |= format->vfespfr; 382 382 btwrite(reg, ZR36057_VFESPFR); 383 383 384 384 /* display configuration */ 385 - reg = (16 << ZR36057_VDCR_MinPix) 386 - | (VidWinHt << ZR36057_VDCR_VidWinHt) 387 - | (VidWinWid << ZR36057_VDCR_VidWinWid); 385 + reg = (16 << ZR36057_VDCR_MIN_PIX) 386 + | (VidWinHt << ZR36057_VDCR_VID_WIN_HT) 387 + | (VidWinWid << ZR36057_VDCR_VID_WIN_WID); 388 388 if (pci_pci_problems & PCIPCI_TRITON) 389 389 // || zr->revision < 1) // Revision 1 has also Triton support 390 - reg &= ~ZR36057_VDCR_Triton; 390 + reg &= ~ZR36057_VDCR_TRITON; 391 391 else 392 - reg |= ZR36057_VDCR_Triton; 392 + reg |= ZR36057_VDCR_TRITON; 393 393 btwrite(reg, ZR36057_VDCR); 394 394 395 395 zr36057_adjust_vfe(zr, zr->codec_mode); ··· 406 406 * capture is pending when capturing is tuned off, FrameGrab 407 407 * will be stuck at 1 until capturing is turned back on. 408 408 */ 409 - if (btread(ZR36057_VSSFGR) & ZR36057_VSSFGR_SnapShot) 409 + if (btread(ZR36057_VSSFGR) & ZR36057_VSSFGR_SNAP_SHOT) 410 410 pci_warn(zr->pci_dev, "zr36057_set_memgrab(1) with SnapShot on!?\n"); 411 411 412 412 /* switch on VSync interrupts */ ··· 414 414 btor(zr->card.vsync_int, ZR36057_ICR); // SW 415 415 416 416 /* enable SnapShot */ 417 - btor(ZR36057_VSSFGR_SnapShot, ZR36057_VSSFGR); 417 + btor(ZR36057_VSSFGR_SNAP_SHOT, ZR36057_VSSFGR); 418 418 419 419 /* Set zr36057 video front end and enable video */ 420 420 zr36057_set_vfe(zr, zr->v4l_settings.width, ··· 425 425 btand(~zr->card.vsync_int, ZR36057_ICR); // SW 426 426 427 427 /* re-enable grabbing to screen if it was running */ 428 - btand(~ZR36057_VDCR_VidEn, ZR36057_VDCR); 429 - btand(~ZR36057_VSSFGR_SnapShot, ZR36057_VSSFGR); 428 + btand(~ZR36057_VDCR_VID_EN, ZR36057_VDCR); 429 + btand(~ZR36057_VSSFGR_SNAP_SHOT, ZR36057_VSSFGR); 430 430 } 431 431 } 432 432 ··· 468 468 zr->jpg_dma_tail = 0; 469 469 zr->jpg_que_tail = 0; 470 470 zr->jpg_seq_num = 0; 471 - zr->JPEG_error = 0; 471 + zr->jpeg_error = 0; 472 472 zr->num_errors = 0; 473 473 zr->jpg_err_seq = 0; 474 474 zr->jpg_err_shift = 0; ··· 491 491 switch (mode) { 492 492 case BUZ_MODE_MOTION_COMPRESS: 493 493 default: 494 - reg = ZR36057_JMC_MJPGCmpMode; 494 + reg = ZR36057_JMC_MJPG_CMP_MODE; 495 495 break; 496 496 497 497 case BUZ_MODE_MOTION_DECOMPRESS: 498 - reg = ZR36057_JMC_MJPGExpMode; 499 - reg |= ZR36057_JMC_SyncMstr; 498 + reg = ZR36057_JMC_MJPG_EXP_MODE; 499 + reg |= ZR36057_JMC_SYNC_MSTR; 500 500 /* RJ: The following is experimental - improves the output to screen */ 501 501 //if(zr->jpg_settings.VFIFO_FB) reg |= ZR36057_JMC_VFIFO_FB; // No, it doesn't. SM 502 502 break; 503 503 504 504 case BUZ_MODE_STILL_COMPRESS: 505 - reg = ZR36057_JMC_JPGCmpMode; 505 + reg = ZR36057_JMC_JPG_CMP_MODE; 506 506 break; 507 507 508 508 case BUZ_MODE_STILL_DECOMPRESS: 509 - reg = ZR36057_JMC_JPGExpMode; 509 + reg = ZR36057_JMC_JPG_EXP_MODE; 510 510 break; 511 511 } 512 512 reg |= ZR36057_JMC_JPG; 513 513 if (zr->jpg_settings.field_per_buff == 1) 514 - reg |= ZR36057_JMC_Fld_per_buff; 514 + reg |= ZR36057_JMC_FLD_PER_BUFF; 515 515 btwrite(reg, ZR36057_JMC); 516 516 517 517 /* vertical */ 518 - btor(ZR36057_VFEVCR_VSPol, ZR36057_VFEVCR); 519 - reg = (6 << ZR36057_VSP_VsyncSize) | 520 - (tvn->Ht << ZR36057_VSP_FrmTot); 518 + btor(ZR36057_VFEVCR_VS_POL, ZR36057_VFEVCR); 519 + reg = (6 << ZR36057_VSP_VSYNC_SIZE) | 520 + (tvn->ht << ZR36057_VSP_FRM_TOT); 521 521 btwrite(reg, ZR36057_VSP); 522 - reg = ((zr->jpg_settings.img_y + tvn->VStart) << ZR36057_FVAP_NAY) | 522 + reg = ((zr->jpg_settings.img_y + tvn->v_start) << ZR36057_FVAP_NAY) | 523 523 (zr->jpg_settings.img_height << ZR36057_FVAP_PAY); 524 524 btwrite(reg, ZR36057_FVAP); 525 525 526 526 /* horizontal */ 527 527 if (zr->card.vfe_pol.hsync_pol) 528 - btor(ZR36057_VFEHCR_HSPol, ZR36057_VFEHCR); 528 + btor(ZR36057_VFEHCR_HS_POL, ZR36057_VFEHCR); 529 529 else 530 - btand(~ZR36057_VFEHCR_HSPol, ZR36057_VFEHCR); 531 - reg = ((tvn->HSyncStart) << ZR36057_HSP_HsyncStart) | 532 - (tvn->Wt << ZR36057_HSP_LineTot); 530 + btand(~ZR36057_VFEHCR_HS_POL, ZR36057_VFEHCR); 531 + reg = ((tvn->h_sync_start) << ZR36057_HSP_HSYNC_START) | 532 + (tvn->wt << ZR36057_HSP_LINE_TOT); 533 533 btwrite(reg, ZR36057_HSP); 534 534 reg = ((zr->jpg_settings.img_x + 535 - tvn->HStart + 4) << ZR36057_FHAP_NAX) | 535 + tvn->h_start + 4) << ZR36057_FHAP_NAX) | 536 536 (zr->jpg_settings.img_width << ZR36057_FHAP_PAX); 537 537 btwrite(reg, ZR36057_FHAP); 538 538 539 539 /* field process parameters */ 540 540 if (zr->jpg_settings.odd_even) 541 - reg = ZR36057_FPP_Odd_Even; 541 + reg = ZR36057_FPP_ODD_EVEN; 542 542 else 543 543 reg = 0; 544 544 545 545 btwrite(reg, ZR36057_FPP); 546 546 547 547 /* Set proper VCLK Polarity, else colors will be wrong during playback */ 548 - //btor(ZR36057_VFESPFR_VCLKPol, ZR36057_VFESPFR); 548 + //btor(ZR36057_VFESPFR_VCLK_POL, ZR36057_VFESPFR); 549 549 550 550 /* code base address */ 551 551 btwrite(zr->p_sc, ZR36057_JCBA); ··· 578 578 { 579 579 zr->intr_counter_GIRQ1 = 0; 580 580 zr->intr_counter_GIRQ0 = 0; 581 - zr->intr_counter_CodRepIRQ = 0; 582 - zr->intr_counter_JPEGRepIRQ = 0; 581 + zr->intr_counter_cod_rep_irq = 0; 582 + zr->intr_counter_jpeg_rep_irq = 0; 583 583 zr->field_counter = 0; 584 - zr->IRQ1_in = 0; 585 - zr->IRQ1_out = 0; 586 - zr->JPEG_in = 0; 587 - zr->JPEG_out = 0; 584 + zr->irq1_in = 0; 585 + zr->irq1_out = 0; 586 + zr->jpeg_in = 0; 587 + zr->jpeg_out = 0; 588 588 zr->JPEG_0 = 0; 589 589 zr->JPEG_1 = 0; 590 - zr->END_event_missed = 0; 591 - zr->JPEG_missed = 0; 592 - zr->JPEG_max_missed = 0; 593 - zr->JPEG_min_missed = 0x7fffffff; 590 + zr->end_event_missed = 0; 591 + zr->jpeg_missed = 0; 592 + zr->jpeg_max_missed = 0; 593 + zr->jpeg_min_missed = 0x7fffffff; 594 594 } 595 595 596 596 static u32 count_reset_interrupt(struct zoran *zr) ··· 607 607 btwrite(ZR36057_ISR_GIRQ0, ZR36057_ISR); 608 608 zr->intr_counter_GIRQ0++; 609 609 } 610 - if (isr & ZR36057_ISR_CodRepIRQ) { 611 - btwrite(ZR36057_ISR_CodRepIRQ, ZR36057_ISR); 612 - zr->intr_counter_CodRepIRQ++; 610 + if (isr & ZR36057_ISR_COD_REP_IRQ) { 611 + btwrite(ZR36057_ISR_COD_REP_IRQ, ZR36057_ISR); 612 + zr->intr_counter_cod_rep_irq++; 613 613 } 614 - if (isr & ZR36057_ISR_JPEGRepIRQ) { 615 - btwrite(ZR36057_ISR_JPEGRepIRQ, ZR36057_ISR); 616 - zr->intr_counter_JPEGRepIRQ++; 614 + if (isr & ZR36057_ISR_JPEG_REP_IRQ) { 615 + btwrite(ZR36057_ISR_JPEG_REP_IRQ, ZR36057_ISR); 616 + zr->intr_counter_jpeg_rep_irq++; 617 617 } 618 618 } 619 619 return isr; ··· 626 626 zr->frame_num = 0; 627 627 628 628 /* deassert P_reset, disable code transfer, deassert Active */ 629 - btwrite(ZR36057_JPC_P_Reset, ZR36057_JPC); 629 + btwrite(ZR36057_JPC_P_RESET, ZR36057_JPC); 630 630 /* stop flushing the internal code buffer */ 631 - btand(~ZR36057_MCTCR_CFlush, ZR36057_MCTCR); 631 + btand(~ZR36057_MCTCR_C_FLUSH, ZR36057_MCTCR); 632 632 /* enable code transfer */ 633 - btor(ZR36057_JPC_CodTrnsEn, ZR36057_JPC); 633 + btor(ZR36057_JPC_COD_TRNS_EN, ZR36057_JPC); 634 634 635 635 /* clear IRQs */ 636 636 btwrite(IRQ_MASK, ZR36057_ISR); 637 637 /* enable the JPEG IRQs */ 638 - btwrite(zr->card.jpeg_int | ZR36057_ICR_JPEGRepIRQ | ZR36057_ICR_IntPinEn, 638 + btwrite(zr->card.jpeg_int | ZR36057_ICR_JPEG_REP_IRQ | ZR36057_ICR_INT_PIN_EN, 639 639 ZR36057_ICR); 640 640 641 641 set_frame(zr, 0); // \FRAME 642 642 643 643 /* set the JPEG codec guest ID */ 644 - reg = (zr->card.gpcs[1] << ZR36057_JCGI_JPEGuestID) | 645 - (0 << ZR36057_JCGI_JPEGuestReg); 644 + reg = (zr->card.gpcs[1] << ZR36057_JCGI_JPE_GUEST_ID) | 645 + (0 << ZR36057_JCGI_JPE_GUEST_REG); 646 646 btwrite(reg, ZR36057_JCGI); 647 647 648 648 if (zr->card.video_vfe == CODEC_TYPE_ZR36016 && ··· 656 656 } 657 657 658 658 /* assert Active */ 659 - btor(ZR36057_JPC_Active, ZR36057_JPC); 659 + btor(ZR36057_JPC_ACTIVE, ZR36057_JPC); 660 660 661 661 /* enable the Go generation */ 662 - btor(ZR36057_JMC_Go_en, ZR36057_JMC); 662 + btor(ZR36057_JMC_GO_EN, ZR36057_JMC); 663 663 udelay(30); 664 664 665 665 set_frame(zr, 1); // /FRAME ··· 679 679 cap.width = zr->jpg_settings.img_width; 680 680 cap.height = zr->jpg_settings.img_height; 681 681 cap.decimation = 682 - zr->jpg_settings.HorDcm | (zr->jpg_settings.VerDcm << 8); 682 + zr->jpg_settings.hor_dcm | (zr->jpg_settings.ver_dcm << 8); 683 683 cap.quality = zr->jpg_settings.jpg_comp.quality; 684 684 685 685 switch (mode) { ··· 764 764 case BUZ_MODE_IDLE: 765 765 default: 766 766 /* shut down processing */ 767 - btand(~(zr->card.jpeg_int | ZR36057_ICR_JPEGRepIRQ), 767 + btand(~(zr->card.jpeg_int | ZR36057_ICR_JPEG_REP_IRQ), 768 768 ZR36057_ICR); 769 - btwrite(zr->card.jpeg_int | ZR36057_ICR_JPEGRepIRQ, 769 + btwrite(zr->card.jpeg_int | ZR36057_ICR_JPEG_REP_IRQ, 770 770 ZR36057_ISR); 771 - btand(~ZR36057_JMC_Go_en, ZR36057_JMC); // \Go_en 771 + btand(~ZR36057_JMC_GO_EN, ZR36057_JMC); // \Go_en 772 772 773 773 msleep(50); 774 774 775 775 set_videobus_dir(zr, 0); 776 776 set_frame(zr, 1); // /FRAME 777 - btor(ZR36057_MCTCR_CFlush, ZR36057_MCTCR); // /CFlush 777 + btor(ZR36057_MCTCR_C_FLUSH, ZR36057_MCTCR); // /CFlush 778 778 btwrite(0, ZR36057_JPC); // \P_Reset,\CodTrnsEn,\Active 779 779 btand(~ZR36057_JMC_VFIFO_FB, ZR36057_JMC); 780 - btand(~ZR36057_JMC_SyncMstr, ZR36057_JMC); 780 + btand(~ZR36057_JMC_SYNC_MSTR, ZR36057_JMC); 781 781 jpeg_codec_reset(zr); 782 782 jpeg_codec_sleep(zr, 1); 783 783 zr36057_adjust_vfe(zr, mode); ··· 803 803 unsigned long payload; 804 804 805 805 max_stat_com = 806 - (zr->jpg_settings.TmpDcm == 806 + (zr->jpg_settings.tmp_dcm == 807 807 1) ? BUZ_NUM_STAT_COM : (BUZ_NUM_STAT_COM >> 1); 808 808 809 809 spin_lock_irqsave(&zr->queued_bufs_lock, flags); ··· 822 822 payload = vb2_get_plane_payload(&vbuf->vb2_buf, 0); 823 823 if (payload == 0) 824 824 payload = zr->buffer_size; 825 - if (zr->jpg_settings.TmpDcm == 1) { 825 + if (zr->jpg_settings.tmp_dcm == 1) { 826 826 /* fill 1 stat_com entry */ 827 827 i = (zr->jpg_dma_head - 828 828 zr->jpg_err_shift) & BUZ_MASK_STAT_COM; ··· 876 876 877 877 spin_lock_irqsave(&zr->queued_bufs_lock, flags); 878 878 while (zr->jpg_dma_tail < zr->jpg_dma_head) { 879 - if (zr->jpg_settings.TmpDcm == 1) 879 + if (zr->jpg_settings.tmp_dcm == 1) 880 880 i = (zr->jpg_dma_tail - zr->jpg_err_shift) & BUZ_MASK_STAT_COM; 881 881 else 882 882 i = ((zr->jpg_dma_tail - zr->jpg_err_shift) & 1) * 2 + 1; ··· 901 901 dif = (seq - zr->jpg_seq_num) & 0xff; 902 902 zr->jpg_seq_num += dif; 903 903 } 904 - buf->vbuf.sequence = zr->jpg_settings.TmpDcm == 904 + buf->vbuf.sequence = zr->jpg_settings.tmp_dcm == 905 905 2 ? (zr->jpg_seq_num >> 1) : zr->jpg_seq_num; 906 906 zr->inuse[i] = NULL; 907 - if (zr->jpg_settings.TmpDcm != 1) 907 + if (zr->jpg_settings.tmp_dcm != 1) 908 908 buf->vbuf.field = zr->jpg_settings.odd_even ? 909 909 V4L2_FIELD_TOP : V4L2_FIELD_BOTTOM; 910 910 else ··· 926 926 astat = stat & IRQ_MASK; 927 927 if (astat & zr->card.vsync_int) { 928 928 if (zr->running == ZORAN_MAP_MODE_RAW) { 929 - if ((btread(ZR36057_VSSFGR) & ZR36057_VSSFGR_SnapShot) == 0) 929 + if ((btread(ZR36057_VSSFGR) & ZR36057_VSSFGR_SNAP_SHOT) == 0) 930 930 pci_warn(zr->pci_dev, "BuzIRQ with SnapShot off ???\n"); 931 - if ((btread(ZR36057_VSSFGR) & ZR36057_VSSFGR_FrameGrab) == 0) 931 + if ((btread(ZR36057_VSSFGR) & ZR36057_VSSFGR_FRAME_GRAB) == 0) 932 932 zr_set_buf(zr); 933 933 return IRQ_HANDLED; 934 934 } 935 - if (astat & ZR36057_ISR_JPEGRepIRQ) { 935 + if (astat & ZR36057_ISR_JPEG_REP_IRQ) { 936 936 if (zr->codec_mode != BUZ_MODE_MOTION_DECOMPRESS && 937 937 zr->codec_mode != BUZ_MODE_MOTION_COMPRESS) { 938 938 pci_err(zr->pci_dev, "JPG IRQ when not in good mode\n"); ··· 999 999 { 1000 1000 btwrite(0, ZR36057_SPGPPCR); 1001 1001 udelay(1000); 1002 - btor(ZR36057_SPGPPCR_SoftReset, ZR36057_SPGPPCR); 1002 + btor(ZR36057_SPGPPCR_SOFT_RESET, ZR36057_SPGPPCR); 1003 1003 udelay(1000); 1004 1004 1005 1005 /* assert P_Reset */ 1006 1006 btwrite(0, ZR36057_JPC); 1007 1007 /* set up GPIO direction - all output */ 1008 - btwrite(ZR36057_SPGPPCR_SoftReset | 0, ZR36057_SPGPPCR); 1008 + btwrite(ZR36057_SPGPPCR_SOFT_RESET | 0, ZR36057_SPGPPCR); 1009 1009 1010 1010 /* set up GPIO pins and guest bus timing */ 1011 1011 btwrite((0x81 << 24) | 0x8888, ZR36057_GPPGCR1);
+47 -47
drivers/staging/media/zoran/zoran_driver.c
··· 64 64 .colorspace = V4L2_COLORSPACE_SRGB, 65 65 .depth = 15, 66 66 .flags = ZORAN_FORMAT_CAPTURE, 67 - .vfespfr = ZR36057_VFESPFR_RGB555 | ZR36057_VFESPFR_ErrDif | 68 - ZR36057_VFESPFR_LittleEndian, 67 + .vfespfr = ZR36057_VFESPFR_RGB555 | ZR36057_VFESPFR_ERR_DIF | 68 + ZR36057_VFESPFR_LITTLE_ENDIAN, 69 69 }, { 70 70 .name = "15-bit RGB BE", 71 71 .fourcc = V4L2_PIX_FMT_RGB555X, 72 72 .colorspace = V4L2_COLORSPACE_SRGB, 73 73 .depth = 15, 74 74 .flags = ZORAN_FORMAT_CAPTURE, 75 - .vfespfr = ZR36057_VFESPFR_RGB555 | ZR36057_VFESPFR_ErrDif, 75 + .vfespfr = ZR36057_VFESPFR_RGB555 | ZR36057_VFESPFR_ERR_DIF, 76 76 }, { 77 77 .name = "16-bit RGB LE", 78 78 .fourcc = V4L2_PIX_FMT_RGB565, 79 79 .colorspace = V4L2_COLORSPACE_SRGB, 80 80 .depth = 16, 81 81 .flags = ZORAN_FORMAT_CAPTURE, 82 - .vfespfr = ZR36057_VFESPFR_RGB565 | ZR36057_VFESPFR_ErrDif | 83 - ZR36057_VFESPFR_LittleEndian, 82 + .vfespfr = ZR36057_VFESPFR_RGB565 | ZR36057_VFESPFR_ERR_DIF | 83 + ZR36057_VFESPFR_LITTLE_ENDIAN, 84 84 }, { 85 85 .name = "16-bit RGB BE", 86 86 .fourcc = V4L2_PIX_FMT_RGB565X, 87 87 .colorspace = V4L2_COLORSPACE_SRGB, 88 88 .depth = 16, 89 89 .flags = ZORAN_FORMAT_CAPTURE, 90 - .vfespfr = ZR36057_VFESPFR_RGB565 | ZR36057_VFESPFR_ErrDif, 90 + .vfespfr = ZR36057_VFESPFR_RGB565 | ZR36057_VFESPFR_ERR_DIF, 91 91 }, { 92 92 .name = "24-bit RGB", 93 93 .fourcc = V4L2_PIX_FMT_BGR24, 94 94 .colorspace = V4L2_COLORSPACE_SRGB, 95 95 .depth = 24, 96 96 .flags = ZORAN_FORMAT_CAPTURE, 97 - .vfespfr = ZR36057_VFESPFR_RGB888 | ZR36057_VFESPFR_Pack24, 97 + .vfespfr = ZR36057_VFESPFR_RGB888 | ZR36057_VFESPFR_PACK24, 98 98 }, { 99 99 .name = "32-bit RGB LE", 100 100 .fourcc = V4L2_PIX_FMT_BGR32, 101 101 .colorspace = V4L2_COLORSPACE_SRGB, 102 102 .depth = 32, 103 103 .flags = ZORAN_FORMAT_CAPTURE, 104 - .vfespfr = ZR36057_VFESPFR_RGB888 | ZR36057_VFESPFR_LittleEndian, 104 + .vfespfr = ZR36057_VFESPFR_RGB888 | ZR36057_VFESPFR_LITTLE_ENDIAN, 105 105 }, { 106 106 .name = "32-bit RGB BE", 107 107 .fourcc = V4L2_PIX_FMT_RGB32, ··· 122 122 .colorspace = V4L2_COLORSPACE_SMPTE170M, 123 123 .depth = 16, 124 124 .flags = ZORAN_FORMAT_CAPTURE, 125 - .vfespfr = ZR36057_VFESPFR_YUV422 | ZR36057_VFESPFR_LittleEndian, 125 + .vfespfr = ZR36057_VFESPFR_YUV422 | ZR36057_VFESPFR_LITTLE_ENDIAN, 126 126 }, { 127 127 .name = "Hardware-encoded Motion-JPEG", 128 128 .fourcc = V4L2_PIX_FMT_MJPEG, ··· 143 143 */ 144 144 static __u32 zoran_v4l2_calc_bufsize(struct zoran_jpg_settings *settings) 145 145 { 146 - __u8 div = settings->VerDcm * settings->HorDcm * settings->TmpDcm; 146 + __u8 div = settings->ver_dcm * settings->hor_dcm * settings->tmp_dcm; 147 147 __u32 num = (1024 * 512) / (div); 148 148 __u32 result = 2; 149 149 ··· 307 307 { 308 308 struct zoran *zr = video_drvdata(file); 309 309 310 - fmt->fmt.pix.width = zr->jpg_settings.img_width / zr->jpg_settings.HorDcm; 310 + fmt->fmt.pix.width = zr->jpg_settings.img_width / zr->jpg_settings.hor_dcm; 311 311 fmt->fmt.pix.height = zr->jpg_settings.img_height * 2 / 312 - (zr->jpg_settings.VerDcm * zr->jpg_settings.TmpDcm); 312 + (zr->jpg_settings.ver_dcm * zr->jpg_settings.tmp_dcm); 313 313 fmt->fmt.pix.sizeimage = zr->buffer_size; 314 314 fmt->fmt.pix.pixelformat = V4L2_PIX_FMT_MJPEG; 315 - if (zr->jpg_settings.TmpDcm == 1) 315 + if (zr->jpg_settings.tmp_dcm == 1) 316 316 fmt->fmt.pix.field = (zr->jpg_settings.odd_even ? 317 317 V4L2_FIELD_SEQ_TB : V4L2_FIELD_SEQ_BT); 318 318 else ··· 358 358 359 359 /* we actually need to set 'real' parameters now */ 360 360 if ((fmt->fmt.pix.height * 2) > BUZ_MAX_HEIGHT) 361 - settings.TmpDcm = 1; 361 + settings.tmp_dcm = 1; 362 362 else 363 - settings.TmpDcm = 2; 363 + settings.tmp_dcm = 2; 364 364 settings.decimation = 0; 365 365 if (fmt->fmt.pix.height <= zr->jpg_settings.img_height / 2) 366 - settings.VerDcm = 2; 366 + settings.ver_dcm = 2; 367 367 else 368 - settings.VerDcm = 1; 368 + settings.ver_dcm = 1; 369 369 if (fmt->fmt.pix.width <= zr->jpg_settings.img_width / 4) 370 - settings.HorDcm = 4; 370 + settings.hor_dcm = 4; 371 371 else if (fmt->fmt.pix.width <= zr->jpg_settings.img_width / 2) 372 - settings.HorDcm = 2; 372 + settings.hor_dcm = 2; 373 373 else 374 - settings.HorDcm = 1; 375 - if (settings.TmpDcm == 1) 374 + settings.hor_dcm = 1; 375 + if (settings.tmp_dcm == 1) 376 376 settings.field_per_buff = 2; 377 377 else 378 378 settings.field_per_buff = 1; 379 379 380 - if (settings.HorDcm > 1) { 380 + if (settings.hor_dcm > 1) { 381 381 settings.img_x = (BUZ_MAX_WIDTH == 720) ? 8 : 0; 382 382 settings.img_width = (BUZ_MAX_WIDTH == 720) ? 704 : BUZ_MAX_WIDTH; 383 383 } else { ··· 391 391 return res; 392 392 393 393 /* tell the user what we actually did */ 394 - fmt->fmt.pix.width = settings.img_width / settings.HorDcm; 394 + fmt->fmt.pix.width = settings.img_width / settings.hor_dcm; 395 395 fmt->fmt.pix.height = settings.img_height * 2 / 396 - (settings.TmpDcm * settings.VerDcm); 397 - if (settings.TmpDcm == 1) 396 + (settings.tmp_dcm * settings.ver_dcm); 397 + if (settings.tmp_dcm == 1) 398 398 fmt->fmt.pix.field = (zr->jpg_settings.odd_even ? 399 399 V4L2_FIELD_SEQ_TB : V4L2_FIELD_SEQ_BT); 400 400 else ··· 462 462 463 463 /* we actually need to set 'real' parameters now */ 464 464 if (fmt->fmt.pix.height * 2 > BUZ_MAX_HEIGHT) 465 - settings.TmpDcm = 1; 465 + settings.tmp_dcm = 1; 466 466 else 467 - settings.TmpDcm = 2; 467 + settings.tmp_dcm = 2; 468 468 settings.decimation = 0; 469 469 if (fmt->fmt.pix.height <= zr->jpg_settings.img_height / 2) 470 - settings.VerDcm = 2; 470 + settings.ver_dcm = 2; 471 471 else 472 - settings.VerDcm = 1; 472 + settings.ver_dcm = 1; 473 473 if (fmt->fmt.pix.width <= zr->jpg_settings.img_width / 4) 474 - settings.HorDcm = 4; 474 + settings.hor_dcm = 4; 475 475 else if (fmt->fmt.pix.width <= zr->jpg_settings.img_width / 2) 476 - settings.HorDcm = 2; 476 + settings.hor_dcm = 2; 477 477 else 478 - settings.HorDcm = 1; 479 - if (settings.TmpDcm == 1) 478 + settings.hor_dcm = 1; 479 + if (settings.tmp_dcm == 1) 480 480 settings.field_per_buff = 2; 481 481 else 482 482 settings.field_per_buff = 1; 483 483 484 - if (settings.HorDcm > 1) { 484 + if (settings.hor_dcm > 1) { 485 485 settings.img_x = (BUZ_MAX_WIDTH == 720) ? 8 : 0; 486 486 settings.img_width = (BUZ_MAX_WIDTH == 720) ? 704 : BUZ_MAX_WIDTH; 487 487 } else { ··· 505 505 zr->buffer_size = zoran_v4l2_calc_bufsize(&zr->jpg_settings); 506 506 507 507 /* tell the user what we actually did */ 508 - fmt->fmt.pix.width = settings.img_width / settings.HorDcm; 508 + fmt->fmt.pix.width = settings.img_width / settings.hor_dcm; 509 509 fmt->fmt.pix.height = settings.img_height * 2 / 510 - (settings.TmpDcm * settings.VerDcm); 511 - if (settings.TmpDcm == 1) 510 + (settings.tmp_dcm * settings.ver_dcm); 511 + if (settings.tmp_dcm == 1) 512 512 fmt->fmt.pix.field = (zr->jpg_settings.odd_even ? 513 513 V4L2_FIELD_SEQ_TB : V4L2_FIELD_SEQ_BT); 514 514 else ··· 874 874 875 875 spin_lock_irqsave(&zr->queued_bufs_lock, flags); 876 876 if (list_empty(&zr->queued_bufs)) { 877 - btand(~ZR36057_ICR_IntPinEn, ZR36057_ICR); 877 + btand(~ZR36057_ICR_INT_PIN_EN, ZR36057_ICR); 878 878 vb2_queue_error(zr->video_dev->queue); 879 879 spin_unlock_irqrestore(&zr->queued_bufs_lock, flags); 880 880 return -EINVAL; 881 881 } 882 882 buf = list_first_entry_or_null(&zr->queued_bufs, struct zr_buffer, queue); 883 883 if (!buf) { 884 - btand(~ZR36057_ICR_IntPinEn, ZR36057_ICR); 884 + btand(~ZR36057_ICR_INT_PIN_EN, ZR36057_ICR); 885 885 vb2_queue_error(zr->video_dev->queue); 886 886 spin_unlock_irqrestore(&zr->queued_bufs_lock, flags); 887 887 return -EINVAL; ··· 907 907 reg = 0; 908 908 if (zr->v4l_settings.height > BUZ_MAX_HEIGHT / 2) 909 909 reg += zr->v4l_settings.bytesperline; 910 - reg = (reg << ZR36057_VSSFGR_DispStride); 911 - reg |= ZR36057_VSSFGR_VidOvf; 912 - reg |= ZR36057_VSSFGR_SnapShot; 913 - reg |= ZR36057_VSSFGR_FrameGrab; 910 + reg = (reg << ZR36057_VSSFGR_DISP_STRIDE); 911 + reg |= ZR36057_VSSFGR_VID_OVF; 912 + reg |= ZR36057_VSSFGR_SNAP_SHOT; 913 + reg |= ZR36057_VSSFGR_FRAME_GRAB; 914 914 btwrite(reg, ZR36057_VSSFGR); 915 915 916 - btor(ZR36057_VDCR_VidEn, ZR36057_VDCR); 916 + btor(ZR36057_VDCR_VID_EN, ZR36057_VDCR); 917 917 return 0; 918 918 } 919 919 ··· 938 938 zoran_feed_stat_com(zr); 939 939 jpeg_start(zr); 940 940 zr->running = zr->map_mode; 941 - btor(ZR36057_ICR_IntPinEn, ZR36057_ICR); 941 + btor(ZR36057_ICR_INT_PIN_EN, ZR36057_ICR); 942 942 return 0; 943 943 } 944 944 ··· 949 949 zr36057_enable_jpg(zr, BUZ_MODE_IDLE); 950 950 zr36057_set_memgrab(zr, 1); 951 951 zr->running = zr->map_mode; 952 - btor(ZR36057_ICR_IntPinEn, ZR36057_ICR); 952 + btor(ZR36057_ICR_INT_PIN_EN, ZR36057_ICR); 953 953 return 0; 954 954 } 955 955 ··· 960 960 unsigned long flags; 961 961 int j; 962 962 963 - btand(~ZR36057_ICR_IntPinEn, ZR36057_ICR); 963 + btand(~ZR36057_ICR_INT_PIN_EN, ZR36057_ICR); 964 964 if (zr->map_mode != ZORAN_MAP_MODE_RAW) 965 965 zr36057_enable_jpg(zr, BUZ_MODE_IDLE); 966 966 zr36057_set_memgrab(zr, 0);
+7 -7
drivers/staging/media/zoran/zr36016.c
··· 244 244 struct zr36016 *ptr = (struct zr36016 *)codec->data; 245 245 246 246 dprintk(2, "%s: set_video %d.%d, %d/%d-%dx%d (0x%x) call\n", 247 - ptr->name, norm->HStart, norm->VStart, 247 + ptr->name, norm->h_start, norm->v_start, 248 248 cap->x, cap->y, cap->width, cap->height, 249 249 cap->decimation); 250 250 ··· 254 254 ptr->width = cap->width; 255 255 ptr->height = cap->height; 256 256 /* (Ronald) This is ugly. zoran_device.c, line 387 257 - * already mentions what happens if HStart is even 257 + * already mentions what happens if h_start is even 258 258 * (blue faces, etc., cr/cb inversed). There's probably 259 - * some good reason why HStart is 0 instead of 1, so I'm 259 + * some good reason why h_start is 0 instead of 1, so I'm 260 260 * leaving it to this for now, but really... This can be 261 261 * done a lot simpler */ 262 - ptr->xoff = (norm->HStart ? norm->HStart : 1) + cap->x; 262 + ptr->xoff = (norm->h_start ? norm->h_start : 1) + cap->x; 263 263 /* Something to note here (I don't understand it), setting 264 - * VStart too high will cause the codec to 'not work'. I 265 - * really don't get it. values of 16 (VStart) already break 264 + * v_start too high will cause the codec to 'not work'. I 265 + * really don't get it. values of 16 (v_start) already break 266 266 * it here. Just '0' seems to work. More testing needed! */ 267 - ptr->yoff = norm->VStart + cap->y; 267 + ptr->yoff = norm->v_start + cap->y; 268 268 /* (Ronald) dzjeeh, can't this thing do hor_decimation = 4? */ 269 269 ptr->xdec = ((cap->decimation & 0xff) == 1) ? 0 : 1; 270 270 ptr->ydec = (((cap->decimation >> 8) & 0xff) == 1) ? 0 : 1;
+1 -1
drivers/staging/media/zoran/zr36050.c
··· 561 561 int size; 562 562 563 563 dprintk(2, "%s: set_video %d.%d, %d/%d-%dx%d (0x%x) q%d call\n", 564 - ptr->name, norm->HStart, norm->VStart, 564 + ptr->name, norm->h_start, norm->v_start, 565 565 cap->x, cap->y, cap->width, cap->height, 566 566 cap->decimation, cap->quality); 567 567 /* if () return -EINVAL;
+61 -61
drivers/staging/media/zoran/zr36057.h
··· 11 11 /* Zoran ZR36057 registers */ 12 12 13 13 #define ZR36057_VFEHCR 0x000 /* Video Front End, Horizontal Configuration Register */ 14 - #define ZR36057_VFEHCR_HSPol BIT(30) 15 - #define ZR36057_VFEHCR_HStart 10 16 - #define ZR36057_VFEHCR_HEnd 0 17 - #define ZR36057_VFEHCR_Hmask 0x3ff 14 + #define ZR36057_VFEHCR_HS_POL BIT(30) 15 + #define ZR36057_VFEHCR_H_START 10 16 + #define ZR36057_VFEHCR_H_END 0 17 + #define ZR36057_VFEHCR_HMASK 0x3ff 18 18 19 19 #define ZR36057_VFEVCR 0x004 /* Video Front End, Vertical Configuration Register */ 20 - #define ZR36057_VFEVCR_VSPol BIT(30) 21 - #define ZR36057_VFEVCR_VStart 10 22 - #define ZR36057_VFEVCR_VEnd 0 23 - #define ZR36057_VFEVCR_Vmask 0x3ff 20 + #define ZR36057_VFEVCR_VS_POL BIT(30) 21 + #define ZR36057_VFEVCR_V_START 10 22 + #define ZR36057_VFEVCR_V_END 0 23 + #define ZR36057_VFEVCR_VMASK 0x3ff 24 24 25 25 #define ZR36057_VFESPFR 0x008 /* Video Front End, Scaler and Pixel Format Register */ 26 - #define ZR36057_VFESPFR_ExtFl BIT(26) 27 - #define ZR36057_VFESPFR_TopField BIT(25) 28 - #define ZR36057_VFESPFR_VCLKPol BIT(24) 29 - #define ZR36057_VFESPFR_HFilter 21 30 - #define ZR36057_VFESPFR_HorDcm 14 31 - #define ZR36057_VFESPFR_VerDcm 8 32 - #define ZR36057_VFESPFR_DispMode 6 26 + #define ZR36057_VFESPFR_EXT_FL BIT(26) 27 + #define ZR36057_VFESPFR_TOP_FIELD BIT(25) 28 + #define ZR36057_VFESPFR_VCLK_POL BIT(24) 29 + #define ZR36057_VFESPFR_H_FILTER 21 30 + #define ZR36057_VFESPFR_HOR_DCM 14 31 + #define ZR36057_VFESPFR_VER_DCM 8 32 + #define ZR36057_VFESPFR_DISP_MODE 6 33 33 #define ZR36057_VFESPFR_YUV422 (0<<3) 34 34 #define ZR36057_VFESPFR_RGB888 (1<<3) 35 35 #define ZR36057_VFESPFR_RGB565 (2<<3) 36 36 #define ZR36057_VFESPFR_RGB555 (3<<3) 37 - #define ZR36057_VFESPFR_ErrDif (1<<2) 38 - #define ZR36057_VFESPFR_Pack24 (1<<1) 39 - #define ZR36057_VFESPFR_LittleEndian (1<<0) 37 + #define ZR36057_VFESPFR_ERR_DIF (1<<2) 38 + #define ZR36057_VFESPFR_PACK24 (1<<1) 39 + #define ZR36057_VFESPFR_LITTLE_ENDIAN (1<<0) 40 40 41 41 #define ZR36057_VDTR 0x00c /* Video Display "Top" Register */ 42 42 43 43 #define ZR36057_VDBR 0x010 /* Video Display "Bottom" Register */ 44 44 45 45 #define ZR36057_VSSFGR 0x014 /* Video Stride, Status, and Frame Grab Register */ 46 - #define ZR36057_VSSFGR_DispStride 16 47 - #define ZR36057_VSSFGR_VidOvf BIT(8) 48 - #define ZR36057_VSSFGR_SnapShot BIT(1) 49 - #define ZR36057_VSSFGR_FrameGrab BIT(0) 46 + #define ZR36057_VSSFGR_DISP_STRIDE 16 47 + #define ZR36057_VSSFGR_VID_OVF BIT(8) 48 + #define ZR36057_VSSFGR_SNAP_SHOT BIT(1) 49 + #define ZR36057_VSSFGR_FRAME_GRAB BIT(0) 50 50 51 51 #define ZR36057_VDCR 0x018 /* Video Display Configuration Register */ 52 - #define ZR36057_VDCR_VidEn BIT(31) 53 - #define ZR36057_VDCR_MinPix 24 54 - #define ZR36057_VDCR_Triton BIT(24) 55 - #define ZR36057_VDCR_VidWinHt 12 56 - #define ZR36057_VDCR_VidWinWid 0 52 + #define ZR36057_VDCR_VID_EN BIT(31) 53 + #define ZR36057_VDCR_MIN_PIX 24 54 + #define ZR36057_VDCR_TRITON BIT(24) 55 + #define ZR36057_VDCR_VID_WIN_HT 12 56 + #define ZR36057_VDCR_VID_WIN_WID 0 57 57 58 58 #define ZR36057_MMTR 0x01c /* Masking Map "Top" Register */ 59 59 60 60 #define ZR36057_MMBR 0x020 /* Masking Map "Bottom" Register */ 61 61 62 62 #define ZR36057_OCR 0x024 /* Overlay Control Register */ 63 - #define ZR36057_OCR_OvlEnable BIT(15) 64 - #define ZR36057_OCR_MaskStride 0 63 + #define ZR36057_OCR_OVL_ENABLE BIT(15) 64 + #define ZR36057_OCR_MASK_STRIDE 0 65 65 66 66 #define ZR36057_SPGPPCR 0x028 /* System, PCI, and General Purpose Pins Control Register */ 67 - #define ZR36057_SPGPPCR_SoftReset BIT(24) 67 + #define ZR36057_SPGPPCR_SOFT_RESET BIT(24) 68 68 69 69 #define ZR36057_GPPGCR1 0x02c /* General Purpose Pins and GuestBus Control Register (1) */ 70 70 71 71 #define ZR36057_MCSAR 0x030 /* MPEG Code Source Address Register */ 72 72 73 73 #define ZR36057_MCTCR 0x034 /* MPEG Code Transfer Control Register */ 74 - #define ZR36057_MCTCR_CodTime BIT(30) 75 - #define ZR36057_MCTCR_CEmpty BIT(29) 76 - #define ZR36057_MCTCR_CFlush BIT(28) 77 - #define ZR36057_MCTCR_CodGuestID 20 78 - #define ZR36057_MCTCR_CodGuestReg 16 74 + #define ZR36057_MCTCR_COD_TIME BIT(30) 75 + #define ZR36057_MCTCR_C_EMPTY BIT(29) 76 + #define ZR36057_MCTCR_C_FLUSH BIT(28) 77 + #define ZR36057_MCTCR_COD_GUEST_ID 20 78 + #define ZR36057_MCTCR_COD_GUEST_REG 16 79 79 80 80 #define ZR36057_MCMPR 0x038 /* MPEG Code Memory Pointer Register */ 81 81 82 82 #define ZR36057_ISR 0x03c /* Interrupt Status Register */ 83 83 #define ZR36057_ISR_GIRQ1 BIT(30) 84 84 #define ZR36057_ISR_GIRQ0 BIT(29) 85 - #define ZR36057_ISR_CodRepIRQ BIT(28) 86 - #define ZR36057_ISR_JPEGRepIRQ BIT(27) 85 + #define ZR36057_ISR_COD_REP_IRQ BIT(28) 86 + #define ZR36057_ISR_JPEG_REP_IRQ BIT(27) 87 87 88 88 #define ZR36057_ICR 0x040 /* Interrupt Control Register */ 89 89 #define ZR36057_ICR_GIRQ1 BIT(30) 90 90 #define ZR36057_ICR_GIRQ0 BIT(29) 91 - #define ZR36057_ICR_CodRepIRQ BIT(28) 92 - #define ZR36057_ICR_JPEGRepIRQ BIT(27) 93 - #define ZR36057_ICR_IntPinEn BIT(24) 91 + #define ZR36057_ICR_COD_REP_IRQ BIT(28) 92 + #define ZR36057_ICR_JPEG_REP_IRQ BIT(27) 93 + #define ZR36057_ICR_INT_PIN_EN BIT(24) 94 94 95 95 #define ZR36057_I2CBR 0x044 /* I2C Bus Register */ 96 96 #define ZR36057_I2CBR_SDA BIT(1) ··· 98 98 99 99 #define ZR36057_JMC 0x100 /* JPEG Mode and Control */ 100 100 #define ZR36057_JMC_JPG BIT(31) 101 - #define ZR36057_JMC_JPGExpMode (0 << 29) 102 - #define ZR36057_JMC_JPGCmpMode BIT(29) 103 - #define ZR36057_JMC_MJPGExpMode (2 << 29) 104 - #define ZR36057_JMC_MJPGCmpMode (3 << 29) 101 + #define ZR36057_JMC_JPG_EXP_MODE (0 << 29) 102 + #define ZR36057_JMC_JPG_CMP_MODE BIT(29) 103 + #define ZR36057_JMC_MJPG_EXP_MODE (2 << 29) 104 + #define ZR36057_JMC_MJPG_CMP_MODE (3 << 29) 105 105 #define ZR36057_JMC_RTBUSY_FB BIT(6) 106 - #define ZR36057_JMC_Go_en BIT(5) 107 - #define ZR36057_JMC_SyncMstr BIT(4) 108 - #define ZR36057_JMC_Fld_per_buff BIT(3) 106 + #define ZR36057_JMC_GO_EN BIT(5) 107 + #define ZR36057_JMC_SYNC_MSTR BIT(4) 108 + #define ZR36057_JMC_FLD_PER_BUFF BIT(3) 109 109 #define ZR36057_JMC_VFIFO_FB BIT(2) 110 110 #define ZR36057_JMC_CFIFO_FB BIT(1) 111 - #define ZR36057_JMC_Stll_LitEndian BIT(0) 111 + #define ZR36057_JMC_STLL_LIT_ENDIAN BIT(0) 112 112 113 113 #define ZR36057_JPC 0x104 /* JPEG Process Control */ 114 - #define ZR36057_JPC_P_Reset BIT(7) 115 - #define ZR36057_JPC_CodTrnsEn BIT(5) 116 - #define ZR36057_JPC_Active BIT(0) 114 + #define ZR36057_JPC_P_RESET BIT(7) 115 + #define ZR36057_JPC_COD_TRNS_EN BIT(5) 116 + #define ZR36057_JPC_ACTIVE BIT(0) 117 117 118 118 #define ZR36057_VSP 0x108 /* Vertical Sync Parameters */ 119 - #define ZR36057_VSP_VsyncSize 16 120 - #define ZR36057_VSP_FrmTot 0 119 + #define ZR36057_VSP_VSYNC_SIZE 16 120 + #define ZR36057_VSP_FRM_TOT 0 121 121 122 122 #define ZR36057_HSP 0x10c /* Horizontal Sync Parameters */ 123 - #define ZR36057_HSP_HsyncStart 16 124 - #define ZR36057_HSP_LineTot 0 123 + #define ZR36057_HSP_HSYNC_START 16 124 + #define ZR36057_HSP_LINE_TOT 0 125 125 126 126 #define ZR36057_FHAP 0x110 /* Field Horizontal Active Portion */ 127 127 #define ZR36057_FHAP_NAX 16 ··· 132 132 #define ZR36057_FVAP_PAY 0 133 133 134 134 #define ZR36057_FPP 0x118 /* Field Process Parameters */ 135 - #define ZR36057_FPP_Odd_Even BIT(0) 135 + #define ZR36057_FPP_ODD_EVEN BIT(0) 136 136 137 137 #define ZR36057_JCBA 0x11c /* JPEG Code Base Address */ 138 138 139 139 #define ZR36057_JCFT 0x120 /* JPEG Code FIFO Threshold */ 140 140 141 141 #define ZR36057_JCGI 0x124 /* JPEG Codec Guest ID */ 142 - #define ZR36057_JCGI_JPEGuestID 4 143 - #define ZR36057_JCGI_JPEGuestReg 0 142 + #define ZR36057_JCGI_JPE_GUEST_ID 4 143 + #define ZR36057_JCGI_JPE_GUEST_REG 0 144 144 145 145 #define ZR36057_GCR2 0x12c /* GuestBus Control Register (2) */ 146 146 147 147 #define ZR36057_POR 0x200 /* Post Office Register */ 148 - #define ZR36057_POR_POPen BIT(25) 149 - #define ZR36057_POR_POTime BIT(24) 150 - #define ZR36057_POR_PODir BIT(23) 148 + #define ZR36057_POR_PO_PEN BIT(25) 149 + #define ZR36057_POR_PO_TIME BIT(24) 150 + #define ZR36057_POR_PO_DIR BIT(23) 151 151 152 152 #define ZR36057_STR 0x300 /* "Still" Transfer Register */ 153 153
+38 -38
drivers/staging/media/zoran/zr36060.c
··· 106 106 { 107 107 int i = 0; 108 108 109 - while (zr36060_read_status(ptr) & ZR060_CFSR_Busy) { 109 + while (zr36060_read_status(ptr) & ZR060_CFSR_BUSY) { 110 110 udelay(1); 111 111 if (i++ > 200000) { // 200ms, there is for sure something wrong!!! 112 112 dprintk(1, ··· 127 127 } 128 128 129 129 zr36060_wait_end(ptr); 130 - if (ptr->status & ZR060_CFSR_Busy) { 130 + if (ptr->status & ZR060_CFSR_BUSY) { 131 131 pr_err("%s: attach failed, jpeg processor failed (end flag)!\n", ptr->name); 132 132 return -EBUSY; 133 133 } ··· 328 328 if (ptr->mode == CODEC_DO_COMPRESSION) { 329 329 dprintk(2, "%s: COMPRESSION SETUP\n", ptr->name); 330 330 331 - zr36060_write(ptr, ZR060_LOAD, ZR060_LOAD_SyncRst); 331 + zr36060_write(ptr, ZR060_LOAD, ZR060_LOAD_SYNC_RST); 332 332 333 333 /* 060 communicates with 067 in master mode */ 334 - zr36060_write(ptr, ZR060_CIR, ZR060_CIR_CodeMstr); 334 + zr36060_write(ptr, ZR060_CIR, ZR060_CIR_CODE_MSTR); 335 335 336 336 /* Compression with or without variable scale factor */ 337 337 /*FIXME: What about ptr->bitrate_ctrl? */ 338 - zr36060_write(ptr, ZR060_CMR, ZR060_CMR_Comp | ZR060_CMR_Pass2 | ZR060_CMR_BRB); 338 + zr36060_write(ptr, ZR060_CMR, ZR060_CMR_COMP | ZR060_CMR_PASS2 | ZR060_CMR_BRB); 339 339 340 340 /* Must be zero */ 341 341 zr36060_write(ptr, ZR060_MBZ, 0x00); ··· 403 403 /* JPEG markers to be included in the compressed stream */ 404 404 zr36060_write(ptr, ZR060_MER, 405 405 ZR060_MER_DQT | ZR060_MER_DHT | 406 - ((ptr->com.len > 0) ? ZR060_MER_Com : 0) | 407 - ((ptr->app.len > 0) ? ZR060_MER_App : 0)); 406 + ((ptr->com.len > 0) ? ZR060_MER_COM : 0) | 407 + ((ptr->app.len > 0) ? ZR060_MER_APP : 0)); 408 408 409 409 /* Setup the Video Frontend */ 410 410 /* Limit pixel range to 16..235 as per CCIR-601 */ 411 - zr36060_write(ptr, ZR060_VCR, ZR060_VCR_Range); 411 + zr36060_write(ptr, ZR060_VCR, ZR060_VCR_RANGE); 412 412 413 413 } else { 414 414 dprintk(2, "%s: EXPANSION SETUP\n", ptr->name); 415 415 416 - zr36060_write(ptr, ZR060_LOAD, ZR060_LOAD_SyncRst); 416 + zr36060_write(ptr, ZR060_LOAD, ZR060_LOAD_SYNC_RST); 417 417 418 418 /* 060 communicates with 067 in master mode */ 419 - zr36060_write(ptr, ZR060_CIR, ZR060_CIR_CodeMstr); 419 + zr36060_write(ptr, ZR060_CIR, ZR060_CIR_CODE_MSTR); 420 420 421 421 /* Decompression */ 422 422 zr36060_write(ptr, ZR060_CMR, 0); ··· 436 436 zr36060_pushit(ptr, ZR060_DHT_IDX, sizeof(zr36060_dht), zr36060_dht); 437 437 438 438 /* Setup the Video Frontend */ 439 - //zr36060_write(ptr, ZR060_VCR, ZR060_VCR_FIExt); 439 + //zr36060_write(ptr, ZR060_VCR, ZR060_VCR_FI_EXT); 440 440 //this doesn't seem right and doesn't work... 441 - zr36060_write(ptr, ZR060_VCR, ZR060_VCR_Range); 441 + zr36060_write(ptr, ZR060_VCR, ZR060_VCR_RANGE); 442 442 } 443 443 444 444 /* Load the tables */ 445 - zr36060_write(ptr, ZR060_LOAD, ZR060_LOAD_SyncRst | ZR060_LOAD_Load); 445 + zr36060_write(ptr, ZR060_LOAD, ZR060_LOAD_SYNC_RST | ZR060_LOAD_LOAD); 446 446 zr36060_wait_end(ptr); 447 447 dprintk(2, "%s: Status after table preload: 0x%02x\n", ptr->name, ptr->status); 448 448 449 - if (ptr->status & ZR060_CFSR_Busy) { 449 + if (ptr->status & ZR060_CFSR_BUSY) { 450 450 pr_err("%s: init aborted!\n", ptr->name); 451 451 return; // something is wrong, its timed out!!!! 452 452 } ··· 494 494 ptr->width = cap->width / (cap->decimation & 0xff); 495 495 ptr->height = cap->height / (cap->decimation >> 8); 496 496 497 - zr36060_write(ptr, ZR060_LOAD, ZR060_LOAD_SyncRst); 497 + zr36060_write(ptr, ZR060_LOAD, ZR060_LOAD_SYNC_RST); 498 498 499 499 /* Note that VSPol/HSPol bits in zr36060 have the opposite 500 500 * meaning of their zr360x7 counterparts with the same names 501 501 * N.b. for VSPol this is only true if FIVEdge = 0 (default, 502 502 * left unchanged here - in accordance with datasheet). 503 503 */ 504 - reg = (!pol->vsync_pol ? ZR060_VPR_VSPol : 0) 505 - | (!pol->hsync_pol ? ZR060_VPR_HSPol : 0) 506 - | (pol->field_pol ? ZR060_VPR_FIPol : 0) 507 - | (pol->blank_pol ? ZR060_VPR_BLPol : 0) 508 - | (pol->subimg_pol ? ZR060_VPR_SImgPol : 0) 509 - | (pol->poe_pol ? ZR060_VPR_PoePol : 0) 510 - | (pol->pvalid_pol ? ZR060_VPR_PValPol : 0) 511 - | (pol->vclk_pol ? ZR060_VPR_VCLKPol : 0); 504 + reg = (!pol->vsync_pol ? ZR060_VPR_VS_POL : 0) 505 + | (!pol->hsync_pol ? ZR060_VPR_HS_POL : 0) 506 + | (pol->field_pol ? ZR060_VPR_FI_POL : 0) 507 + | (pol->blank_pol ? ZR060_VPR_BL_POL : 0) 508 + | (pol->subimg_pol ? ZR060_VPR_S_IMG_POL : 0) 509 + | (pol->poe_pol ? ZR060_VPR_POE_POL : 0) 510 + | (pol->pvalid_pol ? ZR060_VPR_P_VAL_POL : 0) 511 + | (pol->vclk_pol ? ZR060_VPR_VCLK_POL : 0); 512 512 zr36060_write(ptr, ZR060_VPR, reg); 513 513 514 514 reg = 0; ··· 518 518 break; 519 519 520 520 case 2: 521 - reg |= ZR060_SR_HScale2; 521 + reg |= ZR060_SR_H_SCALE2; 522 522 break; 523 523 524 524 case 4: 525 - reg |= ZR060_SR_HScale4; 525 + reg |= ZR060_SR_H_SCALE4; 526 526 break; 527 527 } 528 528 ··· 532 532 break; 533 533 534 534 case 2: 535 - reg |= ZR060_SR_VScale; 535 + reg |= ZR060_SR_V_SCALE; 536 536 break; 537 537 } 538 538 zr36060_write(ptr, ZR060_SR, reg); ··· 543 543 544 544 /* sync generator */ 545 545 546 - reg = norm->Ht - 1; /* Vtotal */ 546 + reg = norm->ht - 1; /* Vtotal */ 547 547 zr36060_write(ptr, ZR060_SGR_VTOTAL_HI, (reg >> 8) & 0xff); 548 548 zr36060_write(ptr, ZR060_SGR_VTOTAL_LO, (reg >> 0) & 0xff); 549 549 550 - reg = norm->Wt - 1; /* Htotal */ 550 + reg = norm->wt - 1; /* Htotal */ 551 551 zr36060_write(ptr, ZR060_SGR_HTOTAL_HI, (reg >> 8) & 0xff); 552 552 zr36060_write(ptr, ZR060_SGR_HTOTAL_LO, (reg >> 0) & 0xff); 553 553 ··· 559 559 reg = 68; 560 560 zr36060_write(ptr, ZR060_SGR_HSYNC, reg); 561 561 562 - reg = norm->VStart - 1; /* BVstart */ 562 + reg = norm->v_start - 1; /* BVstart */ 563 563 zr36060_write(ptr, ZR060_SGR_BVSTART, reg); 564 564 565 - reg += norm->Ha / 2; /* BVend */ 565 + reg += norm->ha / 2; /* BVend */ 566 566 zr36060_write(ptr, ZR060_SGR_BVEND_HI, (reg >> 8) & 0xff); 567 567 zr36060_write(ptr, ZR060_SGR_BVEND_LO, (reg >> 0) & 0xff); 568 568 569 - reg = norm->HStart - 1; /* BHstart */ 569 + reg = norm->h_start - 1; /* BHstart */ 570 570 zr36060_write(ptr, ZR060_SGR_BHSTART, reg); 571 571 572 - reg += norm->Wa; /* BHend */ 572 + reg += norm->wa; /* BHend */ 573 573 zr36060_write(ptr, ZR060_SGR_BHEND_HI, (reg >> 8) & 0xff); 574 574 zr36060_write(ptr, ZR060_SGR_BHEND_LO, (reg >> 0) & 0xff); 575 575 576 576 /* active area */ 577 - reg = cap->y + norm->VStart; /* Vstart */ 577 + reg = cap->y + norm->v_start; /* Vstart */ 578 578 zr36060_write(ptr, ZR060_AAR_VSTART_HI, (reg >> 8) & 0xff); 579 579 zr36060_write(ptr, ZR060_AAR_VSTART_LO, (reg >> 0) & 0xff); 580 580 ··· 582 582 zr36060_write(ptr, ZR060_AAR_VEND_HI, (reg >> 8) & 0xff); 583 583 zr36060_write(ptr, ZR060_AAR_VEND_LO, (reg >> 0) & 0xff); 584 584 585 - reg = cap->x + norm->HStart; /* Hstart */ 585 + reg = cap->x + norm->h_start; /* Hstart */ 586 586 zr36060_write(ptr, ZR060_AAR_HSTART_HI, (reg >> 8) & 0xff); 587 587 zr36060_write(ptr, ZR060_AAR_HSTART_LO, (reg >> 0) & 0xff); 588 588 ··· 591 591 zr36060_write(ptr, ZR060_AAR_HEND_LO, (reg >> 0) & 0xff); 592 592 593 593 /* subimage area */ 594 - reg = norm->VStart - 4; /* SVstart */ 594 + reg = norm->v_start - 4; /* SVstart */ 595 595 zr36060_write(ptr, ZR060_SWR_VSTART_HI, (reg >> 8) & 0xff); 596 596 zr36060_write(ptr, ZR060_SWR_VSTART_LO, (reg >> 0) & 0xff); 597 597 598 - reg += norm->Ha / 2 + 8; /* SVend */ 598 + reg += norm->ha / 2 + 8; /* SVend */ 599 599 zr36060_write(ptr, ZR060_SWR_VEND_HI, (reg >> 8) & 0xff); 600 600 zr36060_write(ptr, ZR060_SWR_VEND_LO, (reg >> 0) & 0xff); 601 601 602 - reg = norm->HStart /*+ 64 */ - 4; /* SHstart */ 602 + reg = norm->h_start /*+ 64 */ - 4; /* SHstart */ 603 603 zr36060_write(ptr, ZR060_SWR_HSTART_HI, (reg >> 8) & 0xff); 604 604 zr36060_write(ptr, ZR060_SWR_HSTART_LO, (reg >> 0) & 0xff); 605 605 606 - reg += norm->Wa + 8; /* SHend */ 606 + reg += norm->wa + 8; /* SHend */ 607 607 zr36060_write(ptr, ZR060_SWR_HEND_HI, (reg >> 8) & 0xff); 608 608 zr36060_write(ptr, ZR060_SWR_HEND_LO, (reg >> 0) & 0xff); 609 609
+33 -33
drivers/staging/media/zoran/zr36060.h
··· 124 124 125 125 /* ZR36060 LOAD register bits */ 126 126 127 - #define ZR060_LOAD_Load BIT(7) 128 - #define ZR060_LOAD_SyncRst BIT(0) 127 + #define ZR060_LOAD_LOAD BIT(7) 128 + #define ZR060_LOAD_SYNC_RST BIT(0) 129 129 130 130 /* ZR36060 Code FIFO Status register bits */ 131 131 132 - #define ZR060_CFSR_Busy BIT(7) 133 - #define ZR060_CFSR_CBusy BIT(2) 132 + #define ZR060_CFSR_BUSY BIT(7) 133 + #define ZR060_CFSR_C_BUSY BIT(2) 134 134 #define ZR060_CFSR_CFIFO (3 << 0) 135 135 136 136 /* ZR36060 Code Interface register */ 137 137 138 - #define ZR060_CIR_Code16 BIT(7) 139 - #define ZR060_CIR_Endian BIT(6) 138 + #define ZR060_CIR_CODE16 BIT(7) 139 + #define ZR060_CIR_ENDIAN BIT(6) 140 140 #define ZR060_CIR_CFIS BIT(2) 141 - #define ZR060_CIR_CodeMstr BIT(0) 141 + #define ZR060_CIR_CODE_MSTR BIT(0) 142 142 143 143 /* ZR36060 Codec Mode register */ 144 144 145 - #define ZR060_CMR_Comp BIT(7) 145 + #define ZR060_CMR_COMP BIT(7) 146 146 #define ZR060_CMR_ATP BIT(6) 147 - #define ZR060_CMR_Pass2 BIT(5) 147 + #define ZR060_CMR_PASS2 BIT(5) 148 148 #define ZR060_CMR_TLM BIT(4) 149 149 #define ZR060_CMR_BRB BIT(2) 150 150 #define ZR060_CMR_FSF BIT(1) 151 151 152 152 /* ZR36060 Markers Enable register */ 153 153 154 - #define ZR060_MER_App BIT(7) 155 - #define ZR060_MER_Com BIT(6) 154 + #define ZR060_MER_APP BIT(7) 155 + #define ZR060_MER_COM BIT(6) 156 156 #define ZR060_MER_DRI BIT(5) 157 157 #define ZR060_MER_DQT BIT(4) 158 158 #define ZR060_MER_DHT BIT(3) ··· 161 161 162 162 #define ZR060_IMR_EOAV BIT(3) 163 163 #define ZR060_IMR_EOI BIT(2) 164 - #define ZR060_IMR_End BIT(1) 165 - #define ZR060_IMR_DataErr BIT(0) 164 + #define ZR060_IMR_END BIT(1) 165 + #define ZR060_IMR_DATA_ERR BIT(0) 166 166 167 167 /* ZR36060 Interrupt Status register */ 168 168 169 - #define ZR060_ISR_ProCnt (3 << 6) 169 + #define ZR060_ISR_PRO_CNT (3 << 6) 170 170 #define ZR060_ISR_EOAV BIT(3) 171 171 #define ZR060_ISR_EOI BIT(2) 172 - #define ZR060_ISR_End BIT(1) 173 - #define ZR060_ISR_DataErr BIT(0) 172 + #define ZR060_ISR_END BIT(1) 173 + #define ZR060_ISR_DATA_ERR BIT(0) 174 174 175 175 /* ZR36060 Video Control register */ 176 176 177 - #define ZR060_VCR_Video8 BIT(7) 178 - #define ZR060_VCR_Range BIT(6) 179 - #define ZR060_VCR_FIDet BIT(3) 180 - #define ZR060_VCR_FIVedge BIT(2) 181 - #define ZR060_VCR_FIExt BIT(1) 182 - #define ZR060_VCR_SyncMstr BIT(0) 177 + #define ZR060_VCR_VIDEO8 BIT(7) 178 + #define ZR060_VCR_RANGE BIT(6) 179 + #define ZR060_VCR_FI_DET BIT(3) 180 + #define ZR060_VCR_FI_VEDGE BIT(2) 181 + #define ZR060_VCR_FI_EXT BIT(1) 182 + #define ZR060_VCR_SYNC_MSTR BIT(0) 183 183 184 184 /* ZR36060 Video Polarity register */ 185 185 186 - #define ZR060_VPR_VCLKPol BIT(7) 187 - #define ZR060_VPR_PValPol BIT(6) 188 - #define ZR060_VPR_PoePol BIT(5) 189 - #define ZR060_VPR_SImgPol BIT(4) 190 - #define ZR060_VPR_BLPol BIT(3) 191 - #define ZR060_VPR_FIPol BIT(2) 192 - #define ZR060_VPR_HSPol BIT(1) 193 - #define ZR060_VPR_VSPol BIT(0) 186 + #define ZR060_VPR_VCLK_POL BIT(7) 187 + #define ZR060_VPR_P_VAL_POL BIT(6) 188 + #define ZR060_VPR_POE_POL BIT(5) 189 + #define ZR060_VPR_S_IMG_POL BIT(4) 190 + #define ZR060_VPR_BL_POL BIT(3) 191 + #define ZR060_VPR_FI_POL BIT(2) 192 + #define ZR060_VPR_HS_POL BIT(1) 193 + #define ZR060_VPR_VS_POL BIT(0) 194 194 195 195 /* ZR36060 Scaling register */ 196 196 197 - #define ZR060_SR_VScale BIT(2) 198 - #define ZR060_SR_HScale2 BIT(0) 199 - #define ZR060_SR_HScale4 (2 << 0) 197 + #define ZR060_SR_V_SCALE BIT(2) 198 + #define ZR060_SR_H_SCALE2 BIT(0) 199 + #define ZR060_SR_H_SCALE4 (2 << 0) 200 200 201 201 #endif /*fndef ZR36060_H */