From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-vs1-f52.google.com (mail-vs1-f52.google.com [209.85.217.52]) (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 9DD001B959 for ; Thu, 25 Jan 2024 08:50:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.217.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706172606; cv=none; b=mJ6w9EbHbHVsV/fumz1m/DFTTpToDf28WbMgpO3R1qJUgizwDfS8HUXAfRLFhDpD+rwhXQiE/RdKdjuqSHnsU+PUuhQP+AIA6pu1SY4M8HF9ocN1kMoA+DnVDYHGTwvuPqrYQYwnCLsHbS8LkNLofQmhiVvkY7M1unxh8/Y4Pqw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706172606; c=relaxed/simple; bh=p4BO9u8QAGeKIOwzK1sY9h5zf9JQT29Y2W8Ay3uMVC4=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=tS0igD81LklcHjRK0I064NhgtBfe7m6gj9XPL9nSDm5rhD0TvepGcYqeGPg3O9VSD2rZALOQ1lqw6VkB7WsFYFl1Ast4cqDB4m+HI+lNV0bDTx2wUlH1nsEabPMhRh0tNzyuunW2Iz9DU7BrUZ26yV5bWWw1pl8XKYfNRYDiuWI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=MT2saab9; arc=none smtp.client-ip=209.85.217.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="MT2saab9" Received: by mail-vs1-f52.google.com with SMTP id ada2fe7eead31-46b1cb24266so19398137.2 for ; Thu, 25 Jan 2024 00:50:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1706172602; x=1706777402; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=SsKffEL6mluctf+cUpjZAVkFUNhs9adzeOY5iA4Fn/I=; b=MT2saab9IBoZTjEHtNwc+e3YAPImc+zomcBLT/Z0pgH9BWa8k/Hb3AxWLmjFlJmAGT 0TLiAuz0cPtnWzo4FyiWFDmHTBgagE6Ar9gaRxXI5sLXHPsZwZjiQ+QAIVlUqw88A4zI QiMYBUPEEUP/KvRZYyIiAHUBXROiew+YB8vdnk5TA5YYICwHD7VCTYa8+cjbpK15BI+9 3r5GF8ai4OFseoskISp+36eNNwCVkr94epn5aau6RwKksvVBcO3LpoSKvPWgKvGMS2oT E7lKks4Ma/PHKXBq4aymMCF0aAKf5VpxspSA3L7duNklPLUuuLe/ztgPSKxUdj99tsQ9 7aYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706172602; x=1706777402; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SsKffEL6mluctf+cUpjZAVkFUNhs9adzeOY5iA4Fn/I=; b=hhF8Xty/4eU1CGw/W3YvmjHNbi4KZLd5qvi1t3lXhAWC0zwP5eXSIVyi1X+Ob049Ui rRNzf4vMs7MCYmkfYhu5xlCL3kStGMVgrcS599bv3Vx7iGwpuoHXAEkYhhNTh5qG8q0H Dq0TYnz4wulzSH2NEcW5rLW2eFRf63cX8Dh9va/61RVQcoWAou7flvgtTxhPRK8PRBHG 3aVWD2dEWIMCPZ9x7rbqcCM3lJYsieGYih6zqDcSbTany0Blga2TKJcGW1B5myXqGRHt WBuQeYuLv9oJUvp2DNhUUEEIz5n6aP0pl7b4C2t3TRB8XCKtUjt3nh76+666t9iEwtBz KiUA== X-Gm-Message-State: AOJu0YyTLcS+ofY3BA5l6+zn33mpV70uQTOWqZGkZUMHAhwHQMriGZsL fMgRSyEhZL+FrRWPHiRy/rIWPU3RBIJ+54V/CeaHRpORj70OMoVgSOZztQ+3JUTf26kAu0Sxtvy aIxl/rMWAwAIKUJeRKvtDdFuYKSNWKXUFrwDaUA== X-Google-Smtp-Source: AGHT+IEXyAabzgXxr3HfBXhvXdKu2rg2zJk9uemqtcciakhWkSZRpFr5cM94Z5De7H+I5E8qdr6SFsVNIxfIMEQUhDg= X-Received: by 2002:a67:f752:0:b0:46a:fae3:d82c with SMTP id w18-20020a67f752000000b0046afae3d82cmr366729vso.22.1706172602526; Thu, 25 Jan 2024 00:50:02 -0800 (PST) Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240124074527.48869-1-krzysztof.kozlowski@linaro.org> <20240124074527.48869-5-krzysztof.kozlowski@linaro.org> In-Reply-To: From: Bartosz Golaszewski Date: Thu, 25 Jan 2024 09:49:51 +0100 Message-ID: Subject: Re: [PATCH v5 4/6] reset: Instantiate reset GPIO controller for shared reset-gpios To: Krzysztof Kozlowski Cc: Srinivas Kandagatla , Banajit Goswami , Bjorn Andersson , Konrad Dybcio , Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Philipp Zabel , "Rafael J. Wysocki" , Viresh Kumar , Frank Rowand , Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, linux-arm-msm@vger.kernel.org, linux-sound@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Chris Packham , Sean Anderson Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Jan 25, 2024 at 9:02=E2=80=AFAM Krzysztof Kozlowski wrote: > > On 24/01/2024 08:45, Krzysztof Kozlowski wrote: > > Devices sharing a reset GPIO could use the reset framework for > > coordinated handling of that shared GPIO line. We have several cases o= f > > such needs, at least for Devicetree-based platforms. > > > > If Devicetree-based device requests a reset line, while "resets" > > Devicetree property is missing but there is a "reset-gpios" one, > > instantiate a new "reset-gpio" platform device which will handle such > > reset line. This allows seamless handling of such shared reset-gpios > > without need of changing Devicetree binding [1]. > > > > To avoid creating multiple "reset-gpio" platform devices, store the > > Devicetree "reset-gpios" GPIO specifiers used for new devices on a > > linked list. Later such Devicetree GPIO specifier (phandle to GPIO > > controller, GPIO number and GPIO flags) is used to check if reset > > controller for given GPIO was already registered. > > > > If two devices have conflicting "reset-gpios" property, e.g. with > > different ACTIVE_xxx flags, this would allow to spawn two separate > > "reset-gpio" devices, where the second would fail probing on busy GPIO > > request. > > > > Link: https://lore.kernel.org/all/YXi5CUCEi7YmNxXM@robh.at.kernel.org/ = [1] > > Cc: Bartosz Golaszewski > > Cc: Chris Packham > > Cc: Sean Anderson > > Signed-off-by: Krzysztof Kozlowski > > > > --- > > > > Depends on previous of change. > > --- > > drivers/reset/core.c | 215 +++++++++++++++++++++++++++++-- > > include/linux/reset-controller.h | 4 + > > 2 files changed, 206 insertions(+), 13 deletions(-) > > > > LKP reported issue when building !GPIOLIB: > https://lore.kernel.org/oe-kbuild-all/202401250958.YksQmnWj-lkp@intel.com= / > > but I intend to solve it providing the stubs. Therefore this patch will > not change. > > Best regards, > Krzysztof > Ah, so this is why you sent the patches. I don't like stubs in gpio/driver.h but I get why they're needed here. Maybe we should consider adding gpio/misc.h for that kind of stuff. Bart