vp7045.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /* Common header-file of the Linux driver for the TwinhanDTV Alpha/MagicBoxII
  3. * USB2.0 DVB-T receiver.
  4. *
  5. * Copyright (C) 2004-5 Patrick Boettcher ([email protected])
  6. *
  7. * Thanks to Twinhan who kindly provided hardware and information.
  8. *
  9. * see Documentation/driver-api/media/drivers/dvb-usb.rst for more information
  10. */
  11. #ifndef _DVB_USB_VP7045_H_
  12. #define _DVB_USB_VP7045_H_
  13. #define DVB_USB_LOG_PREFIX "vp7045"
  14. #include "dvb-usb.h"
  15. /* vp7045 commands */
  16. /* Twinhan Vendor requests */
  17. #define TH_COMMAND_IN 0xC0
  18. #define TH_COMMAND_OUT 0xC1
  19. /* command bytes */
  20. #define TUNER_REG_READ 0x03
  21. #define TUNER_REG_WRITE 0x04
  22. #define RC_VAL_READ 0x05
  23. #define RC_NO_KEY 0x44
  24. #define SET_TUNER_POWER 0x06
  25. #define CHECK_TUNER_POWER 0x12
  26. #define Tuner_Power_ON 1
  27. #define Tuner_Power_OFF 0
  28. #define GET_USB_SPEED 0x07
  29. #define LOCK_TUNER_COMMAND 0x09
  30. #define TUNER_SIGNAL_READ 0x0A
  31. /* FX2 eeprom */
  32. #define SET_EE_VALUE 0x10
  33. #define GET_EE_VALUE 0x11
  34. #define FX2_ID_ADDR 0x00
  35. #define VID_MSB_ADDR 0x02
  36. #define VID_LSB_ADDR 0x01
  37. #define PID_MSB_ADDR 0x04
  38. #define PID_LSB_ADDR 0x03
  39. #define MAC_0_ADDR 0x07
  40. #define MAC_1_ADDR 0x08
  41. #define MAC_2_ADDR 0x09
  42. #define MAC_3_ADDR 0x0a
  43. #define MAC_4_ADDR 0x0b
  44. #define MAC_5_ADDR 0x0c
  45. #define RESET_FX2 0x13
  46. #define FW_VERSION_READ 0x0B
  47. #define VENDOR_STRING_READ 0x0C
  48. #define PRODUCT_STRING_READ 0x0D
  49. #define FW_BCD_VERSION_READ 0x14
  50. extern struct dvb_frontend * vp7045_fe_attach(struct dvb_usb_device *d);
  51. extern int vp7045_usb_op(struct dvb_usb_device *d, u8 cmd, u8 *out, int outlen, u8 *in, int inlen,int msec);
  52. extern u8 vp7045_read_reg(struct dvb_usb_device *d, u8 reg);
  53. #endif