From patchwork Tue Feb 13 07:13:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manivannan Sadhasivam X-Patchwork-Id: 128202 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp3968500ljc; Mon, 12 Feb 2018 23:13:34 -0800 (PST) X-Google-Smtp-Source: AH8x227XSPKih8S2ruDfTfk0EHrH8lNcQ1js/l7hcHUBZrJ6W28sqtQpi0dZp1y39FfBbM84Eaug X-Received: by 10.101.73.143 with SMTP id r15mr228174pgs.161.1518506014398; Mon, 12 Feb 2018 23:13:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518506014; cv=none; d=google.com; s=arc-20160816; b=aX8UtAxynATfiuSBMfvXSks4Wys/dZaY2P9fUAZBDg7aCqHaaYObiD6fEmT4p7UtC6 DPhx9w4UVfda1AtOnevLeKf0HxKeFRLDeNcWjgXuLAYsHzL1iK3VhGr+qSHCDweWiMu+ NKopXcCp32xIU1Pj/2HxMOx8FBqoztX1yGZpaNYwM6QhRBkfejUggoCpcyH9jWvQYaXN +1FAHbi3tQjqxt72ZNaq+F/9oy/EWT63rd7PEUuw4hTVoV9JZgzmZP5lv5g/c0NMhfRI zXuSfjpqOr7dPDWEYbontO2fwBeaiGvmxEEKcUEphP4wFMD4rNwDyOlvc+pFEoYo8PKj nnDA== 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=LuRANK2iLHT/bAeHFiyrYK9VpbcQjtNCnbad6ethTV9L0K9xqc/hXZjIPM/Tnupr49 Vv/deoUQG+LIjgid3cUF8VWly7+PZwL9jt/yQSQgs6mGjVdBBPdTd4IK+CclxUud2ln9 2eujN9Sih1BiDbc8DhjAuhBxpTiVvsDca+au1/GTi53lpukx5EADOQuh2fTX2BlVQlYE tzQ1plDYVl83d0lZrUuUHVkyUcLl2+yxTv4wGgfGFjICGt8922aXhtyjVcrQNJATGOWM 4n8A36yNpQqEQs9C3xA1/zdTfL5DtRhkNJXZQ3ZM3hMrd9k7onZMkAhZD/nN+Qim1VsR 28mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UBMttea0; 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 k14si1019291pff.287.2018.02.12.23.13.34; Mon, 12 Feb 2018 23:13:34 -0800 (PST) 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=UBMttea0; 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 S933532AbeBMHNb (ORCPT + 28 others); Tue, 13 Feb 2018 02:13:31 -0500 Received: from mail-it0-f66.google.com ([209.85.214.66]:50922 "EHLO mail-it0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933502AbeBMHN0 (ORCPT ); Tue, 13 Feb 2018 02:13:26 -0500 Received: by mail-it0-f66.google.com with SMTP id x128so9991428ite.0 for ; Mon, 12 Feb 2018 23:13:26 -0800 (PST) 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=UBMttea0CJLHBgMuaSqw6DmzNKkZZw0yKHjJTZYUhv8habYSqEdYyYcQou9qLqc8rN bFYowm93/dpXuaGzjHhAIzBxWlIkx4C2N4a84M7BSCJpZKaBuHlSJ92zcXjt7+C5ebCY 7R/vXwU2hpHpwy69EBFsE7kP5ySguNnAvoRrA= 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=dsB7XxwnrRfXKEKqOIpzuhAmu0kWq3Vgw1Nqkvz5Aggpp7xNFfgJ+iqz1TzS9Aphtn J+p+5iIEfm2tyEn/TBPJmO9INHNv3pQHGV+k0Ot0ym+kAJHIAoO5Y8vXl2CPQCVrA3n1 RKuwpCHjq2mjhUEjdBVnsofFbMbtDQqJKvRwSHFbTTq2bQD+plOT3paPUsMVLwc72mJL ecg8aat2u2YmDE9ADVfSjBfJY6eouPqoPqf6lu41n6od7v94r/B3I9fVrf7AWXQSPaUx 9FwyJDcSdC9o98p0YDILcfv1nAdK/LL4ysSEITanQRGUfjPzz2qExtY0lkvV/WJDL+om kIjA== X-Gm-Message-State: APf1xPDxLTKyTU5BOPL9BHHCSEorngyUPR9jaY4Xb5hgN5Fa0NMYu8zP u+qtJxy6T52zmkv8JxCnwd4/ X-Received: by 10.36.253.140 with SMTP id m134mr467433ith.85.1518506006058; Mon, 12 Feb 2018 23:13:26 -0800 (PST) Received: from mani-sadhasivam-linaro.Home ([103.59.133.81]) by smtp.googlemail.com with ESMTPSA id k5sm12559239ioe.59.2018.02.12.23.13.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 12 Feb 2018 23:13:25 -0800 (PST) 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, manivannanece23@gmail.com, Manivannan Sadhasivam Subject: [PATCH] media: i2c: ov5640: Add pixel clock support Date: Tue, 13 Feb 2018 12:43:08 +0530 Message-Id: <1518505988-8389-2-git-send-email-manivannan.sadhasivam@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1518505988-8389-1-git-send-email-manivannan.sadhasivam@linaro.org> References: <1518505988-8389-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 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,