Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1066643ybk; Fri, 15 May 2020 23:32:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzL/XRw5VPMvGoCUmAsentoyG2vS4P4k++YccqU8QYK9vQhUDpfWYuJaIOHhlMg1lIW6ChV X-Received: by 2002:a17:906:b4c:: with SMTP id v12mr6249742ejg.25.1589610769161; Fri, 15 May 2020 23:32:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589610769; cv=none; d=google.com; s=arc-20160816; b=g2fgKPE1kBmrE5zxO+sFyl7BfS8V1v5R3cD0Pje8LzUXF8eQCdoXWWdNmmyux8DoYF KTdW8iKbKiiXyHN7ry9R6JHO2S52qSJorOWF7Co7KbeZytywztnGLhlNVa8q6dG9hjaI b730RRXBxMXp64B37v0XJJddtKhCJBctYWLlg+8KL8p9vfLqVbF/fjYIQVTK9qizjRKB aamFzSjTSwppF7sqXOzSDNt4LZA/WGvNhTeMTajr24RcJajC6uT1yEtXtJHikMYzH0vl ryOxo5BcjwNqvXtP5ereaNEg0WDkfkoPAg/pKrDbXCVo3lPrZZLNySI8MJ8hniRSYA5d KEgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=40qmOq9WfLYWjzCfPZdBtFOjcgCKkFGhA5kfOtl5WzQ=; b=NMINp71L9tl9xoGxRQU2URCaNbsDWPWagjMc8Qbu4r0mHvfhfyF6CQgc7AQzeKouBH nkQaswAdN+flu8nH/AqSOzTIlRHEgtRICmoYCxjh3LhjfsGo90tZqRW3oeNb4IBLzm+k H9Jtk+EJOO4j/gOfSHoce8MdPTvnrScx3Zc+Q+/Yt/KN5FA0NiZsWiyMjK8f8WbTkaWf lQdWpYrciAsOixQ5hZsJK+ZxkDHInFM6o6aPJaoDPIjKDOg2w9uUGx3c5q3l97F7LAKc w7DvJsjcg/G6PLhMF5W28F36uDxWeYD6b3KEOwLrQakg9qocBCtZUWdavoiPlJCW2IyM Qotw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@metafoo.de header.s=default2002 header.b=Xr0KtTrK; 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=fail (p=NONE sp=NONE dis=NONE) header.from=metafoo.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bo16si2525687edb.537.2020.05.15.23.31.42; Fri, 15 May 2020 23:32:49 -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=fail header.i=@metafoo.de header.s=default2002 header.b=Xr0KtTrK; 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=fail (p=NONE sp=NONE dis=NONE) header.from=metafoo.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726264AbgEPG2n (ORCPT + 99 others); Sat, 16 May 2020 02:28:43 -0400 Received: from www381.your-server.de ([78.46.137.84]:45214 "EHLO www381.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725275AbgEPG2n (ORCPT ); Sat, 16 May 2020 02:28:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=metafoo.de; s=default2002; h=Content-Transfer-Encoding:Content-Type:In-Reply-To: MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=40qmOq9WfLYWjzCfPZdBtFOjcgCKkFGhA5kfOtl5WzQ=; b=Xr0KtTrKfGhKnuItazqelolnhZ MFFE497pTku5X8nZ2FZldeQ+g7Ov6lDouHiktY5K+Eso8WKBhVfmyWX9MQuX36SjcmU7qZ6uV5I1p 9cRvpGp8heoz++zED1tEZ7XPWZc6YrZY/G2KkPiCNI7VMqFWdIsg8qNYyvpLVh8nrdrLpjlT9Oo79 dL/j6thLZI3sN03L+yPlo5VqMrjrhGnoFQR/zvLA1eB92lXyhZ3kL75mKT5qUgm+SXL2Zuu4Xnz66 1g+CV10+VV0kJOFqdm+v9tLuys2yAYMImLlmXZ6AH8GLcPheBvnEK5OlNV7AkWcDrXX7mZkzr9kq8 SCjzhODA==; Received: from sslproxy01.your-server.de ([78.46.139.224]) by www381.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1jZqJI-0000CB-Oo; Sat, 16 May 2020 08:28:36 +0200 Received: from [82.135.78.16] (helo=[192.168.178.20]) by sslproxy01.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jZqJI-0008w6-Ey; Sat, 16 May 2020 08:28:36 +0200 Subject: Re: [PATCH 0/2] iio: adc: Add a current from voltage driver To: Jonathan Bakker , jic23@kernel.org, knaack.h@gmx.de, pmeerw@pmeerw.net, robh+dt@kernel.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Cc: linus.walleij@linaro.org References: From: Lars-Peter Clausen Message-ID: Date: Sat, 16 May 2020 08:28:35 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Authenticated-Sender: lars@metafoo.de X-Virus-Scanned: Clear (ClamAV 0.102.2/25813/Fri May 15 14:16:29 2020) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/16/20 4:26 AM, Jonathan Bakker wrote: > In the discussion around adding the GP2A002 light driver, there came > up the question of what to do when a system emulates a current ADC > by using a voltage ADC and a resistor. Rather than adding it on > a per-driver basis, it was suggested(1) to add a minimal IIO driver > to support this situation. > > The new driver is fairly simple - it simply takes a voltage ADC and > a resistor value in ohms exposed as the scale and outputs a current. > > It has been tested on a first-gen Galaxy S device which has the above > mentioned GP2A002 chip connected to the voltage ADC resistor complex. > > 1) https://lore.kernel.org/linux-iio/20200202150843.762c6897@archlinux/ Hi, There is afe/iio-rescale.c, which I think already implements this functionality. - Lars