Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp2478757img; Sun, 24 Mar 2019 09:48:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqyeZfAmKf8LXpLqYm26iYz4Ad2f6QMxvTbBIx10d+kK9dKTADbocbzzlDeUlmJW2te6uBUS X-Received: by 2002:a17:902:248:: with SMTP id 66mr21122034plc.286.1553446086255; Sun, 24 Mar 2019 09:48:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553446086; cv=none; d=google.com; s=arc-20160816; b=k1sj5ROodzEx31OsydjcJFUgPp1S/Y3isWaXD3xcaMt7It87YX+o96htBP9iO5d9NR 2MAtmZwA/zaEh/sI5WIltYPvuUR5u7ToT72tx4Ndm4lYH7DKljKJeqIvN1OCN9RD0tXE sLbSYGgMmss6U1QdkHXqAjfTsKpLzjnanVMHAzZ5G4D+e/eDJkOGz03r6lCkCKTvPs8w 9MZnXBna2wMjnv1KN5LZ3JypeSBlhOUDHOGQx4fUxxaDkwNE4yk38xyux15OmZzJENbR LhWqaH40mxjkdp2LWtjsJ5DhDUFoFZ+5cahel7EsE83y11YFV8HXMRewfhP/MkT5epfW Eldg== 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=hIbG6DCp34DlXeZaDhP7CNXhHlyqWynV3pan+bjjBcs=; b=ASF60pO7mwpSxgrTIqIEAFWJZ2u+mNtu8vS0Ib8Cm9o33YpcxNj3djuV7GRwOcq7oL /byxAaSJkq5MK4eGNnkE/N9aYSUfjSHI2H8ARX0qC6dKM21E636YkX959STeoAd9VXhU qDrDuB7/wQGUeWADzi1acTjijXPbjuweIhK6qtXZlcc6R6YrzRsAm09y2aVJTj4MCdMy 8IPBYepcqDi4OIZ3LAXsAJ3FO7kxNkRHY6/3khNj0TQ+5d7YGx/huKJjcwpLdKCLXDTh hmihb9UWp9uuqta+Oq5Dn3X2A4Y/LUZxy2GepZITPudwnbNVDHcoOyoWr9jTysd7qZwR zE6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=igZShqUo; 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 m30si8154834pgb.493.2019.03.24.09.47.51; Sun, 24 Mar 2019 09:48:06 -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=@kernel.org header.s=default header.b=igZShqUo; 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 S1728877AbfCXQqG (ORCPT + 99 others); Sun, 24 Mar 2019 12:46:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:55700 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726317AbfCXQqF (ORCPT ); Sun, 24 Mar 2019 12:46:05 -0400 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 4194420823; Sun, 24 Mar 2019 16:46:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553445965; bh=w0K+OU/VTk8rR7mwNdorB+rujpwHZl+J6xPdr2gqcRM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=igZShqUo/0w/Zj7ubj7gM7oRCrFPEuPjCdnJiYfWZXhLJUfflPQaUiiK5LwJiZ4C0 Krh2jcTAL8dF2UVu61apfcFwS0x0Y6fztFQIDKovVt/+qSYEB2dUrOCXLx9YdzCYTk npmxeQ81jcvsHEhDl6YCYYmUmHHBK64r8lY+sIIE= Date: Sun, 24 Mar 2019 16:45:59 +0000 From: Jonathan Cameron To: Fabrice Gasnier Cc: , , , , , , , , , , Subject: Re: [PATCH v2 5/8] iio: adc: stm32-dfsdm: enable hw consumer Message-ID: <20190324164559.430c12f9@archlinux> In-Reply-To: <1553186849-6261-6-git-send-email-fabrice.gasnier@st.com> References: <1553186849-6261-1-git-send-email-fabrice.gasnier@st.com> <1553186849-6261-6-git-send-email-fabrice.gasnier@st.com> X-Mailer: Claws Mail 3.17.3 (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, 21 Mar 2019 17:47:26 +0100 Fabrice Gasnier wrote: > Optionally enable IIO hw consumer, when provided (e.g. for DFSDM_IIO type). > This is precursor patch to introduce buffer modes. > > Signed-off-by: Fabrice Gasnier Applied, Thanks, Jonathan > --- > drivers/iio/adc/stm32-dfsdm-adc.c | 14 +++++++++++++- > 1 file changed, 13 insertions(+), 1 deletion(-) > > diff --git a/drivers/iio/adc/stm32-dfsdm-adc.c b/drivers/iio/adc/stm32-dfsdm-adc.c > index 66e2ea0..b491424 100644 > --- a/drivers/iio/adc/stm32-dfsdm-adc.c > +++ b/drivers/iio/adc/stm32-dfsdm-adc.c > @@ -630,9 +630,15 @@ static int stm32_dfsdm_postenable(struct iio_dev *indio_dev) > /* Reset adc buffer index */ > adc->bufi = 0; > > + if (adc->hwc) { > + ret = iio_hw_consumer_enable(adc->hwc); > + if (ret < 0) > + return ret; > + } > + > ret = stm32_dfsdm_start_dfsdm(adc->dfsdm); > if (ret < 0) > - return ret; > + goto err_stop_hwc; > > ret = stm32_dfsdm_adc_dma_start(indio_dev); > if (ret) { > @@ -652,6 +658,9 @@ static int stm32_dfsdm_postenable(struct iio_dev *indio_dev) > stm32_dfsdm_adc_dma_stop(indio_dev); > stop_dfsdm: > stm32_dfsdm_stop_dfsdm(adc->dfsdm); > +err_stop_hwc: > + if (adc->hwc) > + iio_hw_consumer_disable(adc->hwc); > > return ret; > } > @@ -667,6 +676,9 @@ static int stm32_dfsdm_predisable(struct iio_dev *indio_dev) > > stm32_dfsdm_stop_dfsdm(adc->dfsdm); > > + if (adc->hwc) > + iio_hw_consumer_disable(adc->hwc); > + > return 0; > } >