^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) #ifndef _DVB_USB_DIGITV_H_
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) #define _DVB_USB_DIGITV_H_
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) #define DVB_USB_LOG_PREFIX "digitv"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) #include "dvb-usb.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) struct digitv_state {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) int is_nxt6000;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) unsigned char sndbuf[7];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) unsigned char rcvbuf[7];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) /* protocol (from usblogging and the SDK:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) * Always 7 bytes bulk message(s) for controlling
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) * First byte describes the command. Reads are 2 consecutive transfer (as always).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) * General structure:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) * write or first message of a read:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) * <cmdbyte> VV <len> B0 B1 B2 B3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) * second message of a read
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) * <cmdbyte> VV <len> R0 R1 R2 R3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) * whereas 0 < len <= 4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) * I2C address is stored somewhere inside the device.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) * 0x01 read from EEPROM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) * VV = offset; B* = 0; R* = value(s)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) * 0x02 read register of the COFDM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) * VV = register; B* = 0; R* = value(s)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) * 0x05 write register of the COFDM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) * VV = register; B* = value(s);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) * 0x06 write to the tuner (only for NXT6000)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) * VV = 0; B* = PLL data; len = 4;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) * 0x03 read remote control
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) * VV = 0; B* = 0; len = 4; R* = key
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) * 0x07 write to the remote (don't know why one should this, resetting ?)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) * VV = 0; B* = key; len = 4;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) * 0x08 write remote type
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) * VV = 0; B[0] = 0x01, len = 4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) * 0x09 write device init
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) * TODO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) #define USB_READ_EEPROM 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) #define USB_READ_COFDM 2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) #define USB_WRITE_COFDM 5
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) #define USB_WRITE_TUNER 6
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) #define USB_READ_REMOTE 3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) #define USB_WRITE_REMOTE 7
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) #define USB_WRITE_REMOTE_TYPE 8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) #define USB_DEV_INIT 9
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) #endif