return -EINVAL;
}
- DRX_GET_TUNERSLOWMODE(demod, tuner_slow_mode);
+ tuner_slow_mode = DRX_ATTR_TUNERSLOWMODE(demod);
/* select fast (switch) or slow (lock) tuner mode */
if (tuner_slow_mode) {
/* update common attributes with information available from this function;
TODO: check if this is required and safe */
- DRX_SET_INTERMEDIATEFREQ(demod, if_frequency);
+ DRX_ATTR_INTERMEDIATEFREQ(demod) = if_frequency;
return 0;
}
/* Scan microcode blocks first for version info if uploading */
if (action == UCODE_UPLOAD) {
/* Clear version block */
- DRX_SET_MCVERTYPE(demod, 0);
- DRX_SET_MCDEV(demod, 0);
- DRX_SET_MCVERSION(demod, 0);
- DRX_SET_MCPATCH(demod, 0);
+ DRX_ATTR_MCRECORD(demod).aux_type = 0;
+ DRX_ATTR_MCRECORD(demod).mc_dev_type = 0;
+ DRX_ATTR_MCRECORD(demod).mc_version = 0;
+ DRX_ATTR_MCRECORD(demod).mc_base_version = 0;
for (i = 0; i < mc_nr_of_blks; i++) {
drxu_code_block_hdr_t block_hdr;
u8 *auxblk = mc_info->mc_data + block_hdr.addr;
u16 auxtype = u_code_read16(auxblk);
if (DRX_ISMCVERTYPE(auxtype)) {
- DRX_SET_MCVERTYPE(demod,
- u_code_read16(auxblk));
+ DRX_ATTR_MCRECORD(demod).aux_type = u_code_read16(auxblk);
auxblk += sizeof(u16);
- DRX_SET_MCDEV(demod,
- u_code_read32(auxblk));
+ DRX_ATTR_MCRECORD(demod).mc_dev_type = u_code_read32(auxblk);
auxblk += sizeof(u32);
- DRX_SET_MCVERSION(demod,
- u_code_read32(auxblk));
+ DRX_ATTR_MCRECORD(demod).mc_version = u_code_read32(auxblk);
auxblk += sizeof(u32);
- DRX_SET_MCPATCH(demod,
- u_code_read32(auxblk));
+ DRX_ATTR_MCRECORD(demod).mc_base_version = u_code_read32(auxblk);
}
}
status = (*(demod->my_demod_funct->close_func)) (demod);
- DRX_SET_ISOPENED(demod, false);
+ DRX_ATTR_ISOPENED(demod) = false;
return status;
}
#define DRX_ATTR_TUNER(d) ((d)->my_tuner)
#define DRX_ATTR_I2CADDR(d) ((d)->my_i2c_dev_addr->i2c_addr)
#define DRX_ATTR_I2CDEVID(d) ((d)->my_i2c_dev_addr->i2c_dev_id)
-
-/**
-* \brief Actual access macro's
-* \param d pointer to demod instance
-* \param x value to set ar to get
-*
-* SET macro's must be used to set the value of an attribute.
-* GET macro's must be used to retrieve the value of an attribute.
-*
-*/
-
-/**************************/
-
-#define DRX_SET_MIRRORFREQSPECT(d, x) \
- do { \
- DRX_ATTR_MIRRORFREQSPECT(d) = (x); \
- } while (0)
-
-#define DRX_GET_MIRRORFREQSPECT(d, x) \
- do { \
- (x) = DRX_ATTR_MIRRORFREQSPECT(d); \
- } while (0)
-
-/**************************/
-
-#define DRX_SET_CURRENTPOWERMODE(d, x) \
- do { \
- DRX_ATTR_CURRENTPOWERMODE(d) = (x); \
- } while (0)
-
-#define DRX_GET_CURRENTPOWERMODE(d, x) \
- do { \
- (x) = DRX_ATTR_CURRENTPOWERMODE(d); \
- } while (0)
-
-/**************************/
-
-#define DRX_SET_MICROCODE(d, x) \
- do { \
- DRX_ATTR_MICROCODE(d) = (x); \
- } while (0)
-
-#define DRX_GET_MICROCODE(d, x) \
- do { \
- (x) = DRX_ATTR_MICROCODE(d); \
- } while (0)
-
-/**************************/
-
-#define DRX_SET_MICROCODESIZE(d, x) \
- do { \
- DRX_ATTR_MICROCODESIZE(d) = (x); \
- } while (0)
-
-#define DRX_GET_MICROCODESIZE(d, x) \
- do { \
- (x) = DRX_ATTR_MICROCODESIZE(d); \
- } while (0)
-
-/**************************/
-
-#define DRX_SET_VERIFYMICROCODE(d, x) \
- do { \
- DRX_ATTR_VERIFYMICROCODE(d) = (x); \
- } while (0)
-
-#define DRX_GET_VERIFYMICROCODE(d, x) \
- do { \
- (x) = DRX_ATTR_VERIFYMICROCODE(d); \
- } while (0)
-
-/**************************/
-
-#define DRX_SET_MCVERTYPE(d, x) \
- do { \
- DRX_ATTR_MCRECORD(d).aux_type = (x); \
- } while (0)
-
-#define DRX_GET_MCVERTYPE(d, x) \
- do { \
- (x) = DRX_ATTR_MCRECORD(d).aux_type; \
- } while (0)
-
-/**************************/
-
#define DRX_ISMCVERTYPE(x) ((x) == AUX_VER_RECORD)
/**************************/
-#define DRX_SET_MCDEV(d, x) \
- do { \
- DRX_ATTR_MCRECORD(d).mc_dev_type = (x); \
- } while (0)
-
-#define DRX_GET_MCDEV(d, x) \
- do { \
- (x) = DRX_ATTR_MCRECORD(d).mc_dev_type; \
- } while (0)
-
-/**************************/
-
-#define DRX_SET_MCVERSION(d, x) \
- do { \
- DRX_ATTR_MCRECORD(d).mc_version = (x); \
- } while (0)
-
-#define DRX_GET_MCVERSION(d, x) \
- do { \
- (x) = DRX_ATTR_MCRECORD(d).mc_version; \
- } while (0)
-
-/**************************/
-#define DRX_SET_MCPATCH(d, x) \
- do { \
- DRX_ATTR_MCRECORD(d).mc_base_version = (x); \
- } while (0)
-
-#define DRX_GET_MCPATCH(d, x) \
- do { \
- (x) = DRX_ATTR_MCRECORD(d).mc_base_version; \
- } while (0)
-
-/**************************/
-
-#define DRX_SET_I2CADDR(d, x) \
- do { \
- DRX_ATTR_I2CADDR(d) = (x); \
- } while (0)
-
-#define DRX_GET_I2CADDR(d, x) \
- do { \
- (x) = DRX_ATTR_I2CADDR(d); \
- } while (0)
-
-/**************************/
-
-#define DRX_SET_I2CDEVID(d, x) \
- do { \
- DRX_ATTR_I2CDEVID(d) = (x); \
- } while (0)
-
-#define DRX_GET_I2CDEVID(d, x) \
- do { \
- (x) = DRX_ATTR_I2CDEVID(d); \
- } while (0)
-
-/**************************/
-
-#define DRX_SET_USEBOOTLOADER(d, x) \
- do { \
- DRX_ATTR_USEBOOTLOADER(d) = (x); \
- } while (0)
-
-#define DRX_GET_USEBOOTLOADER(d, x) \
- do { \
- (x) = DRX_ATTR_USEBOOTLOADER(d); \
- } while (0)
-
-/**************************/
-
-#define DRX_SET_CURRENTSTANDARD(d, x) \
- do { \
- DRX_ATTR_CURRENTSTANDARD(d) = (x); \
- } while (0)
-
-#define DRX_GET_CURRENTSTANDARD(d, x) \
- do { \
- (x) = DRX_ATTR_CURRENTSTANDARD(d); \
- } while (0)
-
-/**************************/
-
-#define DRX_SET_PREVSTANDARD(d, x) \
- do { \
- DRX_ATTR_PREVSTANDARD(d) = (x); \
- } while (0)
-
-#define DRX_GET_PREVSTANDARD(d, x) \
- do { \
- (x) = DRX_ATTR_PREVSTANDARD(d); \
- } while (0)
-
-/**************************/
-
-#define DRX_SET_CACHESTANDARD(d, x) \
- do { \
- DRX_ATTR_CACHESTANDARD(d) = (x); \
- } while (0)
-
-#define DRX_GET_CACHESTANDARD(d, x) \
- do { \
- (x) = DRX_ATTR_CACHESTANDARD(d); \
- } while (0)
-
-/**************************/
-
-#define DRX_SET_CURRENTCHANNEL(d, x) \
- do { \
- DRX_ATTR_CURRENTCHANNEL(d) = (x); \
- } while (0)
-
-#define DRX_GET_CURRENTCHANNEL(d, x) \
- do { \
- (x) = DRX_ATTR_CURRENTCHANNEL(d); \
- } while (0)
-
-/**************************/
-
-#define DRX_SET_ISOPENED(d, x) \
- do { \
- DRX_ATTR_ISOPENED(d) = (x); \
- } while (0)
-
-#define DRX_GET_ISOPENED(d, x) \
- do { \
- (x) = DRX_ATTR_ISOPENED(d); \
- } while (0)
-
-/**************************/
-
-#define DRX_SET_TUNER(d, x) \
- do { \
- DRX_ATTR_TUNER(d) = (x); \
- } while (0)
-
-#define DRX_GET_TUNER(d, x) \
- do { \
- (x) = DRX_ATTR_TUNER(d); \
- } while (0)
-
-/**************************/
-
-#define DRX_SET_CAPABILITIES(d, x) \
- do { \
- DRX_ATTR_CAPABILITIES(d) = (x); \
- } while (0)
-
-#define DRX_GET_CAPABILITIES(d, x) \
- do { \
- (x) = DRX_ATTR_CAPABILITIES(d); \
- } while (0)
-
-/**************************/
-
-#define DRX_SET_PRODUCTID(d, x) \
- do { \
- DRX_ATTR_PRODUCTID(d) |= (x << 4); \
- } while (0)
-
-#define DRX_GET_PRODUCTID(d, x) \
- do { \
- (x) = (DRX_ATTR_PRODUCTID(d) >> 4); \
- } while (0)
-
-/**************************/
-
-#define DRX_SET_MFX(d, x) \
- do { \
- DRX_ATTR_PRODUCTID(d) |= (x); \
- } while (0)
-
-#define DRX_GET_MFX(d, x) \
- do { \
- (x) = (DRX_ATTR_PRODUCTID(d) & 0xF); \
- } while (0)
-
-/**************************/
-
-#define DRX_SET_INTERMEDIATEFREQ(d, x) \
- do { \
- DRX_ATTR_INTERMEDIATEFREQ(d) = (x); \
- } while (0)
-
-#define DRX_GET_INTERMEDIATEFREQ(d, x) \
- do { \
- (x) = DRX_ATTR_INTERMEDIATEFREQ(d); \
- } while (0)
-
-/**************************/
-
-#define DRX_SET_SYSCLOCKFREQ(d, x) \
- do { \
- DRX_ATTR_SYSCLOCKFREQ(d) = (x); \
- } while (0)
-
-#define DRX_GET_SYSCLOCKFREQ(d, x) \
- do { \
- (x) = DRX_ATTR_SYSCLOCKFREQ(d); \
- } while (0)
-
-/**************************/
-
-#define DRX_SET_TUNERRFAGCPOL(d, x) \
- do { \
- DRX_ATTR_TUNERRFAGCPOL(d) = (x); \
- } while (0)
-
-#define DRX_GET_TUNERRFAGCPOL(d, x) \
- do { \
- (x) = DRX_ATTR_TUNERRFAGCPOL(d); \
- } while (0)
-
-/**************************/
-
-#define DRX_SET_TUNERIFAGCPOL(d, x) \
- do { \
- DRX_ATTR_TUNERIFAGCPOL(d) = (x); \
- } while (0)
-
-#define DRX_GET_TUNERIFAGCPOL(d, x) \
- do { \
- (x) = DRX_ATTR_TUNERIFAGCPOL(d); \
- } while (0)
-
-/**************************/
-
-#define DRX_SET_TUNERSLOWMODE(d, x) \
- do { \
- DRX_ATTR_TUNERSLOWMODE(d) = (x); \
- } while (0)
-
-#define DRX_GET_TUNERSLOWMODE(d, x) \
- do { \
- (x) = DRX_ATTR_TUNERSLOWMODE(d); \
- } while (0)
-
-/**************************/
-
-#define DRX_SET_TUNERPORTNR(d, x) \
- do { \
- DRX_ATTR_TUNERSPORTNR(d) = (x); \
- } while (0)
-
-/**************************/
-
/* Macros with device-specific handling are converted to CFG functions */
#define DRX_ACCESSMACRO_SET(demod, value, cfg_name, data_type) \