Received: by 10.223.185.116 with SMTP id b49csp1823735wrg; Sat, 24 Feb 2018 05:00:51 -0800 (PST) X-Google-Smtp-Source: AH8x2273nAmS4rQ4nxg1Mrzbqpjo5ZJJXRqo3qPstbvKvNTnY0uNN2mYl4Yfyc1qgMQsYvXpI2qy X-Received: by 10.101.73.141 with SMTP id r13mr3937509pgs.161.1519477251267; Sat, 24 Feb 2018 05:00:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519477251; cv=none; d=google.com; s=arc-20160816; b=qC+SqPCDQgNAhRk1smAc3ZG5ySxV9qsJ8kLJiDlGylx7pwKtjZtF8pBy6Hz16E+MPt oXWXK93f+3WpTHI6clLKNlijbbNs+r8BGqpFxjOfpZedyDq4tjW67P+59a6qyFU47BvE jJMk8qVTSMvj4jxxQ+S1HAIDWx2sDj9uxyiJ3ZJqI6XeP38BLGGNTvumVAfGfXvgCNFJ JJGtgKO0g7y/fr32d3ZZzX9mqXFA5I078SKUGtKCOfWFcN1Z71DmZR/92Fl0E8a6fo14 V97xhATvxyhz7l4BDZElcbX9S6nuS7Ko7q0y/e03Gf6rFOch9cU5hMDPOlPpy0AfNiD9 PLzQ== 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 :dmarc-filter:arc-authentication-results; bh=TdjWKuhuvgrpRYv83Hi0zPGyjVLftQuzF3ls5Ish6Bw=; b=DT0eJNy9M7F1CVRmqKRC4rofS1/qxlp9QSWpxNtqsULfEImbe7utjQW91utBE5gERG OmWkLyeRPrM7pd90IgYfVmIb5/7F6ZfKvkx8bX8S8mqW+UTfHh8/4NVfK2mxw2hqmiHn YjAVWL2UJPNsqWjs//QZCWRoP6r5dJ4D9zJO8KOpX/LRVdNGdq+2SjwQ8KI1x4DbS2/S 07ZxQL8sQKg7/TYx3ef7EV2YpSARxHusZg9j4vur85+vJwb2TwnjLxHnuQhVo+u7fCdk Mf7zUuykMNqsOi/syozj6Zo2JwPox7fScP6QtqmIym6YHuOZfjBaF0NEv9fMRMS7rXjq e9aA== 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 u68si2934474pgb.287.2018.02.24.05.00.36; Sat, 24 Feb 2018 05:00:51 -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; 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 S1751436AbeBXM7y (ORCPT + 99 others); Sat, 24 Feb 2018 07:59:54 -0500 Received: from mail.kernel.org ([198.145.29.99]:46330 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750934AbeBXM7x (ORCPT ); Sat, 24 Feb 2018 07:59:53 -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 7388C21741; Sat, 24 Feb 2018 12:59:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7388C21741 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=jic23@kernel.org Date: Sat, 24 Feb 2018 12:59:47 +0000 From: Jonathan Cameron To: Fabrice Gasnier Cc: , , , , , , , , , Subject: Re: [PATCH 3/7] iio: adc: stm32-dfsdm: fix clock source selection Message-ID: <20180224125947.5c5734a9@archlinux> In-Reply-To: <1519390261-25453-4-git-send-email-fabrice.gasnier@st.com> References: <1519390261-25453-1-git-send-email-fabrice.gasnier@st.com> <1519390261-25453-4-git-send-email-fabrice.gasnier@st.com> X-Mailer: Claws Mail 3.16.0 (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 Fri, 23 Feb 2018 13:50:57 +0100 Fabrice Gasnier wrote: > Add missing clock source selection. In case "audio" clock is provided, > it's unused currently: "dfsdm" clock is wrongly used by default. > > Fixes: bed73904e76f ("IIO: ADC: add stm32 DFSDM core support") > > Signed-off-by: Fabrice Gasnier Applied to the fixes-togreg branch of iio.git. Thanks, Jonathan > --- > drivers/iio/adc/stm32-dfsdm-core.c | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > > diff --git a/drivers/iio/adc/stm32-dfsdm-core.c b/drivers/iio/adc/stm32-dfsdm-core.c > index 0635f93..e50efdc 100644 > --- a/drivers/iio/adc/stm32-dfsdm-core.c > +++ b/drivers/iio/adc/stm32-dfsdm-core.c > @@ -83,7 +83,7 @@ int stm32_dfsdm_start_dfsdm(struct stm32_dfsdm *dfsdm) > { > struct dfsdm_priv *priv = container_of(dfsdm, struct dfsdm_priv, dfsdm); > struct device *dev = &priv->pdev->dev; > - unsigned int clk_div = priv->spi_clk_out_div; > + unsigned int clk_div = priv->spi_clk_out_div, clk_src; > int ret; > > if (atomic_inc_return(&priv->n_active_ch) == 1) { > @@ -100,6 +100,14 @@ int stm32_dfsdm_start_dfsdm(struct stm32_dfsdm *dfsdm) > } > } > > + /* select clock source, e.g. 0 for "dfsdm" or 1 for "audio" */ > + clk_src = priv->aclk ? 1 : 0; > + ret = regmap_update_bits(dfsdm->regmap, DFSDM_CHCFGR1(0), > + DFSDM_CHCFGR1_CKOUTSRC_MASK, > + DFSDM_CHCFGR1_CKOUTSRC(clk_src)); > + if (ret < 0) > + goto disable_aclk; > + > /* Output the SPI CLKOUT (if clk_div == 0 clock if OFF) */ > ret = regmap_update_bits(dfsdm->regmap, DFSDM_CHCFGR1(0), > DFSDM_CHCFGR1_CKOUTDIV_MASK,