From patchwork Wed Apr 17 10:37:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 790347 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) (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 9A27213C69C; Wed, 17 Apr 2024 10:38:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713350318; cv=none; b=g/p07EebTMfk2aDdoJxCgmrwo9WP7+emLvEHQqicG+MXEwMkqdEBx+jXvDalF8H6VNBRvxzWjKIbzbARW7wlvylzJPcYj8uVUNt5fSI8NYRYbXKD+NXPmGvwBT/KdBkkvVbCnMtgz0uwFR5PJO5Fi1CGOPr06X1zUpZwbUDJLCY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713350318; c=relaxed/simple; bh=qFxQfFj8nM+zXZv3n7qPVjdJftX+8qyHu76VmZRCiJ0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nGHDcLcPAHMjLCyTies+P8WcAdzhVRXzcm7+wlEiaLzE5fHU+Rk8pqlwCoZb2IOS4ydCABQ0GlG4mweyYqqdqtkKNb8xrK6XVffCAKVr4XltjgTsoblvt4ykjTCBBVdot5n7GOBe6qlmXxE9M4jtIp7z/LLPKfkzNyvImFQHCfk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=TsNuyFSS; arc=none smtp.client-ip=192.198.163.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="TsNuyFSS" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1713350317; x=1744886317; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=qFxQfFj8nM+zXZv3n7qPVjdJftX+8qyHu76VmZRCiJ0=; b=TsNuyFSSShd0bWf7hCKuOK1G/bpgHAS8w7c+Mgo8yfF5mAJovgkEn6IY TKC+BidIUws4z9SulG5t4IPjc+hCoRVEVC0Oyl3m0/QdixfyRMEQhuJBd E0NCymlpQQwujXh24zjI4YdqoGYvn9TPJO1hMSekH441Dak/nhWX1aPxl AfXkvCwaG0mL/vLc7iC3Pu/uEhb1jNpMuNBQZDvBbfcbDGCCfhCgrhPJi fI+o3Hm27RonOtGBYZ0lbYOPM6LI5EHgqH/f2VeVvRbyE2ZeAbXh+Udga vUPQzqfAx5spM3RzBCaQqC6BI8pXljjBEUgmtJvFcF7KHR4WAMfVisoNo A==; X-CSE-ConnectionGUID: pWgTZoTmTLu4/sAigr4mug== X-CSE-MsgGUID: J9fzzUshTISZgz69zo2oxw== X-IronPort-AV: E=McAfee;i="6600,9927,11046"; a="9384042" X-IronPort-AV: E=Sophos;i="6.07,209,1708416000"; d="scan'208";a="9384042" Received: from orviesa003.jf.intel.com ([10.64.159.143]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Apr 2024 03:38:34 -0700 X-CSE-ConnectionGUID: dL8S9in4Tg21QPHBiGf9nw== X-CSE-MsgGUID: w+jYd2ImTzKIA9UZzKJwMw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,209,1708416000"; d="scan'208";a="27257838" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa003.jf.intel.com with ESMTP; 17 Apr 2024 03:38:32 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 591B760B; Wed, 17 Apr 2024 13:38:31 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , Mika Westerberg , linux-gpio@vger.kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Linus Walleij , Bartosz Golaszewski Subject: [PATCH v1 1/2] gpiolib: acpi: Add fwnode name to the GPIO interrupt label Date: Wed, 17 Apr 2024 13:37:27 +0300 Message-ID: <20240417103829.2324960-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20240417103829.2324960-1-andriy.shevchenko@linux.intel.com> References: <20240417103829.2324960-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-gpio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 It's ambiguous to have a device-related index in the GPIO interrupt label as most of the devices will have it the same or very similar. Extend label with fwnode name for better granularity. It significantly reduces the scope of searching among devices. Signed-off-by: Andy Shevchenko --- drivers/gpio/gpiolib-acpi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c index 909113312a1b..0b0c8729fc6e 100644 --- a/drivers/gpio/gpiolib-acpi.c +++ b/drivers/gpio/gpiolib-acpi.c @@ -1035,6 +1035,7 @@ struct gpio_desc *acpi_find_gpio(struct fwnode_handle *fwnode, int acpi_dev_gpio_irq_wake_get_by(struct acpi_device *adev, const char *con_id, int index, bool *wake_capable) { + struct fwnode_handle *fwnode = acpi_fwnode_handle(adev); int idx, i; unsigned int irq_flags; int ret; @@ -1044,7 +1045,7 @@ int acpi_dev_gpio_irq_wake_get_by(struct acpi_device *adev, const char *con_id, struct gpio_desc *desc; /* Ignore -EPROBE_DEFER, it only matters if idx matches */ - desc = __acpi_find_gpio(acpi_fwnode_handle(adev), con_id, i, true, &info); + desc = __acpi_find_gpio(fwnode, con_id, i, true, &info); if (IS_ERR(desc) && PTR_ERR(desc) != -EPROBE_DEFER) return PTR_ERR(desc); @@ -1064,7 +1065,7 @@ int acpi_dev_gpio_irq_wake_get_by(struct acpi_device *adev, const char *con_id, acpi_gpio_update_gpiod_flags(&dflags, &info); acpi_gpio_update_gpiod_lookup_flags(&lflags, &info); - snprintf(label, sizeof(label), "GpioInt() %d", index); + snprintf(label, sizeof(label), "%pfwP GpioInt(%d)", fwnode, index); ret = gpiod_configure_flags(desc, label, lflags, dflags); if (ret < 0) return ret; From patchwork Wed Apr 17 10:37:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 789502 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) (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 1860B13C81C; Wed, 17 Apr 2024 10:38:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713350318; cv=none; b=lc5eYdOrWk4v7GMN9d3x03qZyXVXgvXyBOd2NN8zt4VXF/pK2Z8zkzq5YmaEuJucyvrw5hylBZPOpMDsDGBrjcPuZkL8X+YESv5L5j/t2vgM1yiihNm3DW8RP/rcP8jBlpT8rmZ2Ci65AtFcQyiDcQ9PIp4NXEqsOl0M3J9rFjw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713350318; c=relaxed/simple; bh=aymlhITIYRfBYJcXpouBx8T2TCewuPCFC4Acl0FuqQk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=H/+TfX+YJF4TdrVkiOVSnVMbqNCN3RLr6sJEDekVytBs+5AYbh87HswliyudYMpIxutblVxzwJZpfdhzEO7LcClpfPQoetm1AlkuGxL0iXcvGH64vSwbRiKOAfD3u+NaOG/vEDuBAr3SmkcGLhpyeC9kKARqjLIGnPNn13AUJqU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=IDyVyMiR; arc=none smtp.client-ip=192.198.163.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="IDyVyMiR" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1713350317; x=1744886317; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=aymlhITIYRfBYJcXpouBx8T2TCewuPCFC4Acl0FuqQk=; b=IDyVyMiRk9mk1KKscshzE3nqkBd/mmTQqsMLtTOC4JYEGDaHMMwqS9Tm kko3lasm+m0Dfe8XK391WUxewnhK9hKk8CTJvnlgbSnRxtAP4PbASkgKE 9Vv1y3bE0DlUga+zaOA/YEOFHyLz1sS+Fq9esdqiMf/ePoc9KGWXe9rvO 0XcVclZyIaXDu3GTWudkTV4vURHSPX8ijUpbC78+KZjX/8DSwwCI2uWP9 qOMiiFOhj2j/xRYAX5PizKS2jbsuppnnu2MQ7sQ5mBIiujDnoYUCe2n+i +UaJNUZe+Mc5dazXRxPRHFgOPcMJMbaVRB+hRjGlr2HBNyqCfiVwvKsUs Q==; X-CSE-ConnectionGUID: ZQJwm657SraP0SP/SwLzDw== X-CSE-MsgGUID: RDPH5BMnQFGj8+3fWwAGGA== X-IronPort-AV: E=McAfee;i="6600,9927,11046"; a="9384045" X-IronPort-AV: E=Sophos;i="6.07,209,1708416000"; d="scan'208";a="9384045" Received: from orviesa003.jf.intel.com ([10.64.159.143]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Apr 2024 03:38:34 -0700 X-CSE-ConnectionGUID: OGHSCL+ISH2et9QRmcE5pA== X-CSE-MsgGUID: VGVs0J7LRryQZmLtw+XHoQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,209,1708416000"; d="scan'208";a="27257839" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa003.jf.intel.com with ESMTP; 17 Apr 2024 03:38:32 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id A03DCBCD; Wed, 17 Apr 2024 13:38:31 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , Mika Westerberg , linux-gpio@vger.kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Linus Walleij , Bartosz Golaszewski Subject: [PATCH v1 2/2] gpiolib: acpi: Set label for IRQ only lines Date: Wed, 17 Apr 2024 13:37:28 +0300 Message-ID: <20240417103829.2324960-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20240417103829.2324960-1-andriy.shevchenko@linux.intel.com> References: <20240417103829.2324960-1-andriy.shevchenko@linux.intel.com> Precedence: bulk X-Mailing-List: linux-gpio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 When line locked as IRQ it has no label assigned. Assign the meaningful value to it. Signed-off-by: Andy Shevchenko --- drivers/gpio/gpiolib-acpi.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c index 0b0c8729fc6e..553a5f94c00a 100644 --- a/drivers/gpio/gpiolib-acpi.c +++ b/drivers/gpio/gpiolib-acpi.c @@ -1066,6 +1066,10 @@ int acpi_dev_gpio_irq_wake_get_by(struct acpi_device *adev, const char *con_id, acpi_gpio_update_gpiod_lookup_flags(&lflags, &info); snprintf(label, sizeof(label), "%pfwP GpioInt(%d)", fwnode, index); + ret = gpiod_set_consumer_name(desc, con_id ?: label); + if (ret) + return ret; + ret = gpiod_configure_flags(desc, label, lflags, dflags); if (ret < 0) return ret;