From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matti Vaittinen Subject: Re: [PATCH v11 2/8] mfd: bd70528: Support ROHM bd70528 PMIC - core Date: Wed, 3 Apr 2019 11:47:32 +0300 Message-ID: <20190403084732.GA3493@localhost.localdomain> References: <39efebe0396dd42de30d37c6f3c1ef2926c90210.1553515333.git.matti.vaittinen@fi.rohmeurope.com> <20190403073152.GM4187@dell> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20190403073152.GM4187@dell> Sender: linux-kernel-owner@vger.kernel.org To: Lee Jones Cc: mazziesaccount@gmail.com, Rob Herring , Mark Rutland , Michael Turquette , Stephen Boyd , Linus Walleij , Bartosz Golaszewski , Sebastian Reichel , Liam Girdwood , Mark Brown , Alessandro Zummo , Alexandre Belloni , Wim Van Sebroeck , Guenter Roeck , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-gpio@vger.kernel.org, linux-pm@vger.kernel.org, linux-rtc@vger.kernel.org, linux-watchdog@vger.kernel.org, heikki.haikola@fi.rohmeurop List-Id: linux-gpio@vger.kernel.org Hello Lee, Thanks for taking a look on this again =) I agree with most of the comments and correct them at next version. On Wed, Apr 03, 2019 at 08:31:52AM +0100, Lee Jones wrote: > On Mon, 25 Mar 2019, Matti Vaittinen wrote: > > > ROHM BD70528MWV is an ultra-low quiescent current general > > purpose single-chip power management IC for battery-powered > > portable devices. > > > > Add MFD core which enables chip access for following subdevices: > > - regulators/LED drivers > > - battery-charger > > - gpios > > - 32.768kHz clk > > - RTC > > - watchdog > > > > Signed-off-by: Matti Vaittinen > > + * Mapping of main IRQ register bits to sub irq register offsets so > > "sub-IRQ" > > > + * that we can access corect sub IRQ registers based on bits that > > "sub IRQ" is also fine, but please standardise. > > I do prefer "sub-IRQ" though. I'll go with "sub-IRQ" then > > + > > +#define WD_CTRL_MAGIC1 0x55 > > +#define WD_CTRL_MAGIC2 0xAA > > +/** > > + * bd70528_wdt_set - arm or disarm watchdog timer > > + * > > + * @data: device data for the PMIC instance we want to operate on > > + * @enable: new state of WDT. zero to disable, non zero to enable > > + * @old_state: previous state of WDT will be filled here > > + * > > + * Arm or disarm WDT on BD70528 PMIC. Expected to be called only by > > + * BD70528 RTC and BD70528 WDT drivers. The rtc_timer_lock must be taken > > + * by calling bd70528_wdt_lock before calling bd70528_wdt_set. > > + */ > > +int bd70528_wdt_set(struct rohm_regmap_dev *data, int enable, int *old_state) > > Why doesn't this reside in the watchdog driver? If my memory serves me right we shortly discussed this already during v8 review ;) Cant blame you though as I have seen some of the mail traffic going through your inbox :D The motivation to have the functions exported from MFD is to not create sirect dependency between RTC and WDT. There may be cases where we want to leave either RTC or WDT out of compilation. MFD is always needed so the dependency from MFD to RTC/WDT does not harm. (Here's some discussion necromancy if you are interested in re-reading how we did end up with this implementation: https://lore.kernel.org/lkml/20190212091723.GZ20638@dell/) I hope you are still Ok with having the WDT control functions in MFD. Best Regards Matti Vaittinen -- Matti Vaittinen, Linux device drivers ROHM Semiconductors, Finland SWDC Kiviharjunlenkki 1E 90220 OULU FINLAND ~~~ "I don't think so," said Rene Descartes. Just then he vanished ~~~ From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1ACA3C10F06 for ; Wed, 3 Apr 2019 08:47:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E80642147A for ; Wed, 3 Apr 2019 08:47:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729302AbfDCIru (ORCPT ); Wed, 3 Apr 2019 04:47:50 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:41491 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726097AbfDCIro (ORCPT ); Wed, 3 Apr 2019 04:47:44 -0400 Received: by mail-lj1-f194.google.com with SMTP id k8so5701662lja.8; Wed, 03 Apr 2019 01:47:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=vV91FJckZyEnX1fNk46Z/ZVvwXEZdniEhNT6utM+pl0=; b=kRMqzFHUUnLQjLoRZRdDZhwky9eZIzgPjEkF8oyxJRmivKz8g0VTI9sQNmGzJdlJqu mclNwAKYO7QwSPI2f7aLn1WlnhsqjXo6BjVe8JyZcJfAIOvJ5UcTYQJfFWeU1TdcQs3w 6GhE4K57O/3ic4CCFdFxCYY+a8oSxOnaMhRTrujsDhTgkn9Yc57r+nfl/PhMvasnL5f1 YQA39a03iw0x00cJpbQ2Mo7eVjQExM+jhgYMHRUJNnKjKdYYriOv5VT7X4RZjFeF37l9 QzRrtkSostK/E2/Y/7/BUFjLqjkf0swVORevPKP8fmYW8IWdfiF3cJFV15iYXNrzXf9w Ig5g== X-Gm-Message-State: APjAAAU0rf61GsOBz7OIUc5MFSbq8LyZMcJi0dmX+ZRDb2jT4eP5ADBw CZpJfS89EmYjgwKLTcpCb+0P5Gne X-Google-Smtp-Source: APXvYqzNn4N2OOgSmDPgWNdJ7vxsAzE+uFA6SFl4HHatfJnRGC0mozlanur+QnPloC1sFw17e9ioMA== X-Received: by 2002:a2e:8347:: with SMTP id l7mr28852729ljh.17.1554281261464; Wed, 03 Apr 2019 01:47:41 -0700 (PDT) Received: from localhost.localdomain ([213.255.186.46]) by smtp.gmail.com with ESMTPSA id f25sm2344070lfk.69.2019.04.03.01.47.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Apr 2019 01:47:40 -0700 (PDT) Date: Wed, 3 Apr 2019 11:47:32 +0300 From: Matti Vaittinen To: Lee Jones Cc: mazziesaccount@gmail.com, Rob Herring , Mark Rutland , Michael Turquette , Stephen Boyd , Linus Walleij , Bartosz Golaszewski , Sebastian Reichel , Liam Girdwood , Mark Brown , Alessandro Zummo , Alexandre Belloni , Wim Van Sebroeck , Guenter Roeck , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-gpio@vger.kernel.org, linux-pm@vger.kernel.org, linux-rtc@vger.kernel.org, linux-watchdog@vger.kernel.org, heikki.haikola@fi.rohmeurope.com, mikko.mutanen@fi.rohmeurope.com Subject: Re: [PATCH v11 2/8] mfd: bd70528: Support ROHM bd70528 PMIC - core Message-ID: <20190403084732.GA3493@localhost.localdomain> References: <39efebe0396dd42de30d37c6f3c1ef2926c90210.1553515333.git.matti.vaittinen@fi.rohmeurope.com> <20190403073152.GM4187@dell> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190403073152.GM4187@dell> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Lee, Thanks for taking a look on this again =) I agree with most of the comments and correct them at next version. On Wed, Apr 03, 2019 at 08:31:52AM +0100, Lee Jones wrote: > On Mon, 25 Mar 2019, Matti Vaittinen wrote: > > > ROHM BD70528MWV is an ultra-low quiescent current general > > purpose single-chip power management IC for battery-powered > > portable devices. > > > > Add MFD core which enables chip access for following subdevices: > > - regulators/LED drivers > > - battery-charger > > - gpios > > - 32.768kHz clk > > - RTC > > - watchdog > > > > Signed-off-by: Matti Vaittinen > > + * Mapping of main IRQ register bits to sub irq register offsets so > > "sub-IRQ" > > > + * that we can access corect sub IRQ registers based on bits that > > "sub IRQ" is also fine, but please standardise. > > I do prefer "sub-IRQ" though. I'll go with "sub-IRQ" then > > + > > +#define WD_CTRL_MAGIC1 0x55 > > +#define WD_CTRL_MAGIC2 0xAA > > +/** > > + * bd70528_wdt_set - arm or disarm watchdog timer > > + * > > + * @data: device data for the PMIC instance we want to operate on > > + * @enable: new state of WDT. zero to disable, non zero to enable > > + * @old_state: previous state of WDT will be filled here > > + * > > + * Arm or disarm WDT on BD70528 PMIC. Expected to be called only by > > + * BD70528 RTC and BD70528 WDT drivers. The rtc_timer_lock must be taken > > + * by calling bd70528_wdt_lock before calling bd70528_wdt_set. > > + */ > > +int bd70528_wdt_set(struct rohm_regmap_dev *data, int enable, int *old_state) > > Why doesn't this reside in the watchdog driver? If my memory serves me right we shortly discussed this already during v8 review ;) Cant blame you though as I have seen some of the mail traffic going through your inbox :D The motivation to have the functions exported from MFD is to not create sirect dependency between RTC and WDT. There may be cases where we want to leave either RTC or WDT out of compilation. MFD is always needed so the dependency from MFD to RTC/WDT does not harm. (Here's some discussion necromancy if you are interested in re-reading how we did end up with this implementation: https://lore.kernel.org/lkml/20190212091723.GZ20638@dell/) I hope you are still Ok with having the WDT control functions in MFD. Best Regards Matti Vaittinen -- Matti Vaittinen, Linux device drivers ROHM Semiconductors, Finland SWDC Kiviharjunlenkki 1E 90220 OULU FINLAND ~~~ "I don't think so," said Rene Descartes. Just then he vanished ~~~