linux-watchdog.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexandre Belloni <alexandre.belloni@free-electrons.com>
To: S Twiss <stwiss.opensource@diasemi.com>
Cc: LINUXKERNEL <linux-kernel@vger.kernel.org>,
	Lee Jones <lee.jones@linaro.org>,
	Samuel Ortiz <sameo@linux.intel.com>,
	Alessandro Zummo <a.zummo@towertech.it>,
	DEVICETREE <devicetree@vger.kernel.org>,
	David Dajun Chen <david.chen@diasemi.com>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Kumar Gala <galak@codeaurora.org>,
	LINUXINPUT <linux-input@vger.kernel.org>,
	LINUXWATCHDOG <linux-watchdog@vger.kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Pawel Moll <pawel.moll@arm.com>,
	RTCLINUX <rtc-linux@googlegroups.com>,
	Rob Herring <robh+dt@kernel.org>,
	Support Opensource <support.opensource@diasemi.com>,
	Wim Van Sebroeck <wim@iguana.be>
Subject: Re: [rtc-linux] [PATCH V2 1/4] mfd: da9062: DA9062 MFD core driver
Date: Sat, 16 May 2015 10:53:28 +0200	[thread overview]
Message-ID: <20150516085328.GI3338@piout.net> (raw)
In-Reply-To: <af5a7d289bb149e9111ebc70bb0589a994ee2407.1431621833.git.stwiss.opensource@diasemi.com>

On 14/05/2015 at 17:43:52 +0100, S Twiss wrote :
> +config MFD_DA9062
> +	tristate "Dialog Semiconductor DA9062 PMIC Support"
> +	select MFD_CORE
> +	select REGMAP_I2C
> +	select REGMAP_IRQ
> +	depends on I2C=y

Isn't depends on I2C enough?

> diff --git a/drivers/mfd/da9062-core.c b/drivers/mfd/da9062-core.c
> new file mode 100644
> index 0000000..e6a9878
> --- /dev/null
> +++ b/drivers/mfd/da9062-core.c
> +#include <linux/kernel.h>
> +#include <linux/module.h>
> +#include <linux/init.h>
> +#include <linux/slab.h>
> +#include <linux/device.h>
> +#include <linux/delay.h>
> +#include <linux/interrupt.h>
> +#include <linux/mutex.h>
> +#include <linux/regmap.h>
> +
> +#include <linux/irq.h>
> +#include <linux/mfd/core.h>
> +#include <linux/i2c.h>
> +#include <linux/err.h>
> +
> +#include <linux/mfd/da9062/core.h>
> +#include <linux/mfd/da9062/registers.h>
> +#include <linux/of.h>
> +#include <linux/regulator/of_regulator.h>
> +
> +#include <linux/proc_fs.h>
> +#include <linux/kthread.h>
> +#include <linux/uaccess.h>
> +

You should order the header inclusions alphabetically

[...]

> +	{
> +		.name		= "da9062-watchdog",
> +		.num_resources	= ARRAY_SIZE(da9062_wdt_resources),
> +		.resources	= da9062_wdt_resources,
> +		.of_compatible  = "dlg,da9062-wdt",
> +	},
> +	{
> +		.name		= "da9062-onkey",
> +		.num_resources	= ARRAY_SIZE(da9062_onkey_resources),
> +		.resources	= da9062_onkey_resources,
> +		.of_compatible  = "dlg,da9062-onkey",
> +	},
> +	{
> +		.name		= "da9062-thermal",
> +		.num_resources	= ARRAY_SIZE(da9062_thermal_resources),
> +		.resources	= da9062_thermal_resources,
> +		.of_compatible  = "dlg,da9062-thermal",
> +	},
> +	{
> +		.name		= "da9062-rtc",
> +		.num_resources	= ARRAY_SIZE(da9062_rtc_resources),
> +		.resources	= da9062_rtc_resources,
> +		.of_compatible  = "dlg,da9062-rtc",

Did you try to use "da9063-rtc"? The register set seems to be exactly
the same. Unfortunately, the datasheet are not available on the diasemi
website...

Also, the .of_compatibles are not necessary because you don't add any of
bindings to the underlying drivers. The match happens on .name.

> diff --git a/include/linux/mfd/da9062/registers.h b/include/linux/mfd/da9062/registers.h
> new file mode 100644
> index 0000000..d07c2bc
> --- /dev/null
> +++ b/include/linux/mfd/da9062/registers.h

Comparing that file with da9063/registers.h, It really seems that
DA062AA, DA9063AD and DA9063BB are register compatible, apart from a few
differences in the regulator and the gpio count.

Also, at least the watchdog and rtc driver are duplicating their da9063
counterpart. I'm not trying to annoy you, I just want you to understand
that the less code is duplicated, the easiest it will be to maintain
later.


-- 
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

  reply	other threads:[~2015-05-16  8:53 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-14 16:43 [PATCH V2 0/4] da9062: DA9062 driver submission S Twiss
2015-05-14 16:43 ` [PATCH V2 1/4] mfd: da9062: DA9062 MFD core driver S Twiss
2015-05-16  8:53   ` Alexandre Belloni [this message]
2015-05-19  8:34     ` [rtc-linux] " Opensource [Steve Twiss]
2015-05-14 16:43 ` [PATCH V2 3/4] watchdog: da9062: DA9062 watchdog driver S Twiss
2015-05-15  2:13   ` Guenter Roeck
2015-05-15  8:13     ` Opensource [Steve Twiss]
2015-05-15 12:57       ` Guenter Roeck
2015-05-15 15:35         ` Opensource [Steve Twiss]
2015-05-15 20:20           ` Guenter Roeck
2015-05-18 14:15             ` Opensource [Steve Twiss]
2015-05-18 15:27               ` Guenter Roeck
2015-05-18 16:03                 ` Opensource [Steve Twiss]
2015-05-18 17:39                   ` [rtc-linux] " Alexandre Belloni
2015-05-19 10:16                     ` Opensource [Steve Twiss]
2015-05-14 16:43 ` [PATCH V2 4/4] devicetree: da9062: Add bindings for DA9062 driver S Twiss
2015-05-14 16:43 ` [PATCH V2 2/4] regulator: da9062: DA9062 regulator driver S Twiss
2015-05-16  0:46 ` [rtc-linux] [PATCH V2 0/4] da9062: DA9062 driver submission Alexandre Belloni
2015-05-18 14:23   ` Opensource [Steve Twiss]

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=20150516085328.GI3338@piout.net \
    --to=alexandre.belloni@free-electrons.com \
    --cc=a.zummo@towertech.it \
    --cc=broonie@kernel.org \
    --cc=david.chen@diasemi.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=galak@codeaurora.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=lee.jones@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=pawel.moll@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=rtc-linux@googlegroups.com \
    --cc=sameo@linux.intel.com \
    --cc=stwiss.opensource@diasemi.com \
    --cc=support.opensource@diasemi.com \
    --cc=wim@iguana.be \
    /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;
as well as URLs for NNTP newsgroup(s).