Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2535449imu; Thu, 24 Jan 2019 14:41:54 -0800 (PST) X-Google-Smtp-Source: ALg8bN6/eFOLcVW05udNBRuBE9dTSwQ0Wyyr3wxjrhlHIgKu3cJQPm5D2UnDuCzJlxPcthvZSQNP X-Received: by 2002:a65:624c:: with SMTP id q12mr7673407pgv.379.1548369714040; Thu, 24 Jan 2019 14:41:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548369714; cv=none; d=google.com; s=arc-20160816; b=b+jiiN65uvl/tQ5MsM0StPZ0Xv9GllwZm0jYZ7qOghsBTk5c9YREaNq52BqY3Q2G85 uCBU8HmjW7tW284WKVjekOwTuvHVND7zCNTV1u6qH0Jc6xQl37BAgaDJS4KwRNq4mYBg J8NyiZw2QMr1mH/ytHB+9nkjntOseUaGhQL6CQYmp4WSscMPddg33NINUeeGj/D/Nlzo kXz/I/trwvbw1dfNAAPoWwjYM00vYhl4DxPu0bi4smED4jJLZWoGyoneJhb7ztPXpj7G ZOxU3dODnr3hSVDZZJlFAlgZPYMG3+q0Ok7VQJXKx3bzBIW74ReYEyYSmciQ8VUgSAi+ zGuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:to:message-id:in-reply-to:from:cc :user-agent:references:subject:content-transfer-encoding :mime-version:dkim-signature; bh=B2hK2+Hzvo1i2O4RvV8tEv47gJaPOO4S8mtHE8RezAw=; b=n639VY1z1VS2xjQzTtggG2jKOt+/OD7Vg6mN0fb+jAUzdy8pKvH2Arei60iL2j4Uuk XzPhNd7stIwQFI/vmLJh6TtJX1ob9ao+DB+WhTktIWyVFbxJjcDMNTw06mjDhW/4AHMn E7s5QQRJ70ldJxWzsTfRdWTqpPoSOfXaSXaNdaUJiPrnhX6G2dci4VqTxldXbbiiJoY1 e0beq3sH82RDx9nI1WzKz1z8/W/Mg7P/CcZ8RI+9ke9WGt/gDK89TDE2mGswsnVOvr8k Em1aevArVW6erar3+dERWxuZES7Zf9PgeptK9Ed3pfkszSuKCkKs5XdfvMaJkK6z80np SwIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=r6q0Wm0m; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w22si9387302plp.301.2019.01.24.14.41.28; Thu, 24 Jan 2019 14:41:54 -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=@kernel.org header.s=default header.b=r6q0Wm0m; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727558AbfAXWlX (ORCPT + 99 others); Thu, 24 Jan 2019 17:41:23 -0500 Received: from mail.kernel.org ([198.145.29.99]:47472 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725996AbfAXWlX (ORCPT ); Thu, 24 Jan 2019 17:41:23 -0500 Received: from localhost (unknown [104.132.0.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F0A5421872; Thu, 24 Jan 2019 22:41:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548369682; bh=k+kztCmBaXjD7kREzHoQpwFEViSbeAc9Ddlz0bZdawM=; h=Subject:References:Cc:From:In-Reply-To:To:Date:From; b=r6q0Wm0m+7ed8ty+jdYDLsN1YhUGUDyNpNt6ArP84dJTyqWYzovoM5z96MCx/o5f3 /1+IgzU6g4F0vNgdTnQNAP2C9LJirOZMx2R32GqGE9rz4WJkgnfE56KKWgvGQfIyOd 9t6kESaQOahIc2YAqkf60gwuhTrlgyeoVJbPXq7E= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: Re: [PATCH 1/2] staging: iio: adc: ad7192: Add clock for external clock reference References: <20181206091052.7644-1-mircea.caprioru@analog.com> <20181208152954.596529f8@archlinux> <154475156267.19322.6284056396098102605@swboyd.mtv.corp.google.com> <20181216100741.4e362a17@archlinux> User-Agent: alot/0.8 Cc: Mircea Caprioru , Michael.Hennerich@analog.com, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, devel@driverdev.osuosl.org, Rob Herring , linux-clk@vger.kernel.org From: Stephen Boyd In-Reply-To: <20181216100741.4e362a17@archlinux> Message-ID: <154836968107.136743.11352935762099070131@swboyd.mtv.corp.google.com> To: Jonathan Cameron Date: Thu, 24 Jan 2019 14:41:21 -0800 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Jonathan Cameron (2018-12-16 02:07:41) > Rob, Clk experts, questions for you below. >=20 > Jonathan >=20 >=20 > On Thu, 13 Dec 2018 17:39:22 -0800 > Stephen Boyd wrote: >=20 > > Quoting Jonathan Cameron (2018-12-08 07:29:54) > > > On Thu, 6 Dec 2018 11:10:51 +0200 > > > Mircea Caprioru wrote: > > > =20 > > > > This patch adds a clock to the state structure of ad7192 for gettin= g the > > > > external clock frequency. This modifications is in accordance with = clock > > > > framework dt bindings documentation. > > > >=20 > > > > Signed-off-by: Mircea Caprioru =20 > > >=20 > > > +cc Rob and the clk list for advise on how to do the binding for this= one. > > >=20 > > > It is basically 2 pins, you can put a clock in on one of them or conn= ect > > > a crystal across them. The driver has to set a register to say which= is > > > the case. =20 > > >=20 > > > Current proposal is two optional clocks (fall back to internal oscill= ator) > > > but that doesn't seem to be commonly done, so I'm wondering if there > > > is a 'standard' way to handle this sort of thing. > > > =20 > >=20 > > I'm not sure I fully understand, but I think perhaps > > assigned-clock-parents would work? Or does that not work because either > > way some parent is assigned, either the crystal or the optional clk that > > isn't a crystal? > >=20 > My concern is they aren't really separate clock inputs. They are just d= ifferent > ways of providing the same fundamental clock. So I think we may want to = just > provide a single clock and have another dt binding to say what it is. >=20 > So lots of ways we could do it, but I'm not sure what the right one to > go with is! >=20 Sorry for getting back to this so late. Is the datasheet public for this device? If so, any link to it? If it's two pins, and sometimes one pin is connected and other times two pins are connected but a register needs to be set if the pins are connected in one configuration or the other I would say your plan for a DT property indicating how the pins are configured sounds good. Usually the hardware can figure these things out itself so I find this sort of odd, but if this is how it is then there's not much that we can do. It sounds like there aren't two different clk inputs to the device. Given that information specifying two optional clks is incorrect because there is only one 'slot' is the external clk source.