Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4539082ybb; Tue, 7 Apr 2020 09:23:12 -0700 (PDT) X-Google-Smtp-Source: APiQypJICX7fFQyJ+kU5rd0Jj4KdBbl83HjPqG+Lhnqr5O0J+zh6ANjGTnU4gWdBKtHU7gQCtU2i X-Received: by 2002:a4a:d749:: with SMTP id h9mr2502174oot.15.1586276592329; Tue, 07 Apr 2020 09:23:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586276592; cv=none; d=google.com; s=arc-20160816; b=LYwDQn8tRglIJ8Evq92Og97368HdxyQ/eLt0nDXO9MnurVWc+gzXuXwvcej7A7qAzZ DZTHoLl2vf7cprdntI5KF3RasPCxkED2QxyAZ3PKm2+xvlbFOKcg9lpDbJAKi+uChnQS GYmXFm6clqOfJDUkvXKkvoKWmRdvvzh0IRe0C9cSvHnHPpa81eMhzZ2tXvfBOWRP4EI4 5vch+Al51qEacQJSo916+3YOszEUaUNvHYg2hQ4l9+gdxJA8PjeRtTlrTTrayMTk/afG b8Uehq6pKtZ+o8bNvUwqEW+e/VV4Fw62ESc0UeWSAbCyKF8DcVL6K5XajVWF2JffRHY1 Sv8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=zZI8Bgb2zP+vYvmsaAja5UVFPq0X8ple46kz20Hs7lY=; b=e2cNMyj5RE63N8j6AnJkHscK56XbZ+fsSRxBa06HzBCn88mgiWCryLT7IIsnsGdLQw zRNP/t/a8GC8ZyDiagb/IlSVWyU95t+yrMP7n8wZILui681hfLFhYx8MWatte6qzQ3pd kmfWG7M5gWcDuvIrgb2zEvU5xQpr4DcfqzazlGfKsrb6XRIhfMFSoNly6/QBLT3DV11S 7woVMJylBWYwYz/BzC8Abt8gccAit/42UjjsXJqFjP2EyU772e2B05XrVe2xjQsY25FI 9kjWstWIQTLj/Gxu0YJjcGloLCEmwIBx+uuNEfCx3KUAECtWI6+TncSUFNI765G1WEcJ VUDQ== 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 p67si1218950oig.41.2020.04.07.09.23.00; Tue, 07 Apr 2020 09:23:12 -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 S1728314AbgDGQWA (ORCPT + 99 others); Tue, 7 Apr 2020 12:22:00 -0400 Received: from retiisi.org.uk ([95.216.213.190]:51754 "EHLO hillosipuli.retiisi.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727582AbgDGQWA (ORCPT ); Tue, 7 Apr 2020 12:22:00 -0400 Received: from valkosipuli.localdomain (valkosipuli.retiisi.org.uk [IPv6:2a01:4f9:c010:4572::80:2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by hillosipuli.retiisi.org.uk (Postfix) with ESMTPS id 9AC4A634C89; Tue, 7 Apr 2020 19:20:50 +0300 (EEST) Received: from sailus by valkosipuli.localdomain with local (Exim 4.92) (envelope-from ) id 1jLqy1-0002MB-Ja; Tue, 07 Apr 2020 19:20:49 +0300 Date: Tue, 7 Apr 2020 19:20:49 +0300 From: Sakari Ailus To: Maxime Ripard Cc: Robert Foss , Dongchun Zhu , Fabio Estevam , Andy Shevchenko , Tomasz Figa , linux-media , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , linux-kernel , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" Subject: Re: [PATCH v6 1/3] media: dt-bindings: ov8856: Document YAML bindings Message-ID: <20200407162049.GK6127@valkosipuli.retiisi.org.uk> References: <20200331133346.372517-1-robert.foss@linaro.org> <20200331133346.372517-2-robert.foss@linaro.org> <20200401080705.j4goeqcqhoswhx4u@gilmour.lan> <20200403232736.GA6127@valkosipuli.retiisi.org.uk> <20200404093446.vuvwrhn5436h4d3s@gilmour.lan> <20200406083506.GE6127@valkosipuli.retiisi.org.uk> <20200407083647.4mocdl7aqa3x737q@gilmour.lan> <20200407123232.ktvaifhqntgzvkap@gilmour.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200407123232.ktvaifhqntgzvkap@gilmour.lan> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Maxime, On Tue, Apr 07, 2020 at 02:32:32PM +0200, Maxime Ripard wrote: > Hi Robert, > > On Tue, Apr 07, 2020 at 01:29:05PM +0200, Robert Foss wrote: > > On Tue, 7 Apr 2020 at 10:36, Maxime Ripard wrote: > > > On Mon, Apr 06, 2020 at 11:35:07AM +0300, Sakari Ailus wrote: > > > > > But that 19.2MHz is not a limitation of the device itself, it's a > > > > > limitation of our implementation, so we can instead implement > > > > > something equivalent in Linux using a clk_set_rate to 19.2MHz (to make > > > > > sure that our parent clock is configured at the right rate) and the > > > > > clk_get_rate and compare that to 19.2MHz (to make sure that it's not > > > > > been rounded too far apart from the frequency we expect). > > > > > > > > > > This is doing exactly the same thing, except that we don't encode our > > > > > implementation limitations in the DT, but in the driver instead. > > > > > > > > What I really wanted to say that a driver that doesn't get the clock > > > > frequency from DT but still sets that frequency is broken. > > > > > > > > This frequency is highly system specific, and in many cases only a certain > > > > frequency is usable, for a few reasons: On many SoCs, not all common > > > > frequencies can be used (e.g. 9,6 MHz, 19,2 MHz and 24 MHz; while others > > > > are being used as well), and then that frequency affects the usable CSI-2 > > > > bus frequencies directly --- and of those, only safe, known-good ones > > > > should be used. IOW, getting the external clock frequency wrong typically > > > > has an effect that that none of the known-good CSI-2 bus clock frequencies > > > > are available. > > > > > > So clock-frequency is not about the "Frequency of the xvclk clock in > > > Hertz", but the frequency at which that clock must run on this > > > particular SoC / board to be functional? > > > > > > If so, then yeah, we should definitely keep it, but the documentation > > > of the binding should be made clearer as well. > > > > Alright so, let me summarise the desired approach then. > > There's a separate discussion on the same topic here: > https://lore.kernel.org/linux-media/20200407122106.GD4751@pendragon.ideasonboard.com/ > > > ACPI: > > - Fetch the "clock-frequency" property > > - Verify it to be 19.2Mhz > > > > DT: > > - Fetch the "clock-frequency" property > > - Verify it to be 19.2Mhz > > - Get xvclk clock > > - Get xvclk clock rate > > - Verify xvclk clock rate to be 19.2Mhz > > The current status is that you should > 's/clock-frequency/link-frequencies/', and in order to replace > assigned-clock-rates, you'll want to have a clk_set_rate to 19.2MHz > between steps 3 and 4 The (CSI-2) link frequency is specified in the endpoint, and is already being read by the V4L2 fwnode framework. -- Sakari Ailus