cx25821-cards.c 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. * Driver for the Conexant CX25821 PCIe bridge
  3. *
  4. * Copyright (C) 2009 Conexant Systems Inc.
  5. * Authors <shu.lin@conexant.com>, <hiep.huynh@conexant.com>
  6. * Based on Steven Toth <stoth@linuxtv.org> cx23885 driver
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. *
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  22. */
  23. #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
  24. #include <linux/init.h>
  25. #include <linux/module.h>
  26. #include <linux/pci.h>
  27. #include <linux/delay.h>
  28. #include <media/cx25840.h>
  29. #include "cx25821.h"
  30. #include "tuner-xc2028.h"
  31. /* board config info */
  32. struct cx25821_board cx25821_boards[] = {
  33. [UNKNOWN_BOARD] = {
  34. .name = "UNKNOWN/GENERIC",
  35. /* Ensure safe default for unknown boards */
  36. .clk_freq = 0,
  37. },
  38. [CX25821_BOARD] = {
  39. .name = "CX25821",
  40. .portb = CX25821_RAW,
  41. .portc = CX25821_264,
  42. .input[0].type = CX25821_VMUX_COMPOSITE,
  43. },
  44. };
  45. const unsigned int cx25821_bcount = ARRAY_SIZE(cx25821_boards);
  46. struct cx25821_subid cx25821_subids[] = {
  47. {
  48. .subvendor = 0x14f1,
  49. .subdevice = 0x0920,
  50. .card = CX25821_BOARD,
  51. },
  52. };
  53. void cx25821_card_setup(struct cx25821_dev *dev)
  54. {
  55. static u8 eeprom[256];
  56. if (dev->i2c_bus[0].i2c_rc == 0) {
  57. dev->i2c_bus[0].i2c_client.addr = 0xa0 >> 1;
  58. tveeprom_read(&dev->i2c_bus[0].i2c_client, eeprom,
  59. sizeof(eeprom));
  60. }
  61. }