Commit 443f18d0 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab Committed by Mauro Carvalho Chehab

[media] drx-j: CodingStyle fixes

Do the automatic CodingStyle fixes found at Lindent.

No functional changes.
Acked-by: default avatarDevin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
parent ca3355a9
...@@ -50,7 +50,6 @@ extern "C" { ...@@ -50,7 +50,6 @@ extern "C" {
TYPEDEFS TYPEDEFS
-------------------------------------------------------------------------*/ -------------------------------------------------------------------------*/
/*------------------------------------------------------------------------- /*-------------------------------------------------------------------------
DEFINES DEFINES
-------------------------------------------------------------------------*/ -------------------------------------------------------------------------*/
...@@ -58,17 +57,17 @@ DEFINES ...@@ -58,17 +57,17 @@ DEFINES
/*------------------------------------------------------------------------- /*-------------------------------------------------------------------------
Exported FUNCTIONS Exported FUNCTIONS
-------------------------------------------------------------------------*/ -------------------------------------------------------------------------*/
DRXStatus_t DRXBSP_HST_Init( void ); DRXStatus_t DRXBSP_HST_Init(void);
DRXStatus_t DRXBSP_HST_Term( void ); DRXStatus_t DRXBSP_HST_Term(void);
void* DRXBSP_HST_Memcpy( void *to, void *from, u32_t n); void *DRXBSP_HST_Memcpy(void *to, void *from, u32_t n);
int DRXBSP_HST_Memcmp( void *s1, void *s2, u32_t n); int DRXBSP_HST_Memcmp(void *s1, void *s2, u32_t n);
u32_t DRXBSP_HST_Clock( void ); u32_t DRXBSP_HST_Clock(void);
DRXStatus_t DRXBSP_HST_Sleep( u32_t n ); DRXStatus_t DRXBSP_HST_Sleep(u32_t n);
/*------------------------------------------------------------------------- /*-------------------------------------------------------------------------
THE END THE END
...@@ -76,5 +75,4 @@ THE END ...@@ -76,5 +75,4 @@ THE END
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* __DRXBSP_HOST_H__ */ #endif /* __DRXBSP_HOST_H__ */
...@@ -59,7 +59,7 @@ TYPEDEFS ...@@ -59,7 +59,7 @@ TYPEDEFS
* \typedef I2Caddr_t * \typedef I2Caddr_t
* \brief I2C device address (7-bit or 10-bit) * \brief I2C device address (7-bit or 10-bit)
*/ */
typedef u16_t I2Caddr_t; typedef u16_t I2Caddr_t;
/** /**
* \typedef I2CdevId_t * \typedef I2CdevId_t
...@@ -71,7 +71,7 @@ typedef u16_t I2Caddr_t; ...@@ -71,7 +71,7 @@ typedef u16_t I2Caddr_t;
* I2C bus. * I2C bus.
* *
*/ */
typedef u16_t I2CdevId_t; typedef u16_t I2CdevId_t;
/** /**
* \struct _I2CDeviceAddr_t * \struct _I2CDeviceAddr_t
...@@ -81,11 +81,14 @@ typedef u16_t I2CdevId_t; ...@@ -81,11 +81,14 @@ typedef u16_t I2CdevId_t;
* The userData pointer can be used for application specific purposes. * The userData pointer can be used for application specific purposes.
* *
*/ */
struct _I2CDeviceAddr_t { struct _I2CDeviceAddr_t {
I2Caddr_t i2cAddr; /**< The I2C address of the device. */ I2Caddr_t i2cAddr;
I2CdevId_t i2cDevId; /**< The device identifier. */ /**< The I2C address of the device. */
void *userData; /**< User data pointer */ I2CdevId_t i2cDevId;
}; /**< The device identifier. */
void *userData;
/**< User data pointer */
};
/** /**
* \typedef I2CDeviceAddr_t * \typedef I2CDeviceAddr_t
...@@ -94,13 +97,13 @@ struct _I2CDeviceAddr_t { ...@@ -94,13 +97,13 @@ struct _I2CDeviceAddr_t {
* This structure contains the I2C address and the device ID. * This structure contains the I2C address and the device ID.
* *
*/ */
typedef struct _I2CDeviceAddr_t I2CDeviceAddr_t; typedef struct _I2CDeviceAddr_t I2CDeviceAddr_t;
/** /**
* \typedef pI2CDeviceAddr_t * \typedef pI2CDeviceAddr_t
* \brief Pointer to I2C device parameters. * \brief Pointer to I2C device parameters.
*/ */
typedef I2CDeviceAddr_t *pI2CDeviceAddr_t; typedef I2CDeviceAddr_t *pI2CDeviceAddr_t;
/*------------------------------------------------------------------------------ /*------------------------------------------------------------------------------
DEFINES DEFINES
...@@ -133,7 +136,6 @@ STRUCTS ...@@ -133,7 +136,6 @@ STRUCTS
Exported FUNCTIONS Exported FUNCTIONS
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
/** /**
* \fn DRXBSP_I2C_Init() * \fn DRXBSP_I2C_Init()
* \brief Initialize I2C communication module. * \brief Initialize I2C communication module.
...@@ -141,8 +143,7 @@ Exported FUNCTIONS ...@@ -141,8 +143,7 @@ Exported FUNCTIONS
* \retval DRX_STS_OK Initialization successful. * \retval DRX_STS_OK Initialization successful.
* \retval DRX_STS_ERROR Initialization failed. * \retval DRX_STS_ERROR Initialization failed.
*/ */
DRXStatus_t DRXBSP_I2C_Init( void ); DRXStatus_t DRXBSP_I2C_Init(void);
/** /**
* \fn DRXBSP_I2C_Term() * \fn DRXBSP_I2C_Term()
...@@ -151,7 +152,7 @@ DRXStatus_t DRXBSP_I2C_Init( void ); ...@@ -151,7 +152,7 @@ DRXStatus_t DRXBSP_I2C_Init( void );
* \retval DRX_STS_OK Termination successful. * \retval DRX_STS_OK Termination successful.
* \retval DRX_STS_ERROR Termination failed. * \retval DRX_STS_ERROR Termination failed.
*/ */
DRXStatus_t DRXBSP_I2C_Term( void ); DRXStatus_t DRXBSP_I2C_Term(void);
/** /**
* \fn DRXStatus_t DRXBSP_I2C_WriteRead( pI2CDeviceAddr_t wDevAddr, * \fn DRXStatus_t DRXBSP_I2C_WriteRead( pI2CDeviceAddr_t wDevAddr,
...@@ -183,13 +184,11 @@ DRXStatus_t DRXBSP_I2C_Term( void ); ...@@ -183,13 +184,11 @@ DRXStatus_t DRXBSP_I2C_Term( void );
* The device ID can be useful if several devices share an I2C address. * The device ID can be useful if several devices share an I2C address.
* It can be used to control a "switch" on the I2C bus to the correct device. * It can be used to control a "switch" on the I2C bus to the correct device.
*/ */
DRXStatus_t DRXBSP_I2C_WriteRead( pI2CDeviceAddr_t wDevAddr, DRXStatus_t DRXBSP_I2C_WriteRead(pI2CDeviceAddr_t wDevAddr,
u16_t wCount, u16_t wCount,
pu8_t wData, pu8_t wData,
pI2CDeviceAddr_t rDevAddr, pI2CDeviceAddr_t rDevAddr,
u16_t rCount, u16_t rCount, pu8_t rData);
pu8_t rData);
/** /**
* \fn DRXBSP_I2C_ErrorText() * \fn DRXBSP_I2C_ErrorText()
...@@ -198,14 +197,13 @@ DRXStatus_t DRXBSP_I2C_WriteRead( pI2CDeviceAddr_t wDevAddr, ...@@ -198,14 +197,13 @@ DRXStatus_t DRXBSP_I2C_WriteRead( pI2CDeviceAddr_t wDevAddr,
* *
* \return char* Pointer to human readable error text. * \return char* Pointer to human readable error text.
*/ */
char* DRXBSP_I2C_ErrorText( void ); char *DRXBSP_I2C_ErrorText(void);
/** /**
* \var DRX_I2C_Error_g; * \var DRX_I2C_Error_g;
* \brief I2C specific error codes, platform dependent. * \brief I2C specific error codes, platform dependent.
*/ */
extern int DRX_I2C_Error_g; extern int DRX_I2C_Error_g;
/*------------------------------------------------------------------------------ /*------------------------------------------------------------------------------
THE END THE END
......
...@@ -51,7 +51,6 @@ extern "C" { ...@@ -51,7 +51,6 @@ extern "C" {
DEFINES DEFINES
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
/* Sub-mode bits should be adjacent and incremental */ /* Sub-mode bits should be adjacent and incremental */
#define TUNER_MODE_SUB0 0x0001 /* for sub-mode (e.g. RF-AGC setting) */ #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_SUB1 0x0002 /* for sub-mode (e.g. RF-AGC setting) */
...@@ -80,29 +79,26 @@ DEFINES ...@@ -80,29 +79,26 @@ DEFINES
TYPEDEFS TYPEDEFS
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
typedef u32_t TUNERMode_t; typedef u32_t TUNERMode_t;
typedef pu32_t pTUNERMode_t; typedef pu32_t pTUNERMode_t;
typedef char* TUNERSubMode_t; /* description of submode */
typedef TUNERSubMode_t *pTUNERSubMode_t;
typedef char *TUNERSubMode_t; /* description of submode */
typedef TUNERSubMode_t *pTUNERSubMode_t;
typedef enum { typedef enum {
TUNER_LOCKED, TUNER_LOCKED,
TUNER_NOT_LOCKED TUNER_NOT_LOCKED
} TUNERLockStatus_t, *pTUNERLockStatus_t;
} TUNERLockStatus_t, *pTUNERLockStatus_t; typedef struct {
typedef struct {
char *name; /* Tuner brand & type name */ char *name; /* Tuner brand & type name */
DRXFrequency_t minFreqRF; /* Lowest RF input frequency, in kHz */ DRXFrequency_t minFreqRF; /* Lowest RF input frequency, in kHz */
DRXFrequency_t maxFreqRF; /* Highest RF input frequency, in kHz */ DRXFrequency_t maxFreqRF; /* Highest RF input frequency, in kHz */
u8_t subMode; /* Index to sub-mode in use */ u8_t subMode; /* Index to sub-mode in use */
pTUNERSubMode_t subModeDescriptions; /* Pointer to description of sub-modes*/ pTUNERSubMode_t subModeDescriptions; /* Pointer to description of sub-modes */
u8_t subModes; /* Number of available sub-modes */ u8_t subModes; /* Number of available sub-modes */
/* The following fields will be either 0, NULL or FALSE and do not need /* The following fields will be either 0, NULL or FALSE and do not need
...@@ -112,42 +108,44 @@ typedef struct { ...@@ -112,42 +108,44 @@ typedef struct {
DRXFrequency_t RFfrequency; /* only valid if programmed */ DRXFrequency_t RFfrequency; /* only valid if programmed */
DRXFrequency_t IFfrequency; /* only valid if programmed */ DRXFrequency_t IFfrequency; /* only valid if programmed */
void* myUserData; /* pointer to associated demod instance */ void *myUserData; /* pointer to associated demod instance */
u16_t myCapabilities; /* value for storing application flags */ u16_t myCapabilities; /* value for storing application flags */
} TUNERCommonAttr_t, *pTUNERCommonAttr_t; } TUNERCommonAttr_t, *pTUNERCommonAttr_t;
/* /*
* Generic functions for DRX devices. * Generic functions for DRX devices.
*/ */
typedef struct TUNERInstance_s *pTUNERInstance_t; typedef struct TUNERInstance_s *pTUNERInstance_t;
typedef DRXStatus_t (*TUNEROpenFunc_t)( pTUNERInstance_t tuner ); typedef DRXStatus_t(*TUNEROpenFunc_t) (pTUNERInstance_t tuner);
typedef DRXStatus_t (*TUNERCloseFunc_t)( pTUNERInstance_t tuner ); typedef DRXStatus_t(*TUNERCloseFunc_t) (pTUNERInstance_t tuner);
typedef DRXStatus_t (*TUNERSetFrequencyFunc_t)( pTUNERInstance_t tuner, typedef DRXStatus_t(*TUNERSetFrequencyFunc_t) (pTUNERInstance_t tuner,
TUNERMode_t mode, TUNERMode_t mode,
DRXFrequency_t frequency ); DRXFrequency_t
frequency);
typedef DRXStatus_t (*TUNERGetFrequencyFunc_t)( pTUNERInstance_t tuner, typedef DRXStatus_t(*TUNERGetFrequencyFunc_t) (pTUNERInstance_t tuner,
TUNERMode_t mode, TUNERMode_t mode,
pDRXFrequency_t RFfrequency, pDRXFrequency_t
pDRXFrequency_t IFfrequency ); RFfrequency,
pDRXFrequency_t
typedef DRXStatus_t (*TUNERLockStatusFunc_t)( pTUNERInstance_t tuner, IFfrequency);
pTUNERLockStatus_t lockStat );
typedef DRXStatus_t(*TUNERLockStatusFunc_t) (pTUNERInstance_t tuner,
typedef DRXStatus_t (*TUNERi2cWriteReadFunc_t)( pTUNERInstance_t tuner, pTUNERLockStatus_t
pI2CDeviceAddr_t wDevAddr, lockStat);
u16_t wCount,
typedef DRXStatus_t(*TUNERi2cWriteReadFunc_t) (pTUNERInstance_t tuner,
pI2CDeviceAddr_t
wDevAddr, u16_t wCount,
pu8_t wData, pu8_t wData,
pI2CDeviceAddr_t rDevAddr, pI2CDeviceAddr_t
u16_t rCount, rDevAddr, u16_t rCount,
pu8_t rData ); pu8_t rData);
typedef struct typedef struct {
{
TUNEROpenFunc_t openFunc; TUNEROpenFunc_t openFunc;
TUNERCloseFunc_t closeFunc; TUNERCloseFunc_t closeFunc;
TUNERSetFrequencyFunc_t setFrequencyFunc; TUNERSetFrequencyFunc_t setFrequencyFunc;
...@@ -155,17 +153,16 @@ typedef struct ...@@ -155,17 +153,16 @@ typedef struct
TUNERLockStatusFunc_t lockStatusFunc; TUNERLockStatusFunc_t lockStatusFunc;
TUNERi2cWriteReadFunc_t i2cWriteReadFunc; TUNERi2cWriteReadFunc_t i2cWriteReadFunc;
} TUNERFunc_t, *pTUNERFunc_t; } TUNERFunc_t, *pTUNERFunc_t;
typedef struct TUNERInstance_s { typedef struct TUNERInstance_s {
I2CDeviceAddr_t myI2CDevAddr; I2CDeviceAddr_t myI2CDevAddr;
pTUNERCommonAttr_t myCommonAttr; pTUNERCommonAttr_t myCommonAttr;
void* myExtAttr; void *myExtAttr;
pTUNERFunc_t myFunct; pTUNERFunc_t myFunct;
} TUNERInstance_t; } TUNERInstance_t;
/*------------------------------------------------------------------------------ /*------------------------------------------------------------------------------
ENUM ENUM
...@@ -175,34 +172,32 @@ ENUM ...@@ -175,34 +172,32 @@ ENUM
STRUCTS STRUCTS
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
/*------------------------------------------------------------------------------ /*------------------------------------------------------------------------------
Exported FUNCTIONS Exported FUNCTIONS
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
DRXStatus_t DRXBSP_TUNER_Open( pTUNERInstance_t tuner ); DRXStatus_t DRXBSP_TUNER_Open(pTUNERInstance_t tuner);
DRXStatus_t DRXBSP_TUNER_Close( pTUNERInstance_t tuner ); DRXStatus_t DRXBSP_TUNER_Close(pTUNERInstance_t tuner);
DRXStatus_t DRXBSP_TUNER_SetFrequency( pTUNERInstance_t tuner, DRXStatus_t DRXBSP_TUNER_SetFrequency(pTUNERInstance_t tuner,
TUNERMode_t mode, TUNERMode_t mode,
DRXFrequency_t frequency ); DRXFrequency_t frequency);
DRXStatus_t DRXBSP_TUNER_GetFrequency( pTUNERInstance_t tuner, DRXStatus_t DRXBSP_TUNER_GetFrequency(pTUNERInstance_t tuner,
TUNERMode_t mode, TUNERMode_t mode,
pDRXFrequency_t RFfrequency, pDRXFrequency_t RFfrequency,
pDRXFrequency_t IFfrequency ); pDRXFrequency_t IFfrequency);
DRXStatus_t DRXBSP_TUNER_LockStatus( pTUNERInstance_t tuner, DRXStatus_t DRXBSP_TUNER_LockStatus(pTUNERInstance_t tuner,
pTUNERLockStatus_t lockStat ); pTUNERLockStatus_t lockStat);
DRXStatus_t DRXBSP_TUNER_DefaultI2CWriteRead( pTUNERInstance_t tuner, DRXStatus_t DRXBSP_TUNER_DefaultI2CWriteRead(pTUNERInstance_t tuner,
pI2CDeviceAddr_t wDevAddr, pI2CDeviceAddr_t wDevAddr,
u16_t wCount, u16_t wCount,
pu8_t wData, pu8_t wData,
pI2CDeviceAddr_t rDevAddr, pI2CDeviceAddr_t rDevAddr,
u16_t rCount, u16_t rCount, pu8_t rData);
pu8_t rData);
/*------------------------------------------------------------------------------ /*------------------------------------------------------------------------------
THE END THE END
...@@ -211,5 +206,4 @@ THE END ...@@ -211,5 +206,4 @@ THE END
} }
#endif #endif
#endif /* __DRXBSP_TUNER_H__ */ #endif /* __DRXBSP_TUNER_H__ */
/* End of file */ /* End of file */
...@@ -56,114 +56,113 @@ TYPEDEFS ...@@ -56,114 +56,113 @@ TYPEDEFS
* \typedef unsigned char u8_t * \typedef unsigned char u8_t
* \brief type definition of an unsigned 8 bits integer * \brief type definition of an unsigned 8 bits integer
*/ */
typedef unsigned char u8_t; typedef unsigned char u8_t;
/** /**
* \typedef char s8_t * \typedef char s8_t
* \brief type definition of a signed 8 bits integer * \brief type definition of a signed 8 bits integer
*/ */
typedef char s8_t; typedef char s8_t;
/** /**
* \typedef unsigned short u16_t *pu16_t * \typedef unsigned short u16_t *pu16_t
* \brief type definition of an unsigned 16 bits integer * \brief type definition of an unsigned 16 bits integer
*/ */
typedef unsigned short u16_t; typedef unsigned short u16_t;
/** /**
* \typedef short s16_t * \typedef short s16_t
* \brief type definition of a signed 16 bits integer * \brief type definition of a signed 16 bits integer
*/ */
typedef short s16_t; typedef short s16_t;
/** /**
* \typedef unsigned long u32_t * \typedef unsigned long u32_t
* \brief type definition of an unsigned 32 bits integer * \brief type definition of an unsigned 32 bits integer
*/ */
typedef unsigned long u32_t; typedef unsigned long u32_t;
/** /**
* \typedef long s32_t * \typedef long s32_t
* \brief type definition of a signed 32 bits integer * \brief type definition of a signed 32 bits integer
*/ */
typedef long s32_t; typedef long s32_t;
/* /*
* \typedef struct ... u64_t * \typedef struct ... u64_t
* \brief type definition of an usigned 64 bits integer * \brief type definition of an usigned 64 bits integer
*/ */
typedef struct { typedef struct {
u32_t MSLW; u32_t MSLW;
u32_t LSLW; u32_t LSLW;
} u64_t; } u64_t;
/* /*
* \typedef struct ... i64_t * \typedef struct ... i64_t
* \brief type definition of a signed 64 bits integer * \brief type definition of a signed 64 bits integer
*/ */
typedef struct { typedef struct {
s32_t MSLW; s32_t MSLW;
u32_t LSLW; u32_t LSLW;
} s64_t; } s64_t;
/** /**
* \typedef u8_t *pu8_t * \typedef u8_t *pu8_t
* \brief type definition of pointer to an unsigned 8 bits integer * \brief type definition of pointer to an unsigned 8 bits integer
*/ */
typedef u8_t *pu8_t; typedef u8_t *pu8_t;
/** /**
* \typedef s8_t *ps8_t * \typedef s8_t *ps8_t
* \brief type definition of pointer to a signed 8 bits integer * \brief type definition of pointer to a signed 8 bits integer
*/ */
typedef s8_t *ps8_t; typedef s8_t *ps8_t;
/** /**
* \typedef u16_t *pu16_t * \typedef u16_t *pu16_t
* \brief type definition of pointer to an unsigned 16 bits integer * \brief type definition of pointer to an unsigned 16 bits integer
*/ */
typedef u16_t *pu16_t; typedef u16_t *pu16_t;
/** /**
* \typedef s16_t *ps16_t * \typedef s16_t *ps16_t
* \brief type definition of pointer to a signed 16 bits integer * \brief type definition of pointer to a signed 16 bits integer
*/ */
typedef s16_t *ps16_t; typedef s16_t *ps16_t;
/** /**
* \typedef u32_t *pu32_t * \typedef u32_t *pu32_t
* \brief type definition of pointer to an unsigned 32 bits integer * \brief type definition of pointer to an unsigned 32 bits integer
*/ */
typedef u32_t *pu32_t; typedef u32_t *pu32_t;
/** /**
* \typedef s32_t *ps32_t * \typedef s32_t *ps32_t
* \brief type definition of pointer to a signed 32 bits integer * \brief type definition of pointer to a signed 32 bits integer
*/ */
typedef s32_t *ps32_t; typedef s32_t *ps32_t;
/** /**
* \typedef u64_t *pu64_t * \typedef u64_t *pu64_t
* \brief type definition of pointer to an usigned 64 bits integer * \brief type definition of pointer to an usigned 64 bits integer
*/ */
typedef u64_t *pu64_t; typedef u64_t *pu64_t;
/** /**
* \typedef s64_t *ps64_t * \typedef s64_t *ps64_t
* \brief type definition of pointer to a signed 64 bits integer * \brief type definition of pointer to a signed 64 bits integer
*/ */
typedef s64_t *ps64_t; typedef s64_t *ps64_t;
/** /**
* \typedef s32_t DRXFrequency_t * \typedef s32_t DRXFrequency_t
* \brief type definition of frequency * \brief type definition of frequency
*/ */
typedef s32_t DRXFrequency_t; typedef s32_t DRXFrequency_t;
/** /**
* \typedef DRXFrequency_t *pDRXFrequency_t * \typedef DRXFrequency_t *pDRXFrequency_t
* \brief type definition of a pointer to a frequency * \brief type definition of a pointer to a frequency
*/ */
typedef DRXFrequency_t *pDRXFrequency_t; typedef DRXFrequency_t *pDRXFrequency_t;
/** /**
* \typedef u32_t DRXSymbolrate_t * \typedef u32_t DRXSymbolrate_t
* \brief type definition of symbol rate * \brief type definition of symbol rate
*/ */
typedef u32_t DRXSymbolrate_t; typedef u32_t DRXSymbolrate_t;
/** /**
* \typedef DRXSymbolrate_t *pDRXSymbolrate_t * \typedef DRXSymbolrate_t *pDRXSymbolrate_t
* \brief type definition of a pointer to a symbol rate * \brief type definition of a pointer to a symbol rate
*/ */
typedef DRXSymbolrate_t *pDRXSymbolrate_t; typedef DRXSymbolrate_t *pDRXSymbolrate_t;
/*------------------------------------------------------------------------- /*-------------------------------------------------------------------------
DEFINES DEFINES
...@@ -184,32 +183,33 @@ ENUM ...@@ -184,32 +183,33 @@ ENUM
* Boolean datatype. Only define if not already defined TRUE or FALSE. * Boolean datatype. Only define if not already defined TRUE or FALSE.
*/ */
#if defined (TRUE) || defined (FALSE) #if defined (TRUE) || defined (FALSE)
typedef int Bool_t; typedef int Bool_t;
#else #else
/** /**
* \enum Bool_t * \enum Bool_t
* \brief Boolean type * \brief Boolean type
*/ */
typedef enum { typedef enum {
FALSE = 0, FALSE = 0,
TRUE TRUE
} Bool_t; } Bool_t;
#endif #endif
typedef Bool_t *pBool_t; typedef Bool_t *pBool_t;
/** /**
* \enum DRXStatus_t * \enum DRXStatus_t
* \brief Various return statusses * \brief Various return statusses
*/ */
typedef enum { typedef enum {
DRX_STS_READY = 3, /**< device/service is ready */ DRX_STS_READY = 3, /**< device/service is ready */
DRX_STS_BUSY = 2, /**< device/service is busy */ DRX_STS_BUSY = 2, /**< device/service is busy */
DRX_STS_OK = 1, /**< everything is OK */ DRX_STS_OK = 1, /**< everything is OK */
DRX_STS_INVALID_ARG = -1, /**< invalid arguments */ DRX_STS_INVALID_ARG = -1,
/**< invalid arguments */
DRX_STS_ERROR = -2, /**< general error */ DRX_STS_ERROR = -2, /**< general error */
DRX_STS_FUNC_NOT_AVAILABLE = -3 /**< unavailable functionality */ DRX_STS_FUNC_NOT_AVAILABLE = -3
} DRXStatus_t, *pDRXStatus_t; /**< unavailable functionality */
} DRXStatus_t, *pDRXStatus_t;
/*------------------------------------------------------------------------- /*-------------------------------------------------------------------------
STRUCTS STRUCTS
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#include "drxj_mc.h" #include "drxj_mc.h"
#include "drxj.h" #include "drxj.h"
static int drx39xxj_set_powerstate(struct dvb_frontend* fe, int enable) static int drx39xxj_set_powerstate(struct dvb_frontend *fe, int enable)
{ {
struct drx39xxj_state *state = fe->demodulator_priv; struct drx39xxj_state *state = fe->demodulator_priv;
DRXDemodInstance_t *demod = state->demod; DRXDemodInstance_t *demod = state->demod;
...@@ -54,9 +54,9 @@ static int drx39xxj_set_powerstate(struct dvb_frontend* fe, int enable) ...@@ -54,9 +54,9 @@ static int drx39xxj_set_powerstate(struct dvb_frontend* fe, int enable)
return 0; return 0;
} }
static int drx39xxj_read_status(struct dvb_frontend* fe, fe_status_t* status) static int drx39xxj_read_status(struct dvb_frontend *fe, fe_status_t * status)
{ {
struct drx39xxj_state* state = fe->demodulator_priv; struct drx39xxj_state *state = fe->demodulator_priv;
DRXDemodInstance_t *demod = state->demod; DRXDemodInstance_t *demod = state->demod;
DRXStatus_t result; DRXStatus_t result;
DRXLockStatus_t lock_status; DRXLockStatus_t lock_status;
...@@ -87,16 +87,12 @@ static int drx39xxj_read_status(struct dvb_frontend* fe, fe_status_t* status) ...@@ -87,16 +87,12 @@ static int drx39xxj_read_status(struct dvb_frontend* fe, fe_status_t* status)
case DRX_LOCK_STATE_8: case DRX_LOCK_STATE_8:
case DRX_LOCK_STATE_9: case DRX_LOCK_STATE_9:
*status = FE_HAS_SIGNAL *status = FE_HAS_SIGNAL
| FE_HAS_CARRIER | FE_HAS_CARRIER | FE_HAS_VITERBI | FE_HAS_SYNC;
| FE_HAS_VITERBI
| FE_HAS_SYNC;
break; break;
case DRX_LOCKED: case DRX_LOCKED:
*status = FE_HAS_SIGNAL *status = FE_HAS_SIGNAL
| FE_HAS_CARRIER | FE_HAS_CARRIER
| FE_HAS_VITERBI | FE_HAS_VITERBI | FE_HAS_SYNC | FE_HAS_LOCK;
| FE_HAS_SYNC
| FE_HAS_LOCK;
break; break;
default: default:
printk("Lock state unknown %d\n", lock_status); printk("Lock state unknown %d\n", lock_status);
...@@ -105,9 +101,9 @@ static int drx39xxj_read_status(struct dvb_frontend* fe, fe_status_t* status) ...@@ -105,9 +101,9 @@ static int drx39xxj_read_status(struct dvb_frontend* fe, fe_status_t* status)
return 0; return 0;
} }
static int drx39xxj_read_ber(struct dvb_frontend* fe, u32* ber) static int drx39xxj_read_ber(struct dvb_frontend *fe, u32 * ber)
{ {
struct drx39xxj_state* state = fe->demodulator_priv; struct drx39xxj_state *state = fe->demodulator_priv;
DRXDemodInstance_t *demod = state->demod; DRXDemodInstance_t *demod = state->demod;
DRXStatus_t result; DRXStatus_t result;
DRXSigQuality_t sig_quality; DRXSigQuality_t sig_quality;
...@@ -123,9 +119,10 @@ static int drx39xxj_read_ber(struct dvb_frontend* fe, u32* ber) ...@@ -123,9 +119,10 @@ static int drx39xxj_read_ber(struct dvb_frontend* fe, u32* ber)
return 0; return 0;
} }
static int drx39xxj_read_signal_strength(struct dvb_frontend* fe, u16* strength) static int drx39xxj_read_signal_strength(struct dvb_frontend *fe,
u16 * strength)
{ {
struct drx39xxj_state* state = fe->demodulator_priv; struct drx39xxj_state *state = fe->demodulator_priv;
DRXDemodInstance_t *demod = state->demod; DRXDemodInstance_t *demod = state->demod;
DRXStatus_t result; DRXStatus_t result;
DRXSigQuality_t sig_quality; DRXSigQuality_t sig_quality;
...@@ -142,9 +139,9 @@ static int drx39xxj_read_signal_strength(struct dvb_frontend* fe, u16* strength) ...@@ -142,9 +139,9 @@ static int drx39xxj_read_signal_strength(struct dvb_frontend* fe, u16* strength)
return 0; return 0;
} }
static int drx39xxj_read_snr(struct dvb_frontend* fe, u16* snr) static int drx39xxj_read_snr(struct dvb_frontend *fe, u16 * snr)
{ {
struct drx39xxj_state* state = fe->demodulator_priv; struct drx39xxj_state *state = fe->demodulator_priv;
DRXDemodInstance_t *demod = state->demod; DRXDemodInstance_t *demod = state->demod;
DRXStatus_t result; DRXStatus_t result;
DRXSigQuality_t sig_quality; DRXSigQuality_t sig_quality;
...@@ -160,9 +157,9 @@ static int drx39xxj_read_snr(struct dvb_frontend* fe, u16* snr) ...@@ -160,9 +157,9 @@ static int drx39xxj_read_snr(struct dvb_frontend* fe, u16* snr)
return 0; return 0;
} }
static int drx39xxj_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) static int drx39xxj_read_ucblocks(struct dvb_frontend *fe, u32 * ucblocks)
{ {
struct drx39xxj_state* state = fe->demodulator_priv; struct drx39xxj_state *state = fe->demodulator_priv;
DRXDemodInstance_t *demod = state->demod; DRXDemodInstance_t *demod = state->demod;
DRXStatus_t result; DRXStatus_t result;
DRXSigQuality_t sig_quality; DRXSigQuality_t sig_quality;
...@@ -178,23 +175,25 @@ static int drx39xxj_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) ...@@ -178,23 +175,25 @@ static int drx39xxj_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks)
return 0; return 0;
} }
static int drx39xxj_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) static int drx39xxj_get_frontend(struct dvb_frontend *fe,
struct dvb_frontend_parameters *p)
{ {
return 0; return 0;
} }
static int drx39xxj_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) static int drx39xxj_set_frontend(struct dvb_frontend *fe,
struct dvb_frontend_parameters *p)
{ {
#ifdef DJH_DEBUG #ifdef DJH_DEBUG
int i; int i;
#endif #endif
struct drx39xxj_state* state = fe->demodulator_priv; struct drx39xxj_state *state = fe->demodulator_priv;
DRXDemodInstance_t *demod = state->demod; DRXDemodInstance_t *demod = state->demod;
DRXStandard_t standard = DRX_STANDARD_8VSB; DRXStandard_t standard = DRX_STANDARD_8VSB;
DRXChannel_t channel; DRXChannel_t channel;
DRXStatus_t result; DRXStatus_t result;
DRXUIOData_t uioData; DRXUIOData_t uioData;
DRXChannel_t defChannel = {/* frequency */ 0, DRXChannel_t defChannel = { /* frequency */ 0,
/* bandwidth */ DRX_BANDWIDTH_6MHZ, /* bandwidth */ DRX_BANDWIDTH_6MHZ,
/* mirror */ DRX_MIRROR_NO, /* mirror */ DRX_MIRROR_NO,
/* constellation */ DRX_CONSTELLATION_AUTO, /* constellation */ DRX_CONSTELLATION_AUTO,
...@@ -246,7 +245,6 @@ static int drx39xxj_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_pa ...@@ -246,7 +245,6 @@ static int drx39xxj_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_pa
printk("Failed to set channel!\n"); printk("Failed to set channel!\n");
return -EINVAL; return -EINVAL;
} }
// Just for giggles, let's shut off the LNA again.... // Just for giggles, let's shut off the LNA again....
uioData.uio = DRX_UIO1; uioData.uio = DRX_UIO1;
uioData.value = FALSE; uioData.value = FALSE;
...@@ -255,9 +253,8 @@ static int drx39xxj_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_pa ...@@ -255,9 +253,8 @@ static int drx39xxj_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_pa
printk("Failed to disable LNA!\n"); printk("Failed to disable LNA!\n");
return 0; return 0;
} }
#ifdef DJH_DEBUG #ifdef DJH_DEBUG
for(i = 0; i < 2000; i++) { for (i = 0; i < 2000; i++) {
fe_status_t status; fe_status_t status;
drx39xxj_read_status(fe, &status); drx39xxj_read_status(fe, &status);
printk("i=%d status=%d\n", i, status); printk("i=%d status=%d\n", i, status);
...@@ -269,8 +266,7 @@ static int drx39xxj_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_pa ...@@ -269,8 +266,7 @@ static int drx39xxj_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_pa
return 0; return 0;
} }
static int drx39xxj_sleep(struct dvb_frontend *fe)
static int drx39xxj_sleep(struct dvb_frontend* fe)
{ {
/* power-down the demodulator */ /* power-down the demodulator */
return drx39xxj_set_powerstate(fe, 0); return drx39xxj_set_powerstate(fe, 0);
...@@ -308,8 +304,7 @@ static int drx39xxj_i2c_gate_ctrl(struct dvb_frontend *fe, int enable) ...@@ -308,8 +304,7 @@ static int drx39xxj_i2c_gate_ctrl(struct dvb_frontend *fe, int enable)
return 0; return 0;
} }
static int drx39xxj_init(struct dvb_frontend *fe)
static int drx39xxj_init(struct dvb_frontend* fe)
{ {
/* Bring the demod out of sleep */ /* Bring the demod out of sleep */
drx39xxj_set_powerstate(fe, 1); drx39xxj_set_powerstate(fe, 1);
...@@ -324,9 +319,9 @@ static int drx39xxj_get_tune_settings(struct dvb_frontend *fe, ...@@ -324,9 +319,9 @@ static int drx39xxj_get_tune_settings(struct dvb_frontend *fe,
return 0; return 0;
} }
static void drx39xxj_release(struct dvb_frontend* fe) static void drx39xxj_release(struct dvb_frontend *fe)
{ {
struct drx39xxj_state* state = fe->demodulator_priv; struct drx39xxj_state *state = fe->demodulator_priv;
kfree(state); kfree(state);
} }
...@@ -334,7 +329,7 @@ static struct dvb_frontend_ops drx39xxj_ops; ...@@ -334,7 +329,7 @@ static struct dvb_frontend_ops drx39xxj_ops;
struct dvb_frontend *drx39xxj_attach(struct i2c_adapter *i2c) struct dvb_frontend *drx39xxj_attach(struct i2c_adapter *i2c)
{ {
struct drx39xxj_state* state = NULL; struct drx39xxj_state *state = NULL;
I2CDeviceAddr_t *demodAddr = NULL; I2CDeviceAddr_t *demodAddr = NULL;
DRXCommonAttr_t *demodCommAttr = NULL; DRXCommonAttr_t *demodCommAttr = NULL;
...@@ -346,19 +341,24 @@ struct dvb_frontend *drx39xxj_attach(struct i2c_adapter *i2c) ...@@ -346,19 +341,24 @@ struct dvb_frontend *drx39xxj_attach(struct i2c_adapter *i2c)
/* allocate memory for the internal state */ /* allocate memory for the internal state */
state = kmalloc(sizeof(struct drx39xxj_state), GFP_KERNEL); state = kmalloc(sizeof(struct drx39xxj_state), GFP_KERNEL);
if (state == NULL) goto error; if (state == NULL)
goto error;
demod = kmalloc(sizeof(DRXDemodInstance_t), GFP_KERNEL); demod = kmalloc(sizeof(DRXDemodInstance_t), GFP_KERNEL);
if (demod == NULL) goto error; if (demod == NULL)
goto error;
demodAddr = kmalloc(sizeof(I2CDeviceAddr_t), GFP_KERNEL); demodAddr = kmalloc(sizeof(I2CDeviceAddr_t), GFP_KERNEL);
if (demodAddr == NULL) goto error; if (demodAddr == NULL)
goto error;
demodCommAttr = kmalloc(sizeof(DRXCommonAttr_t), GFP_KERNEL); demodCommAttr = kmalloc(sizeof(DRXCommonAttr_t), GFP_KERNEL);
if (demodCommAttr == NULL) goto error; if (demodCommAttr == NULL)
goto error;
demodExtAttr = kmalloc(sizeof(DRXJData_t), GFP_KERNEL); demodExtAttr = kmalloc(sizeof(DRXJData_t), GFP_KERNEL);
if (demodExtAttr == NULL) goto error; if (demodExtAttr == NULL)
goto error;
/* setup the state */ /* setup the state */
state->i2c = i2c; state->i2c = i2c;
...@@ -380,7 +380,8 @@ struct dvb_frontend *drx39xxj_attach(struct i2c_adapter *i2c) ...@@ -380,7 +380,8 @@ struct dvb_frontend *drx39xxj_attach(struct i2c_adapter *i2c)
demod->myExtAttr = demodExtAttr; demod->myExtAttr = demodExtAttr;
memcpy(demod->myExtAttr, &DRXJData_g, sizeof(DRXJData_t)); memcpy(demod->myExtAttr, &DRXJData_g, sizeof(DRXJData_t));
((DRXJData_t *) demod->myExtAttr)->uioSmaTxMode = DRX_UIO_MODE_READWRITE; ((DRXJData_t *) demod->myExtAttr)->uioSmaTxMode =
DRX_UIO_MODE_READWRITE;
demod->myTuner = NULL; demod->myTuner = NULL;
...@@ -432,8 +433,7 @@ static struct dvb_frontend_ops drx39xxj_ops = { ...@@ -432,8 +433,7 @@ static struct dvb_frontend_ops drx39xxj_ops = {
.frequency_stepsize = 62500, .frequency_stepsize = 62500,
.frequency_min = 51000000, .frequency_min = 51000000,
.frequency_max = 858000000, .frequency_max = 858000000,
.caps = FE_CAN_QAM_64 | FE_CAN_QAM_256 | FE_CAN_8VSB .caps = FE_CAN_QAM_64 | FE_CAN_QAM_256 | FE_CAN_8VSB},
},
.init = drx39xxj_init, .init = drx39xxj_init,
.i2c_gate_ctrl = drx39xxj_i2c_gate_ctrl, .i2c_gate_ctrl = drx39xxj_i2c_gate_ctrl,
......
...@@ -35,6 +35,6 @@ struct drx39xxj_state { ...@@ -35,6 +35,6 @@ struct drx39xxj_state {
unsigned int i2c_gate_open:1; unsigned int i2c_gate_open:1;
}; };
extern struct dvb_frontend* drx39xxj_attach(struct i2c_adapter *i2c); extern struct dvb_frontend *drx39xxj_attach(struct i2c_adapter *i2c);
#endif // DVB_DUMMY_FE_H #endif // DVB_DUMMY_FE_H
...@@ -13,59 +13,58 @@ ...@@ -13,59 +13,58 @@
#include "drx39xxj.h" #include "drx39xxj.h"
/* Dummy function to satisfy drxj.c */ /* Dummy function to satisfy drxj.c */
DRXStatus_t DRXBSP_TUNER_Open( pTUNERInstance_t tuner ) DRXStatus_t DRXBSP_TUNER_Open(pTUNERInstance_t tuner)
{ {
return DRX_STS_OK; return DRX_STS_OK;
} }
DRXStatus_t DRXBSP_TUNER_Close( pTUNERInstance_t tuner ) DRXStatus_t DRXBSP_TUNER_Close(pTUNERInstance_t tuner)
{ {
return DRX_STS_OK; return DRX_STS_OK;
} }
DRXStatus_t DRXBSP_TUNER_SetFrequency( pTUNERInstance_t tuner, DRXStatus_t DRXBSP_TUNER_SetFrequency(pTUNERInstance_t tuner,
TUNERMode_t mode, TUNERMode_t mode,
DRXFrequency_t centerFrequency ) DRXFrequency_t centerFrequency)
{ {
return DRX_STS_OK; return DRX_STS_OK;
} }
DRXStatus_t DRXStatus_t
DRXBSP_TUNER_GetFrequency( pTUNERInstance_t tuner, DRXBSP_TUNER_GetFrequency(pTUNERInstance_t tuner,
TUNERMode_t mode, TUNERMode_t mode,
pDRXFrequency_t RFfrequency, pDRXFrequency_t RFfrequency,
pDRXFrequency_t IFfrequency ) pDRXFrequency_t IFfrequency)
{ {
return DRX_STS_OK; return DRX_STS_OK;
} }
DRXStatus_t DRXBSP_HST_Sleep( u32_t n ) DRXStatus_t DRXBSP_HST_Sleep(u32_t n)
{ {
msleep(n); msleep(n);
return DRX_STS_OK; return DRX_STS_OK;
} }
u32_t DRXBSP_HST_Clock( void ) u32_t DRXBSP_HST_Clock(void)
{ {
return jiffies_to_msecs(jiffies); return jiffies_to_msecs(jiffies);
} }
int DRXBSP_HST_Memcmp( void *s1, void *s2, u32_t n) int DRXBSP_HST_Memcmp(void *s1, void *s2, u32_t n)
{ {
return ( memcmp( s1, s2, (size_t) n) ); return (memcmp(s1, s2, (size_t) n));
} }
void* DRXBSP_HST_Memcpy( void *to, void *from, u32_t n) void *DRXBSP_HST_Memcpy(void *to, void *from, u32_t n)
{ {
return ( memcpy( to, from, (size_t) n) ); return (memcpy(to, from, (size_t) n));
} }
DRXStatus_t DRXBSP_I2C_WriteRead( pI2CDeviceAddr_t wDevAddr, DRXStatus_t DRXBSP_I2C_WriteRead(pI2CDeviceAddr_t wDevAddr,
u16_t wCount, u16_t wCount,
pu8_t wData, pu8_t wData,
pI2CDeviceAddr_t rDevAddr, pI2CDeviceAddr_t rDevAddr,
u16_t rCount, u16_t rCount, pu8_t rData)
pu8_t rData )
{ {
struct drx39xxj_state *state; struct drx39xxj_state *state;
struct i2c_msg msg[2]; struct i2c_msg msg[2];
...@@ -116,10 +115,10 @@ DRXStatus_t DRXBSP_I2C_WriteRead( pI2CDeviceAddr_t wDevAddr, ...@@ -116,10 +115,10 @@ DRXStatus_t DRXBSP_I2C_WriteRead( pI2CDeviceAddr_t wDevAddr,
struct drx39xxj_state *state = wDevAddr->userData; struct drx39xxj_state *state = wDevAddr->userData;
struct i2c_msg msg[2] = { struct i2c_msg msg[2] = {
{ .addr = wDevAddr->i2cAddr, {.addr = wDevAddr->i2cAddr,
.flags = 0, .buf = wData, .len = wCount }, .flags = 0,.buf = wData,.len = wCount},
{ .addr = rDevAddr->i2cAddr, {.addr = rDevAddr->i2cAddr,
.flags = I2C_M_RD, .buf = rData, .len = rCount }, .flags = I2C_M_RD,.buf = rData,.len = rCount},
}; };
printk("drx3933 i2c operation addr=%x i2c=%p, wc=%x rc=%x\n", printk("drx3933 i2c operation addr=%x i2c=%p, wc=%x rc=%x\n",
......
...@@ -99,7 +99,6 @@ ...@@ -99,7 +99,6 @@
*; /* illegal statement to force compiler error */ *; /* illegal statement to force compiler error */
#endif #endif
/******************************************** /********************************************
* Single/master multi master setting * Single/master multi master setting
********************************************/ ********************************************/
...@@ -239,8 +238,7 @@ ...@@ -239,8 +238,7 @@
extern "C" { extern "C" {
#endif #endif
extern DRXAccessFunc_t drxDapFASIFunct_g;
extern DRXAccessFunc_t drxDapFASIFunct_g;
#define DRXDAP_FASI_RMW 0x10000000 #define DRXDAP_FASI_RMW 0x10000000
#define DRXDAP_FASI_BROADCAST 0x20000000 #define DRXDAP_FASI_BROADCAST 0x20000000
...@@ -259,10 +257,7 @@ extern DRXAccessFunc_t drxDapFASIFunct_g; ...@@ -259,10 +257,7 @@ extern DRXAccessFunc_t drxDapFASIFunct_g;
#define DRXDAP_FASI_LONG_FORMAT( addr ) (((addr)& 0xFC30FF80)!=0) #define DRXDAP_FASI_LONG_FORMAT( addr ) (((addr)& 0xFC30FF80)!=0)
#define DRXDAP_FASI_OFFSET_TOO_LARGE( addr ) (((addr)& 0x00008000)!=0) #define DRXDAP_FASI_OFFSET_TOO_LARGE( addr ) (((addr)& 0x00008000)!=0)
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* __DRX_DAP_FASI_H__ */ #endif /* __DRX_DAP_FASI_H__ */
...@@ -53,11 +53,10 @@ extern "C" { ...@@ -53,11 +53,10 @@ extern "C" {
#ifdef _REGISTERTABLE_ #ifdef _REGISTERTABLE_
#include <registertable.h> #include <registertable.h>
extern RegisterTable_t drx_driver_version[]; extern RegisterTable_t drx_driver_version[];
extern RegisterTableInfo_t drx_driver_version_info[]; extern RegisterTableInfo_t drx_driver_version_info[];
#endif /* _REGISTERTABLE_ */ #endif /* _REGISTERTABLE_ */
/* /*
*============================================================================== *==============================================================================
* VERSION * VERSION
...@@ -73,9 +72,7 @@ extern RegisterTableInfo_t drx_driver_version_info[]; ...@@ -73,9 +72,7 @@ extern RegisterTableInfo_t drx_driver_version_info[];
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* __DRX_DRIVER_VERSION__H__ */ #endif /* __DRX_DRIVER_VERSION__H__ */
/* /*
* End of file (drx_driver_version.h) * End of file (drx_driver_version.h)
******************************************************************************* *******************************************************************************
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment