Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4013704imu; Tue, 18 Dec 2018 07:46:44 -0800 (PST) X-Google-Smtp-Source: AFSGD/VdVWbLIckco3i9h661pLLattY5KBoCGnF2QprAbkf8r/rIQdwj8f6SvNq2k1roT+cwwJ0T X-Received: by 2002:a63:6506:: with SMTP id z6mr3277499pgb.334.1545148004746; Tue, 18 Dec 2018 07:46:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545148004; cv=none; d=google.com; s=arc-20160816; b=lTFrfEtsHDE3Zd/l/ZQpRm5E1kpAcNrwkWvOUEZ0WIPY/9k0snmj+YYUWuRvFv4aqE YG+jJoQBVNoLYv7+OXgvQUd6eNcCEv5Gm4V3+ZDldInP50cNoGb0Vvip/jDji77i4Lmz DKXxwXFmLkoHgc08f/MwYuiFBSKyMXAD56yfA2YmR+6sUeXtGTJVL4MmTZOt3lOkEGF5 9jqLraGaxTorCKW3MvT6DyY75uuP6k+O8k10HcshV7ixfacWYzVbXDpoG2XxG7iXxpLV kquAS1quv3Q8yXPMapWk0oWSCpboXYMfXqOTZbxRdndojkQdhiLGShY9uZMw5m84Nith ZIBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=1/zhACGiqYxD973F16CJgW7lHQ7NOo+F2AGOaW1Tmr0=; b=EREbyaVKFhW3CwbuJFv99CuIj8ErF8uoU/C0Q7Dq44QWsFgl/8gxPNXa3+MmfCpqj4 DPKUpHSt51f4uLNxno6wfgsI3djn6Eg2XZlDscfc2RavhMKYrq9+2Kmi0gzQK3OWZfR7 aF0V8XC0GkUt+cXdjNi6UcqPP9P7H1Z6rU0C7r+8YR/R2h1mCg1oyTRPZO46yIuniR32 2FLV8dl4PmeVET3SzKB0g01bTflUhJIWmzMxSxdSgb6XZuk83q0WvWpdLJPOfhq/stvj qJ0Sm63WHljkkUjetbDeyuTNOmLoSgiVcIAo8uCI6CzsVAZvbJXfhkocnFWHI21ySaoB yW2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=bOXKUD+i; 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 d34si13423981pgb.43.2018.12.18.07.46.28; Tue, 18 Dec 2018 07:46:44 -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=@amarulasolutions.com header.s=google header.b=bOXKUD+i; 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 S1727074AbeLRPoR (ORCPT + 99 others); Tue, 18 Dec 2018 10:44:17 -0500 Received: from mail-io1-f66.google.com ([209.85.166.66]:38628 "EHLO mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726999AbeLRPoR (ORCPT ); Tue, 18 Dec 2018 10:44:17 -0500 Received: by mail-io1-f66.google.com with SMTP id l14so13098869ioj.5 for ; Tue, 18 Dec 2018 07:44:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=1/zhACGiqYxD973F16CJgW7lHQ7NOo+F2AGOaW1Tmr0=; b=bOXKUD+ium5IZD/ej6gBo6AoeyCaxHe8W9E5ZCZ9r7rduXf5QJjE0bAwXxg5B+JEfK WS01OpHBsjkNblLxpp6gAfnuzn6KtYTbtpH0ctGniiWx9TjXXVTgeEuZn9Iu+P9Xowri 3MGz/BfMlSZXAHytSqm5GvouhhTxIq6b0pQV0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1/zhACGiqYxD973F16CJgW7lHQ7NOo+F2AGOaW1Tmr0=; b=RUronwX2CVcFvdp9rhIPVK3szLiynKruxg55Y1GdHr9Ubmlrx9YaWBmPtz4+BeQth0 Ules4phsgBRGZqxmgcAwT4/MkIfDwdgW8QrydlrWtPGt2n1p1q+GclgqwJUmezJXKKDX ECAR9qTlbF9SY3eTRDgrzRIyGkutu6u99FN0xsz1blRXPpQHX30MKlYRUoIQYf/Ewprx 4h72igpBcazMc2jVUwcApsKgKLqlIAdkZifxdu+nwHT7hRDAReHKkoKKhE3Dx8pphx0Q 1ADaw8CgCx/hkcY43WCHHOcRnOq1jYBqeO5ifWswtHeKoOxI7bTHV+DEuwIzXEi3fArU vuHw== X-Gm-Message-State: AA+aEWaca/rRgzEE6zaFW5kfLQiwS0+DUXzj5vTd98N6AhQC7zYw8pSz orVMkc5SMaNxRbnxmQA9GeUkKAPCK7EJvqpQDB3bTw== X-Received: by 2002:a5e:c609:: with SMTP id f9mr13929097iok.114.1545147508734; Tue, 18 Dec 2018 07:38:28 -0800 (PST) MIME-Version: 1.0 References: <20181218113320.4856-1-jagan@amarulasolutions.com> <20181218113320.4856-4-jagan@amarulasolutions.com> <20181218152318.duynff7f5m2gxtv4@flea> In-Reply-To: <20181218152318.duynff7f5m2gxtv4@flea> From: Jagan Teki Date: Tue, 18 Dec 2018 21:08:17 +0530 Message-ID: Subject: Re: [PATCH v4 3/6] media: sun6i: Update default CSI_SCLK for A64 To: Maxime Ripard Cc: Yong Deng , Mauro Carvalho Chehab , Rob Herring , Mark Rutland , Chen-Yu Tsai , linux-media , linux-arm-kernel , devicetree , linux-kernel , linux-sunxi , linux-amarula@amarulasolutions.com, Michael Trimarchi Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 18, 2018 at 8:53 PM Maxime Ripard wrote: > > On Tue, Dec 18, 2018 at 05:03:17PM +0530, Jagan Teki wrote: > > Unfortunately A64 CSI cannot work with default CSI_SCLK rate. > > > > A64 BSP is using 300MHz clock rate as default csi clock, > > so sun6i_csi require explicit change to update CSI_SCLK > > rate to 300MHZ for A64 SoC's. > > > > So, set the clk_mod to 300MHz only for A64. > > > > Signed-off-by: Jagan Teki > > --- > > drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c | 5 +++++ > > 1 file changed, 5 insertions(+) > > > > diff --git a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c > > index 9ff61896e4bb..91470edf7581 100644 > > --- a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c > > +++ b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c > > @@ -822,6 +822,11 @@ static int sun6i_csi_resource_request(struct sun6i_csi_dev *sdev, > > return PTR_ERR(sdev->clk_mod); > > } > > > > + /* A64 require 300MHz mod clock to operate properly */ > > + if (of_device_is_compatible(pdev->dev.of_node, > > + "allwinner,sun50i-a64-csi")) > > + clk_set_rate_exclusive(sdev->clk_mod, 300000000); > > + > > If you're using clk_set_rate_exclusive, you need to put back the > "exclusive" reference once you're not using the clock. > > Doing it here is not really optimal either, since you'll put a > constraint on the system (maintaining that clock at 300MHz), while > it's not in use. I think we can handle via clk_rate_exclusive_put for those errors cases? If I'm not wrong