From patchwork Fri Jan 3 22:54:05 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shree Ramamoorthy X-Patchwork-Id: 13925976 Received: from fllvem-ot04.ext.ti.com (fllvem-ot04.ext.ti.com [198.47.19.246]) (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 8886E17C220; Fri, 3 Jan 2025 22:54:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.19.246 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735944867; cv=none; b=C4VtXRIHWF/yRLRDFEtjD5HVgft7RBvIOFRKlxugUNUgET/Y4kbTYrJiseW0fn/Bp+fV1MxHsVFo03dOgPZdgm2JKRDcq1zfeL0Ta3v/s/ho6lClfCk17y6iipw2N7W6JcqtpldLxAhrdDfvUEAiC5XAR7wp1t9ClfqPiIK6Qzw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735944867; c=relaxed/simple; bh=Q403zm9mqZiM7NJEI2i/zsUuRRZ6VFwUGAbGjbE+DQE=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=qZVaeC/xam4kvwrWOzyEqnIHQtaJXR9EcBTCmcXlbo1sHT7CwwHj7IqIo52gYzcoxatyP0jLKDnDadHJ70voQkx9BQJrT3WWtesOXLo3w3g1rb0gHyK1KcP5+MRwSNWVmsPrktUjM0q7wzrHwRQa5F2+zFt3VsPsPIzB9wIXY8s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=fFxkbcud; arc=none smtp.client-ip=198.47.19.246 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="fFxkbcud" Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllvem-ot04.ext.ti.com (8.15.2/8.15.2) with ESMTPS id 503Ms7742378837 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 3 Jan 2025 16:54:07 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1735944847; bh=PUaUz+rpwoHsTz7ROMQCNz8UqAK+vdpgENmahlQwB7Y=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=fFxkbcudneJzeehjEF1/4dW9oWPqvBPCkfb3aJNEoII/AbKXOGJyJ3r3DRXtgemIL TaTj2vvKafT/glOPXpbLlKh6F1eWT+GcswdnLhWe9wEBP/1iHmIuPsAopmLJqIDDvJ WjJGRmmY0EusA1NkpTvBrEELDb+NX2ilhvFB1xQc= Received: from DFLE114.ent.ti.com (dfle114.ent.ti.com [10.64.6.35]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTP id 503Ms7QX061292; Fri, 3 Jan 2025 16:54:07 -0600 Received: from DFLE109.ent.ti.com (10.64.6.30) by DFLE114.ent.ti.com (10.64.6.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Fri, 3 Jan 2025 16:54:07 -0600 Received: from lelvsmtp6.itg.ti.com (10.180.75.249) by DFLE109.ent.ti.com (10.64.6.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Fri, 3 Jan 2025 16:54:07 -0600 Received: from DMZ007XYY.dhcp.ti.com (dmz007xyy.dhcp.ti.com [128.247.29.228]) by lelvsmtp6.itg.ti.com (8.15.2/8.15.2) with ESMTP id 503Ms7AM098981; Fri, 3 Jan 2025 16:54:07 -0600 From: Shree Ramamoorthy To: , , , , , , , , , CC: , , Subject: [PATCH v2 1/3] gpio: tps65215: Add TPS65215 to platform_device_id table Date: Fri, 3 Jan 2025 16:54:05 -0600 Message-ID: <20250103225407.196068-2-s-ramamoorthy@ti.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250103225407.196068-1-s-ramamoorthy@ti.com> References: <20250103225407.196068-1-s-ramamoorthy@ti.com> Precedence: bulk X-Mailing-List: linux-omap@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-C2ProcessedOrg: 333ef613-75bf-4e12-a4b1-8e3623f5dcea 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"); MODULE_AUTHOR("Jonathan Cormier "); -MODULE_DESCRIPTION("TPS65219 GPIO driver"); +MODULE_DESCRIPTION("TPS65215/TPS65219 GPIO driver"); MODULE_LICENSE("GPL");