Received: by 10.192.165.156 with SMTP id m28csp902191imm; Wed, 11 Apr 2018 09:01:11 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/KIBLR8RLws51hw0Hk7cB944DvmsX7wf54krd56lOgfjQnra+kjjuG8vo9F+a0x1k9JZCv X-Received: by 10.99.156.17 with SMTP id f17mr3891545pge.102.1523462471125; Wed, 11 Apr 2018 09:01:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523462471; cv=none; d=google.com; s=arc-20160816; b=eweS+AijIepD1kpOC3zrwODf5jkkkxObZp1j1LPmX4SCKzlEvYNSezC7123V2t0rOR WDm8xYGkrt2g+dELM3mkVTN4iqqS22d2ZqfZC5R8kdqxvyRP1os8MKSrpaiJOOmfUze7 H6499RBJe9DH92DCxC3qMVb4647NNvrgHzDQ2S2HbKaop/c1wDtvV/ZPeJokavDNZL6m B6PuGhUVkDyzv1twdI883HP74JLG+Iii1596Hqv8hgV0XJThTPzDaHD0UqLqfHhJUzkA UTnYlJuTIVOelzRUw09B5DdbaE1cPdZlDas7hoNxevhzFiKcQfU1hgfJBU2bTjRG20As DB8g== 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:date:cc:to:from:subject:message-id :arc-authentication-results; bh=/hcbIF6zi6Df4bb/HFUgWdv+DoPNLwt3JGQ8FMTeuME=; b=zUOA/UX86Jsvs2nmYJ9SXgpxMEl8V8//t15vymgRyNoN1kJdLjuMFVwWiFrwpgz/qd yWj/CyKiZzT2uIoR/5OzUR+nmXoT/CLy3bItI5XP0d2Kr50OexhaaSg1U6kYbAch9KNi fOgOioYYO6aFe1ixszKIGJaYD7FZuTqH9pHeFm3SbT4rIwMZ8WTBW9lDpryBfcX5fztH A6vA7ZqeRJL/YVpbzp0dj7LCbUngclNJYe20LSDM3d/RTboRokuT/7GjzAbZ169tM1rs NCJHHurfcl6XFh0KYQDKFoZmrb/CMO28WrfjDScQ5amK2gmV99DQLrsX+rViBQEEbhBl gAiQ== 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 d22-v6si1418754plr.581.2018.04.11.09.00.11; Wed, 11 Apr 2018 09:01:11 -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; 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 S1753348AbeDKP5V (ORCPT + 99 others); Wed, 11 Apr 2018 11:57:21 -0400 Received: from smtprelay0007.hostedemail.com ([216.40.44.7]:44931 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752973AbeDKP5U (ORCPT ); Wed, 11 Apr 2018 11:57:20 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay02.hostedemail.com (Postfix) with ESMTP id 098F432A36; Wed, 11 Apr 2018 15:57:20 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 57,3.5,0,,d41d8cd98f00b204,joe@perches.com,:::::::,RULES_HIT:41:278:355:379:421:541:599:800:960:966:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2196:2198:2199:2200:2393:2559:2562:2693:2731:2828:3138:3139:3140:3141:3142:3353:3622:3865:3866:3867:3868:3870:3871:4250:4321:4385:5007:6119:7576:7903:10004:10400:10848:11026:11232:11473:11658:11914:12438:12555:12740:12760:12895:13069:13311:13357:13439:14181:14659:14721:21080:21433:21451:21627:21740:30054:30091,0,RBL:47.151.150.235:@perches.com:.lbl8.mailshell.net-62.8.0.100 64.201.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:21,LUA_SUMMARY:none X-HE-Tag: wave44_22cd2ca766257 X-Filterd-Recvd-Size: 2114 Received: from XPS-9350.home (unknown [47.151.150.235]) (Authenticated sender: joe@perches.com) by omf01.hostedemail.com (Postfix) with ESMTPA; Wed, 11 Apr 2018 15:57:19 +0000 (UTC) Message-ID: <2f5a6878bf17e9cfa78de3c5b2ae52c1e8995bb1.camel@perches.com> Subject: Re: [PATCH] mfd: mc13xxx: Add mc34708 adc support From: Joe Perches To: Lukasz Majewski , Lee Jones Cc: linux-kernel@vger.kernel.org, Sascha Hauer Date: Wed, 11 Apr 2018 08:57:17 -0700 In-Reply-To: <20180411140929.30357-1-lukma@denx.de> References: <20180411140929.30357-1-lukma@denx.de> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.28.0-4 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2018-04-11 at 16:09 +0200, Lukasz Majewski wrote: > From: Sascha Hauer > > The mc34708 has an improved adc. The older variants will always convert > a fixed order of channels. The mc34708 can do up to eight conversions > in arbitrary channel order. Currently this extended feature is not > supported. We only support touchscreen conversions now, which will > be sampled in a data format compatible to the older chips in order > to keep the API between the mfd and the touchscreen driver. [] > diff --git a/drivers/mfd/mc13xxx-core.c b/drivers/mfd/mc13xxx-core.c [] > +static int mc34708_adc_conversion(struct mc13xxx *mc13xxx, unsigned int mode, > + unsigned int channel, u8 ato, bool atox, > + unsigned int *sample) > +{ > + int ret, i; [] > + if (mc13xxx->adcflags & MC13XXX_ADC_WORKING) { > + ret = -EBUSY; > + goto out; > + } This doesn't work. > [] > + mc13xxx_irq_free(mc13xxx, MC34708_IRQ_TSDONE, &adcdone_data); > + > + if (!ret) { > + ret = -ETIMEDOUT; > + goto out; > + } [] > +out: > + ret = mc13xxx_reg_write(mc13xxx, MC13XXX_ADC0, old_adc0); ret is reassigned here, so the ret = - uses above don't do what is expected. > + > + mc13xxx->adcflags &= ~MC13XXX_ADC_WORKING; > + mc13xxx_unlock(mc13xxx); > + > + return ret; > +}