Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5542211rdb; Wed, 13 Dec 2023 11:35:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IFxH04ri1UY8d3vKvWsgY09dRD7zhbzver+byeE3ckOXvfvYNAwTKP4qxZIdftIC73C18tK X-Received: by 2002:a05:6a20:96db:b0:191:6028:c6cc with SMTP id hq27-20020a056a2096db00b001916028c6ccmr4248645pzc.96.1702496114539; Wed, 13 Dec 2023 11:35:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702496114; cv=none; d=google.com; s=arc-20160816; b=JNI90reV4sMDJdaM6qBLvESBo8VKJ3/43/spBlM4oLgFz3WMly04SsInKpYH/zr0wf BgWrt8DhB3Vsj52HmrireTyJW6aJ/aV759f4KeLhFqwtuYdZacJ9rhtmft744btunOZj nefLq6JU8s8AuKdRWPRi4xYIRqFeguGL+6j0dYlO/PXYJsoXmD/A6iFIM4Fp7eXBHoAY neGvFSamxGjKCv1mi0JOsQGFRJBTQfG/+BUMF/ktMeSc4Qpi2jkOnDkYqzdreQV5jy27 Cy1dhgbmmAkFWFJdQMOphdgwJT9GZP+H23zNWiB/+JmIB4JixP6d6UmPqFPDUyi3sQ3S 973g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=U1jnB48uDjI7LOwgnFlK+qOYTzoZhSRRkbs2+Nsr86k=; fh=6YcZ38kIpLOWV303acM1velGuZFTof8Zjvb7zYIoZdA=; b=M1fz1sx9ZXxtmWCQ02bC+N02SLcAPAPWHWhuxx1F/iaAvPvtw80OCdfx9s+qTzErJY ivj5fVDIXsYM6URTS9j6vJBHlaFStIzIXA2m4IYKxuh4lxCg+QeDYWKK6ZBlr49mb2nX nvf03292OpANkG144e8eAWTRbIQrmPxAZH742cpXBXp7aETU7gmAsiQbUA/czfz2MuGg klYlb1K+1tZWnrIIM2tDGke/Vz4KJPxmkwJdRvIe0LN/4eeNV8hbdIfPmCgYmBulMYvJ cnLnabR3dmXt4iztSRCOP2PotIznyrENZ4JNWyvNQ4PjBMijneHpq81wXHpgMfByUKcD m/Cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=UciZAyJp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id cm22-20020a056a020a1600b005c67bab07f9si10106027pgb.614.2023.12.13.11.35.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 11:35:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=UciZAyJp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 44013802FB92; Wed, 13 Dec 2023 11:35:12 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233820AbjLMTe5 (ORCPT + 99 others); Wed, 13 Dec 2023 14:34:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229671AbjLMTe4 (ORCPT ); Wed, 13 Dec 2023 14:34:56 -0500 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3BDD9C; Wed, 13 Dec 2023 11:35:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702496102; x=1734032102; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=sNFNGP5i3euntVPkAioPBY5yW1MCBKQIcWUNZfB3GYg=; b=UciZAyJpCwrBwtSbpur2KYrw4hB75BarSCSZxm/snWoAUEdP8gzTHCa2 RgmINWQ8L/vPjdsZYPt9ILZnLh2RyvUWYjeQJiy8h60vl8VTd00x85rmM R29DfgqPrXm9S9oZ2s6/8t2QnSaMs8MG1QgR4R9vZPTVrGW6uOYk7v7qt o+FvU0Gp3fh5OmXpiBfjeLyv7wpBTAMpOzYTmk0Al9J/zjhKxkALf2vpP 5PGKRG9urv/+S9mF/f+KnG5kd9X7aH/F+NsIf9wh/xUGNGmmqacla0+su 9LATk+8ppQ9dxhzXvXxXJSn9oSUasyEgPqM0PbWPAJcDGRe1yMeNh8i+Q w==; X-IronPort-AV: E=McAfee;i="6600,9927,10923"; a="397799684" X-IronPort-AV: E=Sophos;i="6.04,273,1695711600"; d="scan'208";a="397799684" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Dec 2023 11:35:02 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10923"; a="774060567" X-IronPort-AV: E=Sophos;i="6.04,273,1695711600"; d="scan'208";a="774060567" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga002.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Dec 2023 11:34:58 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.97) (envelope-from ) id 1rDV0R-00000005cq3-3OC5; Wed, 13 Dec 2023 21:34:55 +0200 Date: Wed, 13 Dec 2023 21:34:55 +0200 From: Andy Shevchenko To: Mark Hasemeyer Cc: LKML , Raul Rangel , 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 v1 1/6] gpiolib: acpi: Modify acpi_dev_irq_wake_get_by to use resource Message-ID: References: <20231213110009.v1.1.Ifd0903f1c351e84376d71dbdadbd43931197f5ea@changeid> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231213110009.v1.1.Ifd0903f1c351e84376d71dbdadbd43931197f5ea@changeid> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 13 Dec 2023 11:35:12 -0800 (PST) On Wed, Dec 13, 2023 at 11:00:19AM -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 acpi_irq_get() > take a resource as an argument. > > Rename the function to acpi_dev_get_gpio_irq_resource to better describe acpi_dev_get_gpio_irq_resource() > the function's new behavior. ... > + * @r: pointer to resource to populate with irq information. It is not modified on failure. IRQ I don't think the second remark is even needed. It's usual approach, i.e. we expect no changes in the output if error condition is met. ... > + * Irq number will be available in the resource structure. IRQ ... > + *r = (struct resource)DEFINE_RES_IRQ(irq); Why do you need "(struct resource)" annotation? ... > + struct resource irqres; > struct i2c_acpi_irq_context irq_ctx = { > .irq = -ENOENT, > }; Hmm... I'm wondering if we can reuse irqres as a context to the respective lookup calls. -- With Best Regards, Andy Shevchenko