Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2993253AbbEPIxi (ORCPT ); Sat, 16 May 2015 04:53:38 -0400 Received: from down.free-electrons.com ([37.187.137.238]:51042 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933788AbbEPIxb (ORCPT ); Sat, 16 May 2015 04:53:31 -0400 Date: Sat, 16 May 2015 10:53:28 +0200 From: Alexandre Belloni To: S Twiss Cc: LINUXKERNEL , Lee Jones , Samuel Ortiz , Alessandro Zummo , DEVICETREE , David Dajun Chen , Dmitry Torokhov , Ian Campbell , Kumar Gala , LINUXINPUT , LINUXWATCHDOG , Liam Girdwood , Mark Brown , Mark Rutland , Pawel Moll , RTCLINUX , Rob Herring , Support Opensource , Wim Van Sebroeck Subject: Re: [rtc-linux] [PATCH V2 1/4] mfd: da9062: DA9062 MFD core driver Message-ID: <20150516085328.GI3338@piout.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3091 Lines: 100 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 > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > +#include > +#include > +#include > + > +#include > +#include > +#include > +#include > + > +#include > +#include > +#include > + 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/