lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <3d2e87de-2aa9-43b0-99be-74ff5f08b28d@ti.com>
Date: Thu, 2 Jan 2025 17:26:00 -0600
From: Shree Ramamoorthy <s-ramamoorthy@...com>
To: Christophe JAILLET <christophe.jaillet@...adoo.fr>, <aaro.koskinen@....fi>,
        <andreas@...nade.info>, <khilman@...libre.com>, <rogerq@...nel.org>,
        <tony@...mide.com>, <lee@...nel.org>, <linux-omap@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>
CC: <m-leonard@...com>, <praneeth@...com>
Subject: Re: [PATCH v1 2/2] mfd: tps65215: Add support for TI TPS65215 PMIC

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@...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@...libre.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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