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: 10215259 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 D566E60467 for ; Tue, 13 Feb 2018 07:13:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C41F328D12 for ; Tue, 13 Feb 2018 07:13:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B8E1528E4E; Tue, 13 Feb 2018 07:13:43 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=unavailable 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 58D2A28D12 for ; Tue, 13 Feb 2018 07:13:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933505AbeBMHNa (ORCPT ); Tue, 13 Feb 2018 02:13:30 -0500 Received: from mail-it0-f65.google.com ([209.85.214.65]:51435 "EHLO mail-it0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933366AbeBMHN0 (ORCPT ); Tue, 13 Feb 2018 02:13:26 -0500 Received: by mail-it0-f65.google.com with SMTP id 193so7094858iti.1 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=Ao6GjDXJU21xDqrgCMZM05uMLQB9ZGqgOY+jhDGZl+fpl2dm8xxyLho84T+Haz/Qo+ JDG1PhCdkT+4eUG+VtOnT3WowE9fw0f5+qlEiZu+K+X5UmWr932CJvbyyldXT/Nl5MLK O8jt3iX5R9/vwHy+L5IY52KcHKt1JWvUzuF7ZpZYUOe8b0C0iyBb9Xz2wQcbo1C/Jo3U yTfjDXEzyVMxMjl+m/73zs54IlMWr5Y4lRsSrugQB7U60++OUHDHBi8CFi6xmaj4rgvD yNLwP28ZKbFafaN6PXd6a49W+73r12FVe6BhUsMTNjGt9GeDt1607qqamOnSiy1oq/3U J5MQ== X-Gm-Message-State: APf1xPCB+mrOXBBWbmjKBovc4ESZKGtruV7gmIex+Nqf3nIjkuH4cfzQ V446UHK/YRBxU7wIWLyX42Va X-Google-Smtp-Source: AH8x227MNpNvqXCIFbowUJIidjjIX0frMp2ANe+MFynJ7XjTYmHAh9T0rHXKbaMlAjVi7zZ77wcEwA== 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-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(+) 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,