Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp1114186rdb; Fri, 2 Feb 2024 14:20:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IF9XwTB+0sZ8GYMfHmOKACoTf+gv8wGM2FgUL6+0CpEbt9QKEtoZIXzPcENNrxJpbmg5RAo X-Received: by 2002:a05:6102:673:b0:46d:169f:acbf with SMTP id z19-20020a056102067300b0046d169facbfmr115974vsf.3.1706912435689; Fri, 02 Feb 2024 14:20:35 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706912435; cv=pass; d=google.com; s=arc-20160816; b=KDV7oQ0Y4piK+Zfewza6fKWE4Z1sr4bAxTuLB7ItxGXpbIJexCdQaV/qwGNYqaP746 7Pq7lpTv7lNN+ZFXbXWlBLSlPrchCesY+8ZKdndnyTHnSB0wwH+0SGMIjMV0nmcSTozx QjxURh/SfUnbZCygsCYAUYk7ahMm5k0muJFBY6eqVplqUzA21BfGDZ82dHLvd0UxILGR xW91mDy5MSSTLVhIlqB64c9KV90NaQ860W/VuNMwNM7ASAFOcjeibfUEhSDTOUStzoHc M0mH1RGeuh6yMXmsKlmIaQyiXK4cy1w6S3F0CtWN5whJpDX+5N+Bx15UQfqqqGwuwFwC /gfA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=A95mBr4LewOKrn0gA7CaGAeJ/T17Q8OZ1lunQJxFPCo=; fh=gS51lhM5v3GfepKtDzYHAQoVjOh8/5a3PXAyjgI3eQw=; b=cGoYcOBYmmVkjAoKZt22lMD09v3f4Lto5w1t6p7sRx55olQGk9MDACQH2akMiNAXZB i/PkavcFExKc7enbFovMzjK2nSXiK4II1A+K0uPBAg7ahqWiPi32uarDs/fksdh6atSk SRcjatJO1hV7+3V38wvqzMr0I62NF06moyIG0bLaFYlki91KDFC46OqngqvsJrpKKPNk bOG6fQOaXc5npfY7tR+blc0qtfZKCLsKt+TsnJogULhhwsV1eeRicsMZQs0C1IkggINR Nhs760d5AvXGJCXdnMG4DDeMGFb7s+2qzY/aBHqOnkWDDJ2SfoHVcuGdhsL/iaKj/QtO VHag==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=iArbkSFP; arc=pass (i=1 spf=pass spfdomain=baylibre.com dkim=pass dkdomain=baylibre-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-50655-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50655-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=1; AJvYcCXhm3Iq/FpxQTxKrixuvcRcG3KIcmQsOHVzaaMTsNaSq96Am4cHTxjirkvbEe+N73QH64ESNQCWaL6CJ6NEasTPEMGJ7RrJaakdVQ9Ggw== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id a15-20020a0ce38f000000b0068c794c81dcsi2944548qvl.210.2024.02.02.14.20.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 14:20:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-50655-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=iArbkSFP; arc=pass (i=1 spf=pass spfdomain=baylibre.com dkim=pass dkdomain=baylibre-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-50655-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50655-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 404911C23A9E for ; Fri, 2 Feb 2024 22:20:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BDDD68593D; Fri, 2 Feb 2024 22:20:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="iArbkSFP" Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com [209.85.208.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 798DE8175D for ; Fri, 2 Feb 2024 22:20:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706912425; cv=none; b=BpduxnuqrGUWKFZYsNJFm283d1z08gLj8HRqJkGgVTETtFhQsZhYf/1gt8/r75QJwsFb6Tx8AIZJ9zRoIOpTqTOJ8I4wJVJvlLbXFcp/rqk3dndt/Rz7H2eLzJhyKWqgFZIQh0SX98+J6XZOPEFq43SWZ4PnFkc2tWa08ByGK30= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706912425; c=relaxed/simple; bh=lGMvrQ7olp6jC3Dg4ETinX5R1CAx4AYVJfrVqs3bq5c=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=TGbob6EqcMaAgqhIpMnThsq4zNRGJyEL40sfn7YEJ3qNFYZKT6+1Ae3TT01p/MscRiYoRuD9EY36II3PZnoprvpO6H4G2B36IllHZ/ClPORb0KYI9Ws8NqgOFldR2N76wWZaZF6GO9WhJrmZrdDfJcQgSreaC2GH4SJbqsHn2mg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=iArbkSFP; arc=none smtp.client-ip=209.85.208.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Received: by mail-lj1-f177.google.com with SMTP id 38308e7fff4ca-2d061f1e2feso30524071fa.1 for ; Fri, 02 Feb 2024 14:20:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1706912421; x=1707517221; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=A95mBr4LewOKrn0gA7CaGAeJ/T17Q8OZ1lunQJxFPCo=; b=iArbkSFPMuueuX/8+KfNWldrzDw66zdwQEnB7iFDtZCFSGwEdhQDuyTqV74WurRqLz qEwCdqoOwRMnSKKVxYgXASAVqIaih5Yo7SbR84dnufs5GHKN4SSHTCZiwrnyEziOGoO/ qALgr2HPcVMWA4aVSSa/tQ68zVJmsMJkczBqiwloZoIXIPfTiasJbUt0Gc/CBH4CGbVg kAGcA5c6u5gNtGcqh932SVsXRuCfEP0gNAQVXqMmbV2A0islHArJfmmhj319KlU9Hclt 7eh7YMxkQsc18V0kkyVH4ttyYEdP69VNoW5uVJgarD4TYU9NwDc9Yey1FqdqpjkXllP7 RAGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706912421; x=1707517221; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=A95mBr4LewOKrn0gA7CaGAeJ/T17Q8OZ1lunQJxFPCo=; b=XVb3WdJmQpCD16N1qQn7Q1UtNct7v9OyC4V9cf75xKdE8l11+eQB616NKTOpzoaDpa xrE1HMMLTQw8jegHG0Ng/T7bP9WHEzMRpv60tjBaT87sPGH3NlhlRUvaVV+Na8cosG4y 8rx3aZgWwuULGHE2ss6EA2KzVWNeuXE3pZqYfnvSIhPxo2KJ4WNLvYeZMQBsJkvnfPNN DUyj2UbsfiMNKpMM/xS6uLeCZwSTT1o7x+wXd0bq6OCA44Yia0uume3wRg7RWALQoony wEI6dXRtXguN5u0wPBNojAh3h+/HQCOREa8tHvskCs6FvYV8YOxYBP51kDrHU19xyE3x qfcQ== X-Gm-Message-State: AOJu0YxAN1LlcLvSaXGFre8V8GHmMKU06O3Rmv5/Y+rj6SVtBAUqUULG FnANUMgpYgEde1B+uWLml+6ySrgz5d4GmxOrUZYbUtpAllnVYEfQAUK60NaGfVCitLQdlYBuepD zXx5XmA+zNQ/lWwId7vKkda+zOj91z6V6Pf9KGw== X-Received: by 2002:a2e:7204:0:b0:2d0:8438:a33e with SMTP id n4-20020a2e7204000000b002d08438a33emr1836616ljc.51.1706912421499; Fri, 02 Feb 2024 14:20:21 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20231114200533.137995-1-alisa.roman@analog.com> <20231114200533.137995-2-alisa.roman@analog.com> <09cc2ecb-b73f-495a-9196-dbb4899f4c85@gmail.com> In-Reply-To: <09cc2ecb-b73f-495a-9196-dbb4899f4c85@gmail.com> From: David Lechner Date: Fri, 2 Feb 2024 16:20:10 -0600 Message-ID: Subject: Re: [PATCH v2 1/4] dt-bindings: iio: adc: ad7192: Add properties To: Alisa-Dariana Roman Cc: Krzysztof Kozlowski , Alisa-Dariana Roman , Michael Hennerich , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Lars-Peter Clausen , Alexandru Tachici , Jonathan Cameron , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Ceclan Dumitru Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Feb 2, 2024 at 8:14=E2=80=AFAM Alisa-Dariana Roman wrote: > > On 14.11.2023 22:29, Krzysztof Kozlowski wrote: > > On 14/11/2023 21:05, Alisa-Dariana Roman wrote: > >> Document properties used for clock configuration. > > > > Some background here is missing - otherwise it looks like you are addin= g > > new properties... > > > >> > >> Signed-off-by: Alisa-Dariana Roman > >> --- > >> .../devicetree/bindings/iio/adc/adi,ad7192.yaml | 10 ++++++++= ++ > >> 1 file changed, 10 insertions(+) > >> > >> diff --git a/Documentation/devicetree/bindings/iio/adc/adi,ad7192.yaml= b/Documentation/devicetree/bindings/iio/adc/adi,ad7192.yaml > >> index 16def2985ab4..9b59d6eea368 100644 > >> --- a/Documentation/devicetree/bindings/iio/adc/adi,ad7192.yaml > >> +++ b/Documentation/devicetree/bindings/iio/adc/adi,ad7192.yaml > >> @@ -80,6 +80,16 @@ properties: > >> and when chop is disabled. > >> type: boolean > >> > >> + adi,clock-xtal: > >> + description: | > >> + External crystal connected from MCLK1 to MCLK2. A better description could be: When this flag is present, it indicates that the clock from the clocks property is a crystal oscillator connected to MCLK1 and MCLK2. When omitted the clock is a CMOS-compatible clock connected to MCLK2. > > > > And this should be input clock. > > > >> + type: boolean > >> + > >> + adi,int-clock-output-enable: > >> + description: | > >> + Internal 4.92 MHz clock available on MCLK2 pin. > >> + type: boolean > > > > This should be clock-cells and clock provider. > > > > Unless you are just documenting already used interface which you do not > > want to break... This property is already used in the mainline Linux driver, so sounds like the "don't want to break it" case. But it would make sense to deprecate this property and use standard clock provider bindings instead. > > > >> + > >> bipolar: > >> description: see Documentation/devicetree/bindings/iio/adc/adc.y= aml > >> type: boolean > > > > Best regards, > > Krzysztof > > > > Thank you very much for the feedback! > > If I understand correctly, there is already an input clock in the binding= s: > ``` > clocks: > maxItems: 1 > description: phandle to the master clock (mclk) > > clock-names: > items: > - const: mclk > ``` > > What I wanted to accomplish with this patch is to document these boolean > properties (from the ad7192 driver code): > ``` > /* use internal clock */ > if (!st->mclk) { > if (device_property_read_bool(dev, "adi,int-clock-output-= enable")) > clock_sel =3D AD7192_CLK_INT_CO; > } else { > if (device_property_read_bool(dev, "adi,clock-xtal")) > clock_sel =3D AD7192_CLK_EXT_MCLK1_2; > else > clock_sel =3D AD7192_CLK_EXT_MCLK2; > } > ``` > > Please let me know how to proceed further! > > Kind regards, > Alisa-Dariana Roman > There was another recent discussion about this exact same clock input/output on another chip recently [1]. So it would be nice if we could end up with the same bindings in both cases (cc Ceclan). In the other thread, it was proposed to have the clocks property to be an array of two phandles, one for the crystal oscillator and one for the external clock rather than a single clock and the adi,clock-xtal property. But that would be a breaking change to these bindings. [1]: https://lore.kernel.org/linux-iio/20240122-bloating-dyslexic-cbc0258c8= 98a@spud/t/#m4e375aa36dae6da0c319518137f03e2f63e72af9