From nobody Thu Dec 18 16:38:03 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 48E9BC83F3A for ; Thu, 31 Aug 2023 18:32:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344849AbjHaScE (ORCPT ); Thu, 31 Aug 2023 14:32:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347034AbjHaScD (ORCPT ); Thu, 31 Aug 2023 14:32:03 -0400 Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 94D9CE5F; Thu, 31 Aug 2023 11:32:00 -0700 (PDT) X-IronPort-AV: E=Sophos;i="6.02,217,1688396400"; d="scan'208";a="174628367" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 01 Sep 2023 03:32:00 +0900 Received: from localhost.localdomain (unknown [10.226.92.179]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 689FD400CEF1; Fri, 1 Sep 2023 03:31:58 +0900 (JST) From: Biju Das To: Tony Lindgren , Lee Jones Cc: Biju Das , linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, Andy Shevchenko Subject: [PATCH v3 1/4] mfd: palmas: Remove trailing comma in the terminator entry Date: Thu, 31 Aug 2023 19:31:50 +0100 Message-Id: <20230831183153.63750-2-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230831183153.63750-1-biju.das.jz@bp.renesas.com> References: <20230831183153.63750-1-biju.das.jz@bp.renesas.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Remove trailing comma in the terminator entry for OF table. Signed-off-by: Biju Das --- v3: * New patch. --- drivers/mfd/palmas.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mfd/palmas.c b/drivers/mfd/palmas.c index 6e562bab62e4..769538b50903 100644 --- a/drivers/mfd/palmas.c +++ b/drivers/mfd/palmas.c @@ -499,7 +499,7 @@ static const struct of_device_id of_palmas_match_tbl[] = =3D { .compatible =3D "ti,tps65917", .data =3D &tps65917_data, }, - { }, + { } }; MODULE_DEVICE_TABLE(of, of_palmas_match_tbl); =20 --=20 2.25.1 From nobody Thu Dec 18 16:38:03 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 23992C83F3B for ; Thu, 31 Aug 2023 18:32:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347046AbjHaScH (ORCPT ); Thu, 31 Aug 2023 14:32:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347038AbjHaScG (ORCPT ); Thu, 31 Aug 2023 14:32:06 -0400 Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1F308E5F; Thu, 31 Aug 2023 11:32:03 -0700 (PDT) X-IronPort-AV: E=Sophos;i="6.02,217,1688396400"; d="scan'208";a="174628372" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 01 Sep 2023 03:32:02 +0900 Received: from localhost.localdomain (unknown [10.226.92.179]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id E66FB40029A1; Fri, 1 Sep 2023 03:32:00 +0900 (JST) From: Biju Das To: Tony Lindgren , Lee Jones Cc: Biju Das , linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, Andy Shevchenko Subject: [PATCH v3 2/4] mfd: palmas: Constify .data in OF table and {palmas,tps65917}_irq_chip Date: Thu, 31 Aug 2023 19:31:51 +0100 Message-Id: <20230831183153.63750-3-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230831183153.63750-1-biju.das.jz@bp.renesas.com> References: <20230831183153.63750-1-biju.das.jz@bp.renesas.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Constify .data in OF table and {palmas,tps65917}_irq_chip and replace the variable *features->features in struct palmas_driver_data and drop the {palmas,tps659038}_features variables and use their values directly in the named initialization. Signed-off-by: Biju Das --- v2->v3: * Restored the OF table position and moved near to the user in patch#3. v1->v2: * Moved the OF table just above its user. * Removed trailing comma from the terminator entry for the OF table. --- drivers/mfd/palmas.c | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/drivers/mfd/palmas.c b/drivers/mfd/palmas.c index 769538b50903..3c0a3d644834 100644 --- a/drivers/mfd/palmas.c +++ b/drivers/mfd/palmas.c @@ -296,7 +296,7 @@ static const struct regmap_irq palmas_irqs[] =3D { }, }; =20 -static struct regmap_irq_chip palmas_irq_chip =3D { +static const struct regmap_irq_chip palmas_irq_chip =3D { .name =3D "palmas", .irqs =3D palmas_irqs, .num_irqs =3D ARRAY_SIZE(palmas_irqs), @@ -309,7 +309,7 @@ static struct regmap_irq_chip palmas_irq_chip =3D { PALMAS_INT1_MASK), }; =20 -static struct regmap_irq_chip tps65917_irq_chip =3D { +static const struct regmap_irq_chip tps65917_irq_chip =3D { .name =3D "tps65917", .irqs =3D tps65917_irqs, .num_irqs =3D ARRAY_SIZE(tps65917_irqs), @@ -463,26 +463,21 @@ static void palmas_power_off(void) __func__, ret); } =20 -static unsigned int palmas_features =3D PALMAS_PMIC_FEATURE_SMPS10_BOOST; -static unsigned int tps659038_features; - struct palmas_driver_data { - unsigned int *features; - struct regmap_irq_chip *irq_chip; + unsigned int features; + const struct regmap_irq_chip *irq_chip; }; =20 -static struct palmas_driver_data palmas_data =3D { - .features =3D &palmas_features, +static const struct palmas_driver_data palmas_data =3D { + .features =3D PALMAS_PMIC_FEATURE_SMPS10_BOOST, .irq_chip =3D &palmas_irq_chip, }; =20 -static struct palmas_driver_data tps659038_data =3D { - .features =3D &tps659038_features, +static const struct palmas_driver_data tps659038_data =3D { .irq_chip =3D &palmas_irq_chip, }; =20 -static struct palmas_driver_data tps65917_data =3D { - .features =3D &tps659038_features, +static const struct palmas_driver_data tps65917_data =3D { .irq_chip =3D &tps65917_irq_chip, }; =20 @@ -507,7 +502,7 @@ static int palmas_i2c_probe(struct i2c_client *i2c) { struct palmas *palmas; struct palmas_platform_data *pdata; - struct palmas_driver_data *driver_data; + const struct palmas_driver_data *driver_data; struct device_node *node =3D i2c->dev.of_node; int ret =3D 0, i; unsigned int reg, addr; @@ -535,8 +530,8 @@ static int palmas_i2c_probe(struct i2c_client *i2c) palmas->dev =3D &i2c->dev; palmas->irq =3D i2c->irq; =20 - driver_data =3D (struct palmas_driver_data *) device_get_match_data(&i2c-= >dev); - palmas->features =3D *driver_data->features; + driver_data =3D device_get_match_data(&i2c->dev); + palmas->features =3D driver_data->features; =20 for (i =3D 0; i < PALMAS_NUM_CLIENTS; i++) { if (i =3D=3D 0) --=20 2.25.1 From nobody Thu Dec 18 16:38:03 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 19AA5C83F37 for ; Thu, 31 Aug 2023 18:32:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347053AbjHaScL (ORCPT ); Thu, 31 Aug 2023 14:32:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50424 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347047AbjHaScI (ORCPT ); Thu, 31 Aug 2023 14:32:08 -0400 Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A5BFDE66; Thu, 31 Aug 2023 11:32:05 -0700 (PDT) X-IronPort-AV: E=Sophos;i="6.02,217,1688396400"; d="scan'208";a="174628376" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 01 Sep 2023 03:32:05 +0900 Received: from localhost.localdomain (unknown [10.226.92.179]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 7AB84400CEF1; Fri, 1 Sep 2023 03:32:03 +0900 (JST) From: Biju Das To: Tony Lindgren , Lee Jones Cc: Biju Das , linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, Andy Shevchenko Subject: [PATCH v3 3/4] mfd: palmas: Move OF table Date: Thu, 31 Aug 2023 19:31:52 +0100 Message-Id: <20230831183153.63750-4-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230831183153.63750-1-biju.das.jz@bp.renesas.com> References: <20230831183153.63750-1-biju.das.jz@bp.renesas.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Move OF table near to the user. While at it, arrange compatible and data in single line. Signed-off-by: Biju Das --- v3: * New patch. --- drivers/mfd/palmas.c | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/drivers/mfd/palmas.c b/drivers/mfd/palmas.c index 3c0a3d644834..3ac9dec2b117 100644 --- a/drivers/mfd/palmas.c +++ b/drivers/mfd/palmas.c @@ -481,23 +481,6 @@ static const struct palmas_driver_data tps65917_data = =3D { .irq_chip =3D &tps65917_irq_chip, }; =20 -static const struct of_device_id of_palmas_match_tbl[] =3D { - { - .compatible =3D "ti,palmas", - .data =3D &palmas_data, - }, - { - .compatible =3D "ti,tps659038", - .data =3D &tps659038_data, - }, - { - .compatible =3D "ti,tps65917", - .data =3D &tps65917_data, - }, - { } -}; -MODULE_DEVICE_TABLE(of, of_palmas_match_tbl); - static int palmas_i2c_probe(struct i2c_client *i2c) { struct palmas *palmas; @@ -707,6 +690,14 @@ static void palmas_i2c_remove(struct i2c_client *i2c) } } =20 +static const struct of_device_id of_palmas_match_tbl[] =3D { + { .compatible =3D "ti,palmas", .data =3D &palmas_data }, + { .compatible =3D "ti,tps659038", .data =3D &tps659038_data }, + { .compatible =3D "ti,tps65917", .data =3D &tps65917_data }, + { } +}; +MODULE_DEVICE_TABLE(of, of_palmas_match_tbl); + static const struct i2c_device_id palmas_i2c_id[] =3D { { "palmas", }, { "twl6035", }, --=20 2.25.1 From nobody Thu Dec 18 16:38:03 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3CD81C83F2F for ; Thu, 31 Aug 2023 18:32:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347062AbjHaScN (ORCPT ); Thu, 31 Aug 2023 14:32:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347047AbjHaScL (ORCPT ); Thu, 31 Aug 2023 14:32:11 -0400 Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 367BCE76; Thu, 31 Aug 2023 11:32:08 -0700 (PDT) X-IronPort-AV: E=Sophos;i="6.02,217,1688396400"; d="scan'208";a="174628379" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 01 Sep 2023 03:32:07 +0900 Received: from localhost.localdomain (unknown [10.226.92.179]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 040DF400CEF1; Fri, 1 Sep 2023 03:32:05 +0900 (JST) From: Biju Das To: Tony Lindgren , Lee Jones Cc: Biju Das , linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, Andy Shevchenko Subject: [PATCH v3 4/4] mfd: palmas: Make similar OF and ID table Date: Thu, 31 Aug 2023 19:31:53 +0100 Message-Id: <20230831183153.63750-5-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230831183153.63750-1-biju.das.jz@bp.renesas.com> References: <20230831183153.63750-1-biju.das.jz@bp.renesas.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Make similar OF and ID table to extend support for ID match using i2c_match_data(). Currently it works only for OF match tables as the driver_data is wrong for ID match. Signed-off-by: Biju Das --- v2->v3: * Updated commit description. v1->v2: * No change. --- drivers/mfd/palmas.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/mfd/palmas.c b/drivers/mfd/palmas.c index 3ac9dec2b117..7fc886f4f80e 100644 --- a/drivers/mfd/palmas.c +++ b/drivers/mfd/palmas.c @@ -513,7 +513,7 @@ static int palmas_i2c_probe(struct i2c_client *i2c) palmas->dev =3D &i2c->dev; palmas->irq =3D i2c->irq; =20 - driver_data =3D device_get_match_data(&i2c->dev); + driver_data =3D i2c_get_match_data(i2c); palmas->features =3D driver_data->features; =20 for (i =3D 0; i < PALMAS_NUM_CLIENTS; i++) { @@ -699,10 +699,10 @@ static const struct of_device_id of_palmas_match_tbl[= ] =3D { MODULE_DEVICE_TABLE(of, of_palmas_match_tbl); =20 static const struct i2c_device_id palmas_i2c_id[] =3D { - { "palmas", }, - { "twl6035", }, - { "twl6037", }, - { "tps65913", }, + { "palmas", (kernel_ulong_t)&palmas_data }, + { "twl6035", (kernel_ulong_t)&palmas_data }, + { "twl6037", (kernel_ulong_t)&palmas_data }, + { "tps65913", (kernel_ulong_t)&palmas_data }, { /* end */ } }; MODULE_DEVICE_TABLE(i2c, palmas_i2c_id); --=20 2.25.1