From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Okan Sahin <okan.sahin@analog.com>
Cc: Lee Jones <lee@kernel.org>, Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>,
Jonathan Cameron <jic23@kernel.org>,
Lars-Peter Clausen <lars@metafoo.de>,
Geert Uytterhoeven <geert+renesas@glider.be>,
ChiYuan Huang <cy_huang@richtek.com>,
Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>,
William Breathitt Gray <william.gray@linaro.org>,
Ramona Bolboaca <ramona.bolboaca@analog.com>,
Caleb Connolly <caleb.connolly@linaro.org>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-iio@vger.kernel.org
Subject: Re: [PATCH v5 5/5] mfd: max77541: Add ADI MAX77541/MAX77540 PMIC Support
Date: Tue, 21 Feb 2023 14:13:50 +0200 [thread overview]
Message-ID: <Y/S1ftKmV92TL8VO@smile.fi.intel.com> (raw)
In-Reply-To: <20230221103926.49597-6-okan.sahin@analog.com>
On Tue, Feb 21, 2023 at 01:39:13PM +0300, Okan Sahin wrote:
> 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.
Extra space in the Subject.
...
> +#include <linux/of_device.h>
Why?
...
> +static const struct regmap_config max77541_regmap_config = {
> + .reg_bits = 8,
> + .val_bits = 8,
Do you need lock of regmap?
> +};
...
> +static const struct mfd_cell max77540_devs[] = {
> + MFD_CELL_OF("max77540-regulator", NULL, NULL, 0, 0,
> + NULL),
Perfectly one line.
> +};
> +static const struct mfd_cell max77541_devs[] = {
> + MFD_CELL_OF("max77541-regulator", NULL, NULL, 0, 0,
> + NULL),
> + MFD_CELL_OF("max77541-adc", NULL, NULL, 0, 0,
> + NULL),
Ditto.
> +};
...
> + if (max77541->chip->id == MAX77541) {
> + ret = devm_regmap_add_irq_chip(dev, max77541->regmap, irq,
> + IRQF_ONESHOT | IRQF_SHARED, 0,
> + &max77541_adc_irq_chip,
> + &max77541->irq_adc);
> + if (ret)
> + return ret;
> + }
> + return ret;
return 0;
...
> +static const struct i2c_device_id max77541_i2c_id[];
What for?
...
> + if (dev->of_node)
> + max77541->chip = of_device_get_match_data(dev);
> + else
> + max77541->chip = (struct chip_info *)
> + i2c_match_id(max77541_i2c_id,
> + client)->driver_data;
Oh. Please use
const struct i2c_device_id *id = i2c_client_get_device_id(client);
...
max77541->chip = device_get_match_data(dev); // needs property.h
if (!max77541->chip)
max77541->chip = (struct chip_info *)id->driver_data;
> + if (!max77541->chip)
> + return -EINVAL;
...
> +#ifndef __MAX77541_MFD_H__
> +#define __MAX77541_MFD_H__
Can we go towards consistency in this?
Seems to me the most used patter so far is
#ifndef __LINUX_MFD_MAX77541_H
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2023-02-21 12:17 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-21 10:39 [PATCH v5 0/5] Add MAX77541/MAX77540 PMIC Support Okan Sahin
2023-02-21 10:39 ` [PATCH v5 1/5] dt-bindings: regulator: max77541: Add ADI MAX77541/MAX77540 Regulator Okan Sahin
2023-02-21 10:39 ` [PATCH v5 2/5] regulator: max77541: Add ADI MAX77541/MAX77540 Regulator Support Okan Sahin
2023-02-21 12:18 ` Andy Shevchenko
2023-02-21 10:39 ` [PATCH v5 3/5] iio: adc: max77541: Add ADI MAX77541 ADC Support Okan Sahin
2023-02-21 11:59 ` Andy Shevchenko
2023-02-21 10:39 ` [PATCH v5 4/5] dt-bindings: mfd: max77541: Add ADI MAX77541/MAX77540 Okan Sahin
2023-02-21 11:21 ` Krzysztof Kozlowski
2023-02-21 10:39 ` [PATCH v5 5/5] mfd: max77541: Add ADI MAX77541/MAX77540 PMIC Support Okan Sahin
2023-02-21 12:13 ` Andy Shevchenko [this message]
2023-02-22 15:32 ` Lee Jones
2023-02-22 16:14 ` Andy Shevchenko
2023-02-23 14:00 ` Lee Jones
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=Y/S1ftKmV92TL8VO@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=broonie@kernel.org \
--cc=caleb.connolly@linaro.org \
--cc=cy_huang@richtek.com \
--cc=devicetree@vger.kernel.org \
--cc=geert+renesas@glider.be \
--cc=jic23@kernel.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=lars@metafoo.de \
--cc=lee@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=okan.sahin@analog.com \
--cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
--cc=ramona.bolboaca@analog.com \
--cc=robh+dt@kernel.org \
--cc=william.gray@linaro.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.