From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B6361C4332D for ; Thu, 19 Mar 2020 12:22:09 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 830462070A for ; Thu, 19 Mar 2020 12:22:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ZQknpE9E" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 830462070A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bp.renesas.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=aCcILSdzxlHJcosPiHQJzkkwh51CX44H3+jcJD73uUk=; b=ZQknpE9Ee7zRufKuqW106AQwW9 9GvgJRAr1ib87kIL/eOR7Nqoy7msIutYLTeslCOXhUkWS5+0qKSqrDUyQPp6n9LAn1sy/J9Tm2NlU cchero7vIRKP1KQ85snerwal/QAa/TpNQt0Ii+Y1ZPNkFyNIJS4/Moo4HxasybfjzckhYs/VbgvI5 5Ucloaf+bhq5aaO49nY4iUdCwvhbyUkyD1i5zA2Q/gEtMfZZuURGSjsupthc5+NWkoWolqcFcH2qf AFmTeHmqZzpSjKjTRGPqeUne6AWUJzmzw3tBV8TQSfgysyKCk4KdpNwnMJxKgEhaNu/bAacxsCDTz 5PVBt0cA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jEuBc-0003dM-PM; Thu, 19 Mar 2020 12:22:08 +0000 Received: from relmlor1.renesas.com ([210.160.252.171] helo=relmlie5.idc.renesas.com) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jEuBZ-0003cv-1b for linux-arm-kernel@lists.infradead.org; Thu, 19 Mar 2020 12:22:06 +0000 X-IronPort-AV: E=Sophos;i="5.70,571,1574089200"; d="scan'208";a="42339836" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 19 Mar 2020 21:22:04 +0900 Received: from localhost.localdomain (unknown [10.226.36.204]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 71BB242BCBDB; Thu, 19 Mar 2020 21:22:00 +0900 (JST) From: Lad Prabhakar To: Laurent Pinchart , Sakari Ailus , Mauro Carvalho Chehab , Rob Herring , Mark Rutland , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Kieran Bingham Subject: [PATCH v4 3/5] media: i2c: ov5645: Increase tolerance of external clock frequency Date: Thu, 19 Mar 2020 12:19:21 +0000 Message-Id: <1584620363-2255-4-git-send-email-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1584620363-2255-1-git-send-email-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <1584620363-2255-1-git-send-email-prabhakar.mahadev-lad.rj@bp.renesas.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200319_052205_187830_544BFBC9 X-CRM114-Status: GOOD ( 12.39 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Lad Prabhakar , linux-kernel@vger.kernel.org, Lad Prabhakar , linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org While testing on Renesas RZ/G2E platform, noticed the clock frequency to be 24242424 as a result the probe failed. This patch increases the tolerance to 5% so that it avoids patching for new platforms and it warns the users if the frequency is not within the range and continue further in the probe instead of returning failure. Signed-off-by: Lad Prabhakar --- drivers/media/i2c/ov5645.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/media/i2c/ov5645.c b/drivers/media/i2c/ov5645.c index e298acdadeef..52a185ed4368 100644 --- a/drivers/media/i2c/ov5645.c +++ b/drivers/media/i2c/ov5645.c @@ -1105,13 +1105,11 @@ static int ov5645_probe(struct i2c_client *client) } } - /* external clock must be 24MHz, allow 1% tolerance */ + /* ideally external clock must be 24MHz, allow 5% tolerance */ xclk_freq = clk_get_rate(ov5645->xclk); - if (xclk_freq < 23760000 || xclk_freq > 24240000) { - dev_err(dev, "external clock frequency %u is not supported\n", - xclk_freq); - return -EINVAL; - } + if (xclk_freq < 22800000 || xclk_freq > 25200000) + dev_warn(dev, "external clock frequency is set to %u, sensor might misbehave\n", + xclk_freq); for (i = 0; i < OV5645_NUM_SUPPLIES; i++) ov5645->supplies[i].supply = ov5645_supply_name[i]; -- 2.20.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel