Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp411079pxx; Mon, 26 Oct 2020 11:16:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyB7saxuoTbHL8Wi3c51Bl8pcRgTNZTB+wrfeGWXQ+IqG1ss6r3biqIXKO7CMDp/Hs2V2Es X-Received: by 2002:a17:906:cc53:: with SMTP id mm19mr16725407ejb.514.1603736205808; Mon, 26 Oct 2020 11:16:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603736205; cv=none; d=google.com; s=arc-20160816; b=s4TUQdcx2ARiYdJZmQCikMnVyKPkef868PH0+yxMcMObFO9JGF88ORsXbeKE/KdsX+ z6y07N/ffo6gzCHMtYLi112EQd3ZLe5O15xaqv0lRidW0pQCI38MHYAV30o7QZS80O8T 6cjcIcIDvJ6ijINtjzlBu+oVmR2b8Z9sEJ7KZPw3Ayi0aSBbYevVBRrEIABQ/rlegjBZ OMi56+2rdbyhiJ07Yum62guyOF0AfQTIizz+x3izvR/4G1TJwqfhxRb394c90J75L0wr tMoy9KZIw2NWwn8yIqOijPMSmHOy/tOviDQy7spdiYMLk3iOn/uAflmY4Xk9aRTVvWGE XVlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=oOkWxKNS7OgYcgr9AtuikvRP6VQyPR3f6F1K+1Zo1kQ=; b=bkWahCKqv9PxNf+9msOeRYQcrmFwz9vtZSQs9YPDVSv897voClfuEcyOMeaZywnL0J 46WrnWwt5fx51FWkv0jir3ORYS/QmiRxPaFfP72YU12vbX6BkVYQWaRr2IAVukp5yllM ECIxnXGwA2un0+9cQG9V1SMVBYu14znIgFczcO1yNV2HLmvDqqYDain1h4gJwkrfZxja gbWyFnkauj2DSbXkKtFSW0oG0KFpc1FtOCiqsubS7IlkQaKis8zF/SMK0yGmLEvOBd5H a1wBRWDOnpcNfBPq91SMuwAYlSuIcII+tIIlR3HlX3Rq4F+MncvVRcHguPeVeQdYlMB6 BchA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LmCoNC6U; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i23si8009457edg.229.2020.10.26.11.16.12; Mon, 26 Oct 2020 11:16:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LmCoNC6U; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1783728AbgJZPV5 (ORCPT + 99 others); Mon, 26 Oct 2020 11:21:57 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:34272 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1783704AbgJZPV5 (ORCPT ); Mon, 26 Oct 2020 11:21:57 -0400 Received: by mail-pl1-f194.google.com with SMTP id r3so4839066plo.1; Mon, 26 Oct 2020 08:21:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=oOkWxKNS7OgYcgr9AtuikvRP6VQyPR3f6F1K+1Zo1kQ=; b=LmCoNC6Ua8HAVPvByC9bsoozCVkd2hq1VykdP1PgLd+mNUcO2yAbtatRvOrWF2lhdX +STcJKR4Be3HsKEN+Y+sxBpGggDqHhp0KbwVHXhGaRiDGyoOsphrkWpwhpIwxDpLpGOP 8JWcS4tkSB7ZnrDLDPyo4Et7OWq/fNFOZ8XFca3sZiasR17l7eYDWZVGqF6dfxlHEEwj d6tRummJL0LIMsaYwgWzosqI/qkcfdFRwzRcLchXH+ZfuDDkhk2tHxUzem72Zn69XJwc cDm+3zLHNIKBW1d8CbwMTglwYlW/korgVg7SxrzXLw6kOBe2NQ+NDf0bH7LXlLNq5Hg2 CGfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=oOkWxKNS7OgYcgr9AtuikvRP6VQyPR3f6F1K+1Zo1kQ=; b=eqWrP0nlHDe9c65iWQ43mThungp564nZCQHYMhkgJHa3KbvLos22DgWYnFFkmvM6YK aL+wqDvGvB0w8m5SHgOrEDaWV9J0GFBkv4xYz2l1QtD4Gx2EE14zi/+aqx3HVk82QWbv DJNIgW5gtfI2l1guyNo9/mhQKErVgfCHLvu7xACtXmQuqIkYJ4OThppA5gSz4jX8gIs8 rqsgsgqaLI1mEuOhpqTLwBexqTxdooJEQIsMWQCxZ0pM7oLuTe84hfZGFmIMMTYLfyQa RTlfSt2elcvFQLvi4z+GAavFd0n2bPkMpodtBnG1mCmOL1iOyhX5AkePTtK098igWPpt CirQ== X-Gm-Message-State: AOAM532hqvOJvbGQx2ZeY5xPg/dMU9YxVYASlaYHnnH4Z3ARg1zrIH2p mOHruI8wgekLoBGGeXOzKoY8n+cyP5ShSt29SwQ= X-Received: by 2002:a17:902:aa8a:b029:d3:c9dd:77d1 with SMTP id d10-20020a170902aa8ab02900d3c9dd77d1mr8806039plr.0.1603725716344; Mon, 26 Oct 2020 08:21:56 -0700 (PDT) MIME-Version: 1.0 References: <20201026151600.2703-1-coiby.xu@gmail.com> In-Reply-To: <20201026151600.2703-1-coiby.xu@gmail.com> From: Andy Shevchenko Date: Mon, 26 Oct 2020 17:22:45 +0200 Message-ID: Subject: Re: [PATCH v2] pinctrl: amd: print debounce filter info in debugfs To: Coiby Xu Cc: "open list:GPIO SUBSYSTEM" , Linus Walleij , Hans de Goede , open list Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 26, 2020 at 5:16 PM Coiby Xu wrote: > > Print the status of debounce filter as follows, > $ cat /sys/kernel/debug/gpio > pin129 interrupt is disabled| interrupt is masked| disable wakeup in S0i3 state| disable wakeup in S3 state| > disable wakeup in S4/S5 state| input is high| pull-up is disabled| Pull-down is disabled| output is disabled| debouncing filter disabled| 0x50000 > pin130 interrupt is disabled| interrupt is masked| disable wakeup in S0i3 state| disable wakeup in S3 state| > disable wakeup in S4/S5 state| input is high| pull-up is disabled| Pull-down is disabled| output is disabled| debouncing filter (high) enabled| debouncing timeout is 124800 (us)| 0x503c8 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Thanks for an update! In general looks good, one nit below (sorry, missed it in v1 round) ... > + char debounce_value[40]; (1) ... > + if (tmr_large) { > + if (tmr_out_unit) > + unit = 62500; > + else > + unit = 15600; Side note: Hmm... Shouldn't be 15625? As 1/4. > + } else { > + if (tmr_out_unit) > + unit = 244; > + else > + unit = 61; ... > + snprintf(debounce_value, 40, > + "debouncing timeout is %u (us)|", time * unit); (2) ... > + snprintf(debounce_value, 40, " "); (3) Because of definition (1) can you in (2) and (3) use sizeof() ? -- With Best Regards, Andy Shevchenko