Received: by 10.223.164.202 with SMTP id h10csp104431wrb; Mon, 13 Nov 2017 21:05:08 -0800 (PST) X-Google-Smtp-Source: AGs4zMYFFB9FIHLShvKkEr43pp6akaRHBcJXk0BLAHs2spDNA+n7D088WVZNIJ1TMdiZkDj6rYyV X-Received: by 10.98.55.133 with SMTP id e127mr12195440pfa.130.1510635908601; Mon, 13 Nov 2017 21:05:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510635908; cv=none; d=google.com; s=arc-20160816; b=AECD1FxzK+VNdbAvTkFzLkmzDwG2In/+ujqxTjXM2olzNnJM2d2NBHEner7kqykQS1 S3r5tJK19a7ySQAptCTHYS26QtaFIlDc9rYMSk8qWOWbXIbI9CyqOBeX7d5N2aNwZCxq LAO0GcUtCX6moMhT2aklCEQJesFXGX8P5uGne9cJmxIiD5+jThqf+nsmELaetBkeoLTo nff4vE1tBV2RHY9kXyZ4/0aX31CAn7oxhhTtnHK+wuOHjaq6dzeGAU+IyvfV/lMYHo8+ wBRJ+Rszhnee4+lgXhJwckQaKxWF7WbVPL9GeGtZicI+OVdPV7RrBd6xt3Ozsi0Kn4iQ t6LA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=cip4vWfrAZ9brejcyfPKBFRMMdagFDq8k46k4p8Fbug=; b=qE+h7mRk5qfbbN/sLci3636afLA2Is4FKp67Ksd1rKqQ0qLTkYPKUcRfk4/g/O0e3s 9NOp9eNsn2XEoz73SaNprHzm0atP1LBsRU4Kj8Y8LOTDNMIKOreKM9yeMz1ihAcfFiGW d2+rDXCuYlndcBNBkoQxyf84+phNez2O+NXhX0JbGAIAzFagCM7yVYKX50E+8/Bu2pH0 iqRnbTH/8LKdj8gHWkpG5Ak6Ok614J+BSye31Suo8ncD3R12e/0zzRe/lYxSm5X23hJZ gzhPL6bHgcpa+1ZcchUJAgEZsLOx528l1yJAdCmtMRzPmRT9ot6cqbSUHvWYMhAMyZQB LgWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mQo4zhbO; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u5si14636616pgr.523.2017.11.13.21.04.54; Mon, 13 Nov 2017 21:05:08 -0800 (PST) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mQo4zhbO; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753346AbdKNE50 (ORCPT + 89 others); Mon, 13 Nov 2017 23:57:26 -0500 Received: from mail-wr0-f179.google.com ([209.85.128.179]:53273 "EHLO mail-wr0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751303AbdKNE5W (ORCPT ); Mon, 13 Nov 2017 23:57:22 -0500 Received: by mail-wr0-f179.google.com with SMTP id u40so16345363wrf.10; Mon, 13 Nov 2017 20:57:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=cip4vWfrAZ9brejcyfPKBFRMMdagFDq8k46k4p8Fbug=; b=mQo4zhbOrMtvQk+/TNC8xCQBi2Z07JkpsTz0pR070GEMGR3w/STuaBQcH513V2RLfc QIqdm0sPoZEP/eGRdc689wl1MQ08TIOhSHiibFPnfJ1XvRXlfmDmBCQ82Gjek8B/2AVb 4H13PwzgjxVoOG9tCPmP+WSf4fqSbTvBSGUhufVUhTQXDuPyNJbT6Tx5KN/v7gClzein G8s7kJj3yimhf4/TaOBuioxJwCj0PBNEnWvg50/CZOkxzenUR/YSJS6qxz+ffHQyOc2O iLnPFrvUY5JzV6SwPSRJk+SMwBXyO7JOQMrFPE3/vwJfHQCcXXzC+X9LC+vJdGnYjsbO KLYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=cip4vWfrAZ9brejcyfPKBFRMMdagFDq8k46k4p8Fbug=; b=FGsH5j89zZFa5w8TZoFCesGHL4nKuktB+VHMHPlb72Da4H/GKKPIHkF8aHXBEf85kJ IwxcTtdktVduDiSkYvb5AqlnFaOYft5r5EN+XQ0BCtV/2ucXlrDpuZtY9LS9jLPCIYdC hqZeKG//0ypjZZymaKggZhNSGDGfH4bm6SP/q45DEpDmgpC6n7rwjOtAh71G5cczehBm RMWrr1rRS26lEn/n9ZR3JNP/aV45j7pXbrWXpny23Kc1P4qFtDv088rTwX+fAw7SDJN+ RdOvYEwX1mgPkrj5n7neYjTUoJHtK6yQC0SLYOI8mo+9ZY97XihOsA98qbTyuVL5j5Lf YXLQ== X-Gm-Message-State: AJaThX6jdFph8sU4sbrnSwHVgTBWdiFkGEYl/Oz8afyuTmk7S5wLF21k gcIdJeZtMsq5ydPrZyCYOvObET45djsYMX5Gp8A= X-Received: by 10.223.170.75 with SMTP id q11mr9629012wrd.167.1510635440971; Mon, 13 Nov 2017 20:57:20 -0800 (PST) MIME-Version: 1.0 Received: by 10.223.173.84 with HTTP; Mon, 13 Nov 2017 20:56:40 -0800 (PST) In-Reply-To: <2a10434c-a2f3-8feb-d0f1-875aaf207f38@posteo.de> References: <20171106071958.322-1-martink@posteo.de> <20171111003350.000077b7@huawei.com> <2a10434c-a2f3-8feb-d0f1-875aaf207f38@posteo.de> From: harinath Nampally Date: Mon, 13 Nov 2017 23:56:40 -0500 Message-ID: Subject: Re: [PATCH] iio: mma8452: add power_mode sysfs configuration To: Martin Kepplinger Cc: Jonathan Cameron , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Martin, > But given your concerns, I would strip down this patch to only offer the > already documented "low_noise" and "low_power" modes. It wouldn't be > worth it to extend the ABI just because of this! OK then we can map 'low_noise' to high resolution mode. But I am afraid I can't test the functionality because I don't have proper instruments to measure the current draw(in microAmps) accurately. > I would like "oversampling" more than this "power_mode" too. For this > driver it would be far more complicated to implement though. I doubt > that it'll be done. power_mode is basically already there implicitely, > and given that there *is* the ABI, we could offer it for free. I think 'oversampling' is already implemented, as I see 'case IIO_CHAN_INFO_OVERSAMPLING_RATIO:' being handled which is basically setting the all 4 different power modes. If we also add 'power_mode', I think it would be like having two different user interfaces for same functionality. So I don't see much of value adding 'power_mode' as well. Please correct me if I am wrong. Thanks, Harinath On Sun, Nov 12, 2017 at 7:28 AM, Martin Kepplinger wrote: > On 2017-11-11 01:33, Jonathan Cameron wrote: >> On Mon, 6 Nov 2017 08:19:58 +0100 >> Martin Kepplinger wrote: >> >>> This adds the power_mode sysfs interface to the device as documented in >>> sysfs-bus-iio. >>> >>> --- >>> >>> Note that I explicitely don't sign off on this. >>> >>> This is a starting point for anybody who can test it and check for correct >>> API usage, and ABI correctness, as documented in Documentation/ABI/testing/sys-bus-iio >>> (grep it for "power_mode"). The ABI doc probably would need an addition >>> too, if the 4 power modes here seem generally useful (there are only >>> 2 listed there)! >>> >>> So, if you can test this, feel free to set up a proper patch or >>> two, and I'm happy to review. >>> >>> Please note that this patch is quite old. It really should be that simple >>> as far as my understanding back then. We always list the available frequencies >>> of the given power mode we are in, for example, already, and everything >>> basically is in place except for the user interface. >> >> Hmm. A lot of devices support something along these lines. The issue >> has always been - how is userspace to figure out what to do with it? >> It's all very vague... >> >> Funnily enough - this used to be really common, but is becoming less so >> now - presumably because no one was using it much (or maybe I am reading >> too much into that ;) >> >> Now the question is whether it can be tied to better defined things? >> >> Here low noise restricts the range to 4g. Issue is that we don't actually >> have writeable _available attributes (which correspond to range in this case). >> > > Does it? Isn't it merely less oversampling. > >> Low power mode... This one is apparently oversampling. If possible support >> it as that as we have well defined interfaces for that. >> >> Jonathan. > > Ah, I remember; the oversampling settings was actually a reason why I > hadn't submitted the patch :) The oversampling API would definitely be > more accurate. > > I would like "oversampling" more than this "power_mode" too. For this > driver it would be far more complicated to implement though. I doubt > that it'll be done. power_mode is basically already there implicitely, > and given that there *is* the ABI, we could offer it for free. > > But given your concerns, I would strip down this patch to only offer the > already documented "low_noise" and "low_power" modes. It wouldn't be > worth it to extend the ABI just because of this! > > Users would have a simple switch if they don't really *want* to know the > details. I think it can be useful to just say "I don't care about power > consuption. Be as accurate as possible" or "I just want this think to > work. Use a little power as possible." Sure it's vage, but would it be > useless? From 1583863353915145152@xxx Sun Nov 12 12:30:01 +0000 2017 X-GM-THRID: 1583300347450826551 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread