Commit 2f1f7333 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

[media] drx-j: make checkpatch.pl happy

Fix the remaining checkpatch.pl compliants at drxj.
Acked-by: default avatarDevin Heitmueller <dheitmueller@kernellabs.com>
Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
parent c361fda0
...@@ -26,28 +26,17 @@ ...@@ -26,28 +26,17 @@
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 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 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE. POSSIBILITY OF SUCH DAMAGE.
*/
/******************************************************************************* DESCRIPTION:
* FILENAME: $Id: drx_dap_fasi.c,v 1.7 2009/12/28 14:36:21 carlo Exp $ Part of DRX driver.
* Data access protocol: Fast Access Sequential Interface (fasi)
* DESCRIPTION: Fast access, because of short addressing format (16 instead of 32 bits addr)
* Part of DRX driver. Sequential, because of I2C.
* Data access protocol: Fast Access Sequential Interface (fasi) These functions know how the chip's memory and registers are to be accessed,
* Fast access, because of short addressing format (16 instead of 32 bits addr) but nothing more.
* Sequential, because of I2C.
* These functions know how the chip's memory and registers are to be accessed, These functions should not need adapting to a new platform.
* but nothing more. */
*
* These functions should not need adapting to a new platform.
*
* USAGE:
* -
*
* NOTES:
*
*
*******************************************************************************/
#include "drx_dap_fasi.h" #include "drx_dap_fasi.h"
#include "drx_driver.h" /* for drxbsp_hst_memcpy() */ #include "drx_driver.h" /* for drxbsp_hst_memcpy() */
...@@ -221,9 +210,8 @@ static int drxdap_fasi_read_block(struct i2c_device_addr *dev_addr, ...@@ -221,9 +210,8 @@ static int drxdap_fasi_read_block(struct i2c_device_addr *dev_addr,
u16 overhead_size = 0; u16 overhead_size = 0;
/* Check parameters ******************************************************* */ /* Check parameters ******************************************************* */
if (dev_addr == NULL) { if (dev_addr == NULL)
return -EINVAL; return -EINVAL;
}
overhead_size = (IS_I2C_10BIT(dev_addr->i2c_addr) ? 2 : 1) + overhead_size = (IS_I2C_10BIT(dev_addr->i2c_addr) ? 2 : 1) +
(DRXDAP_FASI_LONG_FORMAT(addr) ? 4 : 2); (DRXDAP_FASI_LONG_FORMAT(addr) ? 4 : 2);
...@@ -252,8 +240,7 @@ static int drxdap_fasi_read_block(struct i2c_device_addr *dev_addr, ...@@ -252,8 +240,7 @@ static int drxdap_fasi_read_block(struct i2c_device_addr *dev_addr,
addr &= ~DRXDAP_FASI_FLAGS; addr &= ~DRXDAP_FASI_FLAGS;
addr |= flags; addr |= flags;
#if ((DRXDAPFASI_LONG_ADDR_ALLOWED == 1) && \ #if ((DRXDAPFASI_LONG_ADDR_ALLOWED == 1) && (DRXDAPFASI_SHORT_ADDR_ALLOWED == 1))
(DRXDAPFASI_SHORT_ADDR_ALLOWED == 1))
/* short format address preferred but long format otherwise */ /* short format address preferred but long format otherwise */
if (DRXDAP_FASI_LONG_FORMAT(addr)) { if (DRXDAP_FASI_LONG_FORMAT(addr)) {
#endif #endif
...@@ -263,8 +250,7 @@ static int drxdap_fasi_read_block(struct i2c_device_addr *dev_addr, ...@@ -263,8 +250,7 @@ static int drxdap_fasi_read_block(struct i2c_device_addr *dev_addr,
buf[bufx++] = (u8) ((addr >> 24) & 0xFF); buf[bufx++] = (u8) ((addr >> 24) & 0xFF);
buf[bufx++] = (u8) ((addr >> 7) & 0xFF); buf[bufx++] = (u8) ((addr >> 7) & 0xFF);
#endif #endif
#if ((DRXDAPFASI_LONG_ADDR_ALLOWED == 1) && \ #if ((DRXDAPFASI_LONG_ADDR_ALLOWED == 1) && (DRXDAPFASI_SHORT_ADDR_ALLOWED == 1))
(DRXDAPFASI_SHORT_ADDR_ALLOWED == 1))
} else { } else {
#endif #endif
#if (DRXDAPFASI_SHORT_ADDR_ALLOWED == 1) #if (DRXDAPFASI_SHORT_ADDR_ALLOWED == 1)
...@@ -273,8 +259,7 @@ static int drxdap_fasi_read_block(struct i2c_device_addr *dev_addr, ...@@ -273,8 +259,7 @@ static int drxdap_fasi_read_block(struct i2c_device_addr *dev_addr,
(u8) (((addr >> 16) & 0x0F) | (u8) (((addr >> 16) & 0x0F) |
((addr >> 18) & 0xF0)); ((addr >> 18) & 0xF0));
#endif #endif
#if ((DRXDAPFASI_LONG_ADDR_ALLOWED == 1) && \ #if ((DRXDAPFASI_LONG_ADDR_ALLOWED == 1) && (DRXDAPFASI_SHORT_ADDR_ALLOWED == 1))
(DRXDAPFASI_SHORT_ADDR_ALLOWED == 1))
} }
#endif #endif
...@@ -332,9 +317,8 @@ static int drxdap_fasi_read_modify_write_reg16(struct i2c_device_addr *dev_addr, ...@@ -332,9 +317,8 @@ static int drxdap_fasi_read_modify_write_reg16(struct i2c_device_addr *dev_addr,
int rc = -EIO; int rc = -EIO;
#if (DRXDAPFASI_LONG_ADDR_ALLOWED == 1) #if (DRXDAPFASI_LONG_ADDR_ALLOWED == 1)
if (rdata == NULL) { if (rdata == NULL)
return -EINVAL; return -EINVAL;
}
rc = drxdap_fasi_write_reg16(dev_addr, waddr, wdata, DRXDAP_FASI_RMW); rc = drxdap_fasi_write_reg16(dev_addr, waddr, wdata, DRXDAP_FASI_RMW);
if (rc == 0) if (rc == 0)
...@@ -369,9 +353,9 @@ static int drxdap_fasi_read_reg16(struct i2c_device_addr *dev_addr, ...@@ -369,9 +353,9 @@ static int drxdap_fasi_read_reg16(struct i2c_device_addr *dev_addr,
u8 buf[sizeof(*data)]; u8 buf[sizeof(*data)];
int rc; int rc;
if (!data) { if (!data)
return -EINVAL; return -EINVAL;
}
rc = drxdap_fasi_read_block(dev_addr, addr, sizeof(*data), buf, flags); rc = drxdap_fasi_read_block(dev_addr, addr, sizeof(*data), buf, flags);
*data = buf[0] + (((u16) buf[1]) << 8); *data = buf[0] + (((u16) buf[1]) << 8);
return rc; return rc;
...@@ -402,9 +386,9 @@ static int drxdap_fasi_read_reg32(struct i2c_device_addr *dev_addr, ...@@ -402,9 +386,9 @@ static int drxdap_fasi_read_reg32(struct i2c_device_addr *dev_addr,
u8 buf[sizeof(*data)]; u8 buf[sizeof(*data)];
int rc; int rc;
if (!data) { if (!data)
return -EINVAL; return -EINVAL;
}
rc = drxdap_fasi_read_block(dev_addr, addr, sizeof(*data), buf, flags); rc = drxdap_fasi_read_block(dev_addr, addr, sizeof(*data), buf, flags);
*data = (((u32) buf[0]) << 0) + *data = (((u32) buf[0]) << 0) +
(((u32) buf[1]) << 8) + (((u32) buf[1]) << 8) +
...@@ -446,9 +430,8 @@ static int drxdap_fasi_write_block(struct i2c_device_addr *dev_addr, ...@@ -446,9 +430,8 @@ static int drxdap_fasi_write_block(struct i2c_device_addr *dev_addr,
u16 block_size = 0; u16 block_size = 0;
/* Check parameters ******************************************************* */ /* Check parameters ******************************************************* */
if (dev_addr == NULL) { if (dev_addr == NULL)
return -EINVAL; return -EINVAL;
}
overhead_size = (IS_I2C_10BIT(dev_addr->i2c_addr) ? 2 : 1) + overhead_size = (IS_I2C_10BIT(dev_addr->i2c_addr) ? 2 : 1) +
(DRXDAP_FASI_LONG_FORMAT(addr) ? 4 : 2); (DRXDAP_FASI_LONG_FORMAT(addr) ? 4 : 2);
...@@ -457,9 +440,8 @@ static int drxdap_fasi_write_block(struct i2c_device_addr *dev_addr, ...@@ -457,9 +440,8 @@ static int drxdap_fasi_write_block(struct i2c_device_addr *dev_addr,
((!(DRXDAPFASI_LONG_ADDR_ALLOWED)) && ((!(DRXDAPFASI_LONG_ADDR_ALLOWED)) &&
DRXDAP_FASI_LONG_FORMAT(addr)) || DRXDAP_FASI_LONG_FORMAT(addr)) ||
(overhead_size > (DRXDAP_MAX_WCHUNKSIZE)) || (overhead_size > (DRXDAP_MAX_WCHUNKSIZE)) ||
((datasize != 0) && (data == NULL)) || ((datasize & 1) == 1)) { ((datasize != 0) && (data == NULL)) || ((datasize & 1) == 1))
return -EINVAL; return -EINVAL;
}
flags &= DRXDAP_FASI_FLAGS; flags &= DRXDAP_FASI_FLAGS;
flags &= ~DRXDAP_FASI_MODEFLAGS; flags &= ~DRXDAP_FASI_MODEFLAGS;
...@@ -476,8 +458,7 @@ static int drxdap_fasi_write_block(struct i2c_device_addr *dev_addr, ...@@ -476,8 +458,7 @@ static int drxdap_fasi_write_block(struct i2c_device_addr *dev_addr,
/* Buffer device address */ /* Buffer device address */
addr &= ~DRXDAP_FASI_FLAGS; addr &= ~DRXDAP_FASI_FLAGS;
addr |= flags; addr |= flags;
#if (((DRXDAPFASI_LONG_ADDR_ALLOWED) == 1) && \ #if (((DRXDAPFASI_LONG_ADDR_ALLOWED) == 1) && ((DRXDAPFASI_SHORT_ADDR_ALLOWED) == 1))
((DRXDAPFASI_SHORT_ADDR_ALLOWED) == 1))
/* short format address preferred but long format otherwise */ /* short format address preferred but long format otherwise */
if (DRXDAP_FASI_LONG_FORMAT(addr)) { if (DRXDAP_FASI_LONG_FORMAT(addr)) {
#endif #endif
...@@ -487,8 +468,7 @@ static int drxdap_fasi_write_block(struct i2c_device_addr *dev_addr, ...@@ -487,8 +468,7 @@ static int drxdap_fasi_write_block(struct i2c_device_addr *dev_addr,
buf[bufx++] = (u8) ((addr >> 24) & 0xFF); buf[bufx++] = (u8) ((addr >> 24) & 0xFF);
buf[bufx++] = (u8) ((addr >> 7) & 0xFF); buf[bufx++] = (u8) ((addr >> 7) & 0xFF);
#endif #endif
#if (((DRXDAPFASI_LONG_ADDR_ALLOWED) == 1) && \ #if (((DRXDAPFASI_LONG_ADDR_ALLOWED) == 1) && ((DRXDAPFASI_SHORT_ADDR_ALLOWED) == 1))
((DRXDAPFASI_SHORT_ADDR_ALLOWED) == 1))
} else { } else {
#endif #endif
#if ((DRXDAPFASI_SHORT_ADDR_ALLOWED) == 1) #if ((DRXDAPFASI_SHORT_ADDR_ALLOWED) == 1)
...@@ -497,8 +477,7 @@ static int drxdap_fasi_write_block(struct i2c_device_addr *dev_addr, ...@@ -497,8 +477,7 @@ static int drxdap_fasi_write_block(struct i2c_device_addr *dev_addr,
(u8) (((addr >> 16) & 0x0F) | (u8) (((addr >> 16) & 0x0F) |
((addr >> 18) & 0xF0)); ((addr >> 18) & 0xF0));
#endif #endif
#if (((DRXDAPFASI_LONG_ADDR_ALLOWED) == 1) && \ #if (((DRXDAPFASI_LONG_ADDR_ALLOWED) == 1) && ((DRXDAPFASI_SHORT_ADDR_ALLOWED) == 1))
((DRXDAPFASI_SHORT_ADDR_ALLOWED) == 1))
} }
#endif #endif
......
...@@ -234,11 +234,7 @@ ...@@ -234,11 +234,7 @@
/*-------- Public API functions ----------------------------------------------*/ /*-------- Public API functions ----------------------------------------------*/
#ifdef __cplusplus extern struct drx_access_func drx_dap_fasi_funct_g;
extern "C" {
#endif
extern struct drx_access_func drx_dap_fasi_funct_g;
#define DRXDAP_FASI_RMW 0x10000000 #define DRXDAP_FASI_RMW 0x10000000
#define DRXDAP_FASI_BROADCAST 0x20000000 #define DRXDAP_FASI_BROADCAST 0x20000000
...@@ -257,7 +253,4 @@ extern "C" { ...@@ -257,7 +253,4 @@ extern "C" {
#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
}
#endif
#endif /* __DRX_DAP_FASI_H__ */ #endif /* __DRX_DAP_FASI_H__ */
...@@ -226,31 +226,25 @@ static int scan_wait_for_lock(struct drx_demod_instance *demod, bool *is_locked) ...@@ -226,31 +226,25 @@ static int scan_wait_for_lock(struct drx_demod_instance *demod, bool *is_locked)
/* Start polling loop, checking for lock & timeout */ /* Start polling loop, checking for lock & timeout */
while (!done_waiting) { while (!done_waiting) {
if (drx_ctrl(demod, DRX_CTRL_LOCK_STATUS, &lock_state))
if (drx_ctrl(demod, DRX_CTRL_LOCK_STATUS, &lock_state) !=
0) {
return -EIO; return -EIO;
}
current_time = drxbsp_hst_clock(); current_time = drxbsp_hst_clock();
timer_value = current_time - start_time_lock_stage; timer_value = current_time - start_time_lock_stage;
if (lock_state >= desired_lock_state) { if (lock_state >= desired_lock_state) {
*is_locked = true; *is_locked = true;
done_waiting = true; done_waiting = true;
} /* if ( lock_state >= desired_lock_state ) .. */ } else if (lock_state == DRX_NEVER_LOCK) {
else if (lock_state == DRX_NEVER_LOCK) {
done_waiting = true; done_waiting = true;
} /* if ( lock_state == DRX_NEVER_LOCK ) .. */ } else if (timer_value > timeout_value) {
else if (timer_value > timeout_value) {
/* lock_state == DRX_NOT_LOCKED and timeout */ /* lock_state == DRX_NOT_LOCKED and timeout */
done_waiting = true; done_waiting = true;
} else { } else {
if (drxbsp_hst_sleep(10) != 0) { if (drxbsp_hst_sleep(10) != 0)
return -EIO; return -EIO;
} }
} /* if ( timer_value > timeout_value ) .. */ }
} /* while */
return 0; return 0;
} }
...@@ -356,36 +350,30 @@ scan_function_default(void *scan_context, ...@@ -356,36 +350,30 @@ scan_function_default(void *scan_context,
enum drx_scan_command scan_command, enum drx_scan_command scan_command,
struct drx_channel *scan_channel, bool *get_next_channel) struct drx_channel *scan_channel, bool *get_next_channel)
{ {
struct drx_demod_instance *demod = NULL; struct drx_demod_instance *demod = scan_context;
int status = -EIO; int status;
bool is_locked = false; bool is_locked = false;
demod = (struct drx_demod_instance *) scan_context; /* just return OK if not doing "scan next" */
if (scan_command != DRX_SCAN_COMMAND_NEXT)
if (scan_command != DRX_SCAN_COMMAND_NEXT) {
/* just return OK if not doing "scan next" */
return 0; return 0;
}
*get_next_channel = false; *get_next_channel = false;
status = drx_ctrl(demod, DRX_CTRL_SET_CHANNEL, scan_channel); status = drx_ctrl(demod, DRX_CTRL_SET_CHANNEL, scan_channel);
if (status != 0) { if (status)
return status; return status;
}
status = scan_wait_for_lock(demod, &is_locked); status = scan_wait_for_lock(demod, &is_locked);
if (status != 0) { if (status)
return status; return status;
}
/* done with this channel, move to next one */ /* done with this channel, move to next one */
*get_next_channel = true; *get_next_channel = true;
if (!is_locked) { if (!is_locked)
/* no channel found */ return -EBUSY; /* no channel found */
return -EBUSY;
}
/* channel found */ /* channel found */
return 0; return 0;
} }
...@@ -733,23 +721,20 @@ ctrl_program_tuner(struct drx_demod_instance *demod, struct drx_channel *channel ...@@ -733,23 +721,20 @@ ctrl_program_tuner(struct drx_demod_instance *demod, struct drx_channel *channel
bool tuner_slow_mode = false; bool tuner_slow_mode = false;
/* can't tune without a tuner */ /* can't tune without a tuner */
if (demod->my_tuner == NULL) { if (demod->my_tuner == NULL)
return -EINVAL; return -EINVAL;
}
common_attr = (struct drx_common_attr *) demod->my_common_attr; common_attr = demod->my_common_attr;
/* select analog or digital tuner mode based on current standard */ /* select analog or digital tuner mode based on current standard */
if (drx_ctrl(demod, DRX_CTRL_GET_STANDARD, &standard) != 0) { if (drx_ctrl(demod, DRX_CTRL_GET_STANDARD, &standard))
return -EIO; return -EIO;
}
if (DRX_ISATVSTD(standard)) { if (DRX_ISATVSTD(standard))
tuner_mode |= TUNER_MODE_ANALOG; tuner_mode |= TUNER_MODE_ANALOG;
} else { /* note: also for unknown standard */ else
tuner_mode |= TUNER_MODE_DIGITAL; tuner_mode |= TUNER_MODE_DIGITAL; /* also for unknown standard */
}
/* select tuner bandwidth */ /* select tuner bandwidth */
switch (channel->bandwidth) { switch (channel->bandwidth) {
...@@ -769,25 +754,23 @@ ctrl_program_tuner(struct drx_demod_instance *demod, struct drx_channel *channel ...@@ -769,25 +754,23 @@ ctrl_program_tuner(struct drx_demod_instance *demod, struct drx_channel *channel
tuner_slow_mode = DRX_ATTR_TUNERSLOWMODE(demod); tuner_slow_mode = DRX_ATTR_TUNERSLOWMODE(demod);
/* select fast (switch) or slow (lock) tuner mode */ /* select fast (switch) or slow (lock) tuner mode */
if (tuner_slow_mode) { if (tuner_slow_mode)
tuner_mode |= TUNER_MODE_LOCK; tuner_mode |= TUNER_MODE_LOCK;
} else { else
tuner_mode |= TUNER_MODE_SWITCH; tuner_mode |= TUNER_MODE_SWITCH;
}
if (common_attr->tuner_port_nr == 1) { if (common_attr->tuner_port_nr == 1) {
bool bridge_closed = true; bool bridge_closed = true;
int status_bridge = -EIO; int status_bridge = -EIO;
status_bridge = status_bridge = drx_ctrl(demod, DRX_CTRL_I2C_BRIDGE,
drx_ctrl(demod, DRX_CTRL_I2C_BRIDGE, &bridge_closed); &bridge_closed);
if (status_bridge != 0) { if (status_bridge)
return status_bridge; return status_bridge;
}
} }
status = drxbsp_tuner_set_frequency(demod->my_tuner, status = drxbsp_tuner_set_frequency(demod->my_tuner,
tuner_mode, channel->frequency); tuner_mode, channel->frequency);
/* attempt restoring bridge before checking status of set_frequency */ /* attempt restoring bridge before checking status of set_frequency */
if (common_attr->tuner_port_nr == 1) { if (common_attr->tuner_port_nr == 1) {
...@@ -796,24 +779,21 @@ ctrl_program_tuner(struct drx_demod_instance *demod, struct drx_channel *channel ...@@ -796,24 +779,21 @@ ctrl_program_tuner(struct drx_demod_instance *demod, struct drx_channel *channel
status_bridge = status_bridge =
drx_ctrl(demod, DRX_CTRL_I2C_BRIDGE, &bridge_closed); drx_ctrl(demod, DRX_CTRL_I2C_BRIDGE, &bridge_closed);
if (status_bridge != 0) { if (status_bridge)
return status_bridge; return status_bridge;
}
} }
/* now check status of drxbsp_tuner_set_frequency */ /* now check status of drxbsp_tuner_set_frequency */
if (status != 0) { if (status)
return status; return status;
}
/* get actual RF and IF frequencies from tuner */ /* get actual RF and IF frequencies from tuner */
status = drxbsp_tuner_get_frequency(demod->my_tuner, status = drxbsp_tuner_get_frequency(demod->my_tuner,
tuner_mode, tuner_mode,
&(channel->frequency), &(channel->frequency),
&(if_frequency)); &(if_frequency));
if (status != 0) { if (status)
return status; return status;
}
/* update common attributes with information available from this function; /* update common attributes with information available from this function;
TODO: check if this is required and safe */ TODO: check if this is required and safe */
...@@ -839,29 +819,27 @@ static int ctrl_dump_registers(struct drx_demod_instance *demod, ...@@ -839,29 +819,27 @@ static int ctrl_dump_registers(struct drx_demod_instance *demod,
{ {
u16 i = 0; u16 i = 0;
if (registers == NULL) { if (registers == NULL)
/* registers not supplied */ return -EINVAL; /* registers not supplied */
return -EINVAL;
}
/* start dumping registers */ /* start dumping registers */
while (registers[i].address != 0) { while (registers[i].address) {
int status = -EIO; int status = -EIO;
u16 value = 0; u16 value = 0;
u32 data = 0; u32 data = 0;
status = status = demod->my_access_funct->read_reg16func(demod->my_i2c_dev_addr,
demod->my_access_funct->read_reg16func(demod->my_i2c_dev_addr,
registers[i].address, registers[i].address,
&value, 0); &value, 0);
data = (u32) value; data = (u32) value;
if (status != 0) { /*
/* no breakouts; * On error: no breakouts;
depending on device ID, some HW blocks might not be available */ * depending on device ID, some HW blocks might not be available
*/
if (status)
data |= ((u32) status) << 16; data |= ((u32) status) << 16;
}
registers[i].data = data; registers[i].data = data;
i++; i++;
} }
...@@ -989,9 +967,8 @@ ctrl_u_code(struct drx_demod_instance *demod, ...@@ -989,9 +967,8 @@ ctrl_u_code(struct drx_demod_instance *demod,
dev_addr = demod->my_i2c_dev_addr; dev_addr = demod->my_i2c_dev_addr;
/* Check arguments */ /* Check arguments */
if ((mc_info == NULL) || (mc_info->mc_data == NULL)) { if ((mc_info == NULL) || (mc_info->mc_data == NULL))
return -EINVAL; return -EINVAL;
}
mc_data = mc_info->mc_data; mc_data = mc_info->mc_data;
...@@ -1001,10 +978,8 @@ ctrl_u_code(struct drx_demod_instance *demod, ...@@ -1001,10 +978,8 @@ ctrl_u_code(struct drx_demod_instance *demod,
mc_nr_of_blks = u_code_read16(mc_data); mc_nr_of_blks = u_code_read16(mc_data);
mc_data += sizeof(u16); mc_data += sizeof(u16);
if ((mc_magic_word != DRX_UCODE_MAGIC_WORD) || (mc_nr_of_blks == 0)) { if ((mc_magic_word != DRX_UCODE_MAGIC_WORD) || (mc_nr_of_blks == 0))
/* wrong endianess or wrong data ? */ return -EINVAL; /* wrong endianess or wrong data ? */
return -EINVAL;
}
/* Scan microcode blocks first for version info if uploading */ /* Scan microcode blocks first for version info if uploading */
if (action == UCODE_UPLOAD) { if (action == UCODE_UPLOAD) {
...@@ -1049,9 +1024,8 @@ ctrl_u_code(struct drx_demod_instance *demod, ...@@ -1049,9 +1024,8 @@ ctrl_u_code(struct drx_demod_instance *demod,
It is also valid if no validation control exists. It is also valid if no validation control exists.
*/ */
rc = drx_ctrl(demod, DRX_CTRL_VALIDATE_UCODE, NULL); rc = drx_ctrl(demod, DRX_CTRL_VALIDATE_UCODE, NULL);
if (rc != 0 && rc != -ENOTSUPP) { if (rc != 0 && rc != -ENOTSUPP)
return rc; return rc;
}
/* Restore data pointer */ /* Restore data pointer */
mc_data = mc_info->mc_data + 2 * sizeof(u16); mc_data = mc_info->mc_data + 2 * sizeof(u16);
...@@ -1149,9 +1123,8 @@ ctrl_u_code(struct drx_demod_instance *demod, ...@@ -1149,9 +1123,8 @@ ctrl_u_code(struct drx_demod_instance *demod,
mc_data_buffer, mc_data_buffer,
bytes_to_compare); bytes_to_compare);
if (result != 0) { if (result != 0)
return -EIO; return -EIO;
}
curr_addr += curr_addr +=
((dr_xaddr_t) ((dr_xaddr_t)
...@@ -1205,9 +1178,8 @@ ctrl_version(struct drx_demod_instance *demod, struct drx_version_list **version ...@@ -1205,9 +1178,8 @@ ctrl_version(struct drx_demod_instance *demod, struct drx_version_list **version
int return_status = -EIO; int return_status = -EIO;
/* Check arguments */ /* Check arguments */
if (version_list == NULL) { if (version_list == NULL)
return -EINVAL; return -EINVAL;
}
/* Get version info list from demod */ /* Get version info list from demod */
return_status = (*(demod->my_demod_funct->ctrl_func)) (demod, return_status = (*(demod->my_demod_funct->ctrl_func)) (demod,
...@@ -1231,9 +1203,8 @@ ctrl_version(struct drx_demod_instance *demod, struct drx_version_list **version ...@@ -1231,9 +1203,8 @@ ctrl_version(struct drx_demod_instance *demod, struct drx_version_list **version
/* Return version info in "bottom-up" order. This way, multiple /* Return version info in "bottom-up" order. This way, multiple
devices can be handled without using malloc. */ devices can be handled without using malloc. */
struct drx_version_list *current_list_element = demod_version_list; struct drx_version_list *current_list_element = demod_version_list;
while (current_list_element->next != NULL) { while (current_list_element->next != NULL)
current_list_element = current_list_element->next; current_list_element = current_list_element->next;
}
current_list_element->next = &drx_driver_core_version_list; current_list_element->next = &drx_driver_core_version_list;
*version_list = demod_version_list; *version_list = demod_version_list;
......
...@@ -47,10 +47,6 @@ ...@@ -47,10 +47,6 @@
#ifndef __DRX_DRIVER_VERSION__H__ #ifndef __DRX_DRIVER_VERSION__H__
#define __DRX_DRIVER_VERSION__H__ INCLUDED #define __DRX_DRIVER_VERSION__H__ INCLUDED
#ifdef __cplusplus
extern "C" {
#endif
#ifdef _REGISTERTABLE_ #ifdef _REGISTERTABLE_
#include <registertable.h> #include <registertable.h>
extern register_table_t drx_driver_version[]; extern register_table_t drx_driver_version[];
...@@ -69,9 +65,6 @@ extern "C" { ...@@ -69,9 +65,6 @@ extern "C" {
#define VERSION_MINOR 0 #define VERSION_MINOR 0
#define VERSION_PATCH 56 #define VERSION_PATCH 56
#ifdef __cplusplus
}
#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)
......
...@@ -27,14 +27,10 @@ ...@@ -27,14 +27,10 @@
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 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 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE. POSSIBILITY OF SUCH DAMAGE.
*/
/** DRXJ specific header file
* \file $Id: drxj.h,v 1.132 2009/12/22 12:13:48 danielg Exp $
* Authors: Dragan Savic, Milos Nikolic, Mihajlo Katona, Tao Ding, Paul Janssen
* \brief DRXJ specific header file
*
* \author Dragan Savic, Milos Nikolic, Mihajlo Katona, Tao Ding, Paul Janssen
*/ */
#ifndef __DRXJ_H__ #ifndef __DRXJ_H__
...@@ -46,10 +42,6 @@ INCLUDES ...@@ -46,10 +42,6 @@ INCLUDES
#include "drx_driver.h" #include "drx_driver.h"
#include "drx_dap_fasi.h" #include "drx_dap_fasi.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Check DRX-J specific dap condition */ /* Check DRX-J specific dap condition */
/* Multi master mode and short addr format only will not work. /* Multi master mode and short addr format only will not work.
RMW, CRC reset, broadcast and switching back to single master mode RMW, CRC reset, broadcast and switching back to single master mode
...@@ -322,7 +314,7 @@ struct drxj_cfg_oob_misc { ...@@ -322,7 +314,7 @@ struct drxj_cfg_oob_misc {
bool dig_gain_lock; bool dig_gain_lock;
bool ana_gain_lock; bool ana_gain_lock;
u8 state; u8 state;
}; };
/* /*
* Index of in array of coef * Index of in array of coef
...@@ -558,27 +550,6 @@ Access MACROS ...@@ -558,27 +550,6 @@ Access MACROS
#define DRXJ_ATTR_BTSC_DETECT(d) \ #define DRXJ_ATTR_BTSC_DETECT(d) \
(((struct drxj_data *)(d)->my_ext_attr)->aud_data.btsc_detect) (((struct drxj_data *)(d)->my_ext_attr)->aud_data.btsc_detect)
/**
* \brief Actual access macros
* \param d pointer to demod instance
* \param x value to set or to get
*
* SET macros must be used to set the value of an attribute.
* GET macros must be used to retrieve the value of an attribute.
* Depending on the value of DRX_USE_ACCESS_FUNCTIONS the macro's will be
* substituted by "direct-access-inline-code" or a function call.
*
*/
#define DRXJ_GET_BTSC_DETECT(d, x) \
do { \
(x) = DRXJ_ATTR_BTSC_DETECT((d); \
} while (0)
#define DRXJ_SET_BTSC_DETECT(d, x) \
do { \
DRXJ_ATTR_BTSC_DETECT(d) = (x); \
} while (0)
/*------------------------------------------------------------------------- /*-------------------------------------------------------------------------
DEFINES DEFINES
-------------------------------------------------------------------------*/ -------------------------------------------------------------------------*/
...@@ -669,12 +640,12 @@ DEFINES ...@@ -669,12 +640,12 @@ DEFINES
/* Convert OOB lock status to string */ /* Convert OOB lock status to string */
#define DRXJ_STR_OOB_LOCKSTATUS(x) ( \ #define DRXJ_STR_OOB_LOCKSTATUS(x) ( \
(x == DRX_NEVER_LOCK) ? "Never" : \ (x == DRX_NEVER_LOCK) ? "Never" : \
(x == DRX_NOT_LOCKED) ? "No" : \ (x == DRX_NOT_LOCKED) ? "No" : \
(x == DRX_LOCKED) ? "Locked" : \ (x == DRX_LOCKED) ? "Locked" : \
(x == DRX_LOCK_STATE_1) ? "AGC lock" : \ (x == DRX_LOCK_STATE_1) ? "AGC lock" : \
(x == DRX_LOCK_STATE_2) ? "sync lock" : \ (x == DRX_LOCK_STATE_2) ? "sync lock" : \
"(Invalid)") "(Invalid)")
/*------------------------------------------------------------------------- /*-------------------------------------------------------------------------
ENUM ENUM
...@@ -706,7 +677,4 @@ Exported GLOBAL VARIABLES ...@@ -706,7 +677,4 @@ Exported GLOBAL VARIABLES
/*------------------------------------------------------------------------- /*-------------------------------------------------------------------------
THE END THE END
-------------------------------------------------------------------------*/ -------------------------------------------------------------------------*/
#ifdef __cplusplus
}
#endif
#endif /* __DRXJ_H__ */ #endif /* __DRXJ_H__ */
...@@ -47,10 +47,6 @@ ...@@ -47,10 +47,6 @@
#ifndef __DRXJ_MAP__H__ #ifndef __DRXJ_MAP__H__
#define __DRXJ_MAP__H__ INCLUDED #define __DRXJ_MAP__H__ INCLUDED
#ifdef __cplusplus
extern "C" {
#endif
#ifdef _REGISTERTABLE_ #ifdef _REGISTERTABLE_
#include <registertable.h> #include <registertable.h>
extern register_table_t drxj_map[]; extern register_table_t drxj_map[];
...@@ -15056,7 +15052,4 @@ extern "C" { ...@@ -15056,7 +15052,4 @@ extern "C" {
#define VSB_EQTAP_RAM_EQTAP_RAM__M 0xFFF #define VSB_EQTAP_RAM_EQTAP_RAM__M 0xFFF
#define VSB_EQTAP_RAM_EQTAP_RAM__PRE 0x0 #define VSB_EQTAP_RAM_EQTAP_RAM__PRE 0x0
#ifdef __cplusplus
}
#endif
#endif #endif
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