brintos

brintos / linux-shallow public Read only

0
0
Text · 3.1 KiB · cfe7c03 Raw
114 lines · plain
1.. SPDX-License-Identifier: GPL-2.02 3The cx88 driver4===============5 6Author:  Gerd Hoffmann7 8Documentation missing at the cx88 datasheet9-------------------------------------------10 11MO_OUTPUT_FORMAT (0x310164)12 13.. code-block:: none14 15  Previous default from DScaler: 0x1c1f000816  Digit 8: 31-2817  28: PREVREMOD = 118 19  Digit 7: 27-24 (0xc = 12 = b1100 )20  27: COMBALT = 121  26: PAL_INV_PHASE22    (DScaler apparently set this to 1, resulted in sucky picture)23 24  Digits 6,5: 23-1625  25-16: COMB_RANGE = 0x1f [default] (9 bits -> max 512)26 27  Digit 4: 15-1228  15: DISIFX = 029  14: INVCBF = 030  13: DISADAPT = 031  12: NARROWADAPT = 032 33  Digit 3: 11-834  11: FORCE2H35  10: FORCEREMD36  9: NCHROMAEN37  8: NREMODEN38 39  Digit 2: 7-440  7-6: YCORE41  5-4: CCORE42 43  Digit 1: 3-044  3: RANGE = 145  2: HACTEXT46  1: HSFMT47 480x47 is the sync byte for MPEG-2 transport stream packets.49Datasheet incorrectly states to use 47 decimal. 188 is the length.50All DVB compliant frontends output packets with this start code.51 52Hauppauge WinTV cx88 IR information53-----------------------------------54 55The controls for the mux are GPIO [0,1] for source, and GPIO 2 for muting.56 57====== ======== =================================================58GPIO0  GPIO159====== ======== =================================================60  0        0    TV Audio61  1        0    FM radio62  0        1    Line-In63  1        1    Mono tuner bypass or CD passthru (tuner specific)64====== ======== =================================================65 66GPIO 16(I believe) is tied to the IR port (if present).67 68 69From the data sheet:70 71- Register 24'h20004  PCI Interrupt Status72 73 - bit [18]  IR_SMP_INT Set when 32 input samples have been collected over74 - gpio[16] pin into GP_SAMPLE register.75 76What's missing from the data sheet:77 78- Setup 4KHz sampling rate (roughly 2x oversampled; good enough for our RC579  compat remote)80- set register 0x35C050 to  0xa80a8081- enable sampling82- set register 0x35C054 to 0x583- enable the IRQ bit 18 in the interrupt mask register (and84  provide for a handler)85 86GP_SAMPLE register is at 0x35C05887 88Bits are then right shifted into the GP_SAMPLE register at the specified89rate; you get an interrupt when a full DWORD is received.90You need to recover the actual RC5 bits out of the (oversampled) IR sensor91bits. (Hint: look for the 0/1and 1/0 crossings of the RC5 bi-phase data)  An92actual raw RC5 code will span 2-3 DWORDS, depending on the actual alignment.93 94I'm pretty sure when no IR signal is present the receiver is always in a95marking state(1); but stray light, etc can cause intermittent noise values96as well.  Remember, this is a free running sample of the IR receiver state97over time, so don't assume any sample starts at any particular place.98 99Additional info100~~~~~~~~~~~~~~~101 102This data sheet (google search) seems to have a lovely description of the103RC5 basics:104http://www.atmel.com/dyn/resources/prod_documents/doc2817.pdf105 106This document has more data:107http://www.nenya.be/beor/electronics/rc5.htm108 109This document has a  how to decode a bi-phase data stream:110http://www.ee.washington.edu/circuit_archive/text/ir_decode.txt111 112This document has still more info:113http://www.xs4all.nl/~sbp/knowledge/ir/rc5.htm114