cx25840.h 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /* cx25840 API header
  2. *
  3. * Copyright (C) 2003-2004 Chris Kennedy
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License
  7. * as published by the Free Software Foundation; either version 2
  8. * of the License, or (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, write to the Free Software
  17. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  18. */
  19. #ifndef _CX25840_H_
  20. #define _CX25840_H_
  21. #include <linux/videodev2.h>
  22. #include <linux/i2c.h>
  23. extern int cx25840_debug;
  24. #define cx25840_dbg(fmt, arg...) do { if (cx25840_debug) \
  25. printk(KERN_INFO "%s debug %d-%04x: " fmt, client->driver->name, \
  26. i2c_adapter_id(client->adapter), client->addr , ## arg); } while (0)
  27. #define cx25840_err(fmt, arg...) do { \
  28. printk(KERN_ERR "%s %d-%04x: " fmt, client->driver->name, \
  29. i2c_adapter_id(client->adapter), client->addr , ## arg); } while (0)
  30. #define cx25840_info(fmt, arg...) do { \
  31. printk(KERN_INFO "%s %d-%04x: " fmt, client->driver->name, \
  32. i2c_adapter_id(client->adapter), client->addr , ## arg); } while (0)
  33. #define CX25840_CID_CARDTYPE (V4L2_CID_PRIVATE_BASE+0)
  34. enum cx25840_cardtype {
  35. CARDTYPE_PVR150,
  36. CARDTYPE_PG600
  37. };
  38. enum cx25840_input {
  39. CX25840_TUNER,
  40. CX25840_COMPOSITE0,
  41. CX25840_COMPOSITE1,
  42. CX25840_SVIDEO0,
  43. CX25840_SVIDEO1
  44. };
  45. struct cx25840_state {
  46. enum cx25840_cardtype cardtype;
  47. enum cx25840_input input;
  48. int audio_input;
  49. enum v4l2_audio_clock_freq audclk_freq;
  50. };
  51. /* ----------------------------------------------------------------------- */
  52. /* cx25850-core.c */
  53. int cx25840_write(struct i2c_client *client, u16 addr, u8 value);
  54. int cx25840_write4(struct i2c_client *client, u16 addr, u32 value);
  55. u8 cx25840_read(struct i2c_client *client, u16 addr);
  56. u32 cx25840_read4(struct i2c_client *client, u16 addr);
  57. int cx25840_and_or(struct i2c_client *client, u16 addr, u8 mask, u8 value);
  58. v4l2_std_id cx25840_get_v4lstd(struct i2c_client *client);
  59. /* ----------------------------------------------------------------------- */
  60. /* cx25850-firmware.c */
  61. int cx25840_loadfw(struct i2c_client *client);
  62. /* ----------------------------------------------------------------------- */
  63. /* cx25850-audio.c */
  64. int cx25840_audio(struct i2c_client *client, unsigned int cmd, void *arg);
  65. /* ----------------------------------------------------------------------- */
  66. /* cx25850-vbi.c */
  67. void cx25840_vbi_setup(struct i2c_client *client);
  68. int cx25840_vbi(struct i2c_client *client, unsigned int cmd, void *arg);
  69. #endif