Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp118683pxb; Mon, 16 Aug 2021 01:07:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwXcVP0O27lfNQWhd8FBB1/4IlfjEnkgCBmDbGcyuiiof7SHDyakYyda2yH/5i7GTcGjmri X-Received: by 2002:a05:6402:1767:: with SMTP id da7mr18696512edb.66.1629101262202; Mon, 16 Aug 2021 01:07:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629101262; cv=none; d=google.com; s=arc-20160816; b=tGSFVogxh28VsMW/NrN2RPlF1WZUxhdt7aG09i463cze4xkfGTH4WT/mvtX7wd53/0 jmbt+RjMHyUwmehDGHV26fs22R1b5A/3It8aizP16tgaEC8NGBlXBR3govUIIOb6YzrP bgvi/bGzO9UMnoeib8USimZkCp7jMsOU7ZMmzUnVrBL/3KnchXpqYSQATQD4rymVsXz+ /zSFDdFInFH2z3nxiNNDN93H6Fs9teMJv4cs2nWGw8JQE60MRHYgMIvp/KDTGPhOoT1S UGSlZ6P1B7hwSNXeJi3SbpHel9ppuTyxDfs6kvvbyAJwl5Y+/2lXm1BFhjmoBojnkz5L Uz5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=i1ktA99mfz2RHRsDOWxe6xNSbgh0608fnbR1bfs8vTw=; b=MD/l9W/2RVLcRpKCb4Cliri6r4693RTxi7P96jywzI35Ts6WjWLWGwi4d4Lwj1qrNn V70OwfkmXPkCV1mqwM8NiqBccFsWPpg9F0WftfPvnC7yQML47OhWKBH1e1JKE0E/0KoQ kv5kDQlAdM+zExhWy4V3TJBwsNcFBHvE9H80h2CH1Fx/DsyAMU9mZhLeqV/UXeQwgWyU HjLbUMreQzVx7YnoTfbf16R/aNvw8eKPFQ1nBf3jKE0DMlTAWlTx3eIDBEJzcNhYavbf 9kURYX2+lbsTidYUVqlaqXingWj5Ihq0hD204a25UZHuH7EpO3XmJK7oF08FAhFVQwl0 bGDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=QCsNbSm6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i10si12259435ejd.99.2021.08.16.01.07.19; Mon, 16 Aug 2021 01:07:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=QCsNbSm6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234637AbhHPIGF (ORCPT + 99 others); Mon, 16 Aug 2021 04:06:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234610AbhHPIGA (ORCPT ); Mon, 16 Aug 2021 04:06:00 -0400 Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B511C061764; Mon, 16 Aug 2021 01:05:29 -0700 (PDT) Received: by mail-pj1-x102e.google.com with SMTP id om1-20020a17090b3a8100b0017941c44ce4so12740752pjb.3; Mon, 16 Aug 2021 01:05:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=i1ktA99mfz2RHRsDOWxe6xNSbgh0608fnbR1bfs8vTw=; b=QCsNbSm6yw5FCN5rIOla9UxUBS958N2gSQZ6zo6n+i32M9ZVmrpgjhymEQqdX+nKaG 2BBp36WUVzm9/NmMQMplPmh20d9muHXRWrg4RBJW/a8C+6aOJ8mJWEDZdjf2OSaa42YC Rz7ZOwMxMg5QJUr2nA9yvhgc47wATlrrQ5kNq0z/YWzWuTYrmBAMlVcFLcziLYWY4S+d +jVEPdDZCSs5Kv3VfR8Wp+CklRjIIcAfmydcaVd/mxKEYJNWT9IbBwRxyFY2nSg/6J6j avELIFZ/nvi43KV2lyfumCz5VWaZxRoaGdqYLKQmqqjfjvPIc+pz1e5uxEsU8B8fEipu ZpZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=i1ktA99mfz2RHRsDOWxe6xNSbgh0608fnbR1bfs8vTw=; b=qnqBDamBPVQLNMaHoWBZrv4EtuUpFTPK78Hag8apOfUMYu6oiNm8cPruHYs9XhQd8Y K1gcC/A3MVn81CGqQW2dknxnrlnzyPOW/fygQZQyGN/1zpdSOs4OPl1sXbYBp8qBdovn EzfbTanrUklEpjSawesIIJIm5XS5+CHplok4BTh2BYgrvsGh8SRL/a80SV2vvnEQrPdK EKWmnIVIDWpXxXVaoBn8tk/Fi8LJ7Ue2uB3wbHV1WHRpsPKGyi6+90AHJwdaEHY5E7mD 6htiKovUDf2JGbDWlakpnkOxlr+uSJZwt18rGyOEaay03DrDFNvIpPZSiyF5wTIOq6xR 077w== X-Gm-Message-State: AOAM532TZmxgALuHLx2w4ZmDrBzz+ahcPjcO/E112QnGbI143XGgM3i4 ZZy4fUYnjVDpQFabPWqnr1vlZzSQSweVqUJGtRg= X-Received: by 2002:a17:90a:604e:: with SMTP id h14mr16070462pjm.181.1629101129052; Mon, 16 Aug 2021 01:05:29 -0700 (PDT) MIME-Version: 1.0 References: <20210815213309.2847711-1-liambeguin@gmail.com> <20210815213309.2847711-4-liambeguin@gmail.com> In-Reply-To: <20210815213309.2847711-4-liambeguin@gmail.com> From: Andy Shevchenko Date: Mon, 16 Aug 2021 11:04:49 +0300 Message-ID: Subject: Re: [PATCH v6 3/5] iio: adc: ad7949: add vref selection support To: Liam Beguin Cc: Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Charles-Antoine Couret , =?UTF-8?B?TnVubyBTw6E=?= , Linux Kernel Mailing List , linux-iio , devicetree , Rob Herring Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 16, 2021 at 12:35 AM Liam Beguin wrote: > > From: Liam Beguin > > Add support for selecting the voltage reference from the devicetree. > > This change is required to get valid readings with all three > vref hardware configurations supported by the ADC. > > For instance if the ADC isn't provided with an external reference, > the sample request must specify an internal voltage reference to get a > valid reading. ... > + /* Setup internal voltage reference */ > + tmp = 4096000; > + ret = device_property_read_u32(dev, "adi,internal-ref-microvolt", &tmp); > + if (ret < 0 && ret != -EINVAL) { What does this check (second part) is supposed to mean? The first part will make it mandatory, is it the goal? > + dev_err(dev, "invalid value for adi,internal-ref-microvolt\n"); > + return ret; > + } -- With Best Regards, Andy Shevchenko