Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp3741622rwb; Sun, 9 Oct 2022 10:12:12 -0700 (PDT) X-Google-Smtp-Source: AMsMyM52JvxHxqbXfx7gtrj+Wi0qyclO2G8hUbvygJhy+l41h8aHFe0YCllhF1A3tQeA42DCk2O9 X-Received: by 2002:a05:6402:2804:b0:439:83c2:8be2 with SMTP id h4-20020a056402280400b0043983c28be2mr14491710ede.292.1665335532058; Sun, 09 Oct 2022 10:12:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665335532; cv=none; d=google.com; s=arc-20160816; b=CtcQgTTZMNcQcOkcF3Osn52i4nT7SEitn9esFNGFj0NYndctGYduZJW0Tr+QuRyJ8W O6lkPlE4BghAnY2587QNZtkvulPCm4hzZ6zrm+Tka4K+zcUoBmhMnfhrQb+KCmR0xecr N3/H6Ytn2cOx+iuN1/gxWKRb/oN8NC+Zuv7+gnMPPxCQDVlfQGyufEhdTjCCG4YpLfIJ ITChPH0ufl2doa/3Vb9vRU/7Eh70hLk0b6kZhUidt4czBtz7isy8e5sUUzXaGCZU1FTJ HrXSgrk5zqAY3qSKuBFv8iKtTiKS8BdW0iCODZHJAHqw8jZSkKaF1U0PhnrVQPh6926d NS9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=OzjbBH8KEQOHyJFYGFH8YvcQtKYVripAMutnlloS0lA=; b=JfOiiYkAc4xXJnsbiCh+mKRQhJSHyJnpnXKCcF9octN+nipLs3hf5HqkV74sKR+cmP sVeKfJZ9DSE3Khy+0+q5qVP3VkxbViLe74FbnYLV+f4kPr3JESO7p64kamfWkjBgl+S0 sVieX7tAb/d1QoYGxl27WJMjs8ya+8MwV2Ipd83Q6i7zpYdFQrFlJdI3JkqvApukPC1E 1FczblMOb8hI7kAz6U06w8Z5Qmh4/M3tOqFlnx4dWJxfOzvk9jo4kD91cln/Y2oIv825 VKTXf1rcMux80hlBQSr+erbmDib47BeuSGvhPtuYjyxFU5HTdK0OjhndmIH9osHlWQdf ylHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=t1dOg6We; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dt3-20020a170907728300b0073dc32ccd9fsi8093571ejc.104.2022.10.09.10.11.45; Sun, 09 Oct 2022 10:12:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=t1dOg6We; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S230153AbiJIQlg (ORCPT + 99 others); Sun, 9 Oct 2022 12:41:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230058AbiJIQle (ORCPT ); Sun, 9 Oct 2022 12:41:34 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26935BC98; Sun, 9 Oct 2022 09:41:34 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7CB3F60C41; Sun, 9 Oct 2022 16:41:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D117BC433C1; Sun, 9 Oct 2022 16:41:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665333692; bh=zVR71JU/UpAI0sS5K+0vpB9MY/SnZLjg19Qy4gojgDw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=t1dOg6WeadbkxoyduvoN1TE/xZfxSZabyGLxzS2zpiLHeHzXvDFF7CHVDHGhgQvxu 5N4pbD/IbE9I+NiPU0jzD7mLpbh4PURZjS31cYVrIqzxCeOTkyW3mUZdLm78BchDlk dazV0KS1xcCpHo4bEJUXjFWg++BAV70kga4tfCPPdDqzd+sM6+naXhZk1LsALrBsS9 ep+3v4qHvjG39IhqqMj27UwbV0UHD14Hlx0Bkb4MRzPUgXrQdOjHB+1rlNhw1pZMq6 EAH01FuyL3GoaNhgdTquqE4jWaVRIAnqdwD6O7wA03hIX3uGhBfny6dcienvtuJrVg oa8Bt2+5yLQXw== Date: Sun, 9 Oct 2022 17:41:54 +0100 From: Jonathan Cameron To: Ibrahim Tilki Cc: , , , , , , Subject: Re: [PATCH v8 1/3] iio: adc: add max11410 adc driver Message-ID: <20221009174154.41569d52@jic23-huawei> In-Reply-To: <20221003105903.229-2-Ibrahim.Tilki@analog.com> References: <20221003105903.229-1-Ibrahim.Tilki@analog.com> <20221003105903.229-2-Ibrahim.Tilki@analog.com> X-Mailer: Claws Mail 4.1.0 (GTK 3.24.34; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 3 Oct 2022 13:59:01 +0300 Ibrahim Tilki wrote: > Adding support for max11410 24-bit, 1.9ksps delta-sigma adc which > has 3 differential reference and 10 differential channel inputs. > Inputs and references can be buffered internally. Inputs can also > be amplified with internal PGA. > > Device has four digital filter modes: FIR50/60, FIR50, FIR60 and SINC4. > FIR 50Hz and 60Hz rejections can be enabled/disabled separately. > Digital filter selection affects sampling frequency range so driver > has to consider the configured filter when configuring sampling frequency. > > Signed-off-by: Ibrahim Tilki One small thing inline that I tidied up whilst applying. > +static int max11410_configure_channel(struct max11410_state *st, > + struct iio_chan_spec const *chan) > +{ > + struct max11410_channel_config cfg = st->channels[chan->address]; > + unsigned int regval; > + int ret; > + > + if (chan->differential) > + ret = max11410_set_input_mux(st, chan->channel, chan->channel2); > + else > + ret = max11410_set_input_mux(st, chan->channel, > + MAX11410_AINN_GND); > + > + if (ret) > + return ret; > + > + regval = FIELD_PREP(MAX11410_CTRL_VREFP_BUF_BIT, cfg.buffered_vrefp) | > + FIELD_PREP(MAX11410_CTRL_VREFN_BUF_BIT, cfg.buffered_vrefn) | > + FIELD_PREP(MAX11410_CTRL_REFSEL_MASK, cfg.refsel) | > + FIELD_PREP(MAX11410_CTRL_UNIPOLAR_BIT, !cfg.bipolar); drivers/iio/adc/max11410.c:370:18: warning: dubious: x & !y I've fixed it with ... cfg.bipolar ? 0 : 1); Shout if that's an issue (I've gotten these backwards in the past ;)