Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5035517imu; Wed, 19 Dec 2018 04:38:12 -0800 (PST) X-Google-Smtp-Source: AFSGD/W8sq+tbqDTAJ00l0xgRWc3K+drQQfJAC4gu1oiiXa0HNxvGC2omYZ20Td4/oP9sWaNjuJS X-Received: by 2002:a17:902:7107:: with SMTP id a7mr20055358pll.290.1545223092540; Wed, 19 Dec 2018 04:38:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545223092; cv=none; d=google.com; s=arc-20160816; b=UN+h0ZVrIqFMSfFSDm2uug4yydfV5V1/ohNsfvn05AVTaRSqXMQGgGXmjcMSZvHFiH pvWtdatCEBKZ+eCDkq6UeEo178dUhLeSl2JhEbA/QEQmgZcTbrVCUZ/H6KUZM4LnGwS0 dNz5PBCffi+Ei0AxhAp3hJKD3DqkTu/zSxCbK9Sf8DcQ3pT/ecUwUKZNZRcYsHOljIgC lW1qp6/FMrMgaT1z+gEdPBFKIwsc/1hawvwzUJgiXrv2CND9OK11tf/4JPVQ7vOKZsap U89QwRVm4657VyIsiQrKmixG2vlrWe/+E/Ej/M18OpohVLiWGexyyUDcEnVNFZOJDN79 tKIg== 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=TIsaOUia+4f6xiB5ne3A07PpfINF67awrDp0lnaaVwA=; b=zNN1XXjDaIWTuxBB0+M6xvBWfIvhIQfLAd21z4Bj5jwQkAyr7oUoxsQo8Mu6WMvWgM dJiHxWlQr+4UouRfn9Nyfa0ajlaZKYuabyWGB+i0baAKLBpidC8EIDANX0gEQXBYvODj QvnoFRqzTeCvFO2jVkcHbF65AHMfONlTFu7dmDVNiH34sWTdGLFNcKHHjPZGgomjCzaA /UYnzQnnk1Pgr0JzrFS3yoIdDDrf8TtPt6x5fqA6eRLvHbYtaCkkSzno0i+5Z09kBYNY /Sydl8y4OFXS/7xvnowYGjtf6ZcyOBLYtucj+RyX+0a43v/Hom7KI4N4UWKZYtvUVRhm DlpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=rGN0HFR6; 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 p19si15995497pgj.375.2018.12.19.04.37.51; Wed, 19 Dec 2018 04:38:12 -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=rGN0HFR6; 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 S1729018AbeLSKmv (ORCPT + 99 others); Wed, 19 Dec 2018 05:42:51 -0500 Received: from mail-it1-f193.google.com ([209.85.166.193]:37045 "EHLO mail-it1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727586AbeLSKmu (ORCPT ); Wed, 19 Dec 2018 05:42:50 -0500 Received: by mail-it1-f193.google.com with SMTP id b5so8746873iti.2 for ; Wed, 19 Dec 2018 02:42:50 -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=TIsaOUia+4f6xiB5ne3A07PpfINF67awrDp0lnaaVwA=; b=rGN0HFR6UM/at1z8mRFLiTvtXFt9ibuZMTACZ0XLLWxdXt+SSALX9eFLLwY000QGsc ycPc87ljD/pXurAOY/Y06Y7BmGpyrZLBbKUauTcfNpPc5tIbnsiGpaV9MJpifMBM7xNw CEVxLmE35zYtXeoNa66ZRqE3D1xSISGZ/RZOI= 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=TIsaOUia+4f6xiB5ne3A07PpfINF67awrDp0lnaaVwA=; b=MJQlLrAXxBpSGoVx8dNXw+Ws742nYGyfWMjJ7G29ymA3kllN9chcxnV9qVRyxCPQyq UHZg3Hq8gmBj9pS+fm0lh9lZPHCAo9WO/phqsW1onrGHmOgy9C/XqggfiIAzujmIzacp o7EonIBBHaq9FLU6f+7qTnnV8QBpOuv1/A6E+Ap7/FJoGGENpZ3giEKZAnDLsMlUGJkd Ay9zKg47C+rDNIAG2bUIMiV551YxQZqNmSiwUO/T8K8Z5jW6aG0pnFcWL8ng6O7TXu6Q 8732QR54wb1v7St8OAvKyFMwedZFBfbD0icTmdNpWAysxIVGFFBD/n6U+x3Tv01VVDaF iQPg== X-Gm-Message-State: AA+aEWawIxM1aalZXDLplqNMcEGmzjSZwKPu5d/c/iPSu48KV91r0/5g ERZaX0zAHkPAUSfI50AKpbJWj2QTV1HKHkfNx1N3Xg== X-Received: by 2002:a02:104a:: with SMTP id 71mr7451064jay.103.1545216169586; Wed, 19 Dec 2018 02:42:49 -0800 (PST) MIME-Version: 1.0 References: <20181218113320.4856-1-jagan@amarulasolutions.com> <20181218113320.4856-4-jagan@amarulasolutions.com> <20181218152318.duynff7f5m2gxtv4@flea> <20181219100738.iakvqigi7z3k2coa@flea> In-Reply-To: <20181219100738.iakvqigi7z3k2coa@flea> From: Jagan Teki Date: Wed, 19 Dec 2018 16:12:38 +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 Wed, Dec 19, 2018 at 3:37 PM Maxime Ripard wrote: > > On Tue, Dec 18, 2018 at 09:08:17PM +0530, Jagan Teki wrote: > > 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 > > Yes, but it's not only for the error case, it's also for the inactive > case. Yes, I will try to add this next version.