Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2587307lqb; Tue, 28 May 2024 04:54:53 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWETt/iMPnx7Ks6D8pXqA+srSOmgj8kPh+h7+gA4zemjZglCh+DEr2ZvPUbYGp5CwlUUkh+SkMjeMbAXA+UBdN/f8hNKq2bjnJMfVHqjA== X-Google-Smtp-Source: AGHT+IFirlSp2qywAz9Oe8gNTwXl6Bu70O1xe7i8H6M0PgppQUz/Yo/Xvr6IU2bHesnk2X0eXI4M X-Received: by 2002:a05:6512:3b6:b0:523:a89f:aa64 with SMTP id 2adb3069b0e04-529645e34camr6223357e87.20.1716897293783; Tue, 28 May 2024 04:54:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716897293; cv=pass; d=google.com; s=arc-20160816; b=WZNZ9RY7gM9HSCQSBRD9f0uZuPHo4r0aGE36ASY91MnCvR72aGm+Ctf1bjyauDpSjf U5peBLu9vHUsORAyaR/KZ1gf1T3KfNq0w2sBIxYuVFn3cOehUg68lMVrxKWCOAdP9aHz cXXKHQ8lCD3ogSjd+zCcK5kWGeAIWD1MG73MBxPsorG4mTY87MksSZsVTcnphAefX8Q7 QiHRogbHJohFDSCynW5Tf4qqUah+PD3mgMQqflkZBVJlP0EkGnLlFAWj56X3J1ICgrww EYIWtybVjCz5BZ4wknTVTsgjbxQaLcGVXf3iVt3M30XET/64hYnBpt/n61gTcEUo0FpI 0uvg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=t2ZiDWbd+rmrEps4dsEoh3/axBJ9SRQHNITtFJg7aIA=; fh=NV8S3ndJATmw++nSCn31rBGgrLlPnsODytKWHrM7vn4=; b=DUfyAc5fed5nvF0vij0TzJpamUaJdgLtCp9kPbTeb+ujt4wkuY660KwcQgZhmw4SiP 3VGIkK9gL/A/JY4w6gYPCP2/d6gAgSi++X0zcVvRz8IcvIbWWvX232bWiJuvYU/YGAOL /pUhXpMD1UfF2SFODrDZDoanbWYXc9GUyTfewq4w5yis6CxaP2Mxhy3S+HPCzwv2q/OK aS5W6boy3kIxMmC39a3KP5wgePUW2OPdzERrKBZ8Vx1etrlTv9s0MhTdx7TUcuFoHZGo 4h0pHZBjLnQKFs+oldwOkY7SGE16TVgGG09A7u8nf4vTHKHfYDXcxg6VF0z7Cvze69am qkNA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=n+trmbeZ; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-192229-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-192229-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a626cc36e1dsi481093366b.335.2024.05.28.04.54.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 04:54:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-192229-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=n+trmbeZ; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-192229-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-192229-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 718B81F230BD for ; Tue, 28 May 2024 11:54:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B83CC16C878; Tue, 28 May 2024 11:54:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="n+trmbeZ" Received: from mail-yb1-f170.google.com (mail-yb1-f170.google.com [209.85.219.170]) (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 CB7EF16C841 for ; Tue, 28 May 2024 11:54:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716897282; cv=none; b=ojjfTf5yPm+recE0TV986yOE+pSWx8OmBgjFqYQ1XHSPRZS4lYfcxYOTZsdQnP/4h4QOEaaif64ub16jDumJ1iazISwDC1NaGmjEYd1B9ggYBhocStZI7PGA6esSSTLTzE7jR1F95Z10SeDKBwa56yekXFOFM1BhyxAY0RfR5Ew= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716897282; c=relaxed/simple; bh=rOVJH4nneZooWwYT28snd/nHe+v09VIVntLIbqJ6SHM=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=tit504ygML7X2z1WF2egTXf0gDwpFl41xY3ZkasAV1ey5/pIES7LgMgSx99c94ATzDnG81nQrYtmQ3vCj0rygUXXWgi9xqSkERoTygordx3+uJrtZN5L76zpm9cCFtjLf38GtrXRZBGraknyfjGVttDXVIbRE3rynTsGWNSdjGQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=n+trmbeZ; arc=none smtp.client-ip=209.85.219.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-yb1-f170.google.com with SMTP id 3f1490d57ef6-df7812c4526so757179276.1 for ; Tue, 28 May 2024 04:54:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1716897280; x=1717502080; 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=t2ZiDWbd+rmrEps4dsEoh3/axBJ9SRQHNITtFJg7aIA=; b=n+trmbeZdJ1fWWgxL56w5DaT459zEN55sma0Amvtrhbzgz2Y0/8O2QAEPhBHwDogol kTAR1LIrbGIndI6PicSQXUG86k2U8vB/6tFx7k8KfRyTUibKvB/+RD3EyHo11xsaBG/w 4B5kj3sau+ZOM7Mfvz30LepjHHVrMUbpwGmFEHDHwwY0Ma/CNBuxd7yEUOo/NdrhDkP2 xvU/kuIduXk3kzwSOU6BWZbruyVVgHNa6M9tkIGdNoYZ/iTwrxk6DDjI/cyyrafQVall NpqA0xybjCnDSjbHh5OkTvoRG4PdinSRRU4TzEFirlsdexs2Q2qEmsaFkB0IALAz6Ae3 he7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716897280; x=1717502080; 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=t2ZiDWbd+rmrEps4dsEoh3/axBJ9SRQHNITtFJg7aIA=; b=H1NLNSagG5M6U1MjLNcWc3hp/Acx4WpvlGdL+HsuF2djDkLvofvKcr4Ny9Dm9mZO5d yTs3QhmaN3MFwRLqJEnhowc/2EjXikBLr9SNS+0RHUZij3IBbY/QCdgxiYUrO+6ECaGw 70o4MkRKyrJ9unKbgxTR+QIIJeRxMA4DPCFs6sHnFtwYmFksHME1l0zABNcAAu8k/l+4 snmyFkbmFESs/1ePzkvK6VovGVsVu6pQcwWKPQsMdtxcQsoxVIr3NKm3q/HIz+l40ZAg XCdyHnq4NJHKXTaS/glQ92NYC8T8djlRIgOIBlell8J1dNdFgYiKrdBDsAwwzH3EdjKs HnuQ== X-Gm-Message-State: AOJu0YyoniA7wztedpq256DutCoC2wfEQAQHddjmkICuSIUG+ZlikHEx Q+FhJ7V2rgDfQHIAkrFZi4CstREKC6/5rbdznEfFXAKHsZfTRCnJefIh+NQyDR7I7w/rOpH46yU Yq7tSugukozJqG71+EcntYar+BFP405KiwpGeIw== X-Received: by 2002:a25:d0d2:0:b0:de5:5067:6b4a with SMTP id 3f1490d57ef6-df772180300mr13087888276.2.1716897279862; Tue, 28 May 2024 04:54:39 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240520195942.11582-1-laurent.pinchart@ideasonboard.com> <20240520195942.11582-5-laurent.pinchart@ideasonboard.com> In-Reply-To: <20240520195942.11582-5-laurent.pinchart@ideasonboard.com> From: Linus Walleij Date: Tue, 28 May 2024 13:54:29 +0200 Message-ID: Subject: Re: [PATCH 4/5] gpio: adp5585: Add Analog Devices ADP5585 support To: Laurent Pinchart Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-gpio@vger.kernel.org, linux-pwm@vger.kernel.org, Alexandru Ardelean , Bartosz Golaszewski , Conor Dooley , Krzysztof Kozlowski , Lee Jones , Rob Herring , =?UTF-8?Q?Uwe_Kleine=2DK=C3=B6nig?= , Haibo Chen Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Laurent/Haibo, thanks for your patch! On Mon, May 20, 2024 at 9:59=E2=80=AFPM Laurent Pinchart wrote: > From: Haibo Chen > > The ADP5585 is a 10/11 input/output port expander with a built in keypad > matrix decoder, programmable logic, reset generator, and PWM generator. > This driver supports the GPIO function using the platform device > registered by the core MFD driver. > > The driver is derived from an initial implementation from NXP, available > in commit 451f61b46b76 ("MLK-25917-2 gpio: adp5585-gpio: add > adp5585-gpio support") in their BSP kernel tree. It has been extensively > rewritten. > > Signed-off-by: Haibo Chen > Signed-off-by: Laurent Pinchart (...) > +static int adp5585_gpio_direction_input(struct gpio_chip *chip, unsigned= int off) > +{ > + struct adp5585_gpio_dev *adp5585_gpio =3D gpiochip_get_data(chip)= ; > + unsigned int bank =3D ADP5585_BANK(off); > + unsigned int bit =3D ADP5585_BIT(off); > + > + guard(mutex)(&adp5585_gpio->lock); > + > + return regmap_update_bits(adp5585_gpio->regmap, > + ADP5585_GPIO_DIRECTION_A + bank, > + bit, 0); First, I love the guarded mutex! But doesn't regmap already contain a mutex? Or is this one of those cases where regmap has been instantiated without a lock? > + gc =3D &adp5585_gpio->gpio_chip; > + gc->parent =3D dev; > + gc->direction_input =3D adp5585_gpio_direction_input; > + gc->direction_output =3D adp5585_gpio_direction_output; And chance to implemen ->get_direction()? Other than this I think the driver is ready for merge, so with the comments fixed or addressed: Reviewed-by: Linus Walleij Yours, Linus Walleij