From patchwork Wed Aug 30 17:48:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mani, Rajmohan" X-Patchwork-Id: 9930407 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D04E360383 for ; Wed, 30 Aug 2017 17:56:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C716328737 for ; Wed, 30 Aug 2017 17:56:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BB8C32873F; Wed, 30 Aug 2017 17:56:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4304928737 for ; Wed, 30 Aug 2017 17:56:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751572AbdH3R4p (ORCPT ); Wed, 30 Aug 2017 13:56:45 -0400 Received: from mga05.intel.com ([192.55.52.43]:57614 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751357AbdH3R4o (ORCPT ); Wed, 30 Aug 2017 13:56:44 -0400 Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga105.fm.intel.com with ESMTP; 30 Aug 2017 10:56:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,449,1498546800"; d="scan'208";a="146388252" Received: from glacier.sc.intel.com ([10.3.62.78]) by fmsmga006.fm.intel.com with ESMTP; 30 Aug 2017 10:56:36 -0700 From: Rajmohan Mani To: linux-media@vger.kernel.org Cc: mchehab@kernel.org, hverkuil@xs4all.nl, tfiga@chromium.org, sakari.ailus@iki.fi, s.nawrocki@samsung.com, tuukka.toivonen@intel.com, Rajmohan Mani Subject: [PATCH] [media] dw9714: Set the v4l2 focus ctrl step as 1 Date: Wed, 30 Aug 2017 10:48:52 -0700 Message-Id: <1504115332-26651-1-git-send-email-rajmohan.mani@intel.com> X-Mailer: git-send-email 1.9.1 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Current v4l2 focus ctrl step value of 16, limits the minimum granularity of focus positions to 16. Setting this value as 1, enables more accurate focus positions. Signed-off-by: Rajmohan Mani --- drivers/media/i2c/dw9714.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/media/i2c/dw9714.c b/drivers/media/i2c/dw9714.c index 6a607d7..f9212a8 100644 --- a/drivers/media/i2c/dw9714.c +++ b/drivers/media/i2c/dw9714.c @@ -22,6 +22,11 @@ #define DW9714_NAME "dw9714" #define DW9714_MAX_FOCUS_POS 1023 /* + * This sets the minimum granularity for the focus positions. + * A value of 1 gives maximum accuracy for a desired focus position + */ +#define DW9714_FOCUS_STEPS 1 +/* * This acts as the minimum granularity of lens movement. * Keep this value power of 2, so the control steps can be * uniformly adjusted for gradual lens movement, with desired @@ -138,7 +143,7 @@ static int dw9714_init_controls(struct dw9714_device *dev_vcm) v4l2_ctrl_handler_init(hdl, 1); v4l2_ctrl_new_std(hdl, ops, V4L2_CID_FOCUS_ABSOLUTE, - 0, DW9714_MAX_FOCUS_POS, DW9714_CTRL_STEPS, 0); + 0, DW9714_MAX_FOCUS_POS, DW9714_FOCUS_STEPS, 0); if (hdl->error) dev_err(&client->dev, "%s fail error: 0x%x\n",