Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2702349rwd; Sun, 28 May 2023 22:35:08 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4BuYOoU5YE0eYbqf0EP9cZ12FgZO/tgD/1TodeyblYlGgts0WbEy6qgKARgq128gl4c1sC X-Received: by 2002:a05:6a20:8e03:b0:10b:447c:dff2 with SMTP id y3-20020a056a208e0300b0010b447cdff2mr8965993pzj.43.1685338508669; Sun, 28 May 2023 22:35:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685338508; cv=none; d=google.com; s=arc-20160816; b=Z3njaChqpA9diN1OgnjJDSSQXvxb7COLdVxgMoTe4xFQh6CjFm9LhRwI4tOFEHvwNC OTk56ZlvD0oAs80qAO9te7ncEC1zItYdgm3irCtbAiOakF9vCgJBYy+GWiAlENonySs1 1JZqAPa2S7SInTU347lKTUAILFS7t2Ekm04t5iwaRDAtFlXBAtYFm1zLSfWxIL9GOyyU 3il78QeGDqSMG9Vq6xTnhDNLYsw3qdcAfJ6SQbddMIfwCeLboLtl31Sc0v1Y0y1YFiOK Kk9ZAP+OEjSHFVoe3malJ1faz8QdPXqcYVHr3/nJ6hJaqk66CQyDwZsYiYGUK1vz2wgB 5xsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:date:from; bh=9+t2tv3aUcI0VoLj2Q4RbB1qQjGXG9fo3WbT5a1ESPA=; b=SpJ45T78LQXZ2QmAlE5g9KbdrNPFjrg1I2/8jiox+WcfUjuZGn6N39VVGA/4kTO1Na /oufh8Z4X5pTdKknOj6P9m0QSsBvwe/K2o22MFYVVRxXo5mcZQypuHHjllwYqWp3dCMv 0SbGin9g9Ecddrzs1+bMY7e4L4OVxN2GTxSCd20lkFAAjXqcdNEyHJhE7kt2i/B4RkYk AZGaehdBwQoL/yZjCrrezCfrhWhNpQWg103aKd6Va3NkxmRc+TpLHMEff4qBFytn7m3n fJD2WJiZu3TIsnCZstd9iGly1OXzxSUQ6ZpvbBbzhaJ+7UZN1NAwyn5A46wD1Sbf95fi 4dDw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bk13-20020a056a02028d00b00520e69b7439si3486543pgb.560.2023.05.28.22.34.51; Sun, 28 May 2023 22:35:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229604AbjE2FUT (ORCPT + 99 others); Mon, 29 May 2023 01:20:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58420 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230427AbjE2FUP (ORCPT ); Mon, 29 May 2023 01:20:15 -0400 Received: from fgw21-7.mail.saunalahti.fi (fgw21-7.mail.saunalahti.fi [62.142.5.82]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B50F89E for ; Sun, 28 May 2023 22:20:13 -0700 (PDT) Received: from localhost (88-113-26-95.elisa-laajakaista.fi [88.113.26.95]) by fgw21.mail.saunalahti.fi (Halon) with ESMTP id 7a5c1941-fde0-11ed-abf4-005056bdd08f; Mon, 29 May 2023 08:20:09 +0300 (EEST) From: andy.shevchenko@gmail.com Date: Mon, 29 May 2023 08:20:08 +0300 To: Astrid Rost Cc: Jonathan Cameron , Lars-Peter Clausen , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@axis.com, Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , Mathieu Othacehe Subject: Re: [PATCH v4 5/7] iio: light: vcnl4000: Add period for vcnl4040/4200 Message-ID: References: <20230522142621.1680563-1-astrid.rost@axis.com> <20230522142621.1680563-6-astrid.rost@axis.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230522142621.1680563-6-astrid.rost@axis.com> X-Spam-Status: No, score=0.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FORGED_GMAIL_RCVD,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,SPF_HELO_NONE, SPF_SOFTFAIL,T_SCC_BODY_TEXT_LINE autolearn=no 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 Mon, May 22, 2023 at 04:26:19PM +0200, Astrid Rost kirjoitti: > Add read/write attribute for proximity and illuminance period. > The period is set in the interrupt persistence flags > (PS_PERS and ALS_PERS). An interrupt will not be asserted if the raw > value is not over (or lower) than the threshold for the set > continued amount of measurements. > The time in seconds is calculated by the number of continued refreshes > multiplied with the integration time. > It will always pick the next lower possible value. The period changes, > if the integration time is changed. Something interesting happened to the indentation in the above text. ... > +out: out_unlock: > + mutex_unlock(&data->vcnl4000_lock); > + return ret; ... > + *val2 = (*data->chip_spec->ps_it_times)[ret_it][1] > + * vcnl4040_ps_persistence[ret_pers]; ' *' can be placed on the previous line. ... > + if (val2 <= vcnl4040_ps_persistence[index] > + * (*data->chip_spec->ps_it_times)[ret_it][1]) Ditto. > + break; ... > +out: out_unlock: > + mutex_unlock(&data->vcnl4000_lock); > + return ret; ... > + case IIO_EV_DIR_RISING: > + ret = i2c_smbus_write_word_data( > + data->client, VCNL4040_ALS_THDH_LM, val); Indentation. > + break; > + case IIO_EV_DIR_FALLING: > + ret = i2c_smbus_write_word_data( > + data->client, VCNL4040_ALS_THDL_LM, val); Ditto. > + break; ... > + case IIO_EV_DIR_RISING: > + ret = i2c_smbus_write_word_data( > + data->client, VCNL4040_PS_THDH_LM, val); > + break; > + case IIO_EV_DIR_FALLING: > + ret = i2c_smbus_write_word_data( > + data->client, VCNL4040_PS_THDL_LM, val); > + break; Ditto. ... > + { > + .type = IIO_EV_TYPE_THRESH, > + .dir = IIO_EV_DIR_RISING, > + .mask_separate = BIT(IIO_EV_INFO_VALUE), > + }, { > + .type = IIO_EV_TYPE_THRESH, > + .dir = IIO_EV_DIR_FALLING, > + .mask_separate = BIT(IIO_EV_INFO_VALUE), > + }, { > + .type = IIO_EV_TYPE_THRESH, > + .dir = IIO_EV_DIR_EITHER, > + .mask_separate = BIT(IIO_EV_INFO_ENABLE) | BIT(IIO_EV_INFO_PERIOD), > + } Can we keep trailing comma here? ... > - }, Stray change (and see just above). > + }, { > + .type = IIO_EV_TYPE_THRESH, > + .dir = IIO_EV_DIR_EITHER, > + .mask_separate = BIT(IIO_EV_INFO_PERIOD), > + } -- With Best Regards, Andy Shevchenko