Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2503183imm; Mon, 24 Sep 2018 05:34:25 -0700 (PDT) X-Google-Smtp-Source: ACcGV61YFRsoReaSkbd/iQMd/eEedkv9XjQfgEqgeNF+1GRDkNaRu9+VpLSB7LowFj4KRxtneFlD X-Received: by 2002:a63:9d01:: with SMTP id i1-v6mr9117991pgd.98.1537792464993; Mon, 24 Sep 2018 05:34:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537792464; cv=none; d=google.com; s=arc-20160816; b=AboVN4/Lt+n9rmStIK1zZajFywKC1X4NeWJgiRI0nRIHCGTm0Toi9dCLv/kazvjilC QBS3OxYAqyuyPxQL2+eVag6trkQJuw/BfWn1jRhcfsizdJHMsvEnNygEVKpbyXx+DyRp 5RuNGoIpcKRNs47FS8wAU46z4P1IYdDFb6Qe9gU0V+1BHYKHI5I1aL4oeEjgGIyF+jL5 nDgEk6ooCB5GJgZcCXQgY9iGZBIs7oBUXBQGt9OKORfU6n38RZKUY2iu4joKs4klVCU2 hTr2iXCC10Xia4EkBJq04heMiAj1OtucbWgfuIXJS0Uuv2lsPMll+f/6okaZi7iuutQB hsaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=fKUbyuHueUyLBQac8ciZzMrYzpy52HO3PZgIDMwJx3w=; b=YgnfKy4F1uhAAFO6CAa23GP4qqpoIe+NMd1HIsXwZsF6pQSYGLD/KCpEE4mD8xIyKW rvcNgjhMYFaEyMVaO1rclD7XKXkSKKPiCexQi9bSvw9iVXsZT9ns4G8sG0g2PGjXY6hy r0A6hLv9LLUFQ0xxeAPdfoXCRf/0K0cnTI5ZLtoJH0lr59ShGg5SPg2tHk/qOIV9CTlY pkc+wx+1fYCp226hZJavw9U+CoLRPIG02mrpgKjt/Z7FRE6v0c4Cur9KJgknlWzLZpEO Y3eGtnPHb5DRoLwwguDOiH4+BRp1W8Vc3GVCohH0Kji23owtecFNBUOAnGiWRTaHKD32 SSpg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b3-v6si35433104plc.502.2018.09.24.05.34.09; Mon, 24 Sep 2018 05:34:24 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388080AbeIXSdl (ORCPT + 99 others); Mon, 24 Sep 2018 14:33:41 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:58030 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730517AbeIXSdk (ORCPT ); Mon, 24 Sep 2018 14:33:40 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id A4E481099; Mon, 24 Sep 2018 12:31:45 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Todor Tomov , Sakari Ailus , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 4.18 044/235] media: ov5645: Supported external clock is 24MHz Date: Mon, 24 Sep 2018 13:50:30 +0200 Message-Id: <20180924113109.649707358@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180924113103.999624566@linuxfoundation.org> References: <20180924113103.999624566@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Todor Tomov [ Upstream commit 4adb0a0432f489c5eb802b33dae7737f69e6fd7a ] The external clock frequency was set to 23.88MHz by mistake because of a platform which cannot get closer to 24MHz. The supported by the driver external clock is 24MHz so set it correctly and also fix the values of the pixel clock and link clock. However allow 1% tolerance to the external clock as this difference is small enough to be insignificant. Signed-off-by: Todor Tomov Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/media/i2c/ov5645.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) --- a/drivers/media/i2c/ov5645.c +++ b/drivers/media/i2c/ov5645.c @@ -510,8 +510,8 @@ static const struct reg_value ov5645_set }; static const s64 link_freq[] = { - 222880000, - 334320000 + 224000000, + 336000000 }; static const struct ov5645_mode_info ov5645_mode_info_data[] = { @@ -520,7 +520,7 @@ static const struct ov5645_mode_info ov5 .height = 960, .data = ov5645_setting_sxga, .data_size = ARRAY_SIZE(ov5645_setting_sxga), - .pixel_clock = 111440000, + .pixel_clock = 112000000, .link_freq = 0 /* an index in link_freq[] */ }, { @@ -528,7 +528,7 @@ static const struct ov5645_mode_info ov5 .height = 1080, .data = ov5645_setting_1080p, .data_size = ARRAY_SIZE(ov5645_setting_1080p), - .pixel_clock = 167160000, + .pixel_clock = 168000000, .link_freq = 1 /* an index in link_freq[] */ }, { @@ -536,7 +536,7 @@ static const struct ov5645_mode_info ov5 .height = 1944, .data = ov5645_setting_full, .data_size = ARRAY_SIZE(ov5645_setting_full), - .pixel_clock = 167160000, + .pixel_clock = 168000000, .link_freq = 1 /* an index in link_freq[] */ }, }; @@ -1145,7 +1145,8 @@ static int ov5645_probe(struct i2c_clien return ret; } - if (xclk_freq != 23880000) { + /* external clock must be 24MHz, allow 1% tolerance */ + if (xclk_freq < 23760000 || xclk_freq > 24240000) { dev_err(dev, "external clock frequency %u is not supported\n", xclk_freq); return -EINVAL;