mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Shree Ramamoorthy <s-ramamoorthy@ti.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
	<aaro.koskinen@iki.fi>, <andreas@kemnade.info>,
	<khilman@baylibre.com>, <rogerq@kernel.org>, <tony@atomide.com>,
	<lee@kernel.org>, <linux-omap@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Cc: <m-leonard@ti.com>, <praneeth@ti.com>
Subject: Re: [PATCH v1 2/2] mfd: tps65215: Add support for TI TPS65215 PMIC
Date: Thu, 2 Jan 2025 17:26:00 -0600	[thread overview]
Message-ID: <3d2e87de-2aa9-43b0-99be-74ff5f08b28d@ti.com> (raw)
In-Reply-To: <89569f43-e6ee-452e-91b5-eeee2838f9b5@wanadoo.fr>

Hi,


On 1/1/25 4:58 AM, Christophe JAILLET wrote:
> Le 26/12/2024 à 22:49, Shree Ramamoorthy a écrit :
>> Use chip ID and chip_data struct to differentiate between devices in
>> probe(). Add TPS65215 resource information. Update descriptions and
>> copyright information to reflect the driver supports 2 PMIC devices.
>>
>> Signed-off-by: Shree Ramamoorthy <s-ramamoorthy@ti.com>
>
> ...
>
>> +static struct chip_data chip_info_table[] = {
>> +    [TPS65219] = {
>> +        .irq_chip = &tps65219_irq_chip,
>> +        .cells = tps65219_cells,
>> +        .n_cells = ARRAY_SIZE(tps65219_cells),
>> +    },
>> +    [TPS65215] = {
>
> Maybe keep alphabetical order?

Thank you for reviewing! I will apply all the feedback across the related series & send v2 soon.

Shree

>
>> +        .irq_chip = &tps65215_irq_chip,
>> +        .cells = tps65215_cells,
>> +        .n_cells = ARRAY_SIZE(tps65215_cells),
>> +    },
>> +};
>> +
>>   static int tps65219_probe(struct i2c_client *client)
>>   {
>>       struct tps65219 *tps;
>> +    struct chip_data *pmic;
>>       bool pwr_button;
>>       int ret;
>>   @@ -231,6 +366,8 @@ static int tps65219_probe(struct i2c_client 
>> *client)
>>       i2c_set_clientdata(client, tps);
>>         tps->dev = &client->dev;
>> +    tps->chip_id = (uintptr_t)i2c_get_match_data(client);
>> +    pmic = &chip_info_table[tps->chip_id];
>>         tps->regmap = devm_regmap_init_i2c(client, 
>> &tps65219_regmap_config);
>>       if (IS_ERR(tps->regmap)) {
>> @@ -239,14 +376,14 @@ static int tps65219_probe(struct i2c_client 
>> *client)
>>           return ret;
>>       }
>>   -    ret = devm_regmap_add_irq_chip(&client->dev, tps->regmap, 
>> client->irq,
>> -                       IRQF_ONESHOT, 0, &tps65219_irq_chip,
>> +    ret = devm_regmap_add_irq_chip(tps->dev, tps->regmap, client->irq,
>> +                       IRQF_ONESHOT, 0, pmic->irq_chip,
>>                          &tps->irq_data);
>>       if (ret)
>>           return ret;
>>         ret = devm_mfd_add_devices(tps->dev, PLATFORM_DEVID_AUTO,
>> -                   tps65219_cells, ARRAY_SIZE(tps65219_cells),
>> +                   pmic->cells, pmic->n_cells,
>>                      NULL, 0, regmap_irq_get_domain(tps->irq_data));
>>       if (ret) {
>>           dev_err(tps->dev, "Failed to add child devices: %d\n", ret);
>> @@ -284,7 +421,8 @@ static int tps65219_probe(struct i2c_client *client)
>>   }
>>     static const struct of_device_id of_tps65219_match_table[] = {
>> -    { .compatible = "ti,tps65219", },
>> +    { .compatible = "ti,tps65219", .data = (void *)TPS65219, },
>> +    { .compatible = "ti,tps65215", .data = (void *)TPS65215, },
>
> Maybe keep alphabetical order?
>
>>       {}
>>   };
>>   MODULE_DEVICE_TABLE(of, of_tps65219_match_table);
>> @@ -299,5 +437,5 @@ static struct i2c_driver tps65219_driver = {
>>   module_i2c_driver(tps65219_driver);
>>     MODULE_AUTHOR("Jerome Neanne <jneanne@baylibre.com>");
>> -MODULE_DESCRIPTION("TPS65219 power management IC driver");
>> +MODULE_DESCRIPTION("TPS65215/TPS65219 PMIC driver");
>>   MODULE_LICENSE("GPL");
>> diff --git a/include/linux/mfd/tps65219.h b/include/linux/mfd/tps65219.h
>> index 6ed2ec4264d9..945ab805fa6d 100644
>> --- a/include/linux/mfd/tps65219.h
>> +++ b/include/linux/mfd/tps65219.h
>> @@ -1,8 +1,10 @@
>>   /* SPDX-License-Identifier: GPL-2.0 */
>>   /*
>> - * Functions to access TPS65219 Power Management IC.
>> + * Functions to access TPS65215/TPS65219 Integrated Power Management
>> + * Integrated Chips (PMIC)
>>    *
>>    * Copyright (C) 2022 BayLibre Incorporated - 
>> https://www.baylibre.com/
>> + * Copyright (C) 2024 Texas Instruments Incorporated - 
>> https://www.ti.com/
>>    */
>>     #ifndef MFD_TPS65219_H
>> @@ -13,6 +15,12 @@
>>   #include <linux/regmap.h>
>>   #include <linux/regulator/driver.h>
>>   +/* Chip id list*/
>> +enum pmic_id {
>> +    TPS65219,
>> +    TPS65215,
>
> Maybe keep alphabetical order?
>
>> +};
>
> ...
>
> CJ

-- 
Best,
Shree Ramamoorthy
PMIC Software Engineer


      reply	other threads:[~2025-01-02 23:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-26 21:49 [PATCH v1 0/2] Add TI TPS65215 PMIC MFD Support Shree Ramamoorthy
2024-12-26 21:49 ` [PATCH v1 1/2] mfd: tps65215: Remove regmap_read check Shree Ramamoorthy
2024-12-26 21:49 ` [PATCH v1 2/2] mfd: tps65215: Add support for TI TPS65215 PMIC Shree Ramamoorthy
2025-01-01 10:58   ` Christophe JAILLET
2025-01-02 23:26     ` Shree Ramamoorthy [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3d2e87de-2aa9-43b0-99be-74ff5f08b28d@ti.com \
    --to=s-ramamoorthy@ti.com \
    --cc=aaro.koskinen@iki.fi \
    --cc=andreas@kemnade.info \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=khilman@baylibre.com \
    --cc=lee@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=m-leonard@ti.com \
    --cc=praneeth@ti.com \
    --cc=rogerq@kernel.org \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®