Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965439AbbD1L4j (ORCPT ); Tue, 28 Apr 2015 07:56:39 -0400 Received: from mail-wi0-f170.google.com ([209.85.212.170]:35887 "EHLO mail-wi0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964975AbbD1L4g (ORCPT ); Tue, 28 Apr 2015 07:56:36 -0400 Date: Tue, 28 Apr 2015 12:56:31 +0100 From: Lee Jones To: S Twiss Cc: Dmitry Torokhov , Samuel Ortiz , DT , David Dajun Chen , INPUT , Ian Campbell , Kumar Gala , LKML , Mark Rutland , Pawel Moll , Rob Herring , Support Opensource Subject: Re: [RESEND PATCH V2 1/2] input: misc: da9063: OnKey driver Message-ID: <20150428115631.GA9169@x1> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4829 Lines: 156 On Fri, 17 Apr 2015, S Twiss wrote: > From: Steve Twiss > > Add OnKey driver support for DA9063 > > > Signed-off-by: Steve Twiss > > --- > Changes from PATCH V1 to V2 > --------------------------- > - Remove the circular dependency comment in the main e-mail body > linking PATCH V1 1/2 and 2/2 > - Alter the copyright header information to match expected GPLv2 > text from http://www.gnu.org/licenses/gpl-2.0.html > > This patch applies against linux-next and v4.0-rc6 > > > MAINTAINERS | 2 +- > drivers/input/misc/Kconfig | 10 ++ > drivers/input/misc/Makefile | 1 + > drivers/input/misc/da9063-onkey.c | 228 ++++++++++++++++++++++++++++++++++++++ > drivers/mfd/da9063-core.c | 55 +++++++++ > include/linux/mfd/da9063/pdata.h | 1 + This should be a seperate patch. > 6 files changed, 296 insertions(+), 1 deletion(-) > create mode 100644 drivers/input/misc/da9063-onkey.c [...] > diff --git a/drivers/mfd/da9063-core.c b/drivers/mfd/da9063-core.c > index facd361..b6d6f18 100644 > --- a/drivers/mfd/da9063-core.c > +++ b/drivers/mfd/da9063-core.c > @@ -60,6 +60,7 @@ static struct resource da9063_rtc_resources[] = { > > static struct resource da9063_onkey_resources[] = { > { > + .name = "ONKEY", > .start = DA9063_IRQ_ONKEY, > .end = DA9063_IRQ_ONKEY, > .flags = IORESOURCE_IRQ, > @@ -97,6 +98,7 @@ static const struct mfd_cell da9063_devs[] = { > .name = DA9063_DRVNAME_ONKEY, > .num_resources = ARRAY_SIZE(da9063_onkey_resources), > .resources = da9063_onkey_resources, > + .of_compatible = "dlg,da9063-onkey", > }, > { > .name = DA9063_DRVNAME_RTC, This is lowercase, so why does "ONKEY" have to be uppercase? > @@ -109,12 +111,64 @@ static const struct mfd_cell da9063_devs[] = { > }, > }; > > +static int da9063_clear_fault_log(struct da9063 *da9063) > +{ > + int ret = 0; > + int fault_log = 0; > + > + ret = regmap_read(da9063->regmap, DA9063_REG_FAULT_LOG, &fault_log); > + if (ret < 0) { > + dev_err(da9063->dev, "Cannot read FAULT_LOG.\n"); > + return -EIO; > + } > + > + if (fault_log) { > + if (fault_log & DA9063_TWD_ERROR) > + dev_dbg(da9063->dev, > + "Fault log entry detected: DA9063_TWD_ERROR\n"); > + if (fault_log & DA9063_POR) > + dev_dbg(da9063->dev, > + "Fault log entry detected: DA9063_POR\n"); > + if (fault_log & DA9063_VDD_FAULT) > + dev_dbg(da9063->dev, > + "Fault log entry detected: DA9063_VDD_FAULT\n"); > + if (fault_log & DA9063_VDD_START) > + dev_dbg(da9063->dev, > + "Fault log entry detected: DA9063_VDD_START\n"); > + if (fault_log & DA9063_TEMP_CRIT) > + dev_dbg(da9063->dev, > + "Fault log entry detected: DA9063_TEMP_CRIT\n"); > + if (fault_log & DA9063_KEY_RESET) > + dev_dbg(da9063->dev, > + "Fault log entry detected: DA9063_KEY_RESET\n"); > + if (fault_log & DA9063_NSHUTDOWN) > + dev_dbg(da9063->dev, > + "Fault log entry detected: DA9063_NSHUTDOWN\n"); > + if (fault_log & DA9063_WAIT_SHUT) > + dev_dbg(da9063->dev, > + "Fault log entry detected: DA9063_WAIT_SHUT\n"); > + } > + > + ret = regmap_write(da9063->regmap, > + DA9063_REG_FAULT_LOG, > + fault_log); > + if (ret < 0) > + dev_err(da9063->dev, > + "Cannot reset FAULT_LOG values %d\n", ret); > + > + return ret; > +} > + > int da9063_device_init(struct da9063 *da9063, unsigned int irq) > { > struct da9063_pdata *pdata = da9063->dev->platform_data; > int model, variant_id, variant_code; > int ret; > > + ret = da9063_clear_fault_log(da9063); > + if (ret < 0) > + dev_err(da9063->dev, "Cannot clear fault log\n"); > + > if (pdata) { > da9063->flags = pdata->flags; > da9063->irq_base = pdata->irq_base; > @@ -178,6 +232,7 @@ int da9063_device_init(struct da9063 *da9063, unsigned int irq) > if (ret) > dev_err(da9063->dev, "Cannot add MFD cells\n"); > > + Tut tut! > return ret; > } > > diff --git a/include/linux/mfd/da9063/pdata.h b/include/linux/mfd/da9063/pdata.h > index 95c8742..612383b 100644 > --- a/include/linux/mfd/da9063/pdata.h > +++ b/include/linux/mfd/da9063/pdata.h > @@ -103,6 +103,7 @@ struct da9063; > struct da9063_pdata { > int (*init)(struct da9063 *da9063); > int irq_base; > + bool key_power; > unsigned flags; > struct da9063_regulators_pdata *regulators_pdata; > struct led_platform_data *leds_pdata; -- Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog -- 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/