Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp249463pxb; Wed, 24 Feb 2021 00:39:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJxM2DLXeW8C8o0deG4SVwwcwwYySo3S0Eb7Jq8shzkn1G0rZgMreNd22fWwRKCqrf81fu+R X-Received: by 2002:aa7:c645:: with SMTP id z5mr7061333edr.126.1614155940316; Wed, 24 Feb 2021 00:39:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614155940; cv=none; d=google.com; s=arc-20160816; b=mD67PcdgrMIzvOHI9pE1xIKRucU58FbqviydugkIRxMaeYXz67QUzo6GKIuOyFtHyg Ly1ayPP3rUCKZfCDoLIjkW5vdzIap/WvFPkAvxJfK9naaUgAY9qSksKaoQ/zfjqyIXd/ Nv5hPYnNvDb0YW9B0jDs5d7brEcNeg5aveNRAJCpd5nt6ttDZCNvyNN+wVVjfiP0GjWF VyoFkPxoF1gy8rhwPd0S0pN3/D0ChZgySoIsC1moxFFcoRAGA1JyXDtf7+aLRX52OEMz eYFIqHVc1+VmXoNkvdXKNb0kxbQs8ddvSNbqiHtjysE3Rl6slNrjoDwdSQYA0jZVQfo9 7b3Q== 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:from:date:dkim-signature; bh=AiI+JQDNQPv4m7iMBMCRcu16w4oChxUIOx+Z04AmRwo=; b=YwUwelUBCWbb/d9PpblimICjfA62jm6E1zC1zgTB+fd/vIIGzGzu5bOXhkxK/iVoLK j4l0OstrLE7ol5KGKjy0yHJLO7hyIxOT/ZFUPwppYKWpWSSztgW/RBtNFbX/dl0iUxUk +65v7uIts3JbxYCzBKQvstLGnJ7bPdxnq47CrcPZpFsQj1xozWT7BicuDJCzZPlXgz/F YPts6QQaXMqNw0A+c4TZu5z69/BxZMLeC1N9iYAyJOT0aWtseh1mP/DnsrmSlERvexmz Tmhw3LIZQYq742iUSg7x9/XFWkHV1DFchj1Ol7/4lbwFPuCvMwuqCFyKWaN4rmOS488g GYEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZAA8z+a+; 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 m6si841808edp.192.2021.02.24.00.38.31; Wed, 24 Feb 2021 00:39:00 -0800 (PST) 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=ZAA8z+a+; 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 S233365AbhBXIVN (ORCPT + 99 others); Wed, 24 Feb 2021 03:21:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32870 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233158AbhBXIVK (ORCPT ); Wed, 24 Feb 2021 03:21:10 -0500 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AFAA6C061574; Wed, 24 Feb 2021 00:20:29 -0800 (PST) Received: by mail-pj1-x1033.google.com with SMTP id t5so2986075pjd.0; Wed, 24 Feb 2021 00:20:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=AiI+JQDNQPv4m7iMBMCRcu16w4oChxUIOx+Z04AmRwo=; b=ZAA8z+a+eGgPefWZ59f4E8tZHDUtS7S4o7L0Edtg1cMVJDZ2d3KynBdbCYgQC/U8HW /VOqr9SwIUplipy3Kpt9NxvH76pqcEDnPcYtIrXrYm3yiyrJt+G00PCAV1tAx/ZB5RSG afQKB5Zw9Ruie50tHLUpqPAt6Y+vzJ7KEARIbyQyVSvIXFGF3ZoUNSnE90FjVdw4PxxQ IQllujm3+BZbli+YycIKEoD2srU/PJ0LXHjltqUvLsa2PJwNlsfvxwBkwfPeHfOj1kST xUds5h5yH2X8WPaZxRa5Wc3I4pEWl3G2psA0pfaU1bbDqvLQ2byntkQh5W81K4XRLrw5 F6Yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=AiI+JQDNQPv4m7iMBMCRcu16w4oChxUIOx+Z04AmRwo=; b=R8DuVQ7doHYKcX4MPYw0YzB3H46VSuc7nAUnkQfiRrRn2/3SsIRKts3DtkdlPmvspP wvnERkPQrgvPUkYXbNcPpJnePQeE07KTyHDn/AAOhk3foqUJVq5BcqC+u3uLvOFpOaNi lnDTkIrxPUWlc3fvdjkjYb9o1I1Ty2dWFJCoTzOsQTFQxvMtLOWQf31I+dU29wx0Xv4j 2fjeB/P5VrQwXBpblMkZqO8c/tzxCUh6FuoSAKWBu8OXQ3fp2oDg+JtSReWcqn0vUMHu ZJTJiVjgWp2DqvvXfMm38fuct4HbvxfEyEQefqmeAqTkLVvpBFDD5OXLwSKnovB+U2+c jX9w== X-Gm-Message-State: AOAM532XNlcj0dx9K5b0Sbhr1fHowTd8f/GDO7b4BDRYw6dr/19YQ4SD j1ZZH/5ns6tcg7Y8gYNqsak= X-Received: by 2002:a17:90a:2ec6:: with SMTP id h6mr3351903pjs.103.1614154829278; Wed, 24 Feb 2021 00:20:29 -0800 (PST) Received: from shinobu (113x37x72x20.ap113.ftth.ucom.ne.jp. [113.37.72.20]) by smtp.gmail.com with ESMTPSA id n6sm1728112pfo.201.2021.02.24.00.20.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Feb 2021 00:20:28 -0800 (PST) Date: Wed, 24 Feb 2021 17:20:21 +0900 From: William Breathitt Gray To: Oleksij Rempel Cc: devicetree@vger.kernel.org, Ahmad Fatoum , linux-iio@vger.kernel.org, Robin van der Gracht , Linus Walleij , linux-kernel@vger.kernel.org, Rob Herring , Pengutronix Kernel Team , David Jander , Jonathan Cameron Subject: Re: [PATCH v5 2/2] counter: add IRQ or GPIO based event counter Message-ID: References: <20210208135347.18494-1-o.rempel@pengutronix.de> <20210208135347.18494-3-o.rempel@pengutronix.de> <20210215091737.fx6dwiz7tt56wbkr@pengutronix.de> <20210223100656.efbshsh5bz66uhj5@pengutronix.de> <20210223174516.wjlh7hnrd5qe5s6w@pengutronix.de> <20210224073506.GA24260@pengutronix.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="/BAJX8Q7j9z0hddt" Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --/BAJX8Q7j9z0hddt Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Feb 24, 2021 at 05:11:03PM +0900, William Breathitt Gray wrote: > On Wed, Feb 24, 2021 at 08:35:06AM +0100, Oleksij Rempel wrote: > > On Wed, Feb 24, 2021 at 11:34:06AM +0900, William Breathitt Gray wrote: > > > Alternatively, we can take a more generic approach: ignore the GPIO > > > names and focus solely on the IRQ lines; because the GPIO lines will > > > always be tied to respective IRQ lines here, using the IRQ as the bas= is > > > of the name should always be valid. The "name" member of the struct > > > irq_chip can work for this. I haven't tested this, but I think someth= ing > > > like this would work: > > >=20 > > > cnt_signals[0].name =3D irq_get_chip(priv->irq)->name; > >=20 > > ok, i'll take a look at it. >=20 > If that doesn't work, then use devm_kasprintf() to generate the name > based on the IRQ line number. The idea here is that the user should be > able to identify that the Signal component for this Count is the > respective IRQ. >=20 > William Breathitt Gray I realized that these irq_chip names are often just the device name which isn't very useful either. :-( In that case, I suppose we really are just left with generating the name based on the IRQ line number then. This should be fine then: cnt_signals[0].name =3D devm_kasprintf(dev, GFP_KERNEL, "IRQ %d", priv->irq); if (!cnt_signals[0].name) return -ENOMEM; I think this would make it clear to the user that this Signal is the respective IRQ (whether sourced from GPIO or not). William Breathitt Gray --/BAJX8Q7j9z0hddt Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEk5I4PDJ2w1cDf/bghvpINdm7VJIFAmA2DEUACgkQhvpINdm7 VJImuA/9FhUJFLm1+UOrQJ31XDXZ018AgRi2LO5elphbM52xgMdV8e7bpkn9Ujbt Wacl5jV5XAZ6QHF5kKi/L1GCwblG4KH7yKaFOPG2Us0WuIE+AvokiW5sSEwIZSs1 LOnEvgOlH1vtiFKwCQ4sTyOSp+yUciOYYmZcEbcdejkzzdEJktt15d7aVrMsDTFT eR/7RyXpgGoxVjTz2kEzhXbBLVpvOBniPtewd74CueFfy3vpm+PddALnQRp4loCF WT8Tl9f8rhk8QG5uhWxkmxTJtlbp0x8cygbNIdn3goi2B0U/K9KviUNHfw+ERbLs OlGGh3mewT+uyaiElAvRgsePIUmaZyEC8WB/bT7F7bK0D2WeQvbwQ8wcUi2otDC0 P/HonFa93IBmQ775f60so+f1Vx51VWWO+zt8/1D//Nvdx4owBsYJXTE5TACL+Byc nmdWiwlKk2M0njyizP9s1awc/gCEPXvgFfCnZcSXrJvo+uaSHJTAVt8rujVn1Nry O4FIiC5EkoTcO/GX6+6xx958Ac2Og8Ky8tXT0+l7xlFrK4ILxs/kXq3159Hws2SV DTyrlU0zbQtssS2brBydYIAaREokYrM2hMHqzfusvZ1qnkBX+XMYvM/iWcyCBYNm OrjJ/tgh1evtkFRK6164sJRvr+obpOOZke5v/o36z80nCZKMIVA= =FZy6 -----END PGP SIGNATURE----- --/BAJX8Q7j9z0hddt--