[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y5B32hSYKYsYwzfr@smile.fi.intel.com>
Date: Wed, 7 Dec 2022 13:24:10 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Okan Sahin <okan.sahin@...log.com>
Cc: outreachy@...ts.linux.dev, Lee Jones <lee@...nel.org>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>,
Jonathan Cameron <jic23@...nel.org>,
Lars-Peter Clausen <lars@...afoo.de>,
Marcus Folkesson <marcus.folkesson@...il.com>,
Manish Narani <manish.narani@...inx.com>,
Geert Uytterhoeven <geert+renesas@...der.be>,
Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>,
William Breathitt Gray <william.gray@...aro.org>,
Anand Ashok Dumbre <anand.ashok.dumbre@...inx.com>,
ChiYuan Huang <cy_huang@...htek.com>,
Ramona Bolboaca <ramona.bolboaca@...log.com>,
Caleb Connolly <caleb.connolly@...aro.org>,
Marcelo Schmitt <marcelo.schmitt1@...il.com>,
linux-kernel@...r.kernel.org, devicetree@...r.kernel.org,
linux-iio@...r.kernel.org
Subject: Re: [PATCH 1/5] staging: drivers: mfd: Add MAX77541/MAX77540 PMIC
Support
On Wed, Dec 07, 2022 at 12:08:40PM +0300, Okan Sahin wrote:
> This patch adds MFD driver for MAX77541/MAX77540 to enable its sub
> devices.
>
> The MAX77541 is a multi-function devices. It includes
> buck converter and ADC.
>
> The MAX77540 is a high-efficiency buck converter
> with two 3A switching phases.
>
> They have same regmap except for ADC part of MAX77541.
Same comment as per patch 2.
...
> + help
> + Say yes here to add support for Analog Devices
> + MAX77541 and MAX77540 Power Management ICs.
> + This driver provides common support for accessing the device;
> + additional drivers must be enabled in order to use the functionality
> + of the device.
Arbitrary line lengths.
...
> + return devm_mfd_add_devices(dev, -1, max77540_devs, ARRAY_SIZE(max77540_devs),
There is a definition for -1, use it.
> + NULL, 0, NULL);
...
> + return devm_mfd_add_devices(dev, -1, max77541_devs, ARRAY_SIZE(max77541_devs),
Ditto.
> + NULL, 0, NULL);
...
> + chip_id = to_i2c_driver(client->dev.driver)->id_table;
> + if (!chip_data) {
> + chip_data = (void *)i2c_match_id(chip_id, client)->driver_data;
> + }
We have a new helper for this.
...
> + return dev_err_probe(me->dev, PTR_ERR(me->regmap),
> + "Failed to allocate register map\n");
Wrong indentation.
...
> +
Redundant blank line.
> +module_i2c_driver(max77541_i2c_driver);
...
> +MODULE_VERSION("1.0");
Why?
...
Missing inclusions:
- bits.h
- types.h
Missing forward declarations for:
struct device
struct regmap
struct regmap_irq_chip_data
...
> +/* REGISTERS */
...
> +#define MAX77541_REGMAP_IRQ_REG(_mask) \
> + { .mask = (_mask), }
When {} are on one line, the trailing comma inside is not needed.
...
> +enum mx_range {
> + LOW_RANGE,
> + MID_RANGE,
> + HIGH_RANGE,
> + RESERVED
Is it terminator?
> +};
...
> +struct max77541_dev {
> + void *pdata;
Why do you need this?
> + struct device *dev;
Isn't it the same as dev inside regmap?
> + struct regmap_irq_chip_data *irq_data;
> + struct regmap_irq_chip_data *irq_buck;
> + struct regmap_irq_chip_data *irq_topsys;
> + struct regmap_irq_chip_data *irq_adc;
> + struct i2c_client *i2c;
Is this is really needed? Perhaps regmap below provides what you need, no?
> + struct regmap *regmap;
> +
> + u8 type;
> +};
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists