Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp499132ybh; Tue, 10 Mar 2020 02:51:56 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtQc0VBqU78MVDLx7qudZqZAotd14tmO+UE/uxQSUl/43b/gvGOzkvevvNUf0qPN7+DkImm X-Received: by 2002:a9d:19c8:: with SMTP id k66mr4346000otk.43.1583833916160; Tue, 10 Mar 2020 02:51:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583833916; cv=none; d=google.com; s=arc-20160816; b=z8RrGPwj8Nx48dJhgQORzGOLRWek9Tk1s/mPZUIeCOxT77/0723zlsfLPNLRQ8RTn+ MfjVY/6O3hajTniOsEd12RCxE4rvFWTV30GF/oKo3D3q1y3cNLYevSFDa/q7HeolMxpd gqgTuCJzmKTFOSTAYilNlNC/k49NtJv/bbfmhWxm3/FYk2TLTnS2eLMSVnFm7U/B2+0H Zat9dGtIYxjwOCESn1eNM4IZlv5+uD9jMMC7XsoxBZjQPYSe/RUYdrgiXpDuWa8IAQ1o OIynL63Xr2Ug9RWoF4ANSml2JHsm2+ZMObV/M8KJsxm2tLUGg9RC5+Dl63VsSNguAGDW QTkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=SGxwkuxIlBtmxpXNH7oNC9qCZwSKXVmCXIQGg9wbuWE=; b=rz1zeb9YAXK/AN72CgehjSPMZ5lJLTGnpsSbXBYSGE+Bw8UAJGqjO2CR6utMHl1XjV Rpfplno6nPFtdgPhpYoE1xaOUm5cTLCIoF9SJIV0Ng5uNmacLeFOSjuAJuQU0n3MUepB qsNj+8GG7YQoY1QPLxVvWD268COso3DhmtmTTsUNvh58k3MuED85A2VQL8/mDb1G1xKD tHA/x4cdTsDwhCT9P4Jpbe6rQofck/QHCfVoaTgKd+YwK54asKTr1bIIcax7ibgaS2U9 wk8l64Mr/XVDI0cAi9gFXNCx073mzSnv7rfOkMNRUcUG6hvifKWsr3VMXbnPjy9RcAJA 1IWw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y82si3486625oia.35.2020.03.10.02.51.44; Tue, 10 Mar 2020 02:51:56 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726446AbgCJJun (ORCPT + 99 others); Tue, 10 Mar 2020 05:50:43 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:44342 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726211AbgCJJun (ORCPT ); Tue, 10 Mar 2020 05:50:43 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: eballetbo) with ESMTPSA id 54EA929595C Subject: Re: [PATCH v11 3/5] soc: mediatek: Move mt8173 MMSYS to platform driver To: Matthias Brugger , Stephen Boyd , Enric Balletbo Serra Cc: David Airlie , CK HU , Laurent Pinchart , Mark Rutland , Michael Turquette , Philipp Zabel , Rob Herring , ulrich.hecht+renesas@gmail.com, Kate Stewart , Andrew-CT Chen , Minghsiu Tsai , dri-devel , Richard Fontana , Collabora Kernel ML , linux-clk@vger.kernel.org, Weiyi Lu , Chen-Yu Tsai , Linux ARM , mtk01761 , linux-media@vger.kernel.org, "devicetree@vger.kernel.org" , frank-w@public-files.de, Seiya Wang , sean.wang@mediatek.com, Houlong Wei <"houlong.w ei"@mediatek.com>, ARM/Mediatek SoC support , Hsin-Yi Wang , Matthias Brugger , Thomas Gleixner , Mauro Carvalho Chehab , Allison Randal , Greg Kroah-Hartman , Randy Dunlap , linux-kernel , fwll.ch@freedesktop.org, matthias.bgg@kernel.org References: <20200302110128.2664251-1-enric.balletbo@collabora.com> <20200302110128.2664251-4-enric.balletbo@collabora.com> <158344207340.7173.8369925839829696256@swboyd.mtv.corp.google.com> <8bfc4350-6e92-e657-18f2-3624a2558521@collabora.com> <158353062701.66766.10488072352849985568@swboyd.mtv.corp.google.com> <158379424337.149997.7454036134629466675@swboyd.mtv.corp.google.com> <21b43196-230c-5000-546e-b90d4b6b44a3@suse.com> From: Enric Balletbo i Serra Message-ID: <1c726a44-dd8a-d69e-0563-dfbbc455317e@collabora.com> Date: Tue, 10 Mar 2020 10:50:34 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <21b43196-230c-5000-546e-b90d4b6b44a3@suse.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi all, On 10/3/20 10:40, Matthias Brugger wrote: > > > On 09/03/2020 23:50, Stephen Boyd wrote: >> Quoting Enric Balletbo Serra (2020-03-06 14:09:50) >>> Missatge de Stephen Boyd del dia dv., 6 de mar >>> 2020 a les 22:37: >>>> >>>> Quoting Enric Balletbo i Serra (2020-03-06 08:30:16) >>>>> On 5/3/20 22:01, Stephen Boyd wrote: >>>>>> Quoting Enric Balletbo i Serra (2020-03-02 03:01:26) >>>>>>> diff --git a/drivers/soc/mediatek/mtk-mmsys.c b/drivers/soc/mediatek/mtk-mmsys.c >>>>>>> new file mode 100644 >>>>>>> index 000000000000..473cdf732fb5 >>>>>>> --- /dev/null >>>>>>> +++ b/drivers/soc/mediatek/mtk-mmsys.c >>>>>>> @@ -0,0 +1,154 @@ >>>>>>> +// SPDX-License-Identifier: GPL-2.0-only >>>>>>> +/* >>>>>>> + * Copyright (c) 2014 MediaTek Inc. >>>>>>> + * Author: James Liao >>>>>>> + */ >>>>>>> + >>>>>>> +#include >>>>>>> +#include >>>>>>> +#include >>>>>>> + >>>>>>> +#include "../../clk/mediatek/clk-gate.h" >>>>>>> +#include "../../clk/mediatek/clk-mtk.h" >>>>>> >>>>>> Why not use include/linux/clk/? >>>>>> >>>>> >>>>> I can move these files to include, this will impact a lot more of drivers but, >>>>> yes, I think is the right way. >>>>> >>>>>> But I also don't understand why the clk driver is moved outside of >>>>>> drivers/clk/ into drivers/soc/. Commit text saying that it has shared >>>>>> registers doesn't mean it can't still keep the clk driver part in the >>>>>> drivers/clk/ area. >>>>>> >>>>> >>>>> Actually moving this to the soc directory has been requested by CK (mediatek) as >>>>> a change in v8. You can see the discussion in [1] >>>>> >>>> >>>> I can reply there in that thread if necessary, but we shouldn't need to >>>> force simple-mfd into DT bindings to support this. Match the compatible >>>> string in drivers/soc/ and register devices in software for the >>>> different pieces of this overall hardware block. If necessary, pass down >>>> the ioremapped addresss down through device data to each logical driver >>>> in the respective subsystem. >>>> >>>> So yes, it looks like an MFD, but that doesn't mean we have to change >>>> the DT binding or put it in drivers/mfd to support that. And we don't >>>> have to fix any problems with allowing two drivers to probe the same >>>> compatible string. >>>> >>> >>> That thread maybe has too much information and things evolved since >>> then. Note that the final solution is not an MFD neither we change the >>> bindings. I pointed to that thread just because CK (CK please correct >>> me if I'm wrong) thought that the driver is not a pure clock driver >>> and he preferred to move to drivers/soc/mediatek (in that thread, he >>> exposes his opinion on that). Sorry to introduce more confusion. >>> >>> You seem to be fine with the approach (just minor changes), so it >>> looks to me that the only problem is if this should be in drivers/clk >>> or drivers/soc. Honestly, this is not something I can't decide and >>> I'll let you (the soc and clk maintainers) decide. I don't really have >>> a strong opinion here. I don't mind move again to drivers/clk if that >>> is what we want but let's come to an agreement. >>> >> >> It's already in drivers/clk, so leave the clk part there and register >> the clk device and any other devices by matching the compatible in >> drivers/soc. That is my preferred solution. Can that be done? >> > > I think we can once again create a platform device in drivers/soc which matches > the drivers/clk and then do the routing in drivers/soc. Enric any thoughts? > Yes, working already on a new version. Thanks, Enric