Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp561769imw; Mon, 4 Jul 2022 15:05:32 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vIM2EufvPOjTz6mesiQEHQSvFGpudOAdCVc5dfBUZvXuKpcsxr/O9u7BjZdub4tbKs3Qvh X-Received: by 2002:a17:906:8a58:b0:72a:d029:d92e with SMTP id gx24-20020a1709068a5800b0072ad029d92emr4050986ejc.354.1656972332617; Mon, 04 Jul 2022 15:05:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656972332; cv=none; d=google.com; s=arc-20160816; b=UvJP7hFIS6xbM7pI/5YARI5277n9gMTLomd92+/3SBXSOP547sw4uPllv22MYTSwOS x/F11NMvROBFQymb1KLrplzLf1u3MX4ZQwdgdhWAE481M9x1jXXOgO6QdUqoI35hzc8W XmP1NLCfkUrqx/zCKDuto5yQQezk+vbQ1E7BC2JebjURM7Y2y66RXHgMXE24PekvgEzv e1+cOrziwmAf9VpirdcKTP/fSiT+tMop4jn7jHkzmyuzh3Epr8+ERWHxb1wNmHtacY99 +QcQYNp1aXOyxRDk4BDQXWdAOeTLyc73YkoJ7epn+nw7LQoXJBupCEnsaKV20bKtdWrF zGtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=my4+DrJedrpU/mQg8JGhfRmIVUW7fXxN9fPtsnqMMtU=; b=mwgVpxjDZTscooMDsQ9HLfebbKcL0VL/crVwArpJ8qOt/Q/QvQIgazeqboeJmABFIq pq1aI1ebatloPCYpVEiI47FcAUzlyj8OFAI8S9DlKMIoSBJXvRY1UTsTs6Do2YgjRt3I cE2AkK1QKO8+4iliKAHHexcaYvJRmSUl9D+O21lqzNGpF80ass4ATR/nP69t1X5be4Hi l+dMAcW4NEhUAuNmx6+ghOGbK5Qla7BTeqvLZqWZzhTev07KrNrdBJOCqwH07zAA8v9u SCExm6/y6w1NOMLeRHU1KaVmCqik2VpqDCBFqWFl1Fzk0sJMQQAWI0S/bAuU45kRwZah tCZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=pUv3GqCA; 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=pass (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 v24-20020aa7cd58000000b0043a71f2ffc1si682378edw.49.2022.07.04.15.04.48; Mon, 04 Jul 2022 15:05:32 -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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=pUv3GqCA; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230389AbiGDVwQ (ORCPT + 99 others); Mon, 4 Jul 2022 17:52:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229583AbiGDVwL (ORCPT ); Mon, 4 Jul 2022 17:52:11 -0400 Received: from mail-yw1-x112e.google.com (mail-yw1-x112e.google.com [IPv6:2607:f8b0:4864:20::112e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 194B6BC2F; Mon, 4 Jul 2022 14:52:10 -0700 (PDT) Received: by mail-yw1-x112e.google.com with SMTP id 00721157ae682-31cb2c649f7so17770087b3.11; Mon, 04 Jul 2022 14:52:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=my4+DrJedrpU/mQg8JGhfRmIVUW7fXxN9fPtsnqMMtU=; b=pUv3GqCAR076f7MQVe6wqNqK9r3m2Ew/RBH93+pa0aquynCK61nfHf0b7hL044eELB 6MmSG+bt0J6cDt0L4KhhdeX+HrXaDEgugMJrc9ysHoA9t/IFrLg4Wu1H81glivOLsbew mlr/wudKWu8vUqDWWlVUn0lcjddrFhK56vkZAF3jRaoDsgDvM1vw/7j0gO4BrUPCuMAg HOlOtbJ1Hm8Oom3xPPmA4ysQn28rgBejhqg86KfCu5Hleatkzi6FQtkE37VWB4ho3lI3 QGQT5b7/LXgMLuq9aHyRsUuOtysnsSWn5x2mXqLrYZ1v1a6aUKX7YGipnyA/rdHo8WnE XgFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=my4+DrJedrpU/mQg8JGhfRmIVUW7fXxN9fPtsnqMMtU=; b=CfkqBjEFA6l9sPKkaXvRctdjMrJte3aiaNptzvJVJarD+QNp225QKi+49Vc77PWLk1 athrF43JoY9WZBI4taIYl1lAjuA5gP22SrU9CcNnSmv2eTAh7P4TR688gR2wIZRlcOHm /bCt/3i44+UuyWfpiiTTpOZu4cnc2OJpFOoEuIEoYpn/bUkwkubZc6IOkh3Cepaw3vww XAU48IpKNz5A7gaKuF05OGui01TYHIj5TgVjyHUZ0zoRnqkcgyWXHC5y03SdfscyCD7R 4OzM6Z9agmyRS6l6bcJ5ChVC26YdsBCVnXX+HfAPM0JrjWbBY34xTvw8aIgirMhrFfxb m5tg== X-Gm-Message-State: AJIora+e9wdOraoJ0SllYFju3VyOat+JBjr3+G+YTNt5YS4PmiQ5yRKB Eb22i89UvcvauodGxq+2YBLJNfjfqJhhY1qb2hQ= X-Received: by 2002:a81:5d88:0:b0:318:31c1:56f3 with SMTP id r130-20020a815d88000000b0031831c156f3mr35991617ywb.18.1656971529266; Mon, 04 Jul 2022 14:52:09 -0700 (PDT) MIME-Version: 1.0 References: <1656469212-12717-1-git-send-email-u0084500@gmail.com> <1656469212-12717-3-git-send-email-u0084500@gmail.com> In-Reply-To: From: Andy Shevchenko Date: Mon, 4 Jul 2022 23:51:32 +0200 Message-ID: Subject: Re: [PATCH v2 2/2] iio: adc: Add rtq6056 support To: ChiYuan Huang Cc: Jonathan Cameron , Rob Herring , Krzysztof Kozlowski , Lars-Peter Clausen , cy_huang , linux-iio , Linux Kernel Mailing List , devicetree Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 On Mon, Jul 4, 2022 at 9:27 AM ChiYuan Huang wrote: > ChiYuan Huang =E6=96=BC 2022=E5=B9=B47=E6=9C=884=E6= =97=A5 =E9=80=B1=E4=B8=80 =E4=B8=8A=E5=8D=8811:16=E5=AF=AB=E9=81=93=EF=BC= =9A > > Andy Shevchenko =E6=96=BC 2022=E5=B9=B47=E6= =9C=881=E6=97=A5 =E9=80=B1=E4=BA=94 =E4=B8=8B=E5=8D=886:05=E5=AF=AB=E9=81= =93=EF=BC=9A > > > On Wed, Jun 29, 2022 at 4:23 AM cy_huang wrote: ... > > > > + *val =3D DIV_ROUND_UP(1000000, sample_time); > > > > > > USEC_PER_SEC ? > > > > > No, sample time is (vshunt convesion time + vbus conversion time) * > > average sample. > > And the sample freq returns the unit by HZ (sample frequency per second= ) > > > The 'sample time' is unit by micro-second like as you mentioned. Ah, then it should be MICRO, so we will get Hz. > > > > + return IIO_VAL_INT; > > > > +} ... > > > > + struct { > > > > + u16 vals[RTQ6056_MAX_CHANNEL]; > > > > + int64_t timestamp; > > > > + } data __aligned(8); > > > > > > Hmm... alignment of this struct will be at least 4 bytes, but > > > shouldn't we rather be sure that the timestamp member is aligned > > > properly? Otherwise this seems fragile and dependent on > > > RTQ6056_MAX_CHANNEL % 4 =3D=3D 0. > > > > > Yap, from the 'max channel', it already guarantee this struct will be > > aligned at lease 4. > > Actually, It can be removed. I think for the safest side it should be given to the timestamp member. No? --=20 With Best Regards, Andy Shevchenko