Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1017031iob; Fri, 13 May 2022 19:46:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwDWay/vVPfo1sgVfkx/nXlDoCvoHcL0sjGal6iWjwrdGSCo3/Zc8uoxVGWsDkwP1/O6gey X-Received: by 2002:a7b:cc17:0:b0:38d:af7:3848 with SMTP id f23-20020a7bcc17000000b0038d0af73848mr7142497wmh.41.1652496394473; Fri, 13 May 2022 19:46:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652496394; cv=none; d=google.com; s=arc-20160816; b=Qyr8/4IpS7WvUi7aWO8kxl5YMgt9bfjPA+2zmjvPMWT8OTYXrdGm42dtb11WhA20ju zNydbiSRMq4JVZsDpVDcNJAL62AKcU1PD8B7fEkRN8AxyfjpuBuWMyEB3+jjd1RP0sAV KlGj87494y+ymesA1fQ9JLDWXAPpu7rAC1rjRecGbgMKIi0rtlo5rixGUgkfnAB3I7zN MtdM/rB4qL8jogdiV7nBFU1YyuQY8D1N4/8E8C3BArMRA95dlYyARDl5uucOU89/4X+2 PKJKxZovCoDQKbhmWxMhzqYpraNLgPdRwbgJs5icBNdHDmuMK1e+LnXJJzaaPdgWfJJd BHSQ== 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=37RmwmhetMLvFkUyyZurfNorX4wG33rhqZukIX/qsiU=; b=awUKOB760fibpd2mYZBkXBkYiDYPt9UlpcK10+4tg1nvS5yqTRl+o/pmb67p5cLHHi uNldL8AtH+FnNV4+qLJyVExsK7gkSszcufYqKrn8eQDp13VUT8RfcmCr5tQ/Bphw3Rar V2Ge6u2/03OSiKmN8FMR9XWUCHxMRkutelSTYuhyhhIG9R7EzLw2PUwTarsG2vEgA+RW VNpljgM6SAvpdcyg9S+jZgGJpJ2C16O6Pd09Kaf8eJ4HEY2dkyxl2jEAqW6iqzZAZdfb BbqVAggQCaY3E6iD5brMbdmpk7itijCBIjmvE4Bz7iWJM2bCdn9lEvFcIJLO1L4qF18p BJcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=EUZY7FPL; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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. [23.128.96.19]) by mx.google.com with ESMTPS id h24-20020a7bc938000000b003944275785asi6707139wml.219.2022.05.13.19.46.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 19:46:34 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=EUZY7FPL; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 2D5D4360368; Fri, 13 May 2022 16:33:49 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1359664AbiELXy2 (ORCPT + 99 others); Thu, 12 May 2022 19:54:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1359678AbiELXyM (ORCPT ); Thu, 12 May 2022 19:54:12 -0400 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0ABF7289BE4; Thu, 12 May 2022 16:54:12 -0700 (PDT) Received: by mail-lf1-x132.google.com with SMTP id i10so11706627lfg.13; Thu, 12 May 2022 16:54:11 -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=37RmwmhetMLvFkUyyZurfNorX4wG33rhqZukIX/qsiU=; b=EUZY7FPLyS7TjeYz+IPq2u12F2zw0Ll8ANgdRwDBKYQ2WeQVk5WBloVPPxhlt+UNwl zDK9r8QXjBm+Rj4QvwL4S7er5nFV6r0WYlLQ2PM9Y17wCV8feAQiS+iQyL55KnJAuXCO qfK9GFHhyKHCoHiQumXm8FcN9ZHaDT6Lpfz6aBzYoX5+f9aBZjYFIKk7KLyKLyc90sX/ hfLczokeXBKvWnJVCE7nA0RJGlfA/gLewsbyRybyaLcbDLkmT8uX0mYsHj7XcJce80Be kuDAg4UTjqkkMYnspWscCvBzbByYjXOowuXtwP82qQ0bhv5uczRm7qLFdB8B/3d1zhP5 BA2A== 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=37RmwmhetMLvFkUyyZurfNorX4wG33rhqZukIX/qsiU=; b=yNRQ12/v0ZPEqiiw7FgVtJdb2XxpZcx/TnMsRnv8nDlP1p1FtdQpEKEO6w10vcyNR4 BfipRzc9/FOuMrmhRTfGUKh3okximaGQ8SrS6nPk97sa1cOQwf1OtozNx+p9oIG6XUeC vOLYq69EeT4DjDYqA+Ry4U14AjAc3KuTEIluNRnZGZ5pWyPAzwgf0HeCeeYYL0zcemu3 E7+iPzuh4HBNFYlKyde6JT4Nqerlr0XfK87f4U1DGGmTBd4qnqfUQf+f8bKYpARjWl3q WiIK8+oOIdB0vTW6pDBQ+OpHdXL1zWFs/pCTgPTAYkgrU/kJa3rIFzAeIzDiwkQQYhSn aoiA== X-Gm-Message-State: AOAM533kHyAe0zbPDWCBObg83rjZiA+pAt1hMInzZ/+I/Sc10vaLrqNy XQE+GHLapsVXeAuhYERFnLI= X-Received: by 2002:a05:6512:2296:b0:473:cf55:5acd with SMTP id f22-20020a056512229600b00473cf555acdmr1480365lfu.255.1652399650435; Thu, 12 May 2022 16:54:10 -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 r13-20020a2eb60d000000b0024f3d1daea8sm158279ljn.48.2022.05.12.16.54.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 12 May 2022 16:54:09 -0700 (PDT) Message-ID: Date: Fri, 13 May 2022 02:54:08 +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_init(struct iio_dev *indio_dev) > +{ > + int ret; > + struct ltrf216a_data *data = iio_priv(indio_dev); > + > + ret = i2c_smbus_read_byte_data(data->client, LTRF216A_MAIN_CTRL); > + if (ret < 0) { > + dev_err(&data->client->dev, "Error reading LTRF216A_MAIN_CTRL\n"); > + return ret; > + } > + > + /* enable sensor */ > + ret |= FIELD_PREP(LTRF216A_ALS_ENABLE_MASK, 1); > + ret = i2c_smbus_write_byte_data(data->client, LTRF216A_MAIN_CTRL, ret); > + if (ret < 0) { > + dev_err(&data->client->dev, "Error writing LTRF216A_MAIN_CTRL\n"); > + return ret; > + } Couldn't you write "1" directly without reading? What about doing SW reset?