mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Enric Balletbo i Serra <enric.balletbo@collabora.com>
To: CK Hu <ck.hu@mediatek.com>
Cc: mark.rutland@arm.com, Kate Stewart <kstewart@linuxfoundation.org>,
	Minghsiu Tsai <minghsiu.tsai@mediatek.com>,
	Andrew-CT Chen <andrew-ct.chen@mediatek.com>,
	airlied@linux.ie, mturquette@baylibre.com,
	dri-devel@lists.freedesktop.org,
	Richard Fontana <rfontana@redhat.com>,
	laurent.pinchart@ideasonboard.com,
	ulrich.hecht+renesas@gmail.com,
	Collabora Kernel ML <kernel@collabora.com>,
	linux-clk@vger.kernel.org,
	Nicolas Boichat <drinkcat@chromium.org>,
	Weiyi Lu <weiyi.lu@mediatek.com>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	wens@csie.org, Allison Randal <allison@lohutok.net>,
	mtk01761 <wendell.lin@mediatek.com>,
	Owen Chen <owen.chen@mediatek.com>,
	linux-media@vger.kernel.org, devicetree@vger.kernel.org,
	p.zabel@pengutronix.de, frank-w@public-files.de,
	Seiya Wang <seiya.wang@mediatek.com>,
	sean.wang@mediatek.com, Houlong Wei <houlong.wei@mediatek.com>,
	robh+dt@kernel.org, linux-mediatek@lists.infradead.org,
	hsinyi@chromium.org, Matthias Brugger <"matthias. bgg"@gmail.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	linux-arm-kernel@lists.infradead.org,
	Matthias Brugger <mbrugger@suse.com>,
	Fabien Parent <fparent@baylibre.com>,
	sboyd@kernel.org, Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	rdunlap@infradead.org, linux-kernel@vger.kernel.org,
	Daniel Vetter <daniel@ffwll.ch>,
	matthias.bgg@kernel.org
Subject: Re: [PATCH v8 0/6] arm/arm64: mediatek: Fix mmsys device probing
Date: Wed, 26 Feb 2020 10:24:04 +0100	[thread overview]
Message-ID: <6355f1fd-b929-730e-e0f6-96dd5100e3f9@collabora.com> (raw)
In-Reply-To: <1582695176.8324.4.camel@mtksdaap41>

Hi CK,

On 26/2/20 6:32, CK Hu wrote:

[snip]

>>
>> How do you see move mmsys to drivers/soc/mediatek and instantiate the clk and
>> mediatek-drm driver
>>
>>  mmsys: syscon@14000000 {
>>  	compatible = "mediatek,mt8173-mmsys", "syscon", "simple-mfd";
>>  	reg = <0 0x14000000 0 0x1000>;
>>  	power-domains = <&scpsys MT8173_POWER_DOMAIN_MM>;
>>
>> 	clock-controller {
>> 		compatible = "mediatek,clk-mt8173-mm"
>> 		assigned-clocks = <&topckgen CLK_TOP_MM_SEL>;
>> 	 	assigned-clock-rates = <400000000>;
>>  		#clock-cells = <1>;
>> 	};
>>
>> 	display-subsystem {
>> 		compatible = "mediatek,display-subsystem";
>> 	};
>>  };
>>
> 
> Let's start with the simple definition.
> 
> mmsys: syscon at 14000000 {
> 	compatible = "mediatek,mt8173-mmsys", "syscon";
> 	reg = <0 0x14000000 0 0x1000>;
> 	power-domains = <&scpsys MT8173_POWER_DOMAIN_MM>;
> 	assigned-clocks = <&topckgen CLK_TOP_MM_SEL>;
> 	assigned-clock-rates = <400000000>;
> 	#clock-cells = <1>;
> };
> 
> When we break clock control to a sub device of mmsys, the reason is that
> 'Linux' generally categorize clock controller to a device. When we break
> display control to a sub device of mmsys, the reason is that 'Linux'
> generally categorize display controller to a device. All these seems
> software-oriented reason, so I think we do not break any sub device and
> keep mmsys simple.
> 
> When I search of_clk_add_provider(), I find that not all clock provider
> code is in drivers/clk. Maybe when a clock controller is not an
> independent device, the driver code of clock controller could be placed
> within the device driver it belonged to. We could place mmsys driver in
> drivers/soc/mediatek/, and it control the clock, routing, fake engine,
> memory delay,.... I would like drm driver to be placed in
> drivers/gpu/drm/ because display function block, such as OVL, does not
> belong to mmsys device. And finally let mmsys driver to probe
> mediatek-drm driver.
> 

