Back to home page

OSCL-LXR

 
 

    


0001 .. SPDX-License-Identifier: GPL-2.0
0002 
0003 The cx88 driver
0004 ===============
0005 
0006 Author:  Gerd Hoffmann
0007 
0008 Documentation missing at the cx88 datasheet
0009 -------------------------------------------
0010 
0011 MO_OUTPUT_FORMAT (0x310164)
0012 
0013 .. code-block:: none
0014 
0015   Previous default from DScaler: 0x1c1f0008
0016   Digit 8: 31-28
0017   28: PREVREMOD = 1
0018 
0019   Digit 7: 27-24 (0xc = 12 = b1100 )
0020   27: COMBALT = 1
0021   26: PAL_INV_PHASE
0022     (DScaler apparently set this to 1, resulted in sucky picture)
0023 
0024   Digits 6,5: 23-16
0025   25-16: COMB_RANGE = 0x1f [default] (9 bits -> max 512)
0026 
0027   Digit 4: 15-12
0028   15: DISIFX = 0
0029   14: INVCBF = 0
0030   13: DISADAPT = 0
0031   12: NARROWADAPT = 0
0032 
0033   Digit 3: 11-8
0034   11: FORCE2H
0035   10: FORCEREMD
0036   9: NCHROMAEN
0037   8: NREMODEN
0038 
0039   Digit 2: 7-4
0040   7-6: YCORE
0041   5-4: CCORE
0042 
0043   Digit 1: 3-0
0044   3: RANGE = 1
0045   2: HACTEXT
0046   1: HSFMT
0047 
0048 0x47 is the sync byte for MPEG-2 transport stream packets.
0049 Datasheet incorrectly states to use 47 decimal. 188 is the length.
0050 All DVB compliant frontends output packets with this start code.
0051 
0052 Hauppauge WinTV cx88 IR information
0053 -----------------------------------
0054 
0055 The controls for the mux are GPIO [0,1] for source, and GPIO 2 for muting.
0056 
0057 ====== ======== =================================================
0058 GPIO0  GPIO1
0059 ====== ======== =================================================
0060   0        0    TV Audio
0061   1        0    FM radio
0062   0        1    Line-In
0063   1        1    Mono tuner bypass or CD passthru (tuner specific)
0064 ====== ======== =================================================
0065 
0066 GPIO 16(I believe) is tied to the IR port (if present).
0067 
0068 
0069 From the data sheet:
0070 
0071 - Register 24'h20004  PCI Interrupt Status
0072 
0073  - bit [18]  IR_SMP_INT Set when 32 input samples have been collected over
0074  - gpio[16] pin into GP_SAMPLE register.
0075 
0076 What's missing from the data sheet:
0077 
0078 - Setup 4KHz sampling rate (roughly 2x oversampled; good enough for our RC5
0079   compat remote)
0080 - set register 0x35C050 to  0xa80a80
0081 - enable sampling
0082 - set register 0x35C054 to 0x5
0083 - enable the IRQ bit 18 in the interrupt mask register (and
0084   provide for a handler)
0085 
0086 GP_SAMPLE register is at 0x35C058
0087 
0088 Bits are then right shifted into the GP_SAMPLE register at the specified
0089 rate; you get an interrupt when a full DWORD is received.
0090 You need to recover the actual RC5 bits out of the (oversampled) IR sensor
0091 bits. (Hint: look for the 0/1and 1/0 crossings of the RC5 bi-phase data)  An
0092 actual raw RC5 code will span 2-3 DWORDS, depending on the actual alignment.
0093 
0094 I'm pretty sure when no IR signal is present the receiver is always in a
0095 marking state(1); but stray light, etc can cause intermittent noise values
0096 as well.  Remember, this is a free running sample of the IR receiver state
0097 over time, so don't assume any sample starts at any particular place.
0098 
0099 Additional info
0100 ~~~~~~~~~~~~~~~
0101 
0102 This data sheet (google search) seems to have a lovely description of the
0103 RC5 basics:
0104 http://www.atmel.com/dyn/resources/prod_documents/doc2817.pdf
0105 
0106 This document has more data:
0107 http://www.nenya.be/beor/electronics/rc5.htm
0108 
0109 This document has a  how to decode a bi-phase data stream:
0110 http://www.ee.washington.edu/circuit_archive/text/ir_decode.txt
0111 
0112 This document has still more info:
0113 http://www.xs4all.nl/~sbp/knowledge/ir/rc5.htm