From patchwork Wed Jun 11 21:18:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kardell X-Patchwork-Id: 4338521 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 89C6E9F333 for ; Wed, 11 Jun 2014 21:18:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C7A4F202F2 for ; Wed, 11 Jun 2014 21:18:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 01076202F0 for ; Wed, 11 Jun 2014 21:18:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752406AbaFKVSd (ORCPT ); Wed, 11 Jun 2014 17:18:33 -0400 Received: from mail-lb0-f176.google.com ([209.85.217.176]:60895 "EHLO mail-lb0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752377AbaFKVSc (ORCPT ); Wed, 11 Jun 2014 17:18:32 -0400 Received: by mail-lb0-f176.google.com with SMTP id p9so189137lbv.21 for ; Wed, 11 Jun 2014 14:18:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=SJnv/92xRN+lBMRjtGMZSpC0Wsr/SoRD+o9UsxhoMv0=; b=NJCyE7r3FdeLwZSWdg7iynM9a7n0++XzbxiHNAyUIAbPvAHYzfs7bzzxGiQwDtKtnz DcqUPTmJ5ph2YNrJS4XgXy1+CnNGcn9M7RKLXk7/aZabpc6PBmnekC+YexUaYyPgFryk J8VH9g7cbqFRrx8GOBwvCCiBH9csfXEQ8C+zzlKlK+80w7I2UVSb5RA36AMMT6PdNJKx oW5SUuLcYCBQhYPx3ptIG5jUXerlrryg6XEAUoLSFxXksc7+2PmdROemAb/vvbmcjQNi FmuxB5OgJGfMyO3u5WjxPNbi8jYsG4vSZb5T86IPSwlCHJzygvNgPebpMxO82EVJU0J+ E9Qg== X-Gm-Message-State: ALoCoQnrXEQIo1My1BVCXKT+8ALb0HDlSTbVatY1EzBnT2lRdazzh0UIL8r0MN2bBUT8zlnobFxQ X-Received: by 10.112.160.105 with SMTP id xj9mr27669622lbb.2.1402521510538; Wed, 11 Jun 2014 14:18:30 -0700 (PDT) Received: from emu.mida (static-212-247-121-18.cust.tele2.se. [212.247.121.18]) by mx.google.com with ESMTPSA id bq6sm25963670lbb.34.2014.06.11.14.18.29 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Jun 2014 14:18:29 -0700 (PDT) From: Jan Kardell To: Sebastian Andrzej Siewior Cc: Jonathan Cameron , linux-iio@vger.kernel.org, linux-omap@vger.kernel.org Subject: [PATCH] iio: ti_am335x_adc: Use same step id at FIFOs both ends Date: Wed, 11 Jun 2014 23:18:18 +0200 Message-Id: <1402521498-11535-1-git-send-email-jan.kardell@telliq.com> X-Mailer: git-send-email 1.8.4.5 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Since AI lines could be selected at will (linux-3.11) the sending and receiving ends of the FIFO does not agree about what step is used for a line. It only works if the last lines are used, like 5,6,7, and fails if ie 2,4,6 is selected in DT. Signed-off-by: Jan Kardell --- drivers/iio/adc/ti_am335x_adc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/adc/ti_am335x_adc.c b/drivers/iio/adc/ti_am335x_adc.c index a4db302..d5dc4c6 100644 --- a/drivers/iio/adc/ti_am335x_adc.c +++ b/drivers/iio/adc/ti_am335x_adc.c @@ -374,7 +374,7 @@ static int tiadc_read_raw(struct iio_dev *indio_dev, return -EAGAIN; } } - map_val = chan->channel + TOTAL_CHANNELS; + map_val = adc_dev->channel_step[chan->scan_index]; /* * We check the complete FIFO. We programmed just one entry but in case