You can apply the same reasoning in the clk subsystem, not all the drivers in
drivers/clk are pure clock controllers, some of them are already
system-controller or "simple-mfd" and some of them even instantiate other
subdrivers via the platform register API.

Note that moving clk-<chip>-mm drivers to drivers/soc/mediatek will imply move a
lot of code, I'll focus only on mt8173 for now because is the only platform I
can really test. Let me prepare a v9 and lets see how looks like.

Thanks,
 Enric

> Regards,
> CK

[snip]

  reply	other threads:[~2020-02-26  9:24 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-20 17:21 Enric Balletbo i Serra
2020-02-20 17:21 ` [PATCH v8 1/6] drm/mediatek: Use regmap for register access Enric Balletbo i Serra
2020-02-20 23:48   ` Randy Dunlap
2020-02-21  7:46     ` Enric Balletbo i Serra
2020-02-20 17:21 ` [PATCH v8 2/6] drm/mediatek: Omit warning on probe defers Enric Balletbo i Serra
2020-02-20 17:21 ` [PATCH v8 3/6] media: mtk-mdp: Check return value of of_clk_get Enric Balletbo i Serra
2020-02-20 17:21 ` [PATCH v8 4/6] clk: mediatek: mt8173: Switch MMSYS to platform driver Enric Balletbo i Serra
2020-02-20 17:21 ` [PATCH v8 5/6] drm/mediatek: Move MMSYS configuration to include/linux/platform_data Enric Balletbo i Serra
2020-02-20 17:21 ` [PATCH v8 6/6] clk/drm: mediatek: Fix mediatek-drm device probing Enric Balletbo i Serra
2020-02-21  5:18   ` CK Hu
2020-02-21  7:51     ` Enric Balletbo i Serra
2020-02-21  4:39 ` [PATCH v8 0/6] arm/arm64: mediatek: Fix mmsys " CK Hu
2020-02-21  8:56   ` Enric Balletbo i Serra
2020-02-21  9:27     ` CK Hu
2020-02-21 10:24       ` Matthias Brugger
2020-02-21 11:11         ` CK Hu
2020-02-21 11:37           ` Enric Balletbo i Serra
2020-02-21 11:53             ` Matthias Brugger
2020-02-21 17:10               ` Enric Balletbo i Serra
2020-02-24  5:52                 ` CK Hu
2020-02-25 10:56                   ` Enric Balletbo i Serra
2020-02-26  5:32                     ` CK Hu
2020-02-26  9:24                       ` Enric Balletbo i Serra [this message]
2020-02-21 10:20   ` Matthias Brugger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6355f1fd-b929-730e-e0f6-96dd5100e3f9@collabora.com \
    --to=enric.balletbo@collabora.com \
    --cc="matthias. bgg"@gmail.com \
    --cc=airlied@linux.ie \
    --cc=allison@lohutok.net \
    --cc=andrew-ct.chen@mediatek.com \
    --cc=ck.hu@mediatek.com \
    --cc=daniel@ffwll.ch \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=drinkcat@chromium.org \
    --cc=fparent@baylibre.com \
    --cc=frank-w@public-files.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=houlong.wei@mediatek.com \
    --cc=hsinyi@chromium.org \
    --cc=kernel@collabora.com \
    --cc=krzk@kernel.org \
    --cc=kstewart@linuxfoundation.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=mark.rutland@arm.com \
    --cc=matthias.bgg@kernel.org \
    --cc=mbrugger@suse.com \
    --cc=mchehab@kernel.org \
    --cc=minghsiu.tsai@mediatek.com \
    --cc=mturquette@baylibre.com \
    --cc=owen.chen@mediatek.com \
    --cc=p.zabel@pengutronix.de \
    --cc=rdunlap@infradead.org \
    --cc=rfontana@redhat.com \
    --cc=robh+dt@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=sean.wang@mediatek.com \
    --cc=seiya.wang@mediatek.com \
    --cc=tglx@linutronix.de \
    --cc=ulrich.hecht+renesas@gmail.com \
    --cc=weiyi.lu@mediatek.com \
    --cc=wendell.lin@mediatek.com \
    --cc=wens@csie.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome