PD#165008: Modify atv io ctrl and memory alloc for atv crash.
Change-Id: Ib6aa737ffad5d155022ad276ecf16ce2a7537138
Signed-off-by: nengwen.chen <nengwen.chen@amlogic.com>
int size_io_reg = 0;
struct aml_atvdemod_device *dev = NULL;
- dev = devm_kmalloc(&pdev->dev, sizeof(struct aml_atvdemod_device),
- GFP_KERNEL);
+ dev = kzalloc(sizeof(struct aml_atvdemod_device), GFP_KERNEL);
if (!dev)
return -ENOMEM;
fail_register_v4l2:
fail_get_resource:
- /*devm_kfree(&pdev->dev, dev->cls.name);*/
- devm_kfree(&pdev->dev, dev);
+ kfree(dev);
pr_info("%s: fail.\n", __func__);
amlatvdemod_devp = NULL;
- /*devm_kfree(&pdev->dev, dev->cls.name);*/
- devm_kfree(&pdev->dev, dev);
+ kfree(dev);
pr_info("%s: OK.\n", __func__);
}
static int v4l2_frontend_set_mode(struct v4l2_frontend *v4l2_fe,
- unsigned long params)
+ int params)
{
int ret = 0;
struct v4l2_frontend_private *fepriv = v4l2_fe->frontend_priv;
struct analog_demod_ops *analog_ops = NULL;
int priv_cfg = 0;
- pr_dbg("%s: params = %ld.\n", __func__, params);
+ pr_dbg("%s: params = %d.\n", __func__, params);
fepriv->state = V4L2FE_STATE_IDLE;
break;
case V4L2_SET_MODE: /* 0x566c */
- ret = v4l2_frontend_set_mode(v4l2_fe, (unsigned long) arg);
+ ret = v4l2_frontend_set_mode(v4l2_fe, *((int *) arg));
break;
case V4L2_READ_STATUS:
#define V4L2_SET_FRONTEND _IOW('V', 105, struct v4l2_analog_parameters)
#define V4L2_GET_FRONTEND _IOR('V', 106, struct v4l2_analog_parameters)
#define V4L2_GET_EVENT _IOR('V', 107, struct v4l2_frontend_event)
-#define V4L2_SET_MODE _IO('V', 108)
+#define V4L2_SET_MODE _IOW('V', 108, int)
#define V4L2_READ_STATUS _IOR('V', 109, enum v4l2_status)
if (thd_flag == 0) {
thd_tmp_v += adec_rd_reg(OV_CNT_REPORT) & 0xffff;
- pr_dbg("#0x12:0x%x\n", (adec_rd_reg(OV_CNT_REPORT) & 0xffff));
+ pr_info("#0x12:0x%x\n", (adec_rd_reg(OV_CNT_REPORT) & 0xffff));
if (thd_cnt == 15) {
thd_tmp_v /= 3;
if (thd_tmp_v > audio_thd_threshold1) {
} else if (thd_flag == 1) {
thd_tmp_v += adec_rd_reg(OV_CNT_REPORT) & 0xffff;
- pr_dbg("#0x13:0x%x\n", (adec_rd_reg(OV_CNT_REPORT) & 0xffff));
+ pr_info("#0x13:0x%x\n", (adec_rd_reg(OV_CNT_REPORT) & 0xffff));
if (thd_cnt == 15) {
thd_tmp_v /= 3;
if (thd_tmp_v <= audio_thd_threshold2) {
last_stereo_flag = stereo_flag;
last_sap_flag = sap_flag;
- pr_dbg("atvdemod_monitor_audio done ....\n");
+ pr_info("atvdemod_monitor_audio done ....\n");
}
}