From patchwork Thu Mar 29 14:55:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manivannan Sadhasivam X-Patchwork-Id: 132567 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp1859134ljb; Thu, 29 Mar 2018 07:55:20 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/pC7BwCVDE3vgF9CtS72QzYoX5cjL/72DpusPV1JfKeR86VduIgNu4/9GcJkF1+x2z3RQr X-Received: by 2002:a17:902:6acc:: with SMTP id i12-v6mr8848688plt.353.1522335320607; Thu, 29 Mar 2018 07:55:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522335320; cv=none; d=google.com; s=arc-20160816; b=cOziIjmIGVIJjNTczxQVDdCzwqERT3n5GcDlKh2Ro4qOWKFkoSMqHVkujIRkv/fHpg HYUZlYHYJJBhWVQyRWcfMRSKXqr16G++86pvNSJNw4CIgjgq0B8w50jZvxVcRpnHc43M zH+nHDmCOUYks8zJVjrOCfSjURfyjnszZwbKEpPwGN7gOBJzTZIZNKKyYEP9QlskziNS RMF63sUAPy9wtzmMEU9d2H+w9MO/ZyqHXvyGzhMlrbFcJUoDNaHs9+4v8pJKyboCVv3K zY47oXWLrtdCT7Oh+ySiYxgfpAlskXyvwJHatTlJxkBDTK8AnqtQRJj4CfpnaV0gxP9T A4pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=01b8+wtOHadkJG5mmVq4YJ9GoD+SQ0/+11bzilDPHRE=; b=dLNaeFgb4skdp9hYCA7L2MVr/OTnXiyoskjzmApRot0enPT/c+iOXpPjpQp0IpPPIG q6IsrRSALFnaaeEDKgoI2auqeROplU5NJTOMy0jSDfkkaKvV6oQxhrJR99Jfe0POFfDw Px4sXdas/jzjwv4cUtRQVZM+w8AAJLW5tqhRMtuZwIr8SoedlZJtsNQy+H2OQGWCrkMY Z9Opp1wEeNyOkXGL/S4+x1DWTgqUWCa1F0nGqLvQyqYdYGoEUJr5QYHJYaqvye2F/cAK Ik6pHrn8DgECvPTl3vaJjXEny5moHVD1TYyZywdRHM+ilkGRtA0oou5wEqWxONjzm7Fu B/Wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LcMnZRsm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p68si4125760pga.37.2018.03.29.07.55.20; Thu, 29 Mar 2018 07:55:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LcMnZRsm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752204AbeC2OzR (ORCPT + 28 others); Thu, 29 Mar 2018 10:55:17 -0400 Received: from mail-pg0-f66.google.com ([74.125.83.66]:41569 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751187AbeC2OzO (ORCPT ); Thu, 29 Mar 2018 10:55:14 -0400 Received: by mail-pg0-f66.google.com with SMTP id t10so3211568pgv.8 for ; Thu, 29 Mar 2018 07:55:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=01b8+wtOHadkJG5mmVq4YJ9GoD+SQ0/+11bzilDPHRE=; b=LcMnZRsmWPgXnosORxkdX20ipNwTu44XamV2msoye6fX8DGjEmNjZ0QheQIZM4Nr/o TXaTbJR4H6xO6RlZm4yiKJtZKRJ3mDIh6dJHulQGiJ+7zIbEb/yftf0zZIy5Xk0GZFF3 nqsL4gRmF7sCPj0d0xCJFpCuaFTs8CwRicsfI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=01b8+wtOHadkJG5mmVq4YJ9GoD+SQ0/+11bzilDPHRE=; b=DX9OYKCUkkmqOWrtITUw30D1ZXhrZVqpgWjjuYhWbEJal1CBul3TndVKTGHSe9zWew FsDBKPDFgc8d7TmWDQfkci0nkVoES5L8FOb/XluqyUrRQ+9NHnBdobP/U84boDSik26I jsCLc4l+G/xqNuh00DT9HtJQGbUEba/6YapxAmPAx25Bv7S7BCq9fhrPdXJrwzKasY4A 9pLzYmya7dkSV8FULLi8plbZXRQWcP5m3K7iLxnPEnNnJrgvcYByCrcM0vF+71Va4rxV LxTPxYxY9VeXuBybpXgYE2wjnU26ZEOMgTBniX/4kStDmmr3Z3PagF3VKxB3ys4+p3YZ CS5w== X-Gm-Message-State: AElRT7HYguSPSeIK1ppuZeeDPsiua5jHw4dRNrn1ml7zjNFoLbpUJbZ6 jnLXHhrydylYEffdlUoHUom4 X-Received: by 2002:a17:902:6a85:: with SMTP id n5-v6mr3186595plk.165.1522335313575; Thu, 29 Mar 2018 07:55:13 -0700 (PDT) Received: from mani-sadhasivam-linaro.Home ([103.59.133.81]) by smtp.googlemail.com with ESMTPSA id y69sm13960955pfb.52.2018.03.29.07.55.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 29 Mar 2018 07:55:12 -0700 (PDT) From: Manivannan Sadhasivam To: slongerbeam@gmail.com, mchehab@kernel.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Cc: todor.tomov@linaro.org, nicolas.dechesne@linaro.org, dragonboard@lists.96boards.org, loic.poulain@linaro.org, daniel.thompson@linaro.org, Manivannan Sadhasivam Subject: [RESEND PATCH] media: i2c: ov5640: Add pixel clock support Date: Thu, 29 Mar 2018 20:25:00 +0530 Message-Id: <1522335300-13467-2-git-send-email-manivannan.sadhasivam@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1522335300-13467-1-git-send-email-manivannan.sadhasivam@linaro.org> References: <1522335300-13467-1-git-send-email-manivannan.sadhasivam@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Some of the camera subsystems like camss in Qualcommm MSM chipsets require pixel clock support in camera sensor drivers. So, this commit adds a default pixel clock rate of 96MHz to OV5640 camera sensor driver. According to the datasheet, 96MHz can be used as a pixel clock rate for most of the modes. Signed-off-by: Manivannan Sadhasivam --- drivers/media/i2c/ov5640.c | 4 ++++ 1 file changed, 4 insertions(+) -- 2.7.4 Tested-by: Loic Poulain diff --git a/drivers/media/i2c/ov5640.c b/drivers/media/i2c/ov5640.c index 39a2269..7152c84 100644 --- a/drivers/media/i2c/ov5640.c +++ b/drivers/media/i2c/ov5640.c @@ -162,6 +162,7 @@ struct ov5640_ctrls { struct v4l2_ctrl *auto_gain; struct v4l2_ctrl *gain; }; + struct v4l2_ctrl *pixel_clock; struct v4l2_ctrl *brightness; struct v4l2_ctrl *saturation; struct v4l2_ctrl *contrast; @@ -2009,6 +2010,9 @@ static int ov5640_init_controls(struct ov5640_dev *sensor) ctrls->gain = v4l2_ctrl_new_std(hdl, ops, V4L2_CID_GAIN, 0, 1023, 1, 0); + /* Pixel clock (default of 96MHz) */ + ctrls->pixel_clock = v4l2_ctrl_new_std(hdl, ops, V4L2_CID_PIXEL_RATE, + 1, INT_MAX, 1, 96000000); ctrls->saturation = v4l2_ctrl_new_std(hdl, ops, V4L2_CID_SATURATION, 0, 255, 1, 64); ctrls->hue = v4l2_ctrl_new_std(hdl, ops, V4L2_CID_HUE,