Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1815305rdb; Tue, 20 Feb 2024 07:49:39 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU8cNW2/xj8eq+t9HMFPN/cqqC1NuvkCCWmbyYyhTk5liVs2KP2Ys15WWliLZR0MrJnjx3WoYSfYd/+qS5R7zLZAMlIyDitTGYGKA8vWQ== X-Google-Smtp-Source: AGHT+IHCyfp8JaCnKBsk8jDk7w06vCAlkOeZuLwwZuxlZMiaodZZSa06JMaOJ+2PCHiYiyAennAY X-Received: by 2002:a17:902:eb8f:b0:1db:b36c:715f with SMTP id q15-20020a170902eb8f00b001dbb36c715fmr15771838plg.24.1708444179069; Tue, 20 Feb 2024 07:49:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708444179; cv=pass; d=google.com; s=arc-20160816; b=fBJqLRLoL1pNx4hazYIcJmSfKcKsfHMoF1MzMZvnwiHU6k6TCXKr0zWsv0spBkHNOE lZyXKJbivfwyiQMeNWAS5AeSQ02SBj1NMwotany3G2FVkEPgXUTtq6y1K02H6PcGZBLr Oz9lmtAyNpxYZ7IpUennjZT9PwMw5vfNErldV52IKy+mQf58D6Hj6h5gSLuarDwx6txf AcLkw34Rd+9Kizb8OnBhkMaQ9WE1JkwPPnVmX3qP2w47yKiiwI7nFKJpgACxIsbenKBD 7Dxwg6lw89GVhllb8dMsc406HWXSzBKmGgoacwnsepfVMjft09d9gw5q7ttC9dEevCE/ +A0A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:organization:references :in-reply-to:message-id:subject:cc:to:from:date:dkim-signature; bh=UBzWFybglIzQQW2WIYff8wLXG7tNw8XtFLNSamDrZqM=; fh=sT5ATr5aaP5KE/nUPACoft5w1dczHSrICqxHIrG9Tpg=; b=hhH+zkGOxHgGA7bNV72gRywoajVZ+8lMLBZtwqbrcuOSgj0/7P4bNSAfK8zTbQwjn6 XwNGtBYEY2nZfmxMwXQwCcmTcqz72nvecCdUQuK4zgWcqota87lZ0aFe0z7Azm46+9hr /xGJVeTGwr3M4ncnftKFnO0Cz/Ys8fW7dxtvZdJFc4lKfc8u8KRyW5jP7axiozlQ7Zby HhmvcOWYpRJIA6dENQ4AnU58MZ7OHbCIc06e1UGJ8sJ6magAPBtZy2HroR9YRNBq5/++ hVM3CvmSsC085/qLQ5ByAgGbqy+0EZyH1nafnCeJ9hz5ntikK2SZ2LvLC3kolKtAlitv qxqA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=gflXxIoT; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-73272-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-73272-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id f9-20020a170902ce8900b001dbd81089e6si5201431plg.515.2024.02.20.07.49.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 07:49:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-73272-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=gflXxIoT; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-73272-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-73272-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id B669DB2159C for ; Tue, 20 Feb 2024 15:47:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1FC42762ED; Tue, 20 Feb 2024 15:47:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="gflXxIoT" Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) (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 479DA76058; Tue, 20 Feb 2024 15:47:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708444057; cv=none; b=pIHJ6qCgv4xJKnXIpMT7epGKKWdiUCfkpYQI1yFLgGeYkfu+HmagFGkx0vgSDA976U0W+AeqdW6B3EUF8gobMP3mWhlZf1uVe+4fBCXgDmWs9E+qEaLqQxwsPXAOM3JiHG+BCt0mb95SMSy5d3AscyZHyVzepoNYlhPexFLKPhc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708444057; c=relaxed/simple; bh=F3jhYk5mnxC3hqeqtTwV3ntkk3Zh2pJ6VRpifP5nAJw=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=MN52BxjfK3ji4lFNiJVvRVZiXKmvZ1fhM3yVrX1dpwqeBK12kRioKklaheAPNE2aLRCWGXJyP6dYCySL4y32iGGKNwh2sbk2vIcj3fcddoAxehn7Oj/FDDISR4cRP8IlxyDSLGnLrg5AB/010ZdwMWb6pan7wKpQcItKvFGQKBQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=gflXxIoT; arc=none smtp.client-ip=217.70.183.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id 0DA4D1BF20A; Tue, 20 Feb 2024 15:47:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1708444051; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UBzWFybglIzQQW2WIYff8wLXG7tNw8XtFLNSamDrZqM=; b=gflXxIoT1fS/Er6Qod8vrAPUD5yGXocCvpLtJwk54rscGIDLevwmjjWIH0cNmp+Q19SjOR w6vv7VThdrHKWxmneV8klJVj6QA96jLcqNxV3PF0zeX3FHl/7YZHu0Iu+e7y1GARl9tGl9 IbiwAJ+Y4K32h8EKttZU/73S4Viq+k4SVWt1/BgozNRq3qO6YRjdB92FsZ5UmL5Xx1pEkv aaOK1ZXbt2TOxgD9fdlsq7L5RlABljg8JDu7IhnBroG6Qbc/unLHMyemAxFPynU3US/a66 EatUfSYMZAFKNlVmldR/VqkVRrVb6PCHxcOE85Qkdrd7cq/e5cMKV/L74WQUTA== Date: Tue, 20 Feb 2024 16:47:30 +0100 From: Herve Codina To: Bartosz Golaszewski Cc: Linus Walleij , Pavel Machek , Lee Jones , Saravana Kannan , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-leds@vger.kernel.org, Luca Ceresoli , Thomas Petazzoni Subject: Re: [PATCH RESEND 0/2] leds: gpio: Add devlink between the leds-gpio device and the gpio used. Message-ID: <20240220164730.03412479@bootlin.com> In-Reply-To: References: <20240220133950.138452-1-herve.codina@bootlin.com> <20240220155347.693e46e1@bootlin.com> Organization: Bootlin X-Mailer: Claws Mail 4.2.0 (GTK 3.24.38; x86_64-redhat-linux-gnu) 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=UTF-8 Content-Transfer-Encoding: 8bit X-GND-Sasl: herve.codina@bootlin.com Hi Bartosz, On Tue, 20 Feb 2024 16:30:11 +0100 Bartosz Golaszewski wrote: > On Tue, Feb 20, 2024 at 3:53 PM Herve Codina wrote: > > > > On Tue, 20 Feb 2024 15:19:57 +0100 > > Bartosz Golaszewski wrote: > > > > > On Tue, Feb 20, 2024 at 2:39 PM Herve Codina wrote: > > > > > > > > Hi, > > > > > > > > Note: Resent this series with Saravana added in Cc. > > > > > > > > When a gpio used by the leds-gpio device is removed, the leds-gpio > > > > device continues to use this gpio. Also, when the gpio is back, the > > > > leds-gpio still uses the old removed gpio. > > > > > > > > A consumer/supplier relationship is missing between the leds-gpio device > > > > (consumer) and the gpio used (supplier). > > > > > > > > This series adds an addionnal devlink between this two device. > > > > With this link when the gpio is removed, the leds-gpio device is also > > > > removed. > > > > > > > > Best regards, > > > > Hervé Codina > > > > > > > > Herve Codina (2): > > > > gpiolib: Introduce gpiod_device_add_link() > > > > leds: gpio: Add devlinks between the gpio consumed and the gpio leds > > > > device > > > > > > > > drivers/gpio/gpiolib.c | 32 ++++++++++++++++++++++++++++++++ > > > > drivers/leds/leds-gpio.c | 15 +++++++++++++++ > > > > include/linux/gpio/consumer.h | 5 +++++ > > > > 3 files changed, 52 insertions(+) > > > > > > > > -- > > > > 2.43.0 > > > > > > > > > > Can you add some more context here in the form of DT snippets that > > > lead to this being needed? > > > > / { > > leds-dock { > > compatible = "gpio-leds"; > > > > led-5 { > > label = "dock:alarm:red"; > > gpios = <&tca6424_dock_2 12 GPIO_ACTIVE_HIGH>; > > }; > > Do I understand correctly that the devlink is created between "led-5" > and "tca6424_dock_2" but actually should also be created between > "leds-dock" and "tca6424_dock_2"? > Yes, that's my understanding too. Best regards, Hervé