Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752327AbbEDHqw (ORCPT ); Mon, 4 May 2015 03:46:52 -0400 Received: from mail-ob0-f179.google.com ([209.85.214.179]:34338 "EHLO mail-ob0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750798AbbEDHqo (ORCPT ); Mon, 4 May 2015 03:46:44 -0400 MIME-Version: 1.0 In-Reply-To: <639fd177d5ddd4ce80df45f9d774cc971b286ef9.1430393194.git.stwiss.opensource@diasemi.com> References: <639fd177d5ddd4ce80df45f9d774cc971b286ef9.1430393194.git.stwiss.opensource@diasemi.com> Date: Mon, 4 May 2015 09:46:43 +0200 X-Google-Sender-Auth: oZPU7iGW0eysk9DzK_QsHJbWYko Message-ID: Subject: Re: [PATCH V3 3/3] mfd: da9063: MFD support for OnKey driver From: Geert Uytterhoeven To: S Twiss Cc: Lee Jones , Samuel Ortiz , DT , David Dajun Chen , Dmitry Torokhov , INPUT , Ian Campbell , Kumar Gala , LKML , Mark Rutland , Pawel Moll , Rob Herring , Support Opensource Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4324 Lines: 109 Hi Steve, On Thu, Apr 30, 2015 at 1:26 PM, S Twiss wrote: > Add MFD support for the DA9063 OnKey driver Thanks for your patch! > --- 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, > @@ -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; The code above doesn't seem to match the patch description. Can you please explain why it is needed? Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds -- 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/