mode_str = __plat_get_video_mode_name(mode);
- if (strcmp(mode_str, "invalid") != 0)
- strcat(hdmi_mode_str, mode_str);
- else
- strcpy(hdmi_mode_str, mode_str);
+ if (strcmp(mode_str, "invalid") != 0) {
+ if (strlen(mode_str) <
+ (sizeof(hdmi_mode_str) - strlen(hdmi_mode_str)))
+ strcat(hdmi_mode_str, mode_str);
+ } else {
+ if (strlen(mode_str) < sizeof(hdmi_mode_str))
+ strcpy(hdmi_mode_str, mode_str);
+ }
return sprintf(buf, "%s\n", hdmi_mode_str);
}
};
audio_sr = __hw_get_audio_sample_rate();
- if ((audio_sr < 0) || (audio_sr > sizeof(audio_sr_array)))
+ if ((audio_sr < 0) ||
+ (audio_sr >= (sizeof(audio_sr_array)/sizeof(char *))))
audio_sr = 0;
return sprintf(buf, "%s\n", audio_sr_array[audio_sr]);
{
struct hdmirx_ext_drv_s *hdrv = hdmirx_ext_get_driver();
- if ((hdrv) && (hdrv->hw.enable))
+ if (!hdrv)
+ return -1;
+
+ if (hdrv->hw.enable)
return hdrv->hw.enable();
hdrv->state = 1;
{
struct hdmirx_ext_drv_s *hdrv = hdmirx_ext_get_driver();
+ if (!hdrv)
+ return;
+
hdrv->state = 0;
- if ((hdrv) && (hdrv->hw.disable))
+
+ if (hdrv->hw.disable)
hdrv->hw.disable();
}
bAVI = Data[IF_HEADER_LENGTH] & ColorSpaceMask;
if (bAVI == RGB)
AVI->bInputColorSpace = SiI_RX_ICP_RGB;
- else if (bAVI == YCbCr422)
+ else if (bAVI == (BYTE)YCbCr422)
AVI->bInputColorSpace = SiI_RX_ICP_YCbCr422;
- else if (bAVI == YCbCr444)
+ else if (bAVI == (BYTE)YCbCr444)
AVI->bInputColorSpace = SiI_RX_ICP_YCbCr444;
bAVI = Data[IF_HEADER_LENGTH + 1] & ColorimetryMask;
if (bAVI == NoInfo)
AVI->bColorimetry = SiI_RX_ColorimetryNoInfo;
- else if (bAVI == ITU601)
+ else if (bAVI == (BYTE)ITU601)
AVI->bColorimetry = SiI_RX_ITU_601;
- else if (bAVI == ITU709)
+ else if (bAVI == (BYTE)ITU709)
AVI->bColorimetry = SiI_RX_ITU_709;
AVI->bPixRepl = Data[IF_HEADER_LENGTH + 4] & PixReplicationMask;
*/
void InitEEPROMWithDefaults(void)
{
- BYTE abData[6];
+ BYTE abData[7];
abData[0] = RX_API_ID_L;
abData[1] = RX_API_ID_H;
*/
static BYTE siiRXAPIConfig(void)
{
- BYTE abData[6];
+ BYTE abData[8];
BYTE bError;
WORD wDevId;
hlBlockWrite_8BAS((struct I2CShortCommandType_s *)&I2CComm, Data);
#endif
- hlWaitForAck(bEEPROMSlaveAddr, 100);
+ /*hlWaitForAck(bEEPROMSlaveAddr, 100);*/
}
/*----------------------------------------------------------------------*/
static void tvafe_avin_detect_parse_param(char *buf_orig, char **parm)
{
char *ps, *token;
- char delim1[2] = " ";
+ char delim1[3] = " ";
char delim2[2] = "\n";
unsigned int n = 0;
}
- } else{
+ } else {
for (i = 0; i < (ACD_REG_NUM+1); i++) {
ADAPTIVE_CHROMA_MODE_BIT, ADAPTIVE_CHROMA_MODE_WID);
W_APB_BIT(CVD2_CONTROL1, 0, CHROMA_BW_LO_BIT, CHROMA_BW_LO_WID);
- } else{
+ } else {
W_APB_REG(CVD2_VSYNC_NO_SIGNAL_THRESHOLD, 0xf0);
if (cvd2->config_fmt == TVIN_SIG_FMT_CVBS_PAL_I)
/*add for chroma state adjust dynamicly*/
/* vsync signal is not good */
W_APB_REG(CVD2_NOISE_THRESHOLD, 0x00);
- } else{
+ } else {
if (scene_colorful)
W_APB_REG(CVD2_VSYNC_CNTL, 0x02);
}
#endif
- } else{
+ } else {
if (cvd_nonstd_dbg_en)
tvafe_pr_info("%s: out of non-std signal.\n",
__func__);
W_APB_BIT(CVD2_ACTIVE_VIDEO_VHEIGHT, 0xc0,
VACTIVE_HEIGHT_BIT, VACTIVE_HEIGHT_WID);
- } else{
+ } else {
W_APB_BIT(CVD2_VSYNC_SIGNAL_THRESHOLD, 0,
VS_SIGNAL_AUTO_TH_BIT, VS_SIGNAL_AUTO_TH_WID);
cvd2->info.non_std_enable = 1;
- } else{
+ } else {
cvd2->info.non_std_enable = 0;
}
if (cvd2->hw.no_sig)/* || !cvd2->hw.h_lock) */
ret = true;
- } else{
+ } else {
if (cvd2->hw.no_sig || !cvd2->hw.h_lock || !cvd2->hw.v_lock)
ret = true;
__func__);
}
- } else{
+ } else {
if (R_APB_BIT(CVD2_CHROMA_DTO_INCREMENT_23_16,
CDTO_INC_23_16_BIT, CDTO_INC_23_16_WID) !=
/* line525 + 358 =>*/
/*confirm NTSC_M */
cvd2->info.state = TVAFE_CVD2_STATE_FIND;
- } else{
+ } else {
if (cvd_dbg_en)
tvafe_pr_info("%s dismatch ntsc m line625 %d, fsc358 %d,pal %d",
__func__, cvd2->hw.line625,
ret = true;
tvafe_cvd2_reinit(cvd2);
- } else{
+ } else {
ret = false;
cvd2->cvd2_init_en = false;
#ifdef TVAFE_CVD2_AUTO_DE_ENABLE
pga += step;
if (pga >= 255) /* set max value */
pga = 255;
- } else{
+ } else {
if (pga < step) /* set min value */
pga = 0;
else
static void tvafe_parse_param(char *buf_orig, char **parm)
{
char *ps, *token;
- char delim1[2] = " ";
+ char delim1[3] = " ";
char delim2[2] = "\n";
unsigned int n = 0;
char *buf_orig, *ps, *token;
char *parm[6] = {NULL};
struct tvafe_dev_s *devp;
- char delim1[2] = " ";
+ char delim1[3] = " ";
char delim2[2] = "\n";
strcat(delim1, delim2);
if (*token == '\0')
continue;
parm[n++] = token;
- }
+ }
if (!strncmp(parm[0], "dumpmem", strlen("dumpmem"))) {
if (parm[1] != NULL) {
struct file *filp = NULL;
tvafe_pr_info("%s: buffer len is zero\n", __func__);
return 0;
}
- if (!buf->data) {
+
+ if ((buf == NULL) || (buf->data == NULL)) {
if (capture_print_en)
tvafe_pr_info("%s: buffer data pointer is zero\n",
__func__);
tvafe_pr_info("search_table add err: start=%p,search=%p,end=%p\n",
table_start_addr, search_point, table_end_addr);
return NULL;
- } else if (search_size > VBI_BUFF2_SIZE) {
- tvafe_pr_info("search_size out of range\n");
- return NULL;
}
while (count++ < table_size) {
}
static int vbi_set_buffer_size(struct vbi_dev_s *dev,
- unsigned long size)
+ unsigned int size)
{
struct vbi_slicer_s *vbi_slicer = dev->slicer;
struct vbi_ringbuffer_s *buf = &vbi_slicer->buffer;
ssize_t ret = 0;
ssize_t timeout = 0;
- if (!src->data) {
+ if ((src == NULL) || (src->data == NULL)) {
tvafe_pr_info("%s: data null\n", __func__);
return 0;
}
{
int ret = 0;
void __user *argp = (void __user *)arg;
- unsigned long buffer_size_t;
+ unsigned int buffer_size_t;
struct vbi_dev_s *vbi_dev = file->private_data;
struct vbi_slicer_s *vbi_slicer = vbi_dev->slicer;
static void vbi_parse_param(char *buf_orig, char **parm)
{
char *ps, *token;
- char delim1[2] = " ";
+ char delim1[3] = " ";
char delim2[2] = "\n";
unsigned int n = 0;
char *buf_orig;
char *parm[6] = {NULL};
struct vbi_dev_s *devp = dev_get_drvdata(dev);
- struct vbi_slicer_s *vbi_slicer = devp->slicer;
- struct vbi_ringbuffer_s *vbi_buffer = &(vbi_slicer->buffer);
+ struct vbi_slicer_s *vbi_slicer;
+ struct vbi_ringbuffer_s *vbi_buffer;
long val;
int ret = 0;
if (!buff || !devp)
return len;
+
+ vbi_slicer = devp->slicer;
+ vbi_buffer = &(vbi_slicer->buffer);
+
buf_orig = kstrdup(buff, GFP_KERNEL);
vbi_parse_param(buf_orig, (char **)&parm);
if (!strncmp(parm[0], "dumpmem", strlen("dumpmem"))) {
} else if (!strncmp(parm[0], "set_size", strlen("set_size"))) {
if (kstrtol(parm[1], 10, &val) < 0)
return -EINVAL;
- vbi_set_buffer_size(devp, val);
+ vbi_set_buffer_size(devp, (unsigned int)val);
tvafe_pr_info(" set buf size to %d\n",
vbi_slicer->buffer.size);
} else if (!strncmp(parm[0], "set_type", strlen("set_type"))) {
req->low_latency = 0;
if (req->bot_flag)
index = (req->vf->index >> 8) & 0xff;
- if (index != 0xff && index >= 0
+ if (index != 0xff
&& index < p->size
&& p->dv_buf[index]) {
req->aux_buf = p->dv_buf[index];
static void vdin_parse_param(char *buf_orig, char **parm)
{
char *ps, *token;
- char delim1[2] = " ";
+ char delim1[3] = " ";
char delim2[2] = "\n";
unsigned int n = 0;
ps = buf_orig;
unsigned int addr_port = VDIN_CHROMA_ADDR_PORT;
unsigned int data_port = VDIN_CHROMA_DATA_PORT;
long val;
- char delim1[2] = " ";
+ char delim1[3] = " ";
char delim2[2] = "\n";
strcat(delim1, delim2);
unsigned int stamp = 0;
struct tvin_state_machine_ops_s *sm_ops;
int vdin2nr = 0;
- unsigned int offset, vf_drop_cnt;
+ unsigned int offset = 0, vf_drop_cnt = 0;
enum tvin_trans_fmt trans_fmt;
struct tvin_sig_property_s *prop, *pre_prop;
* because the spinlock may affect the system time.
*/
+ /* avoid null pointer oops */
+ if (!devp)
+ return IRQ_HANDLED;
+
+ if (!devp->frontend) {
+ devp->vdin_irq_flag = 1;
+ goto irq_handled;
+ }
+
/* ignore fake irq caused by sw reset*/
if (devp->vdin_reset_flag) {
devp->vdin_reset_flag = 0;
}
vf_drop_cnt = vdin_drop_cnt;
- /* avoid null pointer oops */
- if (!devp || !devp->frontend) {
- devp->vdin_irq_flag = 1;
- goto irq_handled;
- }
offset = devp->addr_offset;
isr_log(devp->vfp);
static long vdin_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
long ret = 0;
- int callmaster_status;
+ int callmaster_status = 0;
struct vdin_dev_s *devp = NULL;
void __user *argp = (void __user *)arg;
vfe->vf.index_disp = p->disp_index[0];
p->disp_mode[p->disp_index[p->skip_vf_num]] = VFRAME_DISP_MODE_OK;
- for (i = p->skip_vf_num - 1; (i >= 0) && (i < VFRAME_DISP_MAX_NUM); i--)
+ for (i = p->skip_vf_num - 1; i < VFRAME_DISP_MAX_NUM; i--)
p->disp_mode[p->disp_index[i]] = VFRAME_DISP_MODE_UNKNOWN;
}
/*disp mode skip
{
unsigned int i;
- for (i = p->skip_vf_num - 1; (i >= 0) && (i < VFRAME_DISP_MAX_NUM); i--)
+ for (i = p->skip_vf_num - 1; i < VFRAME_DISP_MAX_NUM; i--)
p->disp_mode[i] = VFRAME_DISP_MODE_SKIP;
}