Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp3498979rdb; Wed, 27 Dec 2023 09:13:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IGCZY9GlDVonzx5Bk/hj5TbZlg/ezsRlFLi7BF4rociNJdpHxqml9ySC+U79ACtugFi/gfw X-Received: by 2002:a05:6e02:174c:b0:35d:5995:1d74 with SMTP id y12-20020a056e02174c00b0035d59951d74mr19227850ill.57.1703697181273; Wed, 27 Dec 2023 09:13:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703697181; cv=none; d=google.com; s=arc-20160816; b=ueE0BBASH3i21nvxY3E7ct6BWQk0hKWhScxDFF1dCGnVVy0Tnyk+Vf6A2sY40Aqcq9 7igVpTm1w4iqWrjkgptEypezpRQOifLLyZRByj9Ms+Q9K8pAbPAmDY+Z4P0xIFf6QpYc w6SHLheMJP85q3rl4D4mxbTpb/ha1qsDFFmnOH//XSXeUbR9G5QT6Pxrwi3kB0iWINsM oNxBHxxHKOrU9F3fXA8zbcAlrmmHfxHqK+5hFRsrrgQ/GWtMJVxOZxYxdrgZAopm3Oq/ 9hUc/vWmGM3McHIhTN3qb1VDw9UnDA/OhxVif/RPPPUSuO38rxUDIBnGovDXziulSVqS a/lA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=organization:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:dkim-signature; bh=8+o8KZpFeiUPIumdxTCff0qcNTsarTVI4VKNNnrj0fc=; fh=Ato6a76TloMsS14ccX8DPEppYnsTHZ8Wxn60k/C7FdQ=; b=YpqCK23mWlfkYC1KuPfgMST01VJ4ooe7g4nkxJbz9T14O0a+YZqWwOPxs0kk41gTpM u6EPhpyFNnwHpXfR+5Zdc7XvRLhb3NNPoRGAfsR1XDuF7b7UPG6IV0wItpjdKq5rA44a 63MgRApeWZycB+pW0ce++MmqjYJqWFNp6vDXH3hK5fJmFjyLwZdTtNdPvnzXTiCxo9Q6 N4K/k0Y7ULrtsuWYXQP5JBABuJK+9Mppv81PAcpFWcpS3dP8ellSF+mKqLssKlkg3h+7 Up/FGe1i6YL9liZ7wuTHgSE9RSmJCLMFJLN4Qxf44hg9FFtMYhUP4kfjvWxQpTVoo0hl kHGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=dsijAqtz; spf=pass (google.com: domain of linux-kernel+bounces-12161-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12161-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id y66-20020a636445000000b005cdff9cb384si8033254pgb.372.2023.12.27.09.13.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Dec 2023 09:13:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-12161-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=dsijAqtz; spf=pass (google.com: domain of linux-kernel+bounces-12161-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12161-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id E4A47281D1E for ; Wed, 27 Dec 2023 17:13:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 228B646454; Wed, 27 Dec 2023 17:12:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="dsijAqtz" X-Original-To: linux-kernel@vger.kernel.org Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 630EB46424; Wed, 27 Dec 2023 17:12:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1703697168; x=1735233168; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=qalwygJ87p9QV791YnIvbzqccRFudEl4NadPNjBhtRE=; b=dsijAqtztvz0TaekfuLAAD8Sf/VoXF0RoxvdOirjbR9q7PHwYHZEaL63 9ICGisz+bibQzwjRMlflofhnctraxfF1NLAoYAHbK+fcfZreCnT9DV6o2 tLXOV20TGPHHjE75XJ0dr385MCjHrbJ398j/qe6ywr8ochBejVfsC4sRF IOMzXLbLJWVirGUP8XcZ/wKpWQ/6Dz6xkzI/JUIkyoatCQ9GBYuyNUc6E 91uaYSyZ5DuwsjUjObKWwmBdHH0kY34caQpQPt7/wk4QOGsCPq3WSy8DQ iuB7adArxq7IeQgT4ykDYLOWqYpOFo7qTRprh8Bb7sVdmDsP4iDx1OsEe w==; X-IronPort-AV: E=McAfee;i="6600,9927,10936"; a="462886380" X-IronPort-AV: E=Sophos;i="6.04,309,1695711600"; d="scan'208";a="462886380" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Dec 2023 09:12:47 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10936"; a="868901508" X-IronPort-AV: E=Sophos;i="6.04,309,1695711600"; d="scan'208";a="868901508" Received: from smile.fi.intel.com ([10.237.72.54]) by FMSMGA003.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Dec 2023 09:12:42 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.97) (envelope-from ) id 1rIXSR-00000009TKB-0D1R; Wed, 27 Dec 2023 19:12:39 +0200 Date: Wed, 27 Dec 2023 19:12:38 +0200 From: Andy Shevchenko To: Mark Hasemeyer Cc: LKML , AngeloGioacchino Del Regno , Krzysztof Kozlowski , Rob Herring , Konrad Dybcio , Sudeep Holla , Raul Rangel , Tzung-Bi Shih , Bartosz Golaszewski , Len Brown , Linus Walleij , Mika Westerberg , "Rafael J. Wysocki" , Wolfram Sang , linux-acpi@vger.kernel.org, linux-gpio@vger.kernel.org, linux-i2c@vger.kernel.org Subject: Re: [PATCH v3 02/24] gpiolib: acpi: Modify acpi_dev_irq_wake_get_by() to use resource Message-ID: References: <20231226192149.1830592-1-markhas@chromium.org> <20231226122113.v3.2.Ifd0903f1c351e84376d71dbdadbd43931197f5ea@changeid> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231226122113.v3.2.Ifd0903f1c351e84376d71dbdadbd43931197f5ea@changeid> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo On Tue, Dec 26, 2023 at 12:21:06PM -0700, Mark Hasemeyer wrote: > Other information besides wake capability can be provided about GPIO > IRQs such as triggering, polarity, and sharability. Use resource flags > to provide this information to the caller if they want it. > > This should keep the API more robust over time as flags are added, > modified, or removed. It also more closely matches acpi_irq_get() which > take a resource as an argument. > > Rename the function to acpi_dev_get_gpio_irq_resource() to better > describe the function's new behavior. ... > + res_flags = acpi_dev_irq_flags(info.triggering, info.polarity, > + info.shareable, info.wake_capable); Broken indentation of the second line. ... > + *r = DEFINE_RES_NAMED(irq, 1, NULL, res_flags); So? The whole exercise with the first patch is to have here: *r = DEFINE_RES_IRQ_NAMED_FLAGS(irq, NULL, res_flags); ... > + struct resource r; I prefer to see struct resource r = {}; even if it makes no difference. This allows to have robust code. > + ret = acpi_dev_get_gpio_irq_resource(adev, name, index, &r); > + return ret ?: r.start; Btw, this function requires header to include ioport.h. I'm not sure if it's good for ACPI. I would prefer safest approach, i.e. exporting this from a C code, i.e. gpiolib-acpi.c. -- With Best Regards, Andy Shevchenko