Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp242401lqs; Thu, 13 Jun 2024 08:54:05 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVq4KYq5B6TZbKs1ZiNFGLkVC6GyoqEFZYeVz0YXlz/NbX6oUMf4XLqcx8B9HE25bVkJtuFU+9Now5mt/ZU6eU54C424ktQSzgb+B0LmA== X-Google-Smtp-Source: AGHT+IHrPSo/E0s7jH4Dl1BmCYyJKaFc3MeOz6CjJI2q2M1Aevo7KWFaiQ4ik4W3MXgxDB7AjLEj X-Received: by 2002:a05:6214:1bce:b0:6ad:7562:c286 with SMTP id 6a1803df08f44-6b2a33de154mr54465306d6.15.1718294044715; Thu, 13 Jun 2024 08:54:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718294044; cv=pass; d=google.com; s=arc-20160816; b=1J5S0Rck6KB8j6I1vt+gmYZaYR7loafNVnjTlH0gWYlLd2hf5AOj7IMTBXvJ/bt8VD wCBsrHnV3H7oe4rpKjj9XLPwMnRcw34Gnf32dPuqyLybbrYpLqFQu5jSZaQNdQZkFK/Q h9C/TPjdXtzfS24/gL1HiIPJF27Az5HUnbUHFVU4zyLCNtz/7aK8frsVi2Bq7hbIT+L7 6dEj19kQuxGSxUeLnEi3o6OVQjwFzmka2+1x7Je/sk7awNfnJjX/4X6nkS8Xg6oz+nQI bOQyBHSi9jfjO3GdCKvjKCA1wAld/qh4qwauqqgvpVUQHhqEVy4Efk2XupvT44kBmjr4 af5Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=YkvdGlss5qH8Yc1vGfBKBr4ELjGUD+yeYg6KDBo1xLU=; fh=1EFgx4A7SJS7AZ1gluRIrlPZ88KD8RrjewCkCTn95+M=; b=LuouZOS+DUxiPCPDTza66K9PWNuLq2MXKulH+YNNUgyEIoIefORdIF+/KMSvuZGEor Pjv1BS0Hla34ygkDtoxInPQGBrsd04Ps1FoLYlzablfA0x07kKXub7WWZo7mmg7k3orY TxP6SHXX2H70F5iUTZbrw2P6qyLRoc0oXPsU2SqVYC6maIDUwA70AGQaXbhZApXG63SY rN3xIQAwB9BlZGo9LtSM2WO5P/K22umZvLkuqALdBkwa8dwXgH80L8iDs97yQfGL72bT GR5SHYvyBE8AGvqRLVha13iESzb+GXsa/qly2xD9KBba2RsmQBrshfroR9lOKA5ak83b OkIQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Q0g3rWO2; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-213606-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-213606-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 6a1803df08f44-6b2a5a34c44si17684716d6.144.2024.06.13.08.54.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 08:54:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-213606-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Q0g3rWO2; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-213606-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-213606-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 706051C2246F for ; Thu, 13 Jun 2024 15:54:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B654112EBCE; Thu, 13 Jun 2024 15:54:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Q0g3rWO2" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.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 E15684206C for ; Thu, 13 Jun 2024 15:53:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718294040; cv=none; b=JQJB7q5yyl6LpTAKM2BZaH1T8wcVm5OUXUI6wPh6r0dOgAcWpMZevubPQbyiF9GEBEqfIWkdATzhdXePWbCyQLYHgwXsdxosIzM101f39nEPSt3lOIZnkoEp6uBj1HdC/lFd8H90YIAT9PctdauBRICc6rPhQBFzPpw9aRi4Dg0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718294040; c=relaxed/simple; bh=9bX6aH9TVgdh3z6dFkWKTbbnUkvQT6dIwcBQGXzkhpg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=rHa6ABM6oP0D/uavBOB18t8zttQUpJVRGA417/IoKpo6jqLoHgfLtZ2i29PuBwXqqfD1JqGRl4Ko6UOI2SWb3xQVy7otHVREG0oZSZH6/uy/1A6Pb3D1WO11X2FJ01PF79J9g+zP8SC8MosmR69PP3lY7LgqS1SNTCZJZjTbFdo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Q0g3rWO2; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id ABC2FC2BBFC; Thu, 13 Jun 2024 15:53:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718294039; bh=9bX6aH9TVgdh3z6dFkWKTbbnUkvQT6dIwcBQGXzkhpg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Q0g3rWO2ziEBFskClc+W1HAolP55Z8cvoURcyA4lvGyoWj55U4WoNiU1svwwfjHLS fcSTpbZgEiN5nX0ojh+srOz+SSj1I+/dfgpnE6xUC/jW58oGoTas9nnqCjzghyM/SB gvet3ZBQdkUWgMwgELpe81VgoDEXfSOtVCbxO29elI+BpmBmnv2+WBoDO3XKk+jxns 3RCcPfWtURXC+HAhs/3320jpT/b++iwLKqtxU/jtIofF9CyficzvfiGUj3Lfyqcaja Myj6FjlHfenzs8cfiibaPOGEdNFMPc9cO98UlltTJ9Xti7j+KnBBhB4cdiSHkmB822 PE5JJQFplzp4Q== Date: Thu, 13 Jun 2024 16:53:56 +0100 From: Lee Jones To: Andy Shevchenko Cc: linux-kernel@vger.kernel.org, Johan Hovold Subject: Re: [PATCH v2 1/1] mfd: lm3533: Move to new GPIO descriptor-based APIs Message-ID: <20240613155356.GK2561462@google.com> References: <20240605191458.2536819-1-andriy.shevchenko@linux.intel.com> 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-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240605191458.2536819-1-andriy.shevchenko@linux.intel.com> On Wed, 05 Jun 2024, Andy Shevchenko wrote: > Legacy GPIO APIs are subject to remove. Convert the driver to new APIs. > > Signed-off-by: Andy Shevchenko > --- > v2: left platform data in place (Johan), and rebased this patch > drivers/mfd/lm3533-core.c | 24 +++++++----------------- > include/linux/mfd/lm3533.h | 5 ++--- > 2 files changed, 9 insertions(+), 20 deletions(-) It would be nice to get Johan's RB on this. > diff --git a/drivers/mfd/lm3533-core.c b/drivers/mfd/lm3533-core.c > index c1219e608c5f..0a2409d00b2e 100644 > --- a/drivers/mfd/lm3533-core.c > +++ b/drivers/mfd/lm3533-core.c > @@ -11,7 +11,7 @@ > #include > #include > #include > -#include > +#include > #include > #include > #include > @@ -225,14 +225,12 @@ static int lm3533_set_lvled_config(struct lm3533 *lm3533, u8 lvled, u8 led) > > static void lm3533_enable(struct lm3533 *lm3533) > { > - if (gpio_is_valid(lm3533->gpio_hwen)) > - gpio_set_value(lm3533->gpio_hwen, 1); > + gpiod_set_value(lm3533->hwen, 1); > } > > static void lm3533_disable(struct lm3533 *lm3533) > { > - if (gpio_is_valid(lm3533->gpio_hwen)) > - gpio_set_value(lm3533->gpio_hwen, 0); > + gpiod_set_value(lm3533->hwen, 0); > } > > enum lm3533_attribute_type { > @@ -483,18 +481,10 @@ static int lm3533_device_init(struct lm3533 *lm3533) > return -EINVAL; > } > > - lm3533->gpio_hwen = pdata->gpio_hwen; > - > - if (gpio_is_valid(lm3533->gpio_hwen)) { > - ret = devm_gpio_request_one(lm3533->dev, lm3533->gpio_hwen, > - GPIOF_OUT_INIT_LOW, "lm3533-hwen"); > - if (ret < 0) { > - dev_err(lm3533->dev, > - "failed to request HWEN GPIO %d\n", > - lm3533->gpio_hwen); > - return ret; > - } > - } > + lm3533->hwen = devm_gpiod_get(lm3533->dev, NULL, GPIOD_OUT_LOW); > + if (IS_ERR(lm3533->hwen)) > + return dev_err_probe(lm3533->dev, PTR_ERR(lm3533->hwen), "failed to request HWEN GPIO\n"); > + gpiod_set_consumer_name(lm3533->hwen, "lm3533-hwen"); > > lm3533_enable(lm3533); > > diff --git a/include/linux/mfd/lm3533.h b/include/linux/mfd/lm3533.h > index 77092f6363ad..69059a7a2ce5 100644 > --- a/include/linux/mfd/lm3533.h > +++ b/include/linux/mfd/lm3533.h > @@ -16,6 +16,7 @@ > DEVICE_ATTR(_name, S_IRUGO | S_IWUSR , show_##_name, store_##_name) > > struct device; > +struct gpio_desc; > struct regmap; > > struct lm3533 { > @@ -23,7 +24,7 @@ struct lm3533 { > > struct regmap *regmap; > > - int gpio_hwen; > + struct gpio_desc *hwen; > int irq; > > unsigned have_als:1; > @@ -69,8 +70,6 @@ enum lm3533_boost_ovp { > }; > > struct lm3533_platform_data { > - int gpio_hwen; > - > enum lm3533_boost_ovp boost_ovp; > enum lm3533_boost_freq boost_freq; > > -- > 2.43.0.rc1.1336.g36b5255a03ac > -- Lee Jones [李琼斯]