Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9a9a759c authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "ais: support field info report to user space"

parents d7f27ed7 ea9d0315
Loading
Loading
Loading
Loading
+26 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2014-2017, The Linux Foundation. All rights reserved.
 * Copyright (c) 2014-2018, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -1031,7 +1031,10 @@ static long adv7481_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg)
	struct msm_ba_v4l2_ioctl_t adv_arg = *(struct msm_ba_v4l2_ioctl_t *)arg;
	long ret = 0;
	int param = 0;
	uint8_t status = 0;
	struct timespec ts;
	struct csi_ctrl_params user_csi;
	struct field_info_params user_field;
	struct adv7481_vid_params vid_params;
	struct adv7481_hdmi_params hdmi_params;

@@ -1091,6 +1094,28 @@ static long adv7481_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg)
		}
		break;
	}
	case VIDIOC_G_FIELD_INFO:
		/* Select SDP read-only Map 1 */
		adv7481_wr_byte(&state->i2c_client, state->i2c_sdp_addr,
				SDP_RW_MAP_REG, 0x02);
		status = adv7481_rd_byte(&state->i2c_client,
				state->i2c_sdp_addr, SDP_RO_MAP_1_FIELD_ADDR);
		adv7481_wr_byte(&state->i2c_client, state->i2c_sdp_addr,
				SDP_RW_MAP_REG, 0x00);

		user_field.even_field = ADV_REG_GETFIELD(status,
				SDP_RO_MAP_1_EVEN_FIELD);
		get_monotonic_boottime(&ts);
		user_field.field_ts.tv_sec = ts.tv_sec;
		user_field.field_ts.tv_usec = ts.tv_nsec/1000;

		if (copy_to_user((void __user *)adv_arg.ptr,
			(void *)&user_field,
			sizeof(struct field_info_params))) {
			pr_err("%s: Failed to copy FIELD params\n", __func__);
			return -EINVAL;
		}
		break;
	default:
		pr_err("Not a typewriter! Command: 0x%x", cmd);
		ret = -ENOTTY;
+6 −1
Original line number Diff line number Diff line
/* Copyright (c) 2014-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2014-2018, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -411,6 +411,11 @@
#define SDP_RO_MAIN_IN_LOCK_BMSK                0x0001
#define SDP_RO_MAIN_IN_LOCK_SHFT                0

/* SDP R/O Map 1 Registers */
#define SDP_RO_MAP_1_FIELD_ADDR                 0x45
#define SDP_RO_MAP_1_EVEN_FIELD_BMSK            0x10
#define SDP_RO_MAP_1_EVEN_FIELD_SHFT            4


/*
 * CSI Map Registers
+4 −1
Original line number Diff line number Diff line
/* Copyright (c) 2013-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2018, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -164,6 +164,9 @@ struct msm_vfe_irq_ops {
	void (*config_irq)(struct vfe_device *vfe_dev,
		uint32_t irq_status0, uint32_t irq_status1,
		enum msm_isp_irq_operation);
	void (*process_sof_irq)(struct vfe_device *vfe_dev,
		uint32_t irq_status0, uint32_t irq_status1,
		struct msm_isp_timestamp *ts);
	void (*process_eof_irq)(struct vfe_device *vfe_dev,
		uint32_t irq_status0);
};
+18 −2
Original line number Diff line number Diff line
@@ -593,7 +593,6 @@ void msm_vfe47_process_reg_update(struct vfe_device *vfe_dev,
			case VFE_RAW_1:
			case VFE_RAW_2:
				msm_isp_increment_frame_id(vfe_dev, i, ts);
				msm_isp_notify(vfe_dev, ISP_EVENT_SOF, i, ts);
				msm_isp_update_framedrop_reg(vfe_dev, i);
				/*
				 * Reg Update is pseudo SOF for RDI,
@@ -641,7 +640,6 @@ void msm_vfe47_process_epoch_irq(struct vfe_device *vfe_dev,
		msm_isp_update_framedrop_reg(vfe_dev, VFE_PIX_0);
		msm_isp_update_stats_framedrop_reg(vfe_dev);
		msm_isp_update_error_frame_count(vfe_dev);
		msm_isp_notify(vfe_dev, ISP_EVENT_SOF, VFE_PIX_0, ts);
		if (vfe_dev->axi_data.src_info[VFE_PIX_0].raw_stream_count > 0
			&& vfe_dev->axi_data.src_info[VFE_PIX_0].
			pix_stream_count == 0) {
@@ -653,6 +651,23 @@ void msm_vfe47_process_epoch_irq(struct vfe_device *vfe_dev,
	}
}

void msm_isp47_process_sof_irq(struct vfe_device *vfe_dev,
	uint32_t irq_status0, uint32_t irq_status1,
	struct msm_isp_timestamp *ts)
{
	if ((!(irq_status0 & 0x1)) && (!(irq_status1 & 0xE0000000)))
		return;

	if (irq_status0 & BIT(0))
		msm_isp_notify(vfe_dev, ISP_EVENT_SOF, VFE_PIX_0, ts);
	if (irq_status1 & BIT(29))
		msm_isp_notify(vfe_dev, ISP_EVENT_SOF, VFE_RAW_0, ts);
	if (irq_status1 & BIT(30))
		msm_isp_notify(vfe_dev, ISP_EVENT_SOF, VFE_RAW_1, ts);
	if (irq_status1 & BIT(31))
		msm_isp_notify(vfe_dev, ISP_EVENT_SOF, VFE_RAW_2, ts);
}

void msm_isp47_process_eof_irq(struct vfe_device *vfe_dev,
	uint32_t irq_status0)
{
@@ -2709,6 +2724,7 @@ struct msm_vfe_hardware_info vfe47_hw_info = {
			.process_stats_irq = msm_isp_process_stats_irq,
			.process_epoch_irq = msm_vfe47_process_epoch_irq,
			.config_irq = msm_vfe47_config_irq,
			.process_sof_irq = msm_isp47_process_sof_irq,
			.process_eof_irq = msm_isp47_process_eof_irq,
		},
		.axi_ops = {
+4 −1
Original line number Diff line number Diff line
/* Copyright (c) 2013-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2013-2018, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -44,6 +44,9 @@ void msm_vfe47_process_reg_update(struct vfe_device *vfe_dev,
void msm_vfe47_process_epoch_irq(struct vfe_device *vfe_dev,
	uint32_t irq_status0, uint32_t irq_status1,
	struct msm_isp_timestamp *ts);
void msm_isp47_process_sof_irq(struct vfe_device *vfe_dev,
	uint32_t irq_status0, uint32_t irq_status1,
	struct msm_isp_timestamp *ts);
void msm_isp47_process_eof_irq(struct vfe_device *vfe_dev,
	uint32_t irq_status0);
void msm_vfe47_reg_update(struct vfe_device *vfe_dev,
Loading