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

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

Merge "msm: face detect: fill correct pose in face detection result"

parents ba6ee8cf 1534386d
Loading
Loading
Loading
Loading
+24 −1
Original line number Diff line number Diff line
@@ -374,11 +374,34 @@ void msm_fd_hw_get_result_angle_pose(struct msm_fd_device *fd, int idx,
	u32 *angle, u32 *pose)
{
	u32 reg;
	u32 pose_reg;

	reg = msm_fd_hw_read_reg(fd, MSM_FD_IOMEM_CORE,
		MSM_FD_RESULT_ANGLE_POSE(idx));
	*angle = (reg >> MSM_FD_RESULT_ANGLE_SHIFT) & MSM_FD_RESULT_ANGLE_MASK;
	*pose = (reg >> MSM_FD_RESULT_POSE_SHIFT) & MSM_FD_RESULT_POSE_MASK;
	pose_reg = (reg >> MSM_FD_RESULT_POSE_SHIFT) & MSM_FD_RESULT_POSE_MASK;

	switch (pose_reg) {
	case MSM_FD_RESULT_POSE_FRONT:
		*pose = MSM_FD_POSE_FRONT;
		break;
	case MSM_FD_RESULT_POSE_RIGHT_DIAGONAL:
		*pose = MSM_FD_POSE_RIGHT_DIAGONAL;
		break;
	case MSM_FD_RESULT_POSE_RIGHT:
		*pose = MSM_FD_POSE_RIGHT;
		break;
	case MSM_FD_RESULT_POSE_LEFT_DIAGONAL:
		*pose = MSM_FD_POSE_LEFT_DIAGONAL;
		break;
	case MSM_FD_RESULT_POSE_LEFT:
		*pose = MSM_FD_POSE_LEFT;
		break;
	default:
		dev_err(fd->dev, "Invalid pose from the engine\n");
		*pose = MSM_FD_POSE_FRONT;
		break;
	}
}

/*
+5 −0
Original line number Diff line number Diff line
@@ -77,6 +77,11 @@
#define MSM_FD_RESULT_ANGLE_SHIFT (0x000)
#define MSM_FD_RESULT_POSE_MASK   (0x7)
#define MSM_FD_RESULT_POSE_SHIFT  (0x9)
#define MSM_FD_RESULT_POSE_FRONT           (0x1)
#define MSM_FD_RESULT_POSE_RIGHT_DIAGONAL  (0x2)
#define MSM_FD_RESULT_POSE_RIGHT           (0x3)
#define MSM_FD_RESULT_POSE_LEFT_DIAGONAL   (0x4)
#define MSM_FD_RESULT_POSE_LEFT            (0x5)

/* FD misc registers */
#define MSM_FD_MISC_HW_VERSION (0x00)