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.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, USER_AGENT_SANE_1 autolearn=unavailable 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 A11EDC3F2D0 for ; Tue, 10 Mar 2020 09:50:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8604124683 for ; Tue, 10 Mar 2020 09:50:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726265AbgCJJun (ORCPT ); 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: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@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