From: Patrick Dickey <pdickeybeta@gmail.com>
To: linux-media@vger.kernel.org
Cc: Patrick Dickey <pdickeybeta@gmail.com>
Subject: [PATCH 04/25] added bsp_tuner for pctv80e support
Date: Thu, 10 Nov 2011 17:31:24 -0600 [thread overview]
Message-ID: <1320967905-7932-5-git-send-email-pdickeybeta@gmail.com> (raw)
In-Reply-To: <1320967905-7932-1-git-send-email-pdickeybeta@gmail.com>
---
drivers/media/dvb/frontends/bsp_tuner.h | 215 +++++++++++++++++++++++++++++++
1 files changed, 215 insertions(+), 0 deletions(-)
create mode 100644 drivers/media/dvb/frontends/bsp_tuner.h
diff --git a/drivers/media/dvb/frontends/bsp_tuner.h b/drivers/media/dvb/frontends/bsp_tuner.h
new file mode 100644
index 0000000..b67027f
--- /dev/null
+++ b/drivers/media/dvb/frontends/bsp_tuner.h
@@ -0,0 +1,215 @@
+/*
+ Copyright (c), 2004-2005,2007-2010 Trident Microsystems, Inc.
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+ * Neither the name of Trident Microsystems nor Hauppauge Computer Works
+ nor the names of its contributors may be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/**
+* \file $Id: bsp_tuner.h,v 1.5 2009/10/19 22:15:13 dingtao Exp $
+*
+* \brief Tuner dependable type definitions, macro's and functions
+*
+*/
+
+#ifndef __DRXBSP_TUNER_H__
+#define __DRXBSP_TUNER_H__
+/*------------------------------------------------------------------------------
+INCLUDES
+------------------------------------------------------------------------------*/
+#include "bsp_types.h"
+#include "bsp_i2c.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*------------------------------------------------------------------------------
+DEFINES
+------------------------------------------------------------------------------*/
+
+
+ /* Sub-mode bits should be adjacent and incremental */
+#define TUNER_MODE_SUB0 0x0001 /* for sub-mode (e.g. RF-AGC setting) */
+#define TUNER_MODE_SUB1 0x0002 /* for sub-mode (e.g. RF-AGC setting) */
+#define TUNER_MODE_SUB2 0x0004 /* for sub-mode (e.g. RF-AGC setting) */
+#define TUNER_MODE_SUB3 0x0008 /* for sub-mode (e.g. RF-AGC setting) */
+#define TUNER_MODE_SUB4 0x0010 /* for sub-mode (e.g. RF-AGC setting) */
+#define TUNER_MODE_SUB5 0x0020 /* for sub-mode (e.g. RF-AGC setting) */
+#define TUNER_MODE_SUB6 0x0040 /* for sub-mode (e.g. RF-AGC setting) */
+#define TUNER_MODE_SUB7 0x0080 /* for sub-mode (e.g. RF-AGC setting) */
+
+#define TUNER_MODE_DIGITAL 0x0100 /* for digital channel (e.g. DVB-T) */
+#define TUNER_MODE_ANALOG 0x0200 /* for analog channel (e.g. PAL) */
+#define TUNER_MODE_SWITCH 0x0400 /* during channel switch & scanning */
+#define TUNER_MODE_LOCK 0x0800 /* after tuner has locked */
+#define TUNER_MODE_6MHZ 0x1000 /* for 6MHz bandwidth channels */
+#define TUNER_MODE_7MHZ 0x2000 /* for 7MHz bandwidth channels */
+#define TUNER_MODE_8MHZ 0x4000 /* for 8MHz bandwidth channels */
+
+#define TUNER_MODE_SUB_MAX 8
+#define TUNER_MODE_SUBALL (TUNER_MODE_SUB0 | TUNER_MODE_SUB1 | \
+ TUNER_MODE_SUB2 | TUNER_MODE_SUB3 | \
+ TUNER_MODE_SUB4 | TUNER_MODE_SUB5 | \
+ TUNER_MODE_SUB6 | TUNER_MODE_SUB7)
+
+/*------------------------------------------------------------------------------
+TYPEDEFS
+------------------------------------------------------------------------------*/
+
+typedef u32_t TUNERMode_t;
+typedef pu32_t pTUNERMode_t;
+
+typedef char* TUNERSubMode_t; /* description of submode */
+typedef TUNERSubMode_t *pTUNERSubMode_t;
+
+
+typedef enum {
+
+ TUNER_LOCKED,
+ TUNER_NOT_LOCKED
+
+} TUNERLockStatus_t, *pTUNERLockStatus_t;
+
+
+typedef struct {
+
+ char *name; /* Tuner brand & type name */
+ DRXFrequency_t minFreqRF; /* Lowest RF input frequency, in kHz */
+ DRXFrequency_t maxFreqRF; /* Highest RF input frequency, in kHz */
+
+ u8_t subMode; /* Index to sub-mode in use */
+ pTUNERSubMode_t subModeDescriptions; /* Pointer to description of sub-modes*/
+ u8_t subModes; /* Number of available sub-modes */
+
+ /* The following fields will be either 0, NULL or FALSE and do not need
+ initialisation */
+ void *selfCheck; /* gives proof of initialization */
+ Bool_t programmed; /* only valid if selfCheck is OK */
+ DRXFrequency_t RFfrequency; /* only valid if programmed */
+ DRXFrequency_t IFfrequency; /* only valid if programmed */
+
+ void* myUserData; /* pointer to associated demod instance */
+ u16_t myCapabilities; /* value for storing application flags */
+
+} TUNERCommonAttr_t, *pTUNERCommonAttr_t;
+
+
+/*
+* Generic functions for DRX devices.
+*/
+typedef struct TUNERInstance_s *pTUNERInstance_t;
+
+typedef DRXStatus_t (*TUNEROpenFunc_t)(pTUNERInstance_t tuner);
+typedef DRXStatus_t (*TUNERCloseFunc_t)(pTUNERInstance_t tuner);
+
+typedef DRXStatus_t (*TUNERSetFrequencyFunc_t)(pTUNERInstance_t tuner,
+ TUNERMode_t mode,
+ DRXFrequency_t frequency);
+
+typedef DRXStatus_t (*TUNERGetFrequencyFunc_t)(pTUNERInstance_t tuner,
+ TUNERMode_t mode,
+ pDRXFrequency_t RFfrequency,
+ pDRXFrequency_t IFfrequency);
+
+typedef DRXStatus_t (*TUNERLockStatusFunc_t)(pTUNERInstance_t tuner,
+ pTUNERLockStatus_t lockStat);
+
+typedef DRXStatus_t (*TUNERi2cWriteReadFunc_t)(pTUNERInstance_t tuner,
+ pI2CDeviceAddr_t wDevAddr,
+ u16_t wCount,
+ pu8_t wData,
+ pI2CDeviceAddr_t rDevAddr,
+ u16_t rCount,
+ pu8_t rData);
+
+typedef struct
+{
+ TUNEROpenFunc_t openFunc;
+ TUNERCloseFunc_t closeFunc;
+ TUNERSetFrequencyFunc_t setFrequencyFunc;
+ TUNERGetFrequencyFunc_t getFrequencyFunc;
+ TUNERLockStatusFunc_t lockStatusFunc;
+ TUNERi2cWriteReadFunc_t i2cWriteReadFunc;
+
+} TUNERFunc_t, *pTUNERFunc_t;
+
+typedef struct TUNERInstance_s {
+
+ I2CDeviceAddr_t myI2CDevAddr;
+ pTUNERCommonAttr_t myCommonAttr;
+ void* myExtAttr;
+ pTUNERFunc_t myFunct;
+
+} TUNERInstance_t;
+
+
+/*------------------------------------------------------------------------------
+ENUM
+------------------------------------------------------------------------------*/
+
+/*------------------------------------------------------------------------------
+STRUCTS
+------------------------------------------------------------------------------*/
+
+
+/*------------------------------------------------------------------------------
+Exported FUNCTIONS
+------------------------------------------------------------------------------*/
+
+DRXStatus_t DRXBSP_TUNER_Open(pTUNERInstance_t tuner);
+
+DRXStatus_t DRXBSP_TUNER_Close(pTUNERInstance_t tuner);
+
+DRXStatus_t DRXBSP_TUNER_SetFrequency(pTUNERInstance_t tuner,
+ TUNERMode_t mode,
+ DRXFrequency_t frequency);
+
+DRXStatus_t DRXBSP_TUNER_GetFrequency(pTUNERInstance_t tuner,
+ TUNERMode_t mode,
+ pDRXFrequency_t RFfrequency,
+ pDRXFrequency_t IFfrequency);
+
+DRXStatus_t DRXBSP_TUNER_LockStatus(pTUNERInstance_t tuner,
+ pTUNERLockStatus_t lockStat);
+
+DRXStatus_t DRXBSP_TUNER_DefaultI2CWriteRead(pTUNERInstance_t tuner,
+ pI2CDeviceAddr_t wDevAddr,
+ u16_t wCount,
+ pu8_t wData,
+ pI2CDeviceAddr_t rDevAddr,
+ u16_t rCount,
+ pu8_t rData);
+
+/*------------------------------------------------------------------------------
+THE END
+------------------------------------------------------------------------------*/
+#ifdef __cplusplus
+}
+#endif
+#endif /* __DRXBSP_TUNER_H__ */
+
+/* End of file */
--
1.7.5.4
next prev parent reply other threads:[~2011-11-10 23:34 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-10 23:31 [PATCH 00/25] Add PCTV-80e Support to v4l Patrick Dickey
2011-11-10 23:31 ` [PATCH 01/25] added PCTV80e information to cardlist file Patrick Dickey
2011-11-10 23:31 ` [PATCH 02/25] added bsp_host for pctv80e support Patrick Dickey
2011-11-10 23:31 ` [PATCH 03/25] added bsp_i2c " Patrick Dickey
2011-11-10 23:31 ` Patrick Dickey [this message]
2011-11-10 23:31 ` [PATCH 05/25] added bsp_types " Patrick Dickey
2011-11-10 23:31 ` [PATCH 06/25] added drx39xxj " Patrick Dickey
2011-11-10 23:31 ` [PATCH 07/25] added drx39xxj header " Patrick Dickey
2011-11-10 23:31 ` [PATCH 08/25] added drx39_dummy " Patrick Dickey
2011-11-10 23:31 ` [PATCH 09/25] added drx_dap_fasi " Patrick Dickey
2011-11-10 23:31 ` [PATCH 10/25] added drx_dap_fasi header " Patrick Dickey
2011-11-10 23:31 ` [PATCH 11/25] added drx_driver " Patrick Dickey
2011-11-10 23:31 ` [PATCH 12/25] added drx_driver header " Patrick Dickey
2011-11-10 23:31 ` [PATCH 13/25] added drx_driver_version " Patrick Dickey
2011-11-10 23:31 ` [PATCH 15/25] added drxj " Patrick Dickey
2011-11-10 23:31 ` [PATCH 18/25] added drxj_mc_vsb " Patrick Dickey
2011-11-10 23:31 ` [PATCH 19/25] added drxj_mc_vsbqam " Patrick Dickey
2011-11-10 23:31 ` [PATCH 20/25] added drxj_options " Patrick Dickey
2011-11-10 23:31 ` [PATCH 21/25] modified Kconfig to include " Patrick Dickey
2011-11-10 23:31 ` [PATCH 22/25] modified Makefile for " Patrick Dickey
2011-11-10 23:31 ` [PATCH 23/25] modified em28xx-cards " Patrick Dickey
2011-11-10 23:31 ` [PATCH 24/25] modified em28xx-dvb " Patrick Dickey
2011-11-10 23:31 ` [PATCH 25/25] modified em28xx header " Patrick Dickey
2011-11-11 1:45 ` [PATCH 00/25] Add PCTV-80e Support to v4l Devin Heitmueller
2011-11-11 2:36 ` Patrick Dickey
2011-11-11 3:19 ` Devin Heitmueller
2011-11-11 11:39 ` Patrick Dickey
2011-11-11 13:28 ` Patrick Dickey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1320967905-7932-5-git-send-email-pdickeybeta@gmail.com \
--to=pdickeybeta@gmail.com \
--cc=linux-media@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.