Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1052407iob; Fri, 13 May 2022 21:12:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxltKNUt2G6cXV+gGZrIUTNFC20u3Kgnq/9uXoe03thIEAazx2ech3OItqf5tZpPJ1AA4Sy X-Received: by 2002:a05:600c:1908:b0:394:867d:66c4 with SMTP id j8-20020a05600c190800b00394867d66c4mr17361069wmq.152.1652501562443; Fri, 13 May 2022 21:12:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652501562; cv=none; d=google.com; s=arc-20160816; b=RXUirT+QbRcvF+JdVr0EIb1CWF3rCwxqetWW1AbbAICUeU2BEuTyQeRleXeOB9Zjqh SMmMIbyVy5MOqLPRMS77P4ixbpUFCKNiSccIUyPZ+R7GyBRIkxc8GHkK8+ColhZ5U6Gl xewLu0zYOgjsptJExYcKtiR8H0eOVVw+9AC0uTSDgHNfklIrUAoTowghPTgBgCOfCQOw X6MyLlicGS5eTjKTDISrGZhy/MEvb9EaxEVemNewohkwjhMIkWd+P4PrUyaszRmrHkMP TkB/OUwxcJQ2YISEhhgNkl9L6KkL3ZHrAURvFnkVWfdTNK8s6ZKsUZcseaaS7OC6gzv5 wNFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=G9cI8oakPHDWuYiFFBljDMZOYZw1Mkbjku3GoliHgFc=; b=KJIsl0q3Uk7SwghqkzNWWanOWQ9vBJxhS8C8F4MdaVoeKMy68hgXAoVKN7jZ1EzGfE dDI0bxOPdBxrYt4Xn0SFIQLNcVub7w6Bik6Lvo407zciBe72iedngLJuWVF8HvKvttmJ f+UP7DW+dgybRa7MbqPuWISnQoDo7tlze/DegdjjYUdM2/HkQhOhC8agfGuoLTseao9H Iu8eFbccYTnBYB10T1ahsTGYJOniXJZBJlRX48lIarCecYlNNWYabYMyrcO/1b7D0IGH 9xLHkFRMFtmCvsaMz5MHK81sszYHeACAxcWWsLjAu02C155I9vaJFHmeYg/tbMy+Gdnj YFgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=B1CWBB64; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id g10-20020a5d64ea000000b0020cd8f1d259si4998275wri.553.2022.05.13.21.12.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 21:12:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=B1CWBB64; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 48198317D18; Fri, 13 May 2022 17:43:59 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1359532AbiELXla (ORCPT + 99 others); Thu, 12 May 2022 19:41:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356155AbiELXl1 (ORCPT ); Thu, 12 May 2022 19:41:27 -0400 Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com [IPv6:2a00:1450:4864:20::234]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E36355238; Thu, 12 May 2022 16:41:26 -0700 (PDT) Received: by mail-lj1-x234.google.com with SMTP id 4so8343053ljw.11; Thu, 12 May 2022 16:41:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=G9cI8oakPHDWuYiFFBljDMZOYZw1Mkbjku3GoliHgFc=; b=B1CWBB64xhJMs/rCx2iqfL051WBSe6GmObrHiL6dcQS4u1h2Qbg/ERH9H4HRimJgDg b0hSi2MG4MAjmJ/kCWp3CwdIgUc3HSawGHNIugpWO7R0u/C1NbkrksHdO/D0f1iWCNYd n1UBNCZXvxNK3rr0MoaztpnEvhJrloJxdyzjF/LwGdx6rC3iaVGBjixqpAUFf1iCL7Xa 12X3eew/mY8/ZrjP+Zoo2XIG4zCF7gIKYtgivbk7HzLnpKAkBKJiYtOwkNrhMJ0PqcIL UuLxxLlXEKfCEQgmQHbCNPkIKBj84nYfrGV3j2TxoxDrsCTuhg/deS1oyRZNfx256FHn wb4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=G9cI8oakPHDWuYiFFBljDMZOYZw1Mkbjku3GoliHgFc=; b=MC8Y1rwyg+TzbHpVIcUgszW4RbV8aBTix3z8i+J3PjupcjcNg1bOTKrc1a+QLwk6hp rN9fQOsyrvFrQ7el8pdqM50WmvuJEc0mxMx7khb4nD1cBFD0zQF5HLD/UF35h2rKJR+y 3zrH3mrp7CX8W26nHs06dPxbdZUYC/uqt0d47ZKlSh0WeacZmP5Lrc7w3ntGdydgW39t zynohZdwz2gHhPjcvLoML9ORzoqcKB2WmbzJvv6RfAJ4ntrN3g6J5Dcu90h7MuDUcmpX 6ReluERcNKfIatMXTO+IT+Zf2yx0sPK+VUL8dbEKDDMN8N5v9FGfSC0WdEBPWR0wjh6P l2Pw== X-Gm-Message-State: AOAM532L9JtIbXZm+ufl+r81ocm08uBtEQrYwixsl4TL4aHzPyBlrYAo rzsJ+cCZ7pTjvhPngR+cRaA= X-Received: by 2002:a05:651c:160b:b0:24d:a0fa:26cc with SMTP id f11-20020a05651c160b00b0024da0fa26ccmr1449169ljq.150.1652398884840; Thu, 12 May 2022 16:41:24 -0700 (PDT) Received: from [192.168.2.145] (109-252-137-244.dynamic.spd-mgts.ru. [109.252.137.244]) by smtp.googlemail.com with ESMTPSA id g10-20020ac2538a000000b0047255d2111asm134998lfh.73.2022.05.12.16.41.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 12 May 2022 16:41:24 -0700 (PDT) Message-ID: <7a681440-a9bf-d63f-f090-efc96a7b3efe@gmail.com> Date: Fri, 13 May 2022 02:41:23 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH v4 3/3] iio: light: Add support for ltrf216a sensor Content-Language: en-US To: Shreeya Patel , jic23@kernel.org, lars@metafoo.de, robh+dt@kernel.org, Zhigang.Shi@liteon.com, krisman@collabora.com Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@collabora.com, alvaro.soliverez@collabora.com References: <20220511094024.175994-1-shreeya.patel@collabora.com> <20220511094024.175994-4-shreeya.patel@collabora.com> From: Dmitry Osipenko In-Reply-To: <20220511094024.175994-4-shreeya.patel@collabora.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 11.05.2022 12:40, Shreeya Patel пишет: > +static int ltrf216a_probe(struct i2c_client *client) > +{ > + struct ltrf216a_data *data; > + struct iio_dev *indio_dev; > + int ret; > + > + indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*data)); > + if (!indio_dev) > + return -ENOMEM; > + > + data = iio_priv(indio_dev); > + i2c_set_clientdata(client, indio_dev); > + data->client = client; > + > + mutex_init(&data->mutex); > + > + indio_dev->info = <rf216a_info; > + indio_dev->name = LTRF216A_DRV_NAME; > + indio_dev->channels = ltrf216a_channels; > + indio_dev->num_channels = ARRAY_SIZE(ltrf216a_channels); > + indio_dev->modes = INDIO_DIRECT_MODE; > + > + ret = ltrf216a_init(indio_dev); > + if (ret < 0) > + return dev_err_probe(&client->dev, ret, > + "ltrf216a chip init failed\n"); Is it possible to enable sensor only when measurement is made for more power savings? Light sensor shouldn't consume much power, but nevertheless. You'll need to add msleep(power_on_delay + resolution_rate_delay) after enabling sensor and before reading the measurement to wait until measurement is made by h/w.