Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2440149rwd; Sun, 28 May 2023 16:04:35 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ44WQAyKuS2X3eTSfOey56Hs6ROhBXCqL41g+oiA2tt9eqxzwZwkgnQgA7Y1lTkaNqs6rDG X-Received: by 2002:a05:6a20:3ca1:b0:f1:c63a:f7fa with SMTP id b33-20020a056a203ca100b000f1c63af7famr8123836pzj.15.1685315074952; Sun, 28 May 2023 16:04:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685315074; cv=none; d=google.com; s=arc-20160816; b=WK3hA4CGOuUpWWd7KXC2EFEqGKl7sAS8D+ggBE81Lj+laAl2h/s7kt1g1patYFHqax 0vvOsh8xJGjcQ6lYWols1490hzhe2nVLTT1o4NLV0cIE5+c08Ws5sq24cR/6rxc73BW0 ckrKxCcSx0EbcYV6B+7h4FdZ0W2boEMtwkWv7RhZi5N0wSxhAOlrKBFjIK6fYFD8qOyK wHI/x1ojwFYbl1lTbOia7U2Wpe0xeZe4F1pntjm8W+SXJWVislS8Bz9zCu4TrU3i7yVU NQ78SJ9PPIkNelCHxK+woUZOO0uTZPbbfWjVm9fiOOmFe6oN/H+L5a9i1IlhRBYPyJ3h rtaw== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:date:from; bh=NJkVtjLHC6ustq3PGYRMQmWeo+LUUnlfKGgeaPWpSWU=; b=KOw8pLVf5f/ZfdS6uT5MGfMZ4wn0EXYMlXQ/iZ+eIvCLP10uogjErT+b+BHQ71hkbK QA7BYsmyGVpB2IS0jnWlVko/RNiwJkf4uUQPaM9CiAsUyGdMbDDl9ZBsvX8dB7+5EVks C57+KjrJxmOybSDCpMklVrI4nqwTRfeQOtw5sbll12BWJC6bQYZLiRYjxFrAGRiInGtV VwZypP5aXeR0KqT8kMDm0RrtAKeObMjhnMLDWpy3J4wpHCMtfwOiCYHIjFRHl/bfdufS Q3nK8GUDI9jkLJpmW1DTN9jPlgPpSE3pyiVCNUi44r9NyRJ2IC/8cZTiEqbBpRlXnIBX gF0A== 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 gv6-20020a17090b11c600b0025327b5caefsi3802629pjb.165.2023.05.28.16.04.09; Sun, 28 May 2023 16:04:34 -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 S229625AbjE1Wmo (ORCPT + 99 others); Sun, 28 May 2023 18:42:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229523AbjE1Wmn (ORCPT ); Sun, 28 May 2023 18:42:43 -0400 Received: from fgw23-7.mail.saunalahti.fi (fgw23-7.mail.saunalahti.fi [62.142.5.84]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 17CF1B9 for ; Sun, 28 May 2023 15:42:41 -0700 (PDT) Received: from localhost (88-113-26-95.elisa-laajakaista.fi [88.113.26.95]) by fgw23.mail.saunalahti.fi (Halon) with ESMTP id f31d08a1-fda8-11ed-b972-005056bdfda7; Mon, 29 May 2023 01:42:39 +0300 (EEST) From: andy.shevchenko@gmail.com Date: Mon, 29 May 2023 01:42:39 +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 3/7] iio: light: vcnl4000: Add als_it for vcnl4040/4200 Message-ID: References: <20230522142621.1680563-1-astrid.rost@axis.com> <20230522142621.1680563-4-astrid.rost@axis.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230522142621.1680563-4-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:17PM +0200, Astrid Rost kirjoitti: > Add illuminance integration time for vcnl4040 and vcnl4200. > Add read/write attribute for illuminance integration time and read > attribute for available integration times. > Set scale and sampling rate according to the integration time. ... > + data->vcnl4200_al.sampling_rate = ktime_set(0, val * 1200000); > + if (data->id == VCNL4200) > + /* 24000 ?lux/step * 50000 ?s / val */ > + data->al_scale = div_u64(1200000000, val); Without type these constant are integers. Is this okay with 32-bit builds? > + else > + /* 100000 ?lux/step * 80000 ?s / val */ > + data->al_scale = div_u64(8000000000, val); Ditto. Also, can you use constants from units.h (KILO) and time.h (USEC_PER_MSEC)? ... > +out: out_unlock: > + mutex_unlock(&data->vcnl4000_lock); > + return ret; -- With Best Regards, Andy Shevchenko