Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1803766imu; Sat, 8 Dec 2018 07:33:29 -0800 (PST) X-Google-Smtp-Source: AFSGD/WvmAVATBTGa4v0dCai6Wytk3JePo96HT10aUhTrRUk/824p86pp1HfubCawrWz+x3qQrJ6 X-Received: by 2002:a63:dd15:: with SMTP id t21mr5257452pgg.347.1544283208981; Sat, 08 Dec 2018 07:33:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544283208; cv=none; d=google.com; s=arc-20160816; b=lO+s2iT57jqWKWzzypnzxDqQ42SEWX2RAU4WB/rhD8urmJ2YdZPkJsnhKV8GGOYuTw 7bmPtNlGbjfz7qMkVle0uwIWJ8EE6EyT8ubqe99HmFYvFA09SUftiZLgjMai1P9MBmPh Xx4z5f1cMolMB6lVNujRNDwRTKBup2XL5ZtACmkjZpWcPdpxMu4KAAfc9uvRfZFc+kfs rVe7cWl8sPY7P2ZMH1JrFHH0IWXSb7iKrjyfnCuyg7EIZDY1eHrsCA/8esTCKg1cH+a8 aWjhGyWyqqeiF18zQPuJq3Cb5lqRZm4Cd0S7WOTdlCOlGD+97HLdLySuWm2wMFcilIZA SWYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=kCXw9NdpX2k0QY7rJq/NcylEh24cc1nf10t27UZYlkg=; b=BIwBaVHhnmvrisKRQitmsmcjlVYrtJpFtqBNFvgaIleeYgfsgwZrpdMLeRM/8zvdSW e1HjSezPTNnxmaqGbYCBAxTjt3t97aFlQEIJP2BPTT9sWh5We1UI1YXkeq6hhshyhfEO VIRTIDJd84LXdFmReFm3ucuQoQgYtkYF3pB1M6SRcB2SUzcAhilSvcot926c9HICrC/8 eTrdPV/C8nFbjRNAFU6hZe4y4yG4EmbgP4RRsXntvcR5DD0WGOBcDuaCxELSquYTBMzd XtWpH7FEjWX5k/mM1pLW3VAG+awnko3F2+pH/3wSTxwFeXVCgbrUv6qV4OlYF3WjHCYB utQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=UW2fCu+m; 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 d12si5621583pla.351.2018.12.08.07.33.13; Sat, 08 Dec 2018 07:33:28 -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=UW2fCu+m; 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 S1726189AbeLHPch (ORCPT + 99 others); Sat, 8 Dec 2018 10:32:37 -0500 Received: from mail.kernel.org ([198.145.29.99]:37530 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726147AbeLHPch (ORCPT ); Sat, 8 Dec 2018 10:32:37 -0500 Received: from archlinux (cpc91196-cmbg18-2-0-cust659.5-4.cable.virginm.net [81.96.234.148]) (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 E221C20700; Sat, 8 Dec 2018 15:32:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544283156; bh=rCe6V2fbo7XddY4IQPET9TAbkgfxWlAfnSWZydoCxVM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=UW2fCu+mA3sWVEB6bU9L/funy+OnjruvUZB+ZfqEM4wFF8P5Z0ShuK8OWssy2lXAN f/pKMmdVZ4ncXj4BLPlxu9idka57ry22m36SLjD8RKxEZuxVCwlu27FGqKOkACK2vi KBxsVu3EcKIYtJI1wk2O5BuU2ihsdbY/ssTUALn0= Date: Sat, 8 Dec 2018 15:32:32 +0000 From: Jonathan Cameron To: Mircea Caprioru Cc: , , , , , , , Subject: Re: [PATCH 2/2] staging: iio: adc: ad7192: Add clock output option Message-ID: <20181208153232.52524bae@archlinux> In-Reply-To: <20181206091052.7644-2-mircea.caprioru@analog.com> References: <20181206091052.7644-1-mircea.caprioru@analog.com> <20181206091052.7644-2-mircea.caprioru@analog.com> X-Mailer: Claws Mail 3.17.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 6 Dec 2018 11:10:52 +0200 Mircea Caprioru wrote: > When using the internal clock the device has an option in which the clock > output is available on MCLK2 pin. This patch adds a dt binding for enabling > this property. > > Signed-off-by: Mircea Caprioru I'd rather we looked at getting this out of staging, with proper binding docs before we add too many new features, but I suppose this is small enough that it isn't too much of a problem other that we are defining a binding that might not go down well long term. If nothing else we should be supporting this as a clock source to allow it for example to be looped into another identical device as the input. Here we are putting it out on a pin with no 'consumers'. Jonathan > --- > drivers/staging/iio/adc/ad7192.c | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) > > diff --git a/drivers/staging/iio/adc/ad7192.c b/drivers/staging/iio/adc/ad7192.c > index 8a4e6ede42b3..a11c8a82bb7c 100644 > --- a/drivers/staging/iio/adc/ad7192.c > +++ b/drivers/staging/iio/adc/ad7192.c > @@ -611,6 +611,10 @@ static const struct iio_chan_spec ad7193_channels[] = { > static int ad7192_clock_select(struct spi_device *spi, struct ad7192_state *st) > { > int ret; > + bool clock_out_en; > + > + clock_out_en = of_property_read_bool(spi->dev.of_node, > + "adi,int-clock-output-enable"); > > st->clock_sel = AD7192_CLK_EXT_MCLK2; > st->mclk = devm_clk_get(&spi->dev, "clk"); > @@ -626,7 +630,10 @@ static int ad7192_clock_select(struct spi_device *spi, struct ad7192_state *st) > return PTR_ERR(st->mclk); > > /* use internal clock */ > - st->clock_sel = AD7192_CLK_INT; > + if (!clock_out_en) > + st->clock_sel = AD7192_CLK_INT; > + else > + st->clock_sel = AD7192_CLK_INT_CO; > st->fclk = AD7192_INT_FREQ_MHZ; > } > }