Lines Matching refs:reg
711 u32 reg; in zr36057_adjust_vfe() local
715 reg = btread(ZR36057_VFEHCR); in zr36057_adjust_vfe()
716 if (reg & (1 << 10)) { in zr36057_adjust_vfe()
717 reg += ((1 << 10) | 1); in zr36057_adjust_vfe()
719 btwrite(reg, ZR36057_VFEHCR); in zr36057_adjust_vfe()
728 reg = btread(ZR36057_VFEHCR); in zr36057_adjust_vfe()
729 if (!(reg & (1 << 10))) { in zr36057_adjust_vfe()
730 reg -= ((1 << 10) | 1); in zr36057_adjust_vfe()
732 btwrite(reg, ZR36057_VFEHCR); in zr36057_adjust_vfe()
750 u32 reg; in zr36057_set_vfe() local
797 reg = ((HStart & ZR36057_VFEHCR_Hmask) << ZR36057_VFEHCR_HStart) in zr36057_set_vfe()
800 reg |= ZR36057_VFEHCR_HSPol; in zr36057_set_vfe()
801 btwrite(reg, ZR36057_VFEHCR); in zr36057_set_vfe()
815 reg = ((VStart & ZR36057_VFEVCR_Vmask) << ZR36057_VFEVCR_VStart) in zr36057_set_vfe()
817 reg |= ZR36057_VFEVCR_VSPol; in zr36057_set_vfe()
818 btwrite(reg, ZR36057_VFEVCR); in zr36057_set_vfe()
821 reg = 0; in zr36057_set_vfe()
822 reg |= (HorDcm << ZR36057_VFESPFR_HorDcm); in zr36057_set_vfe()
823 reg |= (VerDcm << ZR36057_VFESPFR_VerDcm); in zr36057_set_vfe()
824 reg |= (DispMode << ZR36057_VFESPFR_DispMode); in zr36057_set_vfe()
825 reg |= ZR36057_VFESPFR_LittleEndian; in zr36057_set_vfe()
832 reg |= ZR36057_VFESPFR_ExtFl; // NEEDED!!!!!!! Wolfgang in zr36057_set_vfe()
833 reg |= ZR36057_VFESPFR_TopField; in zr36057_set_vfe()
837 reg |= ZR36057_VFESPFR_YUV422; in zr36057_set_vfe()
841 reg |= ZR36057_VFESPFR_RGB555 | ZR36057_VFESPFR_ErrDif; in zr36057_set_vfe()
845 reg |= ZR36057_VFESPFR_RGB565 | ZR36057_VFESPFR_ErrDif; in zr36057_set_vfe()
849 reg |= ZR36057_VFESPFR_RGB888 | ZR36057_VFESPFR_Pack24; in zr36057_set_vfe()
853 reg |= ZR36057_VFESPFR_RGB888; in zr36057_set_vfe()
863 reg |= 3 << ZR36057_VFESPFR_HFilter; /* 5 tap filter */ in zr36057_set_vfe()
865 reg |= 2 << ZR36057_VFESPFR_HFilter; /* 4 tap filter */ in zr36057_set_vfe()
867 reg |= 1 << ZR36057_VFESPFR_HFilter; /* 3 tap filter */ in zr36057_set_vfe()
869 btwrite(reg, ZR36057_VFESPFR); in zr36057_set_vfe()
873 reg = (16 << ZR36057_VDCR_MinPix) in zr36057_set_vfe()
877 reg &= ~ZR36057_VDCR_Triton; in zr36057_set_vfe()
879 reg |= ZR36057_VDCR_Triton; in zr36057_set_vfe()
880 btwrite(reg, ZR36057_VDCR); in zr36057_set_vfe()
887 reg = virt_to_bus(zr->overlay_mask); in zr36057_set_vfe()
888 btwrite(reg, ZR36057_MMTR); in zr36057_set_vfe()
889 reg = virt_to_bus(zr->overlay_mask + mask_line_size); in zr36057_set_vfe()
890 btwrite(reg, ZR36057_MMBR); in zr36057_set_vfe()
891 reg = mask_line_size - (zr->window.width + 31) / 32; in zr36057_set_vfe()
893 reg += mask_line_size; in zr36057_set_vfe()
894 reg <<= ZR36057_OCR_MaskStride; in zr36057_set_vfe()
895 btwrite(reg, ZR36057_OCR); in zr36057_set_vfe()
908 u32 reg; in zr36057_overlay() local
946 reg = in zr36057_overlay()
949 btwrite(reg, ZR36057_VDTR); in zr36057_overlay()
950 if (reg & 3) in zr36057_overlay()
955 reg += zr->buffer.bytesperline; in zr36057_overlay()
956 btwrite(reg, ZR36057_VDBR); in zr36057_overlay()
960 reg = zr->buffer.bytesperline - zr->window.width * bpp; in zr36057_overlay()
962 reg += zr->buffer.bytesperline; in zr36057_overlay()
963 if (reg & 3) in zr36057_overlay()
967 reg = (reg << ZR36057_VSSFGR_DispStride); in zr36057_overlay()
968 reg |= ZR36057_VSSFGR_VidOvf; /* clear overflow status */ in zr36057_overlay()
969 btwrite(reg, ZR36057_VSSFGR); in zr36057_overlay()
997 u32 reg; in write_overlay_mask() local
1001 reg = 0; in write_overlay_mask()
1300 unsigned reg, unsigned value) in post_office_write() argument
1306 ((reg & 7) << 16) | (value & 0xFF); in post_office_write()
1311 static int post_office_read(struct zoran *zr, unsigned guest, unsigned reg) in post_office_read() argument
1315 por = ZR36057_POR_POTime | ((guest & 7) << 20) | ((reg & 7) << 16); in post_office_read()
1323 static int zr36060_write_8(struct zoran *zr, unsigned reg, unsigned val) in zr36060_write_8() argument
1326 || post_office_write(zr, 0, 1, reg >> 8) in zr36060_write_8()
1327 || post_office_write(zr, 0, 2, reg)) { in zr36060_write_8()
1333 static int zr36060_write_16(struct zoran *zr, unsigned reg, unsigned val) in zr36060_write_16() argument
1335 if (zr36060_write_8(zr, reg + 0, val >> 8)) { in zr36060_write_16()
1338 return zr36060_write_8(zr, reg + 1, val >> 0); in zr36060_write_16()
1341 static int zr36060_write_24(struct zoran *zr, unsigned reg, unsigned val) in zr36060_write_24() argument
1343 if (zr36060_write_8(zr, reg + 0, val >> 16)) { in zr36060_write_24()
1346 return zr36060_write_16(zr, reg + 1, val >> 0); in zr36060_write_24()
1349 static int zr36060_write_32(struct zoran *zr, unsigned reg, unsigned val) in zr36060_write_32() argument
1351 if (zr36060_write_16(zr, reg + 0, val >> 16)) { in zr36060_write_32()
1354 return zr36060_write_16(zr, reg + 2, val >> 0); in zr36060_write_32()
1357 static u32 zr36060_read_8(struct zoran *zr, unsigned reg) in zr36060_read_8() argument
1360 || post_office_write(zr, 0, 1, reg >> 8) in zr36060_read_8()
1361 || post_office_write(zr, 0, 2, reg)) { in zr36060_read_8()
1371 u32 reg; in GPIO() local
1375 reg = btread(ZR36057_GPPGCR1) & ~mask; in GPIO()
1377 reg |= mask; in GPIO()
1379 btwrite(reg, ZR36057_GPPGCR1); in GPIO()
1477 u32 reg; in zr36060_set_jpg() local
1480 reg = (1 << 0) /* CodeMstr */ in zr36060_set_jpg()
1484 zr36060_write_8(zr, 0x002, reg); in zr36060_set_jpg()
1490 reg = 0x00; /* Codec mode = decompression */ in zr36060_set_jpg()
1496 reg = 0xa4; /* Codec mode = compression with variable scale factor */ in zr36060_set_jpg()
1500 zr36060_write_8(zr, 0x003, reg); in zr36060_set_jpg()
1502 reg = 0x00; /* reserved, mbz */ in zr36060_set_jpg()
1503 zr36060_write_8(zr, 0x004, reg); in zr36060_set_jpg()
1526 reg = size * 4 / blocks; in zr36060_set_jpg()
1527 if (reg > 0xf0) in zr36060_set_jpg()
1528 reg = 0xf0; /* 480 bits/block, does 0xff represents unlimited? */ in zr36060_set_jpg()
1529 zr36060_write_8(zr, 0x005, reg); in zr36060_set_jpg()
1532 reg = (zr->params.jpeg_markers) & 0x38; /* DRI, DQT, DHT */ in zr36060_set_jpg()
1534 reg |= JPEG_MARKER_COM; in zr36060_set_jpg()
1536 reg |= JPEG_MARKER_APP; in zr36060_set_jpg()
1537 zr36060_write_8(zr, 0x006, reg); in zr36060_set_jpg()
1540 reg = (0 << 3) /* EOAV=0 */ in zr36060_set_jpg()
1545 reg = (0 << 3) /* EOAV=0 */ in zr36060_set_jpg()
1550 zr36060_write_8(zr, 0x007, reg); in zr36060_set_jpg()
1552 reg = size; in zr36060_set_jpg()
1553 zr36060_write_32(zr, 0x009, reg); in zr36060_set_jpg()
1555 reg = (size * 10) / 11; in zr36060_set_jpg()
1556 …zr36060_write_32(zr, 0x00d, reg); // Not needed for compr. with variable scale factor, just in cas… in zr36060_set_jpg()
1559 reg = 0x0100; /* SF=1.0 */ in zr36060_set_jpg()
1560 zr36060_write_16(zr, 0x011, reg); in zr36060_set_jpg()
1562 reg = 0x00ffffff; /* AF=max */ in zr36060_set_jpg()
1563 zr36060_write_24(zr, 0x013, reg); in zr36060_set_jpg()
1565 reg = 0x0000; /* test */ in zr36060_set_jpg()
1566 zr36060_write_16(zr, 0x024, reg); in zr36060_set_jpg()
1574 u32 reg; in zr36060_set_video() local
1579 reg = (0 << 7) /* Video8 */ in zr36060_set_video()
1588 reg |= (1 << 6); /* Range=1 */ in zr36060_set_video()
1590 zr36060_write_8(zr, 0x030, reg); in zr36060_set_video()
1595 reg = (0 << 7) /* VCLKPol */ in zr36060_set_video()
1605 reg = (0 << 7) /* VCLKPol=0 */ in zr36060_set_video()
1616 reg = (0 << 7) /* VCLKPol=0 */ in zr36060_set_video()
1626 zr36060_write_8(zr, 0x031, reg); in zr36060_set_video()
1631 reg = (0 << 0); in zr36060_set_video()
1635 reg = (1 << 0); in zr36060_set_video()
1639 reg = (2 << 0); in zr36060_set_video()
1643 reg |= (1 << 2); in zr36060_set_video()
1644 zr36060_write_8(zr, 0x032, reg); in zr36060_set_video()
1646 reg = 0x00; /* BackY */ in zr36060_set_video()
1647 zr36060_write_8(zr, 0x033, reg); in zr36060_set_video()
1649 reg = 0x80; /* BackU */ in zr36060_set_video()
1650 zr36060_write_8(zr, 0x034, reg); in zr36060_set_video()
1652 reg = 0x80; /* BackV */ in zr36060_set_video()
1653 zr36060_write_8(zr, 0x035, reg); in zr36060_set_video()
1657 reg = tvn->Ht - 1; /* Vtotal */ in zr36060_set_video()
1658 zr36060_write_16(zr, 0x036, reg); in zr36060_set_video()
1660 reg = tvn->Wt - 1; /* Htotal */ in zr36060_set_video()
1661 zr36060_write_16(zr, 0x038, reg); in zr36060_set_video()
1663 reg = 6 - 1; /* VsyncSize */ in zr36060_set_video()
1664 zr36060_write_8(zr, 0x03a, reg); in zr36060_set_video()
1667 reg = (zr->params.norm == 1 ? 57 : 68); in zr36060_set_video()
1668 zr36060_write_8(zr, 0x03b, reg); in zr36060_set_video()
1670 reg = tvn->VStart - 1; /* BVstart */ in zr36060_set_video()
1671 zr36060_write_8(zr, 0x03c, reg); in zr36060_set_video()
1673 reg += tvn->Ha / 2; /* BVend */ in zr36060_set_video()
1674 zr36060_write_16(zr, 0x03e, reg); in zr36060_set_video()
1676 reg = tvn->HStart + 64 - 1; /* BHstart */ in zr36060_set_video()
1677 zr36060_write_8(zr, 0x03d, reg); in zr36060_set_video()
1679 reg += tvn->Wa; /* BHend */ in zr36060_set_video()
1680 zr36060_write_16(zr, 0x040, reg); in zr36060_set_video()
1683 reg = zr->params.img_y + tvn->VStart; /* Vstart */ in zr36060_set_video()
1684 zr36060_write_16(zr, 0x042, reg); in zr36060_set_video()
1686 reg += zr->params.img_height; /* Vend */ in zr36060_set_video()
1687 zr36060_write_16(zr, 0x044, reg); in zr36060_set_video()
1695 reg = zr->params.img_x + HStart; /* Hstart */ in zr36060_set_video()
1696 zr36060_write_16(zr, 0x046, reg); in zr36060_set_video()
1698 reg += zr->params.img_width; /* Hend */ in zr36060_set_video()
1699 zr36060_write_16(zr, 0x048, reg); in zr36060_set_video()
1702 reg = tvn->VStart - 4; /* SVstart */ in zr36060_set_video()
1703 zr36060_write_16(zr, 0x04a, reg); in zr36060_set_video()
1705 reg += tvn->Ha / 2 + 8; /* SVend */ in zr36060_set_video()
1706 zr36060_write_16(zr, 0x04c, reg); in zr36060_set_video()
1708 reg = tvn->HStart + 64 - 4; /* SHstart */ in zr36060_set_video()
1709 zr36060_write_16(zr, 0x04e, reg); in zr36060_set_video()
1711 reg += tvn->Wa + 8; /* SHend */ in zr36060_set_video()
1712 zr36060_write_16(zr, 0x050, reg); in zr36060_set_video()
1717 u32 reg; in zr36060_set_jpg_SOF() local
1720 reg = 0xffc0; /* SOF marker */ in zr36060_set_jpg_SOF()
1721 zr36060_write_16(zr, 0x060, reg); in zr36060_set_jpg_SOF()
1723 reg = 17; /* SOF length */ in zr36060_set_jpg_SOF()
1724 zr36060_write_16(zr, 0x062, reg); in zr36060_set_jpg_SOF()
1726 reg = 8; /* precision 8 bits */ in zr36060_set_jpg_SOF()
1727 zr36060_write_8(zr, 0x064, reg); in zr36060_set_jpg_SOF()
1729 reg = zr->params.img_height / zr->params.VerDcm; /* image height */ in zr36060_set_jpg_SOF()
1730 zr36060_write_16(zr, 0x065, reg); in zr36060_set_jpg_SOF()
1732 reg = zr->params.img_width / zr->params.HorDcm; /* image width */ in zr36060_set_jpg_SOF()
1733 zr36060_write_16(zr, 0x067, reg); in zr36060_set_jpg_SOF()
1735 reg = 3; /* 3 color components */ in zr36060_set_jpg_SOF()
1736 zr36060_write_8(zr, 0x069, reg); in zr36060_set_jpg_SOF()
1738 reg = 0x002100; /* Y component */ in zr36060_set_jpg_SOF()
1739 zr36060_write_24(zr, 0x06a, reg); in zr36060_set_jpg_SOF()
1741 reg = 0x011101; /* U component */ in zr36060_set_jpg_SOF()
1742 zr36060_write_24(zr, 0x06d, reg); in zr36060_set_jpg_SOF()
1744 reg = 0x021101; /* V component */ in zr36060_set_jpg_SOF()
1745 zr36060_write_24(zr, 0x070, reg); in zr36060_set_jpg_SOF()
1750 u32 reg; in zr36060_set_jpg_SOS() local
1753 reg = 0xffda; /* SOS marker */ in zr36060_set_jpg_SOS()
1754 zr36060_write_16(zr, 0x07a, reg); in zr36060_set_jpg_SOS()
1756 reg = 12; /* SOS length */ in zr36060_set_jpg_SOS()
1757 zr36060_write_16(zr, 0x07c, reg); in zr36060_set_jpg_SOS()
1759 reg = 3; /* 3 color components */ in zr36060_set_jpg_SOS()
1760 zr36060_write_8(zr, 0x07e, reg); in zr36060_set_jpg_SOS()
1762 reg = 0x0000; /* Y component */ in zr36060_set_jpg_SOS()
1763 zr36060_write_16(zr, 0x07f, reg); in zr36060_set_jpg_SOS()
1765 reg = 0x0111; /* U component */ in zr36060_set_jpg_SOS()
1766 zr36060_write_16(zr, 0x081, reg); in zr36060_set_jpg_SOS()
1768 reg = 0x0211; /* V component */ in zr36060_set_jpg_SOS()
1769 zr36060_write_16(zr, 0x083, reg); in zr36060_set_jpg_SOS()
1771 reg = 0x003f00; /* Start, end spectral scans */ in zr36060_set_jpg_SOS()
1772 zr36060_write_24(zr, 0x085, reg); in zr36060_set_jpg_SOS()
1777 u32 reg; in zr36060_set_jpg_DRI() local
1780 reg = 0xffdd; /* DRI marker */ in zr36060_set_jpg_DRI()
1781 zr36060_write_16(zr, 0x0c0, reg); in zr36060_set_jpg_DRI()
1783 reg = 4; /* DRI length */ in zr36060_set_jpg_DRI()
1784 zr36060_write_16(zr, 0x0c2, reg); in zr36060_set_jpg_DRI()
1786 reg = 8; /* length in MCUs */ in zr36060_set_jpg_DRI()
1787 zr36060_write_16(zr, 0x0c4, reg); in zr36060_set_jpg_DRI()
1914 u32 reg; in zr36060_set_jpg_APP() local
1929 reg = 0xffe0 + i; /* APPn marker */ in zr36060_set_jpg_APP()
1930 zr36060_write_16(zr, 0x380, reg); in zr36060_set_jpg_APP()
1932 reg = len + 2; /* APPn len */ in zr36060_set_jpg_APP()
1933 zr36060_write_16(zr, 0x382, reg); in zr36060_set_jpg_APP()
1947 u32 reg; in zr36060_set_jpg_COM() local
1956 reg = 0xfffe; /* COM marker */ in zr36060_set_jpg_COM()
1957 zr36060_write_16(zr, 0x3c0, reg); in zr36060_set_jpg_COM()
1959 reg = len + 2; /* COM len */ in zr36060_set_jpg_COM()
1960 zr36060_write_16(zr, 0x3c2, reg); in zr36060_set_jpg_COM()
1973 u32 reg; in zr36060_set_cap() local
1978 reg = (0 << 7) /* Load=0 */ in zr36060_set_cap()
1980 zr36060_write_8(zr, 0x000, reg); in zr36060_set_cap()
1992 reg = (1 << 7) /* Load=1 */ in zr36060_set_cap()
1994 zr36060_write_8(zr, 0x000, reg); in zr36060_set_cap()
1998 reg = zr36060_read_8(zr, 0x001); in zr36060_set_cap()
1999 if ((reg & (1 << 7)) == 0) { in zr36060_set_cap()
2005 reg); in zr36060_set_cap()
2033 u32 reg; in zr36057_set_jpg() local
2045 reg = ZR36057_JMC_MJPGCmpMode; in zr36057_set_jpg()
2049 reg = ZR36057_JMC_MJPGExpMode; in zr36057_set_jpg()
2050 reg |= ZR36057_JMC_SyncMstr; in zr36057_set_jpg()
2056 reg = ZR36057_JMC_JPGCmpMode; in zr36057_set_jpg()
2060 reg = ZR36057_JMC_JPGExpMode; in zr36057_set_jpg()
2064 reg |= ZR36057_JMC_JPG; in zr36057_set_jpg()
2066 reg |= ZR36057_JMC_Fld_per_buff; in zr36057_set_jpg()
2067 btwrite(reg, ZR36057_JMC); in zr36057_set_jpg()
2071 reg = in zr36057_set_jpg()
2073 btwrite(reg, ZR36057_VSP); in zr36057_set_jpg()
2074 reg = ((zr->params.img_y + tvn->VStart) << ZR36057_FVAP_NAY) in zr36057_set_jpg()
2076 btwrite(reg, ZR36057_FVAP); in zr36057_set_jpg()
2080 reg = in zr36057_set_jpg()
2084 btwrite(reg, ZR36057_HSP); in zr36057_set_jpg()
2085 reg = ((zr->params.img_x + tvn->HStart + 4) << ZR36057_FHAP_NAX) in zr36057_set_jpg()
2087 btwrite(reg, ZR36057_FHAP); in zr36057_set_jpg()
2091 reg = ZR36057_FPP_Odd_Even; in zr36057_set_jpg()
2093 reg = 0; in zr36057_set_jpg()
2096 reg ^= ZR36057_FPP_Odd_Even; in zr36057_set_jpg()
2098 btwrite(reg, ZR36057_FPP); in zr36057_set_jpg()
2104 reg = virt_to_bus(zr->stat_com); in zr36057_set_jpg()
2105 btwrite(reg, ZR36057_JCBA); in zr36057_set_jpg()
2113 reg = 140; in zr36057_set_jpg()
2118 reg = 20; in zr36057_set_jpg()
2122 reg = 80; in zr36057_set_jpg()
2126 btwrite(reg, ZR36057_JCFT); in zr36057_set_jpg()
2291 int reg; in jpeg_start() local
2303 reg = in jpeg_start()
2306 btwrite(reg, ZR36057_JCGI); in jpeg_start()
2874 u32 reg; in zoran_irq() local
2882 reg = in zoran_irq()
2885 btwrite(reg, ZR36057_VDTR); in zoran_irq()
2887 reg += zr->gbpl; in zoran_irq()
2888 btwrite(reg, ZR36057_VDBR); in zoran_irq()
2892 reg = 0; in zoran_irq()
2894 reg += zr->gbpl; in zoran_irq()
2895 reg = in zoran_irq()
2896 (reg << in zoran_irq()
2898 reg |= ZR36057_VSSFGR_VidOvf; in zoran_irq()
2899 reg |= ZR36057_VSSFGR_SnapShot; in zoran_irq()
2900 reg |= ZR36057_VSSFGR_FrameGrab; in zoran_irq()
2901 btwrite(reg, ZR36057_VSSFGR); in zoran_irq()
4421 u32 reg; in zr36057_init_vfe() local
4422 reg = btread(ZR36057_VFESPFR); in zr36057_init_vfe()
4423 reg |= ZR36057_VFESPFR_LittleEndian; in zr36057_init_vfe()
4424 reg &= ~ZR36057_VFESPFR_VCLKPol; in zr36057_init_vfe()
4425 reg |= ZR36057_VFESPFR_ExtFl; in zr36057_init_vfe()
4426 reg |= ZR36057_VFESPFR_TopField; in zr36057_init_vfe()
4427 btwrite(reg, ZR36057_VFESPFR); in zr36057_init_vfe()
4428 reg = btread(ZR36057_VDCR); in zr36057_init_vfe()
4430 reg &= ~ZR36057_VDCR_Triton; in zr36057_init_vfe()
4432 reg |= ZR36057_VDCR_Triton; in zr36057_init_vfe()
4433 btwrite(reg, ZR36057_VDCR); in zr36057_init_vfe()