Received: by 10.213.65.68 with SMTP id h4csp231449imn; Wed, 28 Mar 2018 02:30:16 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+eLM9gMSYn4NSrMpegQLqh4gJ6FE9WaeTCEPxFwCetPQgpIaMubMn3noA/cPCE0cp7bc4b X-Received: by 10.99.100.196 with SMTP id y187mr1982794pgb.83.1522229416120; Wed, 28 Mar 2018 02:30:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522229416; cv=none; d=google.com; s=arc-20160816; b=jG+gzYQTDV5bEhwEtI2QXIFZPIw5P0/6rlRHVcEMUp2xJTh/nz1bSUB2LzFDEgayV/ SMIL/skBRxe7Hprrz6ico0RX+Y2CB1ovWZmrNumqvmJPzlMr7cUy/x+41hmC7H2Du2bA Y8Qlft32qoAy1oUzgau6BwETZT0nk4Fnja2Gj0gu1Is0PjUZnWxW3v3i3KhG84Y4Rr9J ZoT22YGkN3BTB7pUcyfGxG1rz3oEGoy6nKgJn6GoL4p7EoZQ0xvaoSKdVQMfUfgR80yH JGjE42kgBEYNO1joA3x3TAEfoKu3ULkMy5jnhdqfwBEIkDzA7qYU4HG7Mu8Xi2ZMq7zj Fs6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=30qKT+gw4BzRGVERUHuc/6tH3mg92o/hhDvTlmc2lOw=; b=U1i8nIPrt2p4wvdeDZqAuaSsdEokWB6obBdvlS0M7On2fXuRIVmG28fjkEuUh8pcmw C7EGD3EXqatVdlENZb4wPaiSZalFy69hYHxaK77fABmW2JPSKiVsnhEUqW05dGU921mC ZrSbytb1NhP1MpfTjtEzx8xbuG0PH1LtQ36I8VxWoyU0RdKjUzcCeLJi7p/h5rf7rAkj b17DuFQp6qocIdts3TEL0XXKE8NkExyjbt1v0b2xFdlqLyVyfgKTUFwVyIwugt6XUniA uccw/aXyA430ZQNWo/UPitVvANqvUyce6axVqbrTyknQ/ldC49678eWHaCTKwMOqedpf KaDw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o187si2213172pga.528.2018.03.28.02.30.01; Wed, 28 Mar 2018 02:30:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752502AbeC1JTr (ORCPT + 99 others); Wed, 28 Mar 2018 05:19:47 -0400 Received: from mail.bootlin.com ([62.4.15.54]:51563 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751840AbeC1JTo (ORCPT ); Wed, 28 Mar 2018 05:19:44 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 70F532071B; Wed, 28 Mar 2018 11:19:41 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (unknown [37.169.5.27]) by mail.bootlin.com (Postfix) with ESMTPSA id 0357020384; Wed, 28 Mar 2018 11:19:40 +0200 (CEST) Date: Wed, 28 Mar 2018 11:19:41 +0200 From: Alexandre Belloni To: Sean Wang Cc: robh+dt@kernel.org, mark.rutland@arm.com, sre@kernel.org, lee.jones@linaro.org, a.zummo@towertech.it, eddie.huang@mediatek.com, devicetree@vger.kernel.org, linux-rtc@vger.kernel.org, linux-pm@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1 02/16] dt-bindings: rtc: mediatek: add bindings for PMIC RTC Message-ID: <20180328091941.GB13942@piout.net> References: <5846e8be319c4836808c8127d5bb51b7e999e896.1521794177.git.sean.wang@mediatek.com> <20180323094118.GC3417@piout.net> <20180323101505.GF3417@piout.net> <1521920188.31197.13.camel@mtkswgap22> <20180327151848.GD22441@piout.net> <1522209197.18424.26.camel@mtkswgap22> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1522209197.18424.26.camel@mtkswgap22> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 28/03/2018 at 11:53:17 +0800, Sean Wang wrote: > On Tue, 2018-03-27 at 17:18 +0200, Alexandre Belloni wrote: > > On 25/03/2018 at 03:36:28 +0800, Sean Wang wrote: > > > just reply both replies in the same mail > > > > > > 1.) the power-off device is a part of rtc, use the same registers rtc > > > has and thus it is put as child nodes under the node rtc to reflect the > > > reality of characteristics the rtc has. > > > > > > Or am I wrong for a certain aspect in these opinions? > > > > > > > My point is that it is also part of the PMIC so it may as well be > > registers from the mfd driver which already registers a bunch of devices > > instead of doing unusual stuff from the rtc driver. > > > > mt6397_rtc->regmap is mt6397_chip->regmap anyway. You have the added > > benefit that if the RTC driver probe fails for some reason, you may > > still be able to probe the reset driver. > > > > I don't tink there is any benefit having it as a child of the rtc > > device. > > > > > really thanks! it's an optional solution I thought it 's fine and worth > doing > > but so far I cannot fully make sure of whether mfd can accept two > devices holding overlay IORESOURCE_MEM. > There is no overlay because you are using a regmap which handles concurrency for you. What your patch is doing is: struct mt6397_rtc *rtc = dev_get_drvdata(pdev->dev.parent); then you use rtc->regmap But in the rtc driver, you have: struct mt6397_chip *mt6397_chip = dev_get_drvdata(pdev->dev.parent); struct mt6397_rtc *rtc; rtc->regmap = mt6397_chip->regmap; So there is no benefit from being the child of the rtc, you could just do the following in your reset driver: struct mt6397_chip *mt6397_chip = dev_get_drvdata(pdev->dev.parent); and then use mt6397_chip->regmap. -- Alexandre Belloni, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com