From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.42]) (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 38EAC246BB2; Tue, 9 Sep 2025 10:26:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757413609; cv=none; b=Ll48k7LGBiyBITspDZymaQ3jqKMRa1xvuhbKQx/drqJo+9Fe3B5d3+hXuUcX4vVIXvsXGvPWHRiMhd/Dlf46kw15trDGsMDVGLiXxVbrzAdBjf4mzXF1Amosfi5CXFuJdKuSWduHspowzB4NpBHqeE2HL/990vrzKar1jHDzGcE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757413609; c=relaxed/simple; bh=rEz0aN1DZaeSmkFl20TGtczLu/dTU/7sWsuulGancGA=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=ajB2bWuEXRaOGyFQ5s+QO8QG7b5lGib2kNEik5ppp7Pbdacx23Mve1J7nwWUh1IAMG+ph+5dPfIj9mJ7BL/xhxigniLMkRuSUSlgh4iGF0U3TkYxUKALzp8E2UStR+/JZPgnP2fjwAktRtJKzxs49S7nJgj8fEQ9tYu/9wo+rfg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=AJU83v/2; arc=none smtp.client-ip=209.85.218.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="AJU83v/2" Received: by mail-ej1-f42.google.com with SMTP id a640c23a62f3a-b0428b537e5so867026766b.3; Tue, 09 Sep 2025 03:26:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1757413605; x=1758018405; darn=vger.kernel.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=p9/zMINkp6I2G52UnrSGVXR31frbbxrSuqpqrNwzaTM=; b=AJU83v/2f5O7Pi5c2E0NR8rcv5b93hIAJFqX2yk8oTvfy7n2jOaABsRIwv/5eveufK KTS15bnUxUYRx7Dnc9TD8iiLtpSxx4neQIKCWQpcqXdSK3+3M55ky2anAXveWqvcibcb 3e1DPsckoEu0eCJBZ0yc6t5KRt1CQGE+HuvsZrRYSJGZL/UgKPFPxLJonhgfIt2RBqKw q2RIsUlJafxzzyaNJSD47INQfwS4h06nxBJ3KQwb2An5aodScXnACf9y50ih63iFnh2+ mEAwJCuGJlU0VVDSU4/y96hhjwbsJKPXXXhtPF/VOKoW5mdi6ruSwm7+BxJCPyom++VV /4/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757413605; x=1758018405; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=p9/zMINkp6I2G52UnrSGVXR31frbbxrSuqpqrNwzaTM=; b=HW0Oh2396IR8Zte5mnVthL4BLdOUCDV0fxksBudW/yDFjpOsFcTep3oUdi7AnEu8u3 fWB1V8Bn6GqKpsmlmzhUZwr1K3faALllCZoAAJGAiD/qAQxvOmUjwrk44bhk/8HkEIAo GMrzt4IfQpm2Dc8JNnUYtwCHS18CYXvGNkWM6nPCUoFB6HZpkHdIZxkJyvb/Io1ZWmST bUy/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SR1yfw== X-Received: by 2002:a17:906:fe46:b0:b04:1a1c:cb5f with SMTP id a640c23a62f3a-b04b155a027mr1221883066b.33.1757413605262; Tue, 09 Sep 2025 03:26:45 -0700 (PDT) Received: from [10.5.0.2] ([45.94.208.162]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b04190700a4sm2245694366b.63.2025.09.09.03.26.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Sep 2025 03:26:45 -0700 (PDT) Message-ID: <4123c67509c54e78b5a24d2704e4bb2b0a07d585.camel@gmail.com> Subject: Re: [PATCH v2 3/3] gpio: gpio-ltc4283: Add support for the LTC4283 Swap Controller From: Nuno =?ISO-8859-1?Q?S=E1?= To: Andy Shevchenko , Nuno =?ISO-8859-1?Q?S=E1?= Cc: linux-hwmon@vger.kernel.org, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-doc@vger.kernel.org, Krzysztof Kozlowski , Conor Dooley , Jean Delvare , Guenter Roeck , Jonathan Corbet , Linus Walleij , Bartosz Golaszewski Date: Tue, 09 Sep 2025 11:27:09 +0100 In-Reply-To: References: <20250903-ltc4283-support-v2-0-6bce091510bf@analog.com> <20250903-ltc4283-support-v2-3-6bce091510bf@analog.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.56.2 Precedence: bulk X-Mailing-List: linux-gpio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Wed, 2025-09-03 at 13:26 +0200, Andy Shevchenko wrote: > On Wed, Sep 03, 2025 at 11:05:01AM +0100, Nuno S=C3=A1 wrote: > > The LTC4283 device has up to 8 pins that can be configured as GPIOs. > >=20 > > Note that PGIO pins are not set as GPIOs by default so if they are > > configured to be used as GPIOs we need to make sure to initialize them > > to a sane default. They are set as inputs by default. >=20 > ... >=20 > > +/* Non-constant mask variant of FIELD_GET() and FIELD_PREP() */ > > +#define field_get(_mask, _reg) (((_reg) & (_mask)) >> (ffs(_mask) - 1)= ) > > +#define field_prep(_mask, _val) (((_val) << (ffs(_mask) - 1)) & > > (_mask)) >=20 Kind of agree and I remember to see some work some time ago regarding this = but it seems it did not get anywhere.=20 - Nuno S=C3=A1