mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Rutland <mark.rutland@arm.com>
To: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Cc: MyungJoo Ham <myungjoo.ham@samsung.com>,
	Chanwoo Choi <cw00.choi@samsung.com>,
	Samuel Ortiz <sameo@linux.intel.com>,
	Lee Jones <lee.jones@linaro.org>,
	Anton Vorontsov <anton@enomsg.org>,
	David Woodhouse <dwmw2@infradead.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	"grant.likely@linaro.org" <grant.likely@linaro.org>,
	"rob.herring@calxeda.com" <rob.herring@calxeda.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Kyungmin Park <kyungmin.park@samsung.com>
Subject: Re: [PATCH 1/4] mfd: max14577: Add max14577 MFD driver core
Date: Wed, 13 Nov 2013 11:50:18 +0000	[thread overview]
Message-ID: <20131113115018.GE21713@e106331-lin.cambridge.arm.com> (raw)
In-Reply-To: <1384328457-5147-2-git-send-email-k.kozlowski@samsung.com>

On Wed, Nov 13, 2013 at 07:40:54AM +0000, Krzysztof Kozlowski wrote:
> From: Chanwoo Choi <cw00.choi@samsung.com>
> 
> This patch adds max14577 core/irq driver to support MUIC(Micro USB IC)
> device and charger device and support irq domain method to control
> internal interrupt of max14577 device. Also, this patch supports DT
> binding with max14577_i2c_parse_dt().
> 
> The MAXIM 14577 chip contains Micro-USB Interface Circuit and Li+ Battery
> Charger. It contains accessory and USB charger detection logic. It supports
> USB 2.0 Hi-Speed, UART and stereo audio signals over Micro-USB connector.
> 
> The battery charger is compliant with the USB Battery Charging Specification
> Revision 1.1. It has also SFOUT LDO output for powering USB devices.
> 
> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> ---
>  drivers/mfd/Kconfig                  |   13 ++
>  drivers/mfd/Makefile                 |    1 +
>  drivers/mfd/max14577-irq.c           |  283 +++++++++++++++++++++++++++++++++
>  drivers/mfd/max14577.c               |  268 +++++++++++++++++++++++++++++++
>  include/linux/mfd/max14577-private.h |  291 ++++++++++++++++++++++++++++++++++
>  include/linux/mfd/max14577.h         |   76 +++++++++
>  6 files changed, 932 insertions(+)
>  create mode 100644 drivers/mfd/max14577-irq.c
>  create mode 100644 drivers/mfd/max14577.c
>  create mode 100644 include/linux/mfd/max14577-private.h
>  create mode 100644 include/linux/mfd/max14577.h

I see some of_* calls in the code, but no documentation of the binding.
As this has more than just a compatible, interrupts, and reg, it needs
its own binding document.

[...]

> +static struct mfd_cell max14577_devs[] = {
> +       { .name = "max14577-muic",
> +               .of_compatible = "maxim,max14577-muic", },

The compatible string looks fine to me, but should be documented.

[...]

> +#ifdef CONFIG_OF
> +static struct max14577_platform_data *max14577_i2c_parse_dt(struct device *dev)
> +{
> +       struct max14577_platform_data *pdata;
> +       struct device_node *np = dev->of_node;
> +
> +       pdata = devm_kzalloc(dev, sizeof(struct max14577_platform_data),
> +                            GFP_KERNEL);
> +       if (!pdata)
> +               return ERR_PTR(-ENOMEM);
> +
> +       pdata->irq_gpio = of_get_named_gpio(np, "irq_gpio", 0);

In general, '-' is preferred to '_' in property names. This should be
irq-gpio.

What exactly is this used for? I know that others have strong opinions
about how gpio/irq interaction should be handled.

> +       if (!gpio_is_valid(pdata->irq_gpio)) {
> +               dev_err(dev, "Invalid irq_gpio in DT\n");
> +               return ERR_PTR(-EINVAL);
> +       }
> +
> +       if (of_property_read_bool(np, "wakeup"))
> +               pdata->wakeup = true;

What does this mean? It seems like a remarkably generic name for
something that I'd guess is _very_ specific to this particular binding.

It might be worth prefixing it, and is certainly worth having a more
precise name.

Thanks,
Mark.

  reply	other threads:[~2013-11-13 11:50 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-13  7:40 [PATCH 0/4] mfd: max14577: Add max14577 MFD drivers Krzysztof Kozlowski
2013-11-13  7:40 ` [PATCH 1/4] mfd: max14577: Add max14577 MFD driver core Krzysztof Kozlowski
2013-11-13 11:50   ` Mark Rutland [this message]
2013-11-14  8:32     ` Krzysztof Kozlowski
2013-11-13 13:13   ` Mark Brown
2013-11-14  1:33     ` Kyungmin Park
2013-11-14 10:24       ` Mark Brown
2013-11-14 10:53         ` Marek Szyprowski
2013-11-14 11:22           ` Mark Brown
2013-11-14  8:15     ` Krzysztof Kozlowski
2013-11-13  7:40 ` [PATCH 2/4] extcon: max77693: Add extcon-max14577 driver to support MUIC device Krzysztof Kozlowski
2013-11-13  7:40 ` [PATCH 3/4] charger: max14577: Add charger support for Maxim 14577 Krzysztof Kozlowski
2013-11-13  7:40 ` [PATCH 4/4] regulator: max14577: Add regulator driver " Krzysztof Kozlowski
2013-11-13 13:23   ` Mark Brown
2013-11-14  9:17     ` Krzysztof Kozlowski

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=20131113115018.GE21713@e106331-lin.cambridge.arm.com \
    --to=mark.rutland@arm.com \
    --cc=anton@enomsg.org \
    --cc=b.zolnierkie@samsung.com \
    --cc=broonie@kernel.org \
    --cc=cw00.choi@samsung.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dwmw2@infradead.org \
    --cc=grant.likely@linaro.org \
    --cc=k.kozlowski@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=lee.jones@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=myungjoo.ham@samsung.com \
    --cc=rob.herring@calxeda.com \
    --cc=sameo@linux.intel.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®