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

This commit is contained in:
Linux Build Service Account 2014-11-26 15:23:46 -08:00 committed by Gerrit - the friendly Code Review server
commit bdfa6d08f4
2 changed files with 29 additions and 1 deletions

View file

@ -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;
}
}
/*

View file

@ -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)