[media] drx-j: get rid of the typedefs on bsp_i2c.h
Most of the hard work here were done by this small script: for i in *; do sed s,pI2CDeviceAddr_t,"struct i2c_device_addr *",g <$i >a && mv a $i; done for i in *; do sed s,I2CDeviceAddr_t,"struct i2c_device_addr",g <$i >a && mv a $i; done Only bsp_i2c.h were added by hand. Acked-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
This commit is contained in:
Родитель
c7db16ae19
Коммит
5b223b390d
|
@ -46,54 +46,19 @@
|
||||||
|
|
||||||
#ifndef __BSPI2C_H__
|
#ifndef __BSPI2C_H__
|
||||||
#define __BSPI2C_H__
|
#define __BSPI2C_H__
|
||||||
/*------------------------------------------------------------------------------
|
|
||||||
INCLUDES
|
|
||||||
------------------------------------------------------------------------------*/
|
|
||||||
#include "bsp_types.h"
|
#include "bsp_types.h"
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
/*
|
||||||
TYPEDEFS
|
* This structure contains the I2C address, the device ID and a userData pointer.
|
||||||
------------------------------------------------------------------------------*/
|
* The userData pointer can be used for application specific purposes.
|
||||||
|
*/
|
||||||
|
struct i2c_device_addr {
|
||||||
|
u16 i2cAddr; /* The I2C address of the device. */
|
||||||
|
u16 i2cDevId; /* The device identifier. */
|
||||||
|
void *userData; /* User data pointer */
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* \struct _I2CDeviceAddr_t
|
|
||||||
* \brief I2C device parameters.
|
|
||||||
*
|
|
||||||
* This structure contains the I2C address, the device ID and a userData pointer.
|
|
||||||
* The userData pointer can be used for application specific purposes.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
struct I2CDeviceAddr_t {
|
|
||||||
u16 i2cAddr;
|
|
||||||
/**< The I2C address of the device. */
|
|
||||||
u16 i2cDevId;
|
|
||||||
/**< The device identifier. */
|
|
||||||
void *userData;
|
|
||||||
/**< User data pointer */
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \typedef I2CDeviceAddr_t
|
|
||||||
* \brief I2C device parameters.
|
|
||||||
*
|
|
||||||
* This structure contains the I2C address and the device ID.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
typedef struct I2CDeviceAddr_t I2CDeviceAddr_t;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* \typedef pI2CDeviceAddr_t
|
|
||||||
* \brief Pointer to I2C device parameters.
|
|
||||||
*/
|
|
||||||
typedef I2CDeviceAddr_t *pI2CDeviceAddr_t;
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
|
||||||
DEFINES
|
|
||||||
------------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
|
||||||
MACROS
|
|
||||||
------------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \def IS_I2C_10BIT( addr )
|
* \def IS_I2C_10BIT( addr )
|
||||||
|
@ -106,14 +71,6 @@ MACROS
|
||||||
#define IS_I2C_10BIT(addr) \
|
#define IS_I2C_10BIT(addr) \
|
||||||
(((addr) & 0xF8) == 0xF0)
|
(((addr) & 0xF8) == 0xF0)
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
|
||||||
ENUM
|
|
||||||
------------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
|
||||||
STRUCTS
|
|
||||||
------------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
/*------------------------------------------------------------------------------
|
||||||
Exported FUNCTIONS
|
Exported FUNCTIONS
|
||||||
------------------------------------------------------------------------------*/
|
------------------------------------------------------------------------------*/
|
||||||
|
@ -137,10 +94,10 @@ Exported FUNCTIONS
|
||||||
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( struct i2c_device_addr *wDevAddr,
|
||||||
* u16_t wCount,
|
* u16_t wCount,
|
||||||
* pu8_t wData,
|
* pu8_t wData,
|
||||||
* pI2CDeviceAddr_t rDevAddr,
|
* struct i2c_device_addr *rDevAddr,
|
||||||
* u16_t rCount,
|
* u16_t rCount,
|
||||||
* pu8_t rData)
|
* pu8_t rData)
|
||||||
* \brief Read and/or write count bytes from I2C bus, store them in data[].
|
* \brief Read and/or write count bytes from I2C bus, store them in data[].
|
||||||
|
@ -166,10 +123,10 @@ Exported FUNCTIONS
|
||||||
* 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(struct i2c_device_addr *wDevAddr,
|
||||||
u16_t wCount,
|
u16_t wCount,
|
||||||
pu8_t wData,
|
pu8_t wData,
|
||||||
pI2CDeviceAddr_t rDevAddr,
|
struct i2c_device_addr *rDevAddr,
|
||||||
u16_t rCount, pu8_t rData);
|
u16_t rCount, pu8_t rData);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -138,10 +138,10 @@ TYPEDEFS
|
||||||
lockStat);
|
lockStat);
|
||||||
|
|
||||||
typedef DRXStatus_t(*TUNERi2cWriteReadFunc_t) (pTUNERInstance_t tuner,
|
typedef DRXStatus_t(*TUNERi2cWriteReadFunc_t) (pTUNERInstance_t tuner,
|
||||||
pI2CDeviceAddr_t
|
struct i2c_device_addr *
|
||||||
wDevAddr, u16_t wCount,
|
wDevAddr, u16_t wCount,
|
||||||
pu8_t wData,
|
pu8_t wData,
|
||||||
pI2CDeviceAddr_t
|
struct i2c_device_addr *
|
||||||
rDevAddr, u16_t rCount,
|
rDevAddr, u16_t rCount,
|
||||||
pu8_t rData);
|
pu8_t rData);
|
||||||
|
|
||||||
|
@ -157,7 +157,7 @@ TYPEDEFS
|
||||||
|
|
||||||
typedef struct TUNERInstance_s {
|
typedef struct TUNERInstance_s {
|
||||||
|
|
||||||
I2CDeviceAddr_t myI2CDevAddr;
|
struct i2c_device_addr myI2CDevAddr;
|
||||||
pTUNERCommonAttr_t myCommonAttr;
|
pTUNERCommonAttr_t myCommonAttr;
|
||||||
void *myExtAttr;
|
void *myExtAttr;
|
||||||
pTUNERFunc_t myFunct;
|
pTUNERFunc_t myFunct;
|
||||||
|
@ -193,10 +193,10 @@ Exported FUNCTIONS
|
||||||
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,
|
struct i2c_device_addr *wDevAddr,
|
||||||
u16_t wCount,
|
u16_t wCount,
|
||||||
pu8_t wData,
|
pu8_t wData,
|
||||||
pI2CDeviceAddr_t rDevAddr,
|
struct i2c_device_addr *rDevAddr,
|
||||||
u16_t rCount, pu8_t rData);
|
u16_t rCount, pu8_t rData);
|
||||||
|
|
||||||
/*------------------------------------------------------------------------------
|
/*------------------------------------------------------------------------------
|
||||||
|
|
|
@ -327,7 +327,7 @@ struct dvb_frontend *drx39xxj_attach(struct i2c_adapter *i2c)
|
||||||
{
|
{
|
||||||
struct drx39xxj_state *state = NULL;
|
struct drx39xxj_state *state = NULL;
|
||||||
|
|
||||||
I2CDeviceAddr_t *demodAddr = NULL;
|
struct i2c_device_addr *demodAddr = NULL;
|
||||||
DRXCommonAttr_t *demodCommAttr = NULL;
|
DRXCommonAttr_t *demodCommAttr = NULL;
|
||||||
DRXJData_t *demodExtAttr = NULL;
|
DRXJData_t *demodExtAttr = NULL;
|
||||||
DRXDemodInstance_t *demod = NULL;
|
DRXDemodInstance_t *demod = NULL;
|
||||||
|
@ -344,7 +344,7 @@ struct dvb_frontend *drx39xxj_attach(struct i2c_adapter *i2c)
|
||||||
if (demod == NULL)
|
if (demod == NULL)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
demodAddr = kmalloc(sizeof(I2CDeviceAddr_t), GFP_KERNEL);
|
demodAddr = kmalloc(sizeof(struct i2c_device_addr), GFP_KERNEL);
|
||||||
if (demodAddr == NULL)
|
if (demodAddr == NULL)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
|
@ -364,7 +364,7 @@ struct dvb_frontend *drx39xxj_attach(struct i2c_adapter *i2c)
|
||||||
|
|
||||||
demod->myI2CDevAddr = demodAddr;
|
demod->myI2CDevAddr = demodAddr;
|
||||||
memcpy(demod->myI2CDevAddr, &DRXJDefaultAddr_g,
|
memcpy(demod->myI2CDevAddr, &DRXJDefaultAddr_g,
|
||||||
sizeof(I2CDeviceAddr_t));
|
sizeof(struct i2c_device_addr));
|
||||||
demod->myI2CDevAddr->userData = state;
|
demod->myI2CDevAddr->userData = state;
|
||||||
demod->myCommonAttr = demodCommAttr;
|
demod->myCommonAttr = demodCommAttr;
|
||||||
memcpy(demod->myCommonAttr, &DRXJDefaultCommAttr_g,
|
memcpy(demod->myCommonAttr, &DRXJDefaultCommAttr_g,
|
||||||
|
|
|
@ -60,10 +60,10 @@ 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(struct i2c_device_addr *wDevAddr,
|
||||||
u16_t wCount,
|
u16_t wCount,
|
||||||
pu8_t wData,
|
pu8_t wData,
|
||||||
pI2CDeviceAddr_t rDevAddr,
|
struct i2c_device_addr *rDevAddr,
|
||||||
u16_t rCount, pu8_t rData)
|
u16_t rCount, pu8_t rData)
|
||||||
{
|
{
|
||||||
struct drx39xxj_state *state;
|
struct drx39xxj_state *state;
|
||||||
|
|
|
@ -55,61 +55,61 @@
|
||||||
/*============================================================================*/
|
/*============================================================================*/
|
||||||
|
|
||||||
/* Function prototypes */
|
/* Function prototypes */
|
||||||
static DRXStatus_t DRXDAP_FASI_WriteBlock(pI2CDeviceAddr_t devAddr, /* address of I2C device */
|
static DRXStatus_t DRXDAP_FASI_WriteBlock(struct i2c_device_addr *devAddr, /* address of I2C device */
|
||||||
DRXaddr_t addr, /* address of register/memory */
|
DRXaddr_t addr, /* address of register/memory */
|
||||||
u16_t datasize, /* size of data */
|
u16_t datasize, /* size of data */
|
||||||
pu8_t data, /* data to send */
|
pu8_t data, /* data to send */
|
||||||
DRXflags_t flags); /* special device flags */
|
DRXflags_t flags); /* special device flags */
|
||||||
|
|
||||||
static DRXStatus_t DRXDAP_FASI_ReadBlock(pI2CDeviceAddr_t devAddr, /* address of I2C device */
|
static DRXStatus_t DRXDAP_FASI_ReadBlock(struct i2c_device_addr *devAddr, /* address of I2C device */
|
||||||
DRXaddr_t addr, /* address of register/memory */
|
DRXaddr_t addr, /* address of register/memory */
|
||||||
u16_t datasize, /* size of data */
|
u16_t datasize, /* size of data */
|
||||||
pu8_t data, /* data to send */
|
pu8_t data, /* data to send */
|
||||||
DRXflags_t flags); /* special device flags */
|
DRXflags_t flags); /* special device flags */
|
||||||
|
|
||||||
static DRXStatus_t DRXDAP_FASI_WriteReg8(pI2CDeviceAddr_t devAddr, /* address of I2C device */
|
static DRXStatus_t DRXDAP_FASI_WriteReg8(struct i2c_device_addr *devAddr, /* address of I2C device */
|
||||||
DRXaddr_t addr, /* address of register */
|
DRXaddr_t addr, /* address of register */
|
||||||
u8_t data, /* data to write */
|
u8_t data, /* data to write */
|
||||||
DRXflags_t flags); /* special device flags */
|
DRXflags_t flags); /* special device flags */
|
||||||
|
|
||||||
static DRXStatus_t DRXDAP_FASI_ReadReg8(pI2CDeviceAddr_t devAddr, /* address of I2C device */
|
static DRXStatus_t DRXDAP_FASI_ReadReg8(struct i2c_device_addr *devAddr, /* address of I2C device */
|
||||||
DRXaddr_t addr, /* address of register */
|
DRXaddr_t addr, /* address of register */
|
||||||
pu8_t data, /* buffer to receive data */
|
pu8_t data, /* buffer to receive data */
|
||||||
DRXflags_t flags); /* special device flags */
|
DRXflags_t flags); /* special device flags */
|
||||||
|
|
||||||
static DRXStatus_t DRXDAP_FASI_ReadModifyWriteReg8(pI2CDeviceAddr_t devAddr, /* address of I2C device */
|
static DRXStatus_t DRXDAP_FASI_ReadModifyWriteReg8(struct i2c_device_addr *devAddr, /* address of I2C device */
|
||||||
DRXaddr_t waddr, /* address of register */
|
DRXaddr_t waddr, /* address of register */
|
||||||
DRXaddr_t raddr, /* address to read back from */
|
DRXaddr_t raddr, /* address to read back from */
|
||||||
u8_t datain, /* data to send */
|
u8_t datain, /* data to send */
|
||||||
pu8_t dataout); /* data to receive back */
|
pu8_t dataout); /* data to receive back */
|
||||||
|
|
||||||
static DRXStatus_t DRXDAP_FASI_WriteReg16(pI2CDeviceAddr_t devAddr, /* address of I2C device */
|
static DRXStatus_t DRXDAP_FASI_WriteReg16(struct i2c_device_addr *devAddr, /* address of I2C device */
|
||||||
DRXaddr_t addr, /* address of register */
|
DRXaddr_t addr, /* address of register */
|
||||||
u16_t data, /* data to write */
|
u16_t data, /* data to write */
|
||||||
DRXflags_t flags); /* special device flags */
|
DRXflags_t flags); /* special device flags */
|
||||||
|
|
||||||
static DRXStatus_t DRXDAP_FASI_ReadReg16(pI2CDeviceAddr_t devAddr, /* address of I2C device */
|
static DRXStatus_t DRXDAP_FASI_ReadReg16(struct i2c_device_addr *devAddr, /* address of I2C device */
|
||||||
DRXaddr_t addr, /* address of register */
|
DRXaddr_t addr, /* address of register */
|
||||||
pu16_t data, /* buffer to receive data */
|
pu16_t data, /* buffer to receive data */
|
||||||
DRXflags_t flags); /* special device flags */
|
DRXflags_t flags); /* special device flags */
|
||||||
|
|
||||||
static DRXStatus_t DRXDAP_FASI_ReadModifyWriteReg16(pI2CDeviceAddr_t devAddr, /* address of I2C device */
|
static DRXStatus_t DRXDAP_FASI_ReadModifyWriteReg16(struct i2c_device_addr *devAddr, /* address of I2C device */
|
||||||
DRXaddr_t waddr, /* address of register */
|
DRXaddr_t waddr, /* address of register */
|
||||||
DRXaddr_t raddr, /* address to read back from */
|
DRXaddr_t raddr, /* address to read back from */
|
||||||
u16_t datain, /* data to send */
|
u16_t datain, /* data to send */
|
||||||
pu16_t dataout); /* data to receive back */
|
pu16_t dataout); /* data to receive back */
|
||||||
|
|
||||||
static DRXStatus_t DRXDAP_FASI_WriteReg32(pI2CDeviceAddr_t devAddr, /* address of I2C device */
|
static DRXStatus_t DRXDAP_FASI_WriteReg32(struct i2c_device_addr *devAddr, /* address of I2C device */
|
||||||
DRXaddr_t addr, /* address of register */
|
DRXaddr_t addr, /* address of register */
|
||||||
u32_t data, /* data to write */
|
u32_t data, /* data to write */
|
||||||
DRXflags_t flags); /* special device flags */
|
DRXflags_t flags); /* special device flags */
|
||||||
|
|
||||||
static DRXStatus_t DRXDAP_FASI_ReadReg32(pI2CDeviceAddr_t devAddr, /* address of I2C device */
|
static DRXStatus_t DRXDAP_FASI_ReadReg32(struct i2c_device_addr *devAddr, /* address of I2C device */
|
||||||
DRXaddr_t addr, /* address of register */
|
DRXaddr_t addr, /* address of register */
|
||||||
pu32_t data, /* buffer to receive data */
|
pu32_t data, /* buffer to receive data */
|
||||||
DRXflags_t flags); /* special device flags */
|
DRXflags_t flags); /* special device flags */
|
||||||
|
|
||||||
static DRXStatus_t DRXDAP_FASI_ReadModifyWriteReg32(pI2CDeviceAddr_t devAddr, /* address of I2C device */
|
static DRXStatus_t DRXDAP_FASI_ReadModifyWriteReg32(struct i2c_device_addr *devAddr, /* address of I2C device */
|
||||||
DRXaddr_t waddr, /* address of register */
|
DRXaddr_t waddr, /* address of register */
|
||||||
DRXaddr_t raddr, /* address to read back from */
|
DRXaddr_t raddr, /* address to read back from */
|
||||||
u32_t datain, /* data to send */
|
u32_t datain, /* data to send */
|
||||||
|
@ -149,7 +149,7 @@ DRXAccessFunc_t drxDapFASIFunct_g = {
|
||||||
|
|
||||||
/* Functions not supported by protocol*/
|
/* Functions not supported by protocol*/
|
||||||
|
|
||||||
static DRXStatus_t DRXDAP_FASI_WriteReg8(pI2CDeviceAddr_t devAddr, /* address of I2C device */
|
static DRXStatus_t DRXDAP_FASI_WriteReg8(struct i2c_device_addr *devAddr, /* address of I2C device */
|
||||||
DRXaddr_t addr, /* address of register */
|
DRXaddr_t addr, /* address of register */
|
||||||
u8_t data, /* data to write */
|
u8_t data, /* data to write */
|
||||||
DRXflags_t flags)
|
DRXflags_t flags)
|
||||||
|
@ -157,7 +157,7 @@ static DRXStatus_t DRXDAP_FASI_WriteReg8(pI2CDeviceAddr_t devAddr, /* address of
|
||||||
return DRX_STS_ERROR;
|
return DRX_STS_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
static DRXStatus_t DRXDAP_FASI_ReadReg8(pI2CDeviceAddr_t devAddr, /* address of I2C device */
|
static DRXStatus_t DRXDAP_FASI_ReadReg8(struct i2c_device_addr *devAddr, /* address of I2C device */
|
||||||
DRXaddr_t addr, /* address of register */
|
DRXaddr_t addr, /* address of register */
|
||||||
pu8_t data, /* buffer to receive data */
|
pu8_t data, /* buffer to receive data */
|
||||||
DRXflags_t flags)
|
DRXflags_t flags)
|
||||||
|
@ -165,7 +165,7 @@ static DRXStatus_t DRXDAP_FASI_ReadReg8(pI2CDeviceAddr_t devAddr, /* address of
|
||||||
return DRX_STS_ERROR;
|
return DRX_STS_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
static DRXStatus_t DRXDAP_FASI_ReadModifyWriteReg8(pI2CDeviceAddr_t devAddr, /* address of I2C device */
|
static DRXStatus_t DRXDAP_FASI_ReadModifyWriteReg8(struct i2c_device_addr *devAddr, /* address of I2C device */
|
||||||
DRXaddr_t waddr, /* address of register */
|
DRXaddr_t waddr, /* address of register */
|
||||||
DRXaddr_t raddr, /* address to read back from */
|
DRXaddr_t raddr, /* address to read back from */
|
||||||
u8_t datain, /* data to send */
|
u8_t datain, /* data to send */
|
||||||
|
@ -174,7 +174,7 @@ static DRXStatus_t DRXDAP_FASI_ReadModifyWriteReg8(pI2CDeviceAddr_t devAddr, /*
|
||||||
return DRX_STS_ERROR;
|
return DRX_STS_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
static DRXStatus_t DRXDAP_FASI_ReadModifyWriteReg32(pI2CDeviceAddr_t devAddr, /* address of I2C device */
|
static DRXStatus_t DRXDAP_FASI_ReadModifyWriteReg32(struct i2c_device_addr *devAddr, /* address of I2C device */
|
||||||
DRXaddr_t waddr, /* address of register */
|
DRXaddr_t waddr, /* address of register */
|
||||||
DRXaddr_t raddr, /* address to read back from */
|
DRXaddr_t raddr, /* address to read back from */
|
||||||
u32_t datain, /* data to send */
|
u32_t datain, /* data to send */
|
||||||
|
@ -188,7 +188,7 @@ static DRXStatus_t DRXDAP_FASI_ReadModifyWriteReg32(pI2CDeviceAddr_t devAddr, /*
|
||||||
/******************************
|
/******************************
|
||||||
*
|
*
|
||||||
* DRXStatus_t DRXDAP_FASI_ReadBlock (
|
* DRXStatus_t DRXDAP_FASI_ReadBlock (
|
||||||
* pI2CDeviceAddr_t devAddr, -- address of I2C device
|
* struct i2c_device_addr *devAddr, -- address of I2C device
|
||||||
* DRXaddr_t addr, -- address of chip register/memory
|
* DRXaddr_t addr, -- address of chip register/memory
|
||||||
* u16_t datasize, -- number of bytes to read
|
* u16_t datasize, -- number of bytes to read
|
||||||
* pu8_t data, -- data to receive
|
* pu8_t data, -- data to receive
|
||||||
|
@ -210,7 +210,7 @@ static DRXStatus_t DRXDAP_FASI_ReadModifyWriteReg32(pI2CDeviceAddr_t devAddr, /*
|
||||||
*
|
*
|
||||||
******************************/
|
******************************/
|
||||||
|
|
||||||
static DRXStatus_t DRXDAP_FASI_ReadBlock(pI2CDeviceAddr_t devAddr,
|
static DRXStatus_t DRXDAP_FASI_ReadBlock(struct i2c_device_addr *devAddr,
|
||||||
DRXaddr_t addr,
|
DRXaddr_t addr,
|
||||||
u16_t datasize,
|
u16_t datasize,
|
||||||
pu8_t data, DRXflags_t flags)
|
pu8_t data, DRXflags_t flags)
|
||||||
|
@ -303,7 +303,7 @@ static DRXStatus_t DRXDAP_FASI_ReadBlock(pI2CDeviceAddr_t devAddr,
|
||||||
/******************************
|
/******************************
|
||||||
*
|
*
|
||||||
* DRXStatus_t DRXDAP_FASI_ReadModifyWriteReg16 (
|
* DRXStatus_t DRXDAP_FASI_ReadModifyWriteReg16 (
|
||||||
* pI2CDeviceAddr_t devAddr, -- address of I2C device
|
* struct i2c_device_addr *devAddr, -- address of I2C device
|
||||||
* DRXaddr_t waddr, -- address of chip register/memory
|
* DRXaddr_t waddr, -- address of chip register/memory
|
||||||
* DRXaddr_t raddr, -- chip address to read back from
|
* DRXaddr_t raddr, -- chip address to read back from
|
||||||
* u16_t wdata, -- data to send
|
* u16_t wdata, -- data to send
|
||||||
|
@ -325,7 +325,7 @@ static DRXStatus_t DRXDAP_FASI_ReadBlock(pI2CDeviceAddr_t devAddr,
|
||||||
*
|
*
|
||||||
******************************/
|
******************************/
|
||||||
|
|
||||||
static DRXStatus_t DRXDAP_FASI_ReadModifyWriteReg16(pI2CDeviceAddr_t devAddr,
|
static DRXStatus_t DRXDAP_FASI_ReadModifyWriteReg16(struct i2c_device_addr *devAddr,
|
||||||
DRXaddr_t waddr,
|
DRXaddr_t waddr,
|
||||||
DRXaddr_t raddr,
|
DRXaddr_t raddr,
|
||||||
u16_t wdata, pu16_t rdata)
|
u16_t wdata, pu16_t rdata)
|
||||||
|
@ -349,7 +349,7 @@ static DRXStatus_t DRXDAP_FASI_ReadModifyWriteReg16(pI2CDeviceAddr_t devAddr,
|
||||||
/******************************
|
/******************************
|
||||||
*
|
*
|
||||||
* DRXStatus_t DRXDAP_FASI_ReadReg16 (
|
* DRXStatus_t DRXDAP_FASI_ReadReg16 (
|
||||||
* pI2CDeviceAddr_t devAddr, -- address of I2C device
|
* struct i2c_device_addr *devAddr, -- address of I2C device
|
||||||
* DRXaddr_t addr, -- address of chip register/memory
|
* DRXaddr_t addr, -- address of chip register/memory
|
||||||
* pu16_t data, -- data to receive
|
* pu16_t data, -- data to receive
|
||||||
* DRXflags_t flags) -- special device flags
|
* DRXflags_t flags) -- special device flags
|
||||||
|
@ -364,7 +364,7 @@ static DRXStatus_t DRXDAP_FASI_ReadModifyWriteReg16(pI2CDeviceAddr_t devAddr,
|
||||||
*
|
*
|
||||||
******************************/
|
******************************/
|
||||||
|
|
||||||
static DRXStatus_t DRXDAP_FASI_ReadReg16(pI2CDeviceAddr_t devAddr,
|
static DRXStatus_t DRXDAP_FASI_ReadReg16(struct i2c_device_addr *devAddr,
|
||||||
DRXaddr_t addr,
|
DRXaddr_t addr,
|
||||||
pu16_t data, DRXflags_t flags)
|
pu16_t data, DRXflags_t flags)
|
||||||
{
|
{
|
||||||
|
@ -382,7 +382,7 @@ static DRXStatus_t DRXDAP_FASI_ReadReg16(pI2CDeviceAddr_t devAddr,
|
||||||
/******************************
|
/******************************
|
||||||
*
|
*
|
||||||
* DRXStatus_t DRXDAP_FASI_ReadReg32 (
|
* DRXStatus_t DRXDAP_FASI_ReadReg32 (
|
||||||
* pI2CDeviceAddr_t devAddr, -- address of I2C device
|
* struct i2c_device_addr *devAddr, -- address of I2C device
|
||||||
* DRXaddr_t addr, -- address of chip register/memory
|
* DRXaddr_t addr, -- address of chip register/memory
|
||||||
* pu32_t data, -- data to receive
|
* pu32_t data, -- data to receive
|
||||||
* DRXflags_t flags) -- special device flags
|
* DRXflags_t flags) -- special device flags
|
||||||
|
@ -397,7 +397,7 @@ static DRXStatus_t DRXDAP_FASI_ReadReg16(pI2CDeviceAddr_t devAddr,
|
||||||
*
|
*
|
||||||
******************************/
|
******************************/
|
||||||
|
|
||||||
static DRXStatus_t DRXDAP_FASI_ReadReg32(pI2CDeviceAddr_t devAddr,
|
static DRXStatus_t DRXDAP_FASI_ReadReg32(struct i2c_device_addr *devAddr,
|
||||||
DRXaddr_t addr,
|
DRXaddr_t addr,
|
||||||
pu32_t data, DRXflags_t flags)
|
pu32_t data, DRXflags_t flags)
|
||||||
{
|
{
|
||||||
|
@ -417,7 +417,7 @@ static DRXStatus_t DRXDAP_FASI_ReadReg32(pI2CDeviceAddr_t devAddr,
|
||||||
/******************************
|
/******************************
|
||||||
*
|
*
|
||||||
* DRXStatus_t DRXDAP_FASI_WriteBlock (
|
* DRXStatus_t DRXDAP_FASI_WriteBlock (
|
||||||
* pI2CDeviceAddr_t devAddr, -- address of I2C device
|
* struct i2c_device_addr *devAddr, -- address of I2C device
|
||||||
* DRXaddr_t addr, -- address of chip register/memory
|
* DRXaddr_t addr, -- address of chip register/memory
|
||||||
* u16_t datasize, -- number of bytes to read
|
* u16_t datasize, -- number of bytes to read
|
||||||
* pu8_t data, -- data to receive
|
* pu8_t data, -- data to receive
|
||||||
|
@ -436,7 +436,7 @@ static DRXStatus_t DRXDAP_FASI_ReadReg32(pI2CDeviceAddr_t devAddr,
|
||||||
*
|
*
|
||||||
******************************/
|
******************************/
|
||||||
|
|
||||||
static DRXStatus_t DRXDAP_FASI_WriteBlock(pI2CDeviceAddr_t devAddr,
|
static DRXStatus_t DRXDAP_FASI_WriteBlock(struct i2c_device_addr *devAddr,
|
||||||
DRXaddr_t addr,
|
DRXaddr_t addr,
|
||||||
u16_t datasize,
|
u16_t datasize,
|
||||||
pu8_t data, DRXflags_t flags)
|
pu8_t data, DRXflags_t flags)
|
||||||
|
@ -526,7 +526,7 @@ static DRXStatus_t DRXDAP_FASI_WriteBlock(pI2CDeviceAddr_t devAddr,
|
||||||
st = DRXBSP_I2C_WriteRead(devAddr,
|
st = DRXBSP_I2C_WriteRead(devAddr,
|
||||||
(u16_t) (bufx),
|
(u16_t) (bufx),
|
||||||
buf,
|
buf,
|
||||||
(pI2CDeviceAddr_t) (NULL),
|
(struct i2c_device_addr *) (NULL),
|
||||||
0, (pu8_t) (NULL));
|
0, (pu8_t) (NULL));
|
||||||
|
|
||||||
if ((st != DRX_STS_OK) && (firstErr == DRX_STS_OK)) {
|
if ((st != DRX_STS_OK) && (firstErr == DRX_STS_OK)) {
|
||||||
|
@ -543,7 +543,7 @@ static DRXStatus_t DRXDAP_FASI_WriteBlock(pI2CDeviceAddr_t devAddr,
|
||||||
st = DRXBSP_I2C_WriteRead(devAddr,
|
st = DRXBSP_I2C_WriteRead(devAddr,
|
||||||
(u16_t) (bufx + todo),
|
(u16_t) (bufx + todo),
|
||||||
buf,
|
buf,
|
||||||
(pI2CDeviceAddr_t) (NULL),
|
(struct i2c_device_addr *) (NULL),
|
||||||
0, (pu8_t) (NULL));
|
0, (pu8_t) (NULL));
|
||||||
|
|
||||||
if ((st != DRX_STS_OK) && (firstErr == DRX_STS_OK)) {
|
if ((st != DRX_STS_OK) && (firstErr == DRX_STS_OK)) {
|
||||||
|
@ -561,7 +561,7 @@ static DRXStatus_t DRXDAP_FASI_WriteBlock(pI2CDeviceAddr_t devAddr,
|
||||||
/******************************
|
/******************************
|
||||||
*
|
*
|
||||||
* DRXStatus_t DRXDAP_FASI_WriteReg16 (
|
* DRXStatus_t DRXDAP_FASI_WriteReg16 (
|
||||||
* pI2CDeviceAddr_t devAddr, -- address of I2C device
|
* struct i2c_device_addr *devAddr, -- address of I2C device
|
||||||
* DRXaddr_t addr, -- address of chip register/memory
|
* DRXaddr_t addr, -- address of chip register/memory
|
||||||
* u16_t data, -- data to send
|
* u16_t data, -- data to send
|
||||||
* DRXflags_t flags) -- special device flags
|
* DRXflags_t flags) -- special device flags
|
||||||
|
@ -575,7 +575,7 @@ static DRXStatus_t DRXDAP_FASI_WriteBlock(pI2CDeviceAddr_t devAddr,
|
||||||
*
|
*
|
||||||
******************************/
|
******************************/
|
||||||
|
|
||||||
static DRXStatus_t DRXDAP_FASI_WriteReg16(pI2CDeviceAddr_t devAddr,
|
static DRXStatus_t DRXDAP_FASI_WriteReg16(struct i2c_device_addr *devAddr,
|
||||||
DRXaddr_t addr,
|
DRXaddr_t addr,
|
||||||
u16_t data, DRXflags_t flags)
|
u16_t data, DRXflags_t flags)
|
||||||
{
|
{
|
||||||
|
@ -590,7 +590,7 @@ static DRXStatus_t DRXDAP_FASI_WriteReg16(pI2CDeviceAddr_t devAddr,
|
||||||
/******************************
|
/******************************
|
||||||
*
|
*
|
||||||
* DRXStatus_t DRXDAP_FASI_WriteReg32 (
|
* DRXStatus_t DRXDAP_FASI_WriteReg32 (
|
||||||
* pI2CDeviceAddr_t devAddr, -- address of I2C device
|
* struct i2c_device_addr *devAddr, -- address of I2C device
|
||||||
* DRXaddr_t addr, -- address of chip register/memory
|
* DRXaddr_t addr, -- address of chip register/memory
|
||||||
* u32_t data, -- data to send
|
* u32_t data, -- data to send
|
||||||
* DRXflags_t flags) -- special device flags
|
* DRXflags_t flags) -- special device flags
|
||||||
|
@ -604,7 +604,7 @@ static DRXStatus_t DRXDAP_FASI_WriteReg16(pI2CDeviceAddr_t devAddr,
|
||||||
*
|
*
|
||||||
******************************/
|
******************************/
|
||||||
|
|
||||||
static DRXStatus_t DRXDAP_FASI_WriteReg32(pI2CDeviceAddr_t devAddr,
|
static DRXStatus_t DRXDAP_FASI_WriteReg32(struct i2c_device_addr *devAddr,
|
||||||
DRXaddr_t addr,
|
DRXaddr_t addr,
|
||||||
u32_t data, DRXflags_t flags)
|
u32_t data, DRXflags_t flags)
|
||||||
{
|
{
|
||||||
|
|
|
@ -991,7 +991,7 @@ CtrlUCode(pDRXDemodInstance_t demod,
|
||||||
u16_t mcNrOfBlks = 0;
|
u16_t mcNrOfBlks = 0;
|
||||||
u16_t mcMagicWord = 0;
|
u16_t mcMagicWord = 0;
|
||||||
pu8_t mcData = (pu8_t) (NULL);
|
pu8_t mcData = (pu8_t) (NULL);
|
||||||
pI2CDeviceAddr_t devAddr = (pI2CDeviceAddr_t) (NULL);
|
struct i2c_device_addr *devAddr = (struct i2c_device_addr *) (NULL);
|
||||||
|
|
||||||
devAddr = demod->myI2CDevAddr;
|
devAddr = demod->myI2CDevAddr;
|
||||||
|
|
||||||
|
|
|
@ -1329,11 +1329,11 @@ STRUCTS
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
u16_t portNr; /**< I2C port number */
|
u16_t portNr; /**< I2C port number */
|
||||||
pI2CDeviceAddr_t wDevAddr;
|
struct i2c_device_addr *wDevAddr;
|
||||||
/**< Write device address */
|
/**< Write device address */
|
||||||
u16_t wCount; /**< Size of write data in bytes */
|
u16_t wCount; /**< Size of write data in bytes */
|
||||||
pu8_t wData; /**< Pointer to write data */
|
pu8_t wData; /**< Pointer to write data */
|
||||||
pI2CDeviceAddr_t rDevAddr;
|
struct i2c_device_addr *rDevAddr;
|
||||||
/**< Read device address */
|
/**< Read device address */
|
||||||
u16_t rCount; /**< Size of data to read in bytes */
|
u16_t rCount; /**< Size of data to read in bytes */
|
||||||
pu8_t rData; /**< Pointer to read buffer */
|
pu8_t rData; /**< Pointer to read buffer */
|
||||||
|
@ -1726,71 +1726,71 @@ STRUCTS
|
||||||
typedef u32_t DRXflags_t, *pDRXflags_t;
|
typedef u32_t DRXflags_t, *pDRXflags_t;
|
||||||
|
|
||||||
/* Write block of data to device */
|
/* Write block of data to device */
|
||||||
typedef DRXStatus_t(*DRXWriteBlockFunc_t) (pI2CDeviceAddr_t devAddr, /* address of I2C device */
|
typedef DRXStatus_t(*DRXWriteBlockFunc_t) (struct i2c_device_addr *devAddr, /* address of I2C device */
|
||||||
DRXaddr_t addr, /* address of register/memory */
|
DRXaddr_t addr, /* address of register/memory */
|
||||||
u16_t datasize, /* size of data in bytes */
|
u16_t datasize, /* size of data in bytes */
|
||||||
pu8_t data, /* data to send */
|
pu8_t data, /* data to send */
|
||||||
DRXflags_t flags);
|
DRXflags_t flags);
|
||||||
|
|
||||||
/* Read block of data from device */
|
/* Read block of data from device */
|
||||||
typedef DRXStatus_t(*DRXReadBlockFunc_t) (pI2CDeviceAddr_t devAddr, /* address of I2C device */
|
typedef DRXStatus_t(*DRXReadBlockFunc_t) (struct i2c_device_addr *devAddr, /* address of I2C device */
|
||||||
DRXaddr_t addr, /* address of register/memory */
|
DRXaddr_t addr, /* address of register/memory */
|
||||||
u16_t datasize, /* size of data in bytes */
|
u16_t datasize, /* size of data in bytes */
|
||||||
pu8_t data, /* receive buffer */
|
pu8_t data, /* receive buffer */
|
||||||
DRXflags_t flags);
|
DRXflags_t flags);
|
||||||
|
|
||||||
/* Write 8-bits value to device */
|
/* Write 8-bits value to device */
|
||||||
typedef DRXStatus_t(*DRXWriteReg8Func_t) (pI2CDeviceAddr_t devAddr, /* address of I2C device */
|
typedef DRXStatus_t(*DRXWriteReg8Func_t) (struct i2c_device_addr *devAddr, /* address of I2C device */
|
||||||
DRXaddr_t addr, /* address of register/memory */
|
DRXaddr_t addr, /* address of register/memory */
|
||||||
u8_t data, /* data to send */
|
u8_t data, /* data to send */
|
||||||
DRXflags_t flags);
|
DRXflags_t flags);
|
||||||
|
|
||||||
/* Read 8-bits value to device */
|
/* Read 8-bits value to device */
|
||||||
typedef DRXStatus_t(*DRXReadReg8Func_t) (pI2CDeviceAddr_t devAddr, /* address of I2C device */
|
typedef DRXStatus_t(*DRXReadReg8Func_t) (struct i2c_device_addr *devAddr, /* address of I2C device */
|
||||||
DRXaddr_t addr, /* address of register/memory */
|
DRXaddr_t addr, /* address of register/memory */
|
||||||
pu8_t data, /* receive buffer */
|
pu8_t data, /* receive buffer */
|
||||||
DRXflags_t flags);
|
DRXflags_t flags);
|
||||||
|
|
||||||
/* Read modify write 8-bits value to device */
|
/* Read modify write 8-bits value to device */
|
||||||
typedef DRXStatus_t(*DRXReadModifyWriteReg8Func_t) (pI2CDeviceAddr_t devAddr, /* address of I2C device */
|
typedef DRXStatus_t(*DRXReadModifyWriteReg8Func_t) (struct i2c_device_addr *devAddr, /* address of I2C device */
|
||||||
DRXaddr_t waddr, /* write address of register */
|
DRXaddr_t waddr, /* write address of register */
|
||||||
DRXaddr_t raddr, /* read address of register */
|
DRXaddr_t raddr, /* read address of register */
|
||||||
u8_t wdata, /* data to write */
|
u8_t wdata, /* data to write */
|
||||||
pu8_t rdata); /* data to read */
|
pu8_t rdata); /* data to read */
|
||||||
|
|
||||||
/* Write 16-bits value to device */
|
/* Write 16-bits value to device */
|
||||||
typedef DRXStatus_t(*DRXWriteReg16Func_t) (pI2CDeviceAddr_t devAddr, /* address of I2C device */
|
typedef DRXStatus_t(*DRXWriteReg16Func_t) (struct i2c_device_addr *devAddr, /* address of I2C device */
|
||||||
DRXaddr_t addr, /* address of register/memory */
|
DRXaddr_t addr, /* address of register/memory */
|
||||||
u16_t data, /* data to send */
|
u16_t data, /* data to send */
|
||||||
DRXflags_t flags);
|
DRXflags_t flags);
|
||||||
|
|
||||||
/* Read 16-bits value to device */
|
/* Read 16-bits value to device */
|
||||||
typedef DRXStatus_t(*DRXReadReg16Func_t) (pI2CDeviceAddr_t devAddr, /* address of I2C device */
|
typedef DRXStatus_t(*DRXReadReg16Func_t) (struct i2c_device_addr *devAddr, /* address of I2C device */
|
||||||
DRXaddr_t addr, /* address of register/memory */
|
DRXaddr_t addr, /* address of register/memory */
|
||||||
pu16_t data, /* receive buffer */
|
pu16_t data, /* receive buffer */
|
||||||
DRXflags_t flags);
|
DRXflags_t flags);
|
||||||
|
|
||||||
/* Read modify write 16-bits value to device */
|
/* Read modify write 16-bits value to device */
|
||||||
typedef DRXStatus_t(*DRXReadModifyWriteReg16Func_t) (pI2CDeviceAddr_t devAddr, /* address of I2C device */
|
typedef DRXStatus_t(*DRXReadModifyWriteReg16Func_t) (struct i2c_device_addr *devAddr, /* address of I2C device */
|
||||||
DRXaddr_t waddr, /* write address of register */
|
DRXaddr_t waddr, /* write address of register */
|
||||||
DRXaddr_t raddr, /* read address of register */
|
DRXaddr_t raddr, /* read address of register */
|
||||||
u16_t wdata, /* data to write */
|
u16_t wdata, /* data to write */
|
||||||
pu16_t rdata); /* data to read */
|
pu16_t rdata); /* data to read */
|
||||||
|
|
||||||
/* Write 32-bits value to device */
|
/* Write 32-bits value to device */
|
||||||
typedef DRXStatus_t(*DRXWriteReg32Func_t) (pI2CDeviceAddr_t devAddr, /* address of I2C device */
|
typedef DRXStatus_t(*DRXWriteReg32Func_t) (struct i2c_device_addr *devAddr, /* address of I2C device */
|
||||||
DRXaddr_t addr, /* address of register/memory */
|
DRXaddr_t addr, /* address of register/memory */
|
||||||
u32_t data, /* data to send */
|
u32_t data, /* data to send */
|
||||||
DRXflags_t flags);
|
DRXflags_t flags);
|
||||||
|
|
||||||
/* Read 32-bits value to device */
|
/* Read 32-bits value to device */
|
||||||
typedef DRXStatus_t(*DRXReadReg32Func_t) (pI2CDeviceAddr_t devAddr, /* address of I2C device */
|
typedef DRXStatus_t(*DRXReadReg32Func_t) (struct i2c_device_addr *devAddr, /* address of I2C device */
|
||||||
DRXaddr_t addr, /* address of register/memory */
|
DRXaddr_t addr, /* address of register/memory */
|
||||||
pu32_t data, /* receive buffer */
|
pu32_t data, /* receive buffer */
|
||||||
DRXflags_t flags);
|
DRXflags_t flags);
|
||||||
|
|
||||||
/* Read modify write 32-bits value to device */
|
/* Read modify write 32-bits value to device */
|
||||||
typedef DRXStatus_t(*DRXReadModifyWriteReg32Func_t) (pI2CDeviceAddr_t devAddr, /* address of I2C device */
|
typedef DRXStatus_t(*DRXReadModifyWriteReg32Func_t) (struct i2c_device_addr *devAddr, /* address of I2C device */
|
||||||
DRXaddr_t waddr, /* write address of register */
|
DRXaddr_t waddr, /* write address of register */
|
||||||
DRXaddr_t raddr, /* read address of register */
|
DRXaddr_t raddr, /* read address of register */
|
||||||
u32_t wdata, /* data to write */
|
u32_t wdata, /* data to write */
|
||||||
|
@ -1948,7 +1948,7 @@ STRUCTS
|
||||||
/**< data access protocol functions */
|
/**< data access protocol functions */
|
||||||
pTUNERInstance_t myTuner;
|
pTUNERInstance_t myTuner;
|
||||||
/**< tuner instance,if NULL then baseband */
|
/**< tuner instance,if NULL then baseband */
|
||||||
pI2CDeviceAddr_t myI2CDevAddr;
|
struct i2c_device_addr *myI2CDevAddr;
|
||||||
/**< i2c address and device identifier */
|
/**< i2c address and device identifier */
|
||||||
pDRXCommonAttr_t myCommonAttr;
|
pDRXCommonAttr_t myCommonAttr;
|
||||||
/**< common DRX attributes */
|
/**< common DRX attributes */
|
||||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -734,7 +734,7 @@ Exported GLOBAL VARIABLES
|
||||||
extern DRXAccessFunc_t drxDapDRXJFunct_g;
|
extern DRXAccessFunc_t drxDapDRXJFunct_g;
|
||||||
extern DRXDemodFunc_t DRXJFunctions_g;
|
extern DRXDemodFunc_t DRXJFunctions_g;
|
||||||
extern DRXJData_t DRXJData_g;
|
extern DRXJData_t DRXJData_g;
|
||||||
extern I2CDeviceAddr_t DRXJDefaultAddr_g;
|
extern struct i2c_device_addr DRXJDefaultAddr_g;
|
||||||
extern DRXCommonAttr_t DRXJDefaultCommAttr_g;
|
extern DRXCommonAttr_t DRXJDefaultCommAttr_g;
|
||||||
extern DRXDemodInstance_t DRXJDefaultDemod_g;
|
extern DRXDemodInstance_t DRXJDefaultDemod_g;
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче