From nobody Thu Nov 28 00:34:47 2024 Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EDF801D414C for ; Mon, 7 Oct 2024 12:39:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728304798; cv=none; b=jbddBh1hIqYJ/oxIkN7dt0hQz3+CvyORtZI+P4eRdBIIP/pljqaVr5eBSmDdFTKW4jbVcvYoTy5RpUPaP/QynPAoAGY9sTlzE8NZEM87KxJ7zSKDHBTg2KnWrPH7ptNgcoAmnqw5vhsV9ZEF8sxleI9FDbwv+KVedv5LXzXu1nU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728304798; c=relaxed/simple; bh=keW+vT550WqqZOgWV5RvIAX0hhvZXHvpuvbMkV4b5MQ=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DMGLDyKk/sCrIKWLmxriQ4FJj8NT/TQM6m+eWaECVuURs1lls5tlmIHGB+kRLvg63gkebW9/Agbc9EdBDx3C5fQEAN4MOLJ0OrnrewhTBKLJU8xGYFuhdj2ivm4B1sFC3N2q9uaxo0TEzoOhiOSQYxLj24ava7iDY/s/glKnThA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=YmAYEbNf; arc=none smtp.client-ip=209.85.218.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="YmAYEbNf" Received: by mail-ej1-f50.google.com with SMTP id a640c23a62f3a-a99422929b2so225209766b.0 for ; Mon, 07 Oct 2024 05:39:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1728304793; x=1728909593; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=E3hAOrRw5xQdhMiyBTBpAF1zCHGDS1up/fzBs4ITHy4=; b=YmAYEbNfRsa+9ZquXK4zGHRxscymbJd6awqpfXIKu810sjLWv2SabVfJYFOGpGEvJl rNU8t9KyUdHDirnctl9N6k00X02lFRGVGWQkD4X0AJ7C8pKudEIgtLkp47MVh2QmooKG MBqNJ24SCrOSN0OFz0eY+ybE5RgGT22INAIfyl+ISh3M+xhLJqs7cKlDebQLnq8HjY7y 5Zefsro0WqT/OGHildlBvW9RfHajWqbpsUg7vDyhHIIAYB9hgcbbJ7mKx97yrXm+Xjl6 rHKMGN0LyD8fbOxeuZcOF63Ev/oybP4BzG1GoIYL6wmgE1A5LXAp+vM9VDZwJDCtsx/Y Q2wA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728304793; x=1728909593; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=E3hAOrRw5xQdhMiyBTBpAF1zCHGDS1up/fzBs4ITHy4=; b=UfntpGk8RKDtfXahm6EVooEixfJq3J1ONDxu0FYNRjx2HWJ5GogRLPVYziWjMrgy3h dZMH4o3uTA6ddPzngo0hCFe7WMiPlCQqxVU4w27+SCHJI48GON1kSrjgD4yJT81dXdRZ TH8rM5pmAhviqxRDumpz2jau2R7pWc2qZrYj0T+9rXmLZ4MeRsMNs83lxH1ZegtNDWsJ qXZyajNni+XegoXXmKvCWEUmTbnpL2hVbJX3f19uVgITBpV9GOfMlJ09Xtjn5QUH8nQi hR60LclD4bJQAjF8gGH0SMJUff+kmvTBVaRMN+O1ymS0JjbpT6gKOGUiJJgKyNlG4e23 HIJQ== X-Forwarded-Encrypted: i=1; AJvYcCWEWNwgY1wQjtzZceEUZ0Xg8ucoEksc/Tx3p1TzQbuugHJCi8NGPBmgfFXB+JkHkLxfkNiIWMXU4fPPcTw=@vger.kernel.org X-Gm-Message-State: AOJu0YxJicYNC+Vlvx2KUshl0UkxebEWOlBnyEYuNQQ+jilLyanBQS7e KpJizttZPE+dXkHbPT05E7yh+aEBFPlujCZ3pV1uCw6cgC9FAeyxXM6Den4NRv4= X-Google-Smtp-Source: AGHT+IFAuS51Efpu99SVNutmZJk8el6z6Su02r4hqkQ+BkrfYww1vueUey7cM49AcZEtj5NuSSmKaA== X-Received: by 2002:a17:907:972a:b0:a8d:555f:eeda with SMTP id a640c23a62f3a-a991bce5aecmr1345288866b.8.1728304793310; Mon, 07 Oct 2024 05:39:53 -0700 (PDT) Received: from localhost (host-87-21-212-62.retail.telecomitalia.it. [87.21.212.62]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a994e6e571asm189794266b.85.2024.10.07.05.39.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Oct 2024 05:39:53 -0700 (PDT) From: Andrea della Porta To: Andrea della Porta , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Florian Fainelli , Broadcom internal kernel review list , Lorenzo Pieralisi , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= , Manivannan Sadhasivam , Bjorn Helgaas , Linus Walleij , Catalin Marinas , Will Deacon , Bartosz Golaszewski , Derek Kiernan , Dragan Cvetic , Arnd Bergmann , Greg Kroah-Hartman , Saravana Kannan , linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-gpio@vger.kernel.org, Masahiro Yamada , Stefan Wahren , Herve Codina , Luca Ceresoli , Thomas Petazzoni , Andrew Lunn Subject: [PATCH v2 07/14] gpiolib: Export symbol gpiochip_set_names() Date: Mon, 7 Oct 2024 14:39:50 +0200 Message-ID: X-Mailer: git-send-email 2.44.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Being able to assign gpio line names dynamically is a feature that could be used by drivers that do not have the exact naming (e.g. through the DTB/DTBO) at probing time. An example of this is the RP1 driver that populates the DT at late time through a DT overlay. In this case a custom overlay can be loaded from userspace with the gpio line names. Export gpiochip_set_names() to allow refreshing the gpio line names from the driver module. Signed-off-by: Andrea della Porta --- drivers/gpio/gpiolib.c | 3 ++- include/linux/gpio/driver.h | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index c6afbf434366..a2aa3560094a 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -522,7 +522,7 @@ static void gpiochip_set_desc_names(struct gpio_chip *g= c) * names belong to the underlying firmware node and should not be released * by the caller. */ -static int gpiochip_set_names(struct gpio_chip *chip) +int gpiochip_set_names(struct gpio_chip *chip) { struct gpio_device *gdev =3D chip->gpiodev; struct device *dev =3D &gdev->dev; @@ -589,6 +589,7 @@ static int gpiochip_set_names(struct gpio_chip *chip) =20 return 0; } +EXPORT_SYMBOL(gpiochip_set_names); =20 static unsigned long *gpiochip_allocate_mask(struct gpio_chip *gc) { diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h index 2dd7cb9cc270..6e4cd7b7e47e 100644 --- a/include/linux/gpio/driver.h +++ b/include/linux/gpio/driver.h @@ -679,6 +679,9 @@ bool gpiochip_line_is_open_source(struct gpio_chip *gc,= unsigned int offset); bool gpiochip_line_is_persistent(struct gpio_chip *gc, unsigned int offset= ); bool gpiochip_line_is_valid(const struct gpio_chip *gc, unsigned int offse= t); =20 +/* Assign gpio line names from device property */ +int gpiochip_set_names(struct gpio_chip *chip); + /* get driver data */ void *gpiochip_get_data(struct gpio_chip *gc); =20 --=20 2.35.3