From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_2 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 22097C43331 for ; Sat, 28 Mar 2020 17:31:43 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EC317206DB for ; Sat, 28 Mar 2020 17:31:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="OIMnXA5w"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="UsHokRD9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EC317206DB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=aG/jl8hkqUJAql2vczocfjjMmfxR46v6VMH61Dc1WfY=; b=OIMnXA5woN437M XwRF2rO3ttHfOfDTAXqbL4sPiImHkkZegGuqNIa4VKR4mAPjl/9tMF+oUGl+TQ+xjdKMpxbewfWH0 oEt0MGULDBgg94zUVRGAT2BgpVTCwxhB1D680Z3A0HBNcj0KEkt8K6EwxPk9owF5A0hxyVlMneBPT 3RF30v0usmReOj9NQZGhgGnc+e0IqCFjZ/htG4Vh82Ag5AAbzuheJR5toIjWcpm5iM8NVDrqOe179 BeZ5HcncxlORm/rd0KoYag8B0FrBnbuEQvbzJKAVnQXYpdfM9i2Jlv/tlly70rp5bDxUn8lIoTn5R 0mW4TVD1tHG3tigFh81w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jIFJ5-0001rR-Pz; Sat, 28 Mar 2020 17:31:39 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jIFJ3-0001r2-78 for linux-arm-kernel@lists.infradead.org; Sat, 28 Mar 2020 17:31:38 +0000 Received: from archlinux (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (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 82208206DB; Sat, 28 Mar 2020 17:31:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585416696; bh=vG64A0FZ/wyL1OcvxNk+CZBzjwTgOgIwdp7k4GCvs6A=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=UsHokRD9QbPm4IQfC3LcYutgvPiC6kVQHgDpmVxCG3k+v7UDLNfBrmh7WDZjNP5uB FsDLp6LSaDTeH+/uInypdmApoB+gI4QXJ6EsYlclo2IL49L0H59lP9FICBmjLxIjrE o44LAH91Jlux5JXzv1nji/Ej/PxzZ+xtxxkS8QSI= Date: Sat, 28 Mar 2020 17:31:32 +0000 From: Jonathan Cameron To: Subject: Re: [PATCH v3 1/3] iio: adc: at91-sama5d2_adc: fix differential channels in triggered mode Message-ID: <20200328173132.25f7e1d8@archlinux> In-Reply-To: <5c0829d6-3b8d-0efc-0ffc-042727cb9115@microchip.com> References: <1580216189-27418-1-git-send-email-eugen.hristev@microchip.com> <1580216189-27418-2-git-send-email-eugen.hristev@microchip.com> <20200202110206.7326ce4d@archlinux> <5c0829d6-3b8d-0efc-0ffc-042727cb9115@microchip.com> X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200328_103137_302369_BC4A763C X-CRM114-Status: GOOD ( 22.37 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-iio@vger.kernel.org, Ludovic.Desroches@microchip.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, alexandru.ardelean@analog.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, 23 Mar 2020 10:42:19 +0000 wrote: > On 02.02.2020 13:02, Jonathan Cameron wrote: > > On Tue, 28 Jan 2020 12:57:39 +0000 > > wrote: > > > >> From: Eugen Hristev > >> > >> The differential channels require writing the channel offset register (COR). > >> Otherwise they do not work in differential mode. > >> The configuration of COR is missing in triggered mode. > >> > >> Fixes: 5e1a1da0f8c9 ("iio: adc: at91-sama5d2_adc: add hw trigger and buffer support") > >> Signed-off-by: Eugen Hristev > > Applied to the fixes-togreg branch of iio.git. Normally I avoid rebasing that > > branch but I may do so this time given it's currently mid merge window. > > > > The other two patches will have to wait for this one to get upstream of > > my togreg branch which will take a few weeks. > > > > Please give me a poke if I seem to have forgotten about them! > > > > Poke ! Timings have gone badly this cycle I'm afraid, so whilst it's made it into staging/staging-next, I'm not going to be rebasing togreg until after a pull request to Greg KH. The timing issue was I didn't get one out before staging most likely closed (one week ahead of the window opening which it will probably do tomorrow). So this will have to wait at least a few weeks more. Sorry for the delay. Jonathan > > Eugen > > > Thanks, > > > > Jonathan > > > >> --- > >> Changes in v2: > >> - moved to the start of the list > >> > >> drivers/iio/adc/at91-sama5d2_adc.c | 15 +++++++++++++++ > >> 1 file changed, 15 insertions(+) > >> > >> diff --git a/drivers/iio/adc/at91-sama5d2_adc.c b/drivers/iio/adc/at91-sama5d2_adc.c > >> index e1850f3..2a6950a 100644 > >> --- a/drivers/iio/adc/at91-sama5d2_adc.c > >> +++ b/drivers/iio/adc/at91-sama5d2_adc.c > >> @@ -723,6 +723,7 @@ static int at91_adc_configure_trigger(struct iio_trigger *trig, bool state) > >> > >> for_each_set_bit(bit, indio->active_scan_mask, indio->num_channels) { > >> struct iio_chan_spec const *chan = at91_adc_chan_get(indio, bit); > >> + u32 cor; > >> > >> if (!chan) > >> continue; > >> @@ -732,6 +733,20 @@ static int at91_adc_configure_trigger(struct iio_trigger *trig, bool state) > >> continue; > >> > >> if (state) { > >> + cor = at91_adc_readl(st, AT91_SAMA5D2_COR); > >> + > >> + if (chan->differential) > >> + cor |= (BIT(chan->channel) | > >> + BIT(chan->channel2)) << > >> + AT91_SAMA5D2_COR_DIFF_OFFSET; > >> + else > >> + cor &= ~(BIT(chan->channel) << > >> + AT91_SAMA5D2_COR_DIFF_OFFSET); > >> + > >> + at91_adc_writel(st, AT91_SAMA5D2_COR, cor); > >> + } > >> + > >> + if (state) { > >> at91_adc_writel(st, AT91_SAMA5D2_CHER, > >> BIT(chan->channel)); > >> /* enable irq only if not using DMA */ > > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel