Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1558843ybb; Thu, 2 Apr 2020 03:11:37 -0700 (PDT) X-Google-Smtp-Source: APiQypL0i/CqXvkMEJ2qhdrnL9gBDhza3cGty/L52UWsQUyO7zqrxajapCJdI+7qKdO+37zP2xkp X-Received: by 2002:a05:6830:146:: with SMTP id j6mr1718200otp.352.1585822297608; Thu, 02 Apr 2020 03:11:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585822297; cv=none; d=google.com; s=arc-20160816; b=I7N4kotj3HkMm4+evJNvqPUbU+TYlacXnIkfPJQwvxWM7HvMRNIri2jhhIlD4cGu2Z 6x3FwU++QI1wtOCUFMHwzwMZ5tnMPGUKzkMy7ElbM8Ggh2GcRjIPyOpzYTKFAnlw3XSs Fqr2oetCqzsZIIXa5D2pFS7LTlZRkz0yqgxeaTLtfGAsStmE00isKahc5w58M5MKOsOk dwDKuGz1f1rEiUhom9/vDgczXWXfYemczHP1n/LPspJ0tE/2MffBpndrRYIejVkich/T D28BLJxj6EUkFWJEjg2+oQLPitCKdHdP+QRQmoqWuz9lDtjtDrpX6+cFgq8MdJrpKYjj U8dw== 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=MRdlSIlWiqiUEn9v/+BSCM98gAfMn515+Qx9Pso1+1M=; b=qodZ4JqRqrX8Cv/42P3uZkY/7gzZ3M/p9ynC2TKkoRX7FzV3NGPrtl9lfNVu0cIy6U IxPXXeZAg5cIVH+KmOG6YZfK5ABOHP3OChHH1ifAEp1JnqSk4bct0url4DvAD/MTfWbv +ugglyV4qd48Gc26+nQIeNZq+aIEpCFehNBlS5siQynv4f15sOZbeQaj93pSEZMHcAT6 ofR/kTmrN5vlgAQuD/UwiPsNafjo+ea6WW9uNpaYEJdQCgseQwDjHQadTsZcLGpHygXC xpc6fgHHfa9kTfSI192iKmxhAEK5wOgWMdtQhKg5lLHZUlcitjapGhqWj1CPXeukZV4d kViQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eihORtTg; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q2si2337791otg.211.2020.04.02.03.11.24; Thu, 02 Apr 2020 03:11:37 -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; dkim=pass header.i=@linaro.org header.s=google header.b=eihORtTg; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387928AbgDBKKN (ORCPT + 99 others); Thu, 2 Apr 2020 06:10:13 -0400 Received: from mail-ot1-f68.google.com ([209.85.210.68]:38444 "EHLO mail-ot1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387895AbgDBKKM (ORCPT ); Thu, 2 Apr 2020 06:10:12 -0400 Received: by mail-ot1-f68.google.com with SMTP id t28so2829054ott.5 for ; Thu, 02 Apr 2020 03:10:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=MRdlSIlWiqiUEn9v/+BSCM98gAfMn515+Qx9Pso1+1M=; b=eihORtTgxTZlcrTJ/9m6HDeGAe36CEbjF+saO5ljAmLWT/D8IrrbD/k7YTxI3xWXO4 ylnchmXj5sp9VZ7zqA/HMR7QDWFcrBNQcuwNPbNnQ4dMocOW51OLPY7OTJak3JK+Oqwp GJzYConXFZ8RL2W+vQ+t4j9yLNaKA5VskegVJPg0L9KNMDortPbE8UtViAiQ3oQZiqeT 1C6N66XvBAyAOgQRTKQBfB7K6CRqR/HMkJsA/8LbB6Sa9nSQ2ohnRRwPAUntCv1JAQ84 /GgKhieuyOZS50zZ7AjXCxCpmCE+LFNkJl6FW2xiKh2c8FWNGJI4LJFGlhKdoGpRw8/X Uvaw== 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=MRdlSIlWiqiUEn9v/+BSCM98gAfMn515+Qx9Pso1+1M=; b=MFwUWSo/Ptije+zTgQ06Nd5rY40mpqBHtvDjdlxfdtt6OERpzytz0p9B2dyiKzndwL 3rjAuXQ1tmjD9PDWcgvyoCtptXvbQkeJ0qWoIcGuOBIPuz1q8s08j5wqGphiDv6TRxk7 FErd7YE3qSR1FbjfT9zwBtQss52X08JCsh9TdNtQg0KwsJ3kAV9IeurDKtBtxe73oqYX BiEYhsGdho6lpyDjwLM+tpzFmKQ/XBwaDm5fYzy/30lGA68bHJixxKnuKNxXOdXtKWPT kBXZUuShw7k1WeJNKPcOXCcR1hLjp3/RdTB/TWQW/NriMM/KfJOWFkofJ5EwUfxrdBQH XlHQ== X-Gm-Message-State: AGi0PuZOXLvTl9uasBhntrZI7GM8tal3nSv7HQMD2v5C8tMUTxFjRTvY UM8g74NICUsNg8rV/9cW+Vqg1+k9LgkVkCJC8wR/4g== X-Received: by 2002:a9d:6c88:: with SMTP id c8mr1673754otr.272.1585822211618; Thu, 02 Apr 2020 03:10:11 -0700 (PDT) MIME-Version: 1.0 References: <20200331133346.372517-1-robert.foss@linaro.org> <20200331133346.372517-2-robert.foss@linaro.org> <20200401080705.j4goeqcqhoswhx4u@gilmour.lan> In-Reply-To: <20200401080705.j4goeqcqhoswhx4u@gilmour.lan> From: Robert Foss Date: Thu, 2 Apr 2020 12:10:00 +0200 Message-ID: Subject: Re: [PATCH v6 1/3] media: dt-bindings: ov8856: Document YAML bindings To: Maxime Ripard Cc: Dongchun Zhu , Fabio Estevam , Andy Shevchenko , Sakari Ailus , Tomasz Figa , linux-media , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , linux-kernel , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" 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 Hey Maxime, On Wed, 1 Apr 2020 at 10:07, Maxime Ripard wrote: > > Hi, > > On Tue, Mar 31, 2020 at 03:33:44PM +0200, Robert Foss wrote: > > From: Dongchun Zhu > > > > This patch adds documentation of device tree in YAML schema for the > > OV8856 CMOS image sensor. > > > > Signed-off-by: Dongchun Zhu > > Signed-off-by: Robert Foss > > --- > > > > - Changes since v5: > > * Add assigned-clocks and assigned-clock-rates > > * robher: dt-schema errors > > > > - Changes since v4: > > * Fabio: Change reset-gpio to GPIO_ACTIVE_LOW, explain in description > > * Add clock-lanes property to example > > * robher: Fix syntax error in devicetree example > > > > - Changes since v3: > > * robher: Fix syntax error > > * robher: Removed maxItems > > * Fixes yaml 'make dt-binding-check' errors > > > > - Changes since v2: > > Fixes comments from from Andy, Tomasz, Sakari, Rob. > > * Convert text documentation to YAML schema. > > > > - Changes since v1: > > Fixes comments from Sakari, Tomasz > > * Add clock-frequency and link-frequencies in DT > > > > .../devicetree/bindings/media/i2c/ov8856.yaml | 150 ++++++++++++++++++ > > MAINTAINERS | 1 + > > 2 files changed, 151 insertions(+) > > create mode 100644 Documentation/devicetree/bindings/media/i2c/ov8856.yaml > > > > diff --git a/Documentation/devicetree/bindings/media/i2c/ov8856.yaml b/Documentation/devicetree/bindings/media/i2c/ov8856.yaml > > new file mode 100644 > > index 000000000000..beeddfbb8709 > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/media/i2c/ov8856.yaml > > @@ -0,0 +1,150 @@ > > +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) > > +# Copyright (c) 2019 MediaTek Inc. > > +%YAML 1.2 > > +--- > > +$id: http://devicetree.org/schemas/media/i2c/ov8856.yaml# > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > + > > +title: Omnivision OV8856 CMOS Sensor Device Tree Bindings > > + > > +maintainers: > > + - Ben Kao > > + - Dongchun Zhu > > + > > +description: |- > > + The Omnivision OV8856 is a high performance, 1/4-inch, 8 megapixel, CMOS > > + image sensor that delivers 3264x2448 at 30fps. It provides full-frame, > > + sub-sampled, and windowed 10-bit MIPI images in various formats via the > > + Serial Camera Control Bus (SCCB) interface. This chip is programmable > > + through I2C and two-wire SCCB. The sensor output is available via CSI-2 > > + serial data output (up to 4-lane). > > + > > +properties: > > + compatible: > > + const: ovti,ov8856 > > + > > + reg: > > + maxItems: 1 > > + > > + clocks: > > + maxItems: 1 > > + > > + clock-names: > > + description: > > + Input clock for the sensor. > > + items: > > + - const: xvclk > > + > > + clock-frequency: > > + description: > > + Frequency of the xvclk clock in Hertz. > > We also had that discussion recently for another omnivision sensor > (ov5645 iirc), but what is clock-frequency useful for? > > It seems that the sensor is passed in clocks, so if you need to > retrieve the clock rate you should use the clock API instead. > > Looking at the driver, it looks like it first retrieves the clock, set > it to clock-frequency, and then checks that this is OV8856_XVCLK_19_2 > (19.2 MHz). As far as I understand it, 19.2MHz is requirement for the sensor mode that currently defaults to. Some modes require higher clock speeds than this however. > > The datasheet says that the sensor can have any frequency in the 6 - > 27 MHz range, so this is a driver limitation and should be set in the > driver using the clock API, and you can always bail out if it doesn't > provide a rate that is not acceptable for the drivers assumption. > > In any case, you don't need clock-frequency here... So your suggestion is that we remove all clocks-rate properties, and replace the clk_get_rate() calls in the driver with clk_set_rate() calls for the desired frequencies? > > > + assigned-clocks: > > + description: > > + Input clock for the sensor. > > + > > + assigned-clock-rates: > > + description: > > + Frequency of the xvclk clock in Hertz. > > And you don't need assigned-clock-rates either. Ack. > > Maxime