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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id EA0B6CF9C6B for ; Tue, 24 Sep 2024 16:51:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc: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=XrLxPgkgKOiPm2BGxnQytFvFW36owhoRBcwb0NgVun8=; b=sn3Hyp7+LtgjPIFwgWQz+M/eoK ZFgYWGPS/5N/pzUuAnXZSw0ysWV6nWcdhgeWAdzlVhxLU9QAvXvTop6252xYRxrP2CBIf8+hFbxhw 8I2GSgQ7KfZ/sKLU1lW4/bv4A8zeYmMBrkKbGI+tYwCOFqGr09+kGJ6U4hS/ghsrpm1w99VtAqap+ TC4ySN4eqZniaIFwt9n2KxKK7tuZEFpvpAqYido4vrlAwJtVotU+875HT0FHiUyhiRCb2z2rQDB3f 072UcWizIdKThpzWQ+X8REdtMnVev2VBUGo4tDDdGk93KdaHPC01XFBu5WpCaMG7EYCKs6Ae+IRBe +ysX4J/w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1st8lK-00000002tgA-3sIx; Tue, 24 Sep 2024 16:51:42 +0000 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1st8kA-00000002tV6-1ptM for linux-arm-kernel@lists.infradead.org; Tue, 24 Sep 2024 16:50:31 +0000 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-206b9455460so520735ad.0 for ; Tue, 24 Sep 2024 09:50:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727196629; x=1727801429; darn=lists.infradead.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=XrLxPgkgKOiPm2BGxnQytFvFW36owhoRBcwb0NgVun8=; b=iGdRsjuDO9yuAwpz5eK5eyCh6XbvFYh+2eycKh668jIrLsBjyZHEnXtXNaf/Mq9a1u Mghlr5TyP21l/iOviGyi18HwvEAKbSwHjEtg5DQUxsqqeoUEE9k6ldL9BcL7RMAhlQVb AMZpzKIGDOladELrDP2UFWwckASCoq7/DkDpgASWbiwYZOIkmMCGW0mg4hZkn6s3M0SN NDOJlEqDS3nrMwOR75Ewrj8QHIdvQa3FeTOuZxK1HAg5p5E3+g798LL+YZgIg2Kw6vJf qDMC3VGGkcL85NfzBZ3+PXIOmnD2HkxIDlBh5T71W3BWxyaw6/inmn+MnVEbhJdf0i9A Kq/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727196629; x=1727801429; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=XrLxPgkgKOiPm2BGxnQytFvFW36owhoRBcwb0NgVun8=; b=ZcNKuE14yN9O0KDXmsdv5rSjX2IJJ8sU0Bxk/OKFdshCdHbjajohx71m/8wqdR2C0U DgrojFZaA6RDJSwhBM396doqPWx81sbszhXyoddFfc+zIDdi/AJQwtFuTJRdYDI5no+b xUFKsIlM6rhkcgOO1ReaiB0Ck/iVHqyEl3/QVaa4DSq6HPJ3kbPgr2SffcVPicndO+v1 OE56rN9ukKUT7JhzEypfJfjgbq4stmb2kUCUIikP0j1xogXkF4zzBBuSq6eFl00nMuIc 3mXzGK2JX8YKAjAgCDROUFJ7O1Qpdz33c2kc0t7kXJg0coIAg0P5pMpVA+IWKdVrmGVa DfMQ== X-Forwarded-Encrypted: i=1; AJvYcCXlPfdQviqAnhZ5i8QVJ5e8gU+ZVk711oLpA2JTryS1XatzhcH8fvn0xHZTJwuTVbLRXFSgE+D6zEGCTdCrcQEG@lists.infradead.org X-Gm-Message-State: AOJu0Yw1tdWsLpVjWsjPEfOqpQZ/FOd617fT6PQrfS5XedRfadEQu0Se lWOBf1NKDB1cyq9en39czdov7OT97IwS6hGLjC7/OfzN8zaiQTRQ X-Google-Smtp-Source: AGHT+IFqfUUaDOPnE1y9rGSkTZU20gXomlidJ6gg6vYqzx/bbHaIxhoy3MT4T10BvyOIE84H7hgXng== X-Received: by 2002:a17:902:f60a:b0:205:5d71:561e with SMTP id d9443c01a7336-20aed13c417mr58688885ad.26.1727196629208; Tue, 24 Sep 2024 09:50:29 -0700 (PDT) Received: from joaog-nb ([67.159.246.222]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20af17dfeedsm12290045ad.147.2024.09.24.09.50.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Sep 2024 09:50:28 -0700 (PDT) Date: Tue, 24 Sep 2024 13:50:21 -0300 From: =?utf-8?Q?Jo=C3=A3o_Paulo_Gon=C3=A7alves?= To: Frank Li Cc: Francesco Dolcini , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Rob Herring , Krzysztof Kozlowski , Conor Dooley , =?utf-8?Q?Jo=C3=A3o_Paulo_Gon=C3=A7alves?= , imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Francesco Dolcini Subject: Re: [PATCH v1 3/3] arm64: dts: freescale: imx8mp-verdin: Add Ivy carrier board Message-ID: <20240924165021.n6lln424llsfzhtu@joaog-nb> References: <20240924114053.127737-1-francesco@dolcini.it> <20240924114053.127737-4-francesco@dolcini.it> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240924_095030_502773_1867191C X-CRM114-Status: GOOD ( 19.19 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Frank, On Tue, Sep 24, 2024 at 11:09:51AM -0400, Frank Li wrote: > On Tue, Sep 24, 2024 at 01:40:53PM +0200, Francesco Dolcini wrote: > > From: João Paulo Gonçalves > > > > Add Toradex Verdin Ivy carrier board support. One notable feature of Ivy > > is the analog inputs. These inputs are multiplexed, allowing the same > > input to measure either voltage or current. For current measurements, > > a GPIO switch enables or disables the shunt resistor. This process is > > automatically managed by the Linux kernel using the IIO and MUX > > subsystems. Voltage measurement is always enabled, but the voltage > > measured by the ADC is scaled by a cascade voltage divider. In the > > device tree, the equivalent gain of the voltage divider is used, which > > can be calculated as follows: > > > > ------------ > > + | > > .-. > > R1=30K | | > > | | > > '-' > > |------------------- > > Analog Input (AIN) | | > > .-. .-. > > R2=10K | | R3=30K | | > > | | | | > > '-' '-' > > | | > > | |-------- > > | .-. + > > | R4=10K | | > > | | | ADC Input (Channels 0 and 1) > > | '-' > > - | | - > > -----------| |-------- > > === === > > GND GND > > > > Vin = Analog Input (AIN) > > Vout = ADC Input > > Rth = Thevenin Equiv. Resistance > > Vth = Thevenin Equiv. Voltage > > RL = Load Resistor > > > > R1 = 30K, R2 = 10K, R3 = 30K, R4 = 10K > > RL = R4 = 10K > > > > Rth = (R1 // R2) + R3 = 37500 Ohms > > Vth = (Vin * R2) / (R1 + R2) = Vin/4; > > Vout = (Vth * RL)/ (Rth + RL) = Vth/4.75 = Vin/19 > > Gain = Vout/Vin = 1/19 > > which properties related these value? The gain value is used on the "ain1_voltage_unmanaged" node for the full-ohms and output-ohms properties. Best Regards, João Paulo Gonçalves