From mboxrd@z Thu Jan 1 00:00:00 1970 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 A919D6136; Tue, 7 Jan 2025 12:41:09 +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=1736253669; cv=none; b=C0yk4aDe5AmLQK8/zaYB5WVH5ZPjAAd/o+lzHXk0YfxvkxEwzpfHWQmvXJ91sAhKQRIadpEJ9L6qOnA9834zKIqb98U7G8Y7x6D8YnoCn3f2umYPiKb7nh1nZBu1vU4Cquv7s7irtcKlhMSyV98DbJz0j5gjd30u8ldyoBpF8Wg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736253669; c=relaxed/simple; bh=evf3VwYTDSmuPtcbDp8le7uiUBejQKMOWJd23ZtaCnY=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=R1XizkyxApgZYLb2RVPyNOdXpLUcoDOtcVTUxeAt9mlz2EDPODN5sGxRwBy/xuzAJaXUXhIHOSNRwr3Z+/gdtCKsjDWRpZ3uUdrVcR0Ei5pnuBYo3Ezc1Gxb+VtL0UX8lO0Z4Ar2AbiYkde/oztbDOJs2nnB1kfmiNC3J94iLdI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=FPEPU4pB; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="FPEPU4pB" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 06F3AC4CED6; Tue, 7 Jan 2025 12:41:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1736253669; bh=evf3VwYTDSmuPtcbDp8le7uiUBejQKMOWJd23ZtaCnY=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=FPEPU4pBu0w8eZXbkiGuLozhY/+J3efXGQhQaUB6lwyzEBPnlVRLnm5aSv9cES6dR TXP3HlaE5+7ohA0Y2afC33tFvoT8zL0Vr4NUf77djo4za0f953yPnnsdoKnTQZ/hll PRyjbUe6c0IGXCqtITCJIG/v7PJnuUFqopTcNdSK+FZImGc4SMd+tKM/qdWWewXsF8 mM6yF6OaW4IBK4GMtGV5B9mwwsjX5DBddwug/B5XWuGKRpWgxSihQWErJA6SScSl1x A/ZAEzDRhSmBw6lIz9RQtgbQSbwJB1iJnsy82dBL+8pLTo4ETob+zrJ57cr4dHvXNU DupbDPwazQzEQ== Message-ID: Date: Tue, 7 Jan 2025 14:41:03 +0200 Precedence: bulk X-Mailing-List: linux-omap@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 1/3] gpio: tps65215: Add TPS65215 to platform_device_id table To: Andrew Davis , Shree Ramamoorthy , aaro.koskinen@iki.fi, andreas@kemnade.info, khilman@baylibre.com, tony@atomide.com, linus.walleij@linaro.org, brgl@bgdev.pl, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org Cc: m-leonard@ti.com, praneeth@ti.com, christophe.jaillet@wanadoo.fr References: <20250103225407.196068-1-s-ramamoorthy@ti.com> <20250103225407.196068-2-s-ramamoorthy@ti.com> <707925ce-b76e-470a-921f-7ac165a04d69@kernel.org> Content-Language: en-US From: Roger Quadros In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 06/01/2025 19:30, Andrew Davis wrote: > On 1/4/25 12:21 PM, Roger Quadros wrote: >> >> >> On 04/01/2025 00:54, Shree Ramamoorthy wrote: >>> Add platform_device_id struct and use the platform_get_device_id() output >>> to match which PMIC device is in use. With new name options, the gpio_chip >>> .label field is now assigned to the platform_device name match. >>> >>> Remove MODULE_ALIAS since it is now generated by MODULE_DEVICE_TABLE. >>> >>> Signed-off-by: Shree Ramamoorthy >>> --- >>>   drivers/gpio/gpio-tps65219.c | 17 ++++++++++++----- >>>   1 file changed, 12 insertions(+), 5 deletions(-) >>> >>> diff --git a/drivers/gpio/gpio-tps65219.c b/drivers/gpio/gpio-tps65219.c >>> index 526640c39a11..7e03be0c7c92 100644 >>> --- a/drivers/gpio/gpio-tps65219.c >>> +++ b/drivers/gpio/gpio-tps65219.c >>> @@ -1,8 +1,8 @@ >>>   // SPDX-License-Identifier: GPL-2.0 >>>   /* >>> - * GPIO driver for TI TPS65219 PMICs >>> + * GPIO driver for TI TPS65215/TPS65219 PMICs >>>    * >>> - * Copyright (C) 2022 Texas Instruments Incorporated - http://www.ti.com/ >>> + * Copyright (C) 2024 Texas Instruments Incorporated - http://www.ti.com/ >>>    */ >>>     #include >>> @@ -141,7 +141,6 @@ static int tps65219_gpio_direction_output(struct gpio_chip *gc, unsigned int off >>>   } >>>     static const struct gpio_chip tps65219_template_chip = { >>> -    .label            = "tps65219-gpio", >>>       .owner            = THIS_MODULE, >>>       .get_direction        = tps65219_gpio_get_direction, >>>       .direction_input    = tps65219_gpio_direction_input, >>> @@ -164,20 +163,28 @@ static int tps65219_gpio_probe(struct platform_device *pdev) >>>         gpio->tps = tps; >>>       gpio->gpio_chip = tps65219_template_chip; >>> +    gpio->gpio_chip.label = dev_name(&pdev->dev); >>>       gpio->gpio_chip.parent = tps->dev; >>>         return devm_gpiochip_add_data(&pdev->dev, &gpio->gpio_chip, gpio); >>>   } >>>   +static const struct platform_device_id tps6521x_gpio_id_table[] = { >>> +    { "tps65215-gpio", TPS65215 }, >>> +    { "tps65219-gpio", TPS65219 }, >>> +    { } >>> +}; >>> +MODULE_DEVICE_TABLE(platform, tps6521x_gpio_id_table); >>> + >>>   static struct platform_driver tps65219_gpio_driver = { >>>       .driver = { >>>           .name = "tps65219-gpio", >>>       }, >>>       .probe = tps65219_gpio_probe, >>> +    .id_table = tps6521x_gpio_id_table, >>>   }; >>>   module_platform_driver(tps65219_gpio_driver); >>>   -MODULE_ALIAS("platform:tps65219-gpio"); >> >> Why do you drop the MODULE_ALIAS? >> You can add multiple MODULE_ALIASES if needed. >> > > The new MODULE_DEVICE_TABLE() above causes all the needed > module aliases to be made for us automatically. Thanks! > >>>   MODULE_AUTHOR("Jonathan Cormier "); >>> -MODULE_DESCRIPTION("TPS65219 GPIO driver"); >>> +MODULE_DESCRIPTION("TPS65215/TPS65219 GPIO driver"); >> >> "TPS6521x GPIO driver"? >> >> I also see a product named TPS65216. >> By any chance can that be also supported by this driver? >> > > That is kinda the issue with "x" in the name, TPS65216 might > need a different driver, in which case the x here would mislead > folks into thinking this driver covers the whole family. Agreed. > > Andrew > >>>   MODULE_LICENSE("GPL"); >> -- cheers, -roger