linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Lorenzo Bianconi <lorenzo@kernel.org>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Cc: linux-clk@vger.kernel.org, mturquette@baylibre.com,
	sboyd@kernel.org, linux-arm-kernel@lists.infradead.org,
	robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org,
	conor+dt@kernel.org, nbd@nbd.name, john@phrozen.org,
	devicetree@vger.kernel.org, dd@embedd.com,
	catalin.marinas@arm.com, will@kernel.org, upstream@airoha.com,
	lorenzo.bianconi83@gmail.com,
	angelogioacchino.delregno@collabora.com
Subject: Re: [PATCH 4/4] clk: en7523: add EN7581 support
Date: Thu, 4 Apr 2024 09:55:28 +0200	[thread overview]
Message-ID: <Zg5c8Pg0XKJx9TP5@lore-desk> (raw)
In-Reply-To: <95d194ed-86fe-45df-88f1-ae460eb36eaf@linaro.org>


[-- Attachment #1.1: Type: text/plain, Size: 1781 bytes --]

> On 03/04/2024 18:20, Lorenzo Bianconi wrote:
> > Introduce EN7581 clock support to clk-en7523 driver.
> > 
> > Tested-by: Zhengping Zhang <zhengping.zhang@airoha.com>
> > Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> 
> 
> > +	return 0;
> > +}
> > +
> >  static int en7523_clk_probe(struct platform_device *pdev)
> >  {
> >  	struct device_node *node = pdev->dev.of_node;
> > @@ -306,6 +413,12 @@ static int en7523_clk_probe(struct platform_device *pdev)
> >  	if (IS_ERR(np_base))
> >  		return PTR_ERR(np_base);
> >  
> > +	if (of_device_is_compatible(node, "airoha,en7581-scu")) {
> 
> Having matching and compatible comparisons inside various code is
> discouraged. Does not scale. Use driver/match data to store some sort of
> flags and check for the flag or some other parameter. The best if
> compatible appears once and only once: in of_device_id.

ack, I will fix it.

Regards,
Lorenzo

> 
> > +		r = en7581_clk_hw_init(pdev, base, np_base);
> > +		if (r)
> > +			return r;
> > +	}
> > +
> >  	clk_data = devm_kzalloc(&pdev->dev,
> >  				struct_size(clk_data, hws, EN7523_NUM_CLOCKS),
> >  				GFP_KERNEL);
> > @@ -329,8 +442,15 @@ static const struct clk_ops en7523_pcie_ops = {
> >  	.unprepare = en7523_pci_unprepare,
> >  };
> >  
> > +static const struct clk_ops en7581_pcie_ops = {
> > +	.is_enabled = en7581_pci_is_enabled,
> > +	.prepare = en7581_pci_prepare,
> > +	.unprepare = en7581_pci_unprepare,
> > +};
> > +
> >  static const struct of_device_id of_match_clk_en7523[] = {
> >  	{ .compatible = "airoha,en7523-scu", .data = &en7523_pcie_ops },
> > +	{ .compatible = "airoha,en7581-scu", .data = &en7581_pcie_ops },
> >  	{ /* sentinel */ }
> >  };
> >  
> 
> Best regards,
> Krzysztof
> 

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2024-04-04  7:55 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-03 16:20 [PATCH 0/4] Introduce clock support for Airoha EN7581 SoC Lorenzo Bianconi
2024-04-03 16:20 ` [PATCH 1/4] dt-bindings: clock: airoha: add EN7581 binding Lorenzo Bianconi
2024-04-04  6:34   ` Krzysztof Kozlowski
2024-04-04  8:43     ` Lorenzo Bianconi
2024-04-03 16:20 ` [PATCH 2/4] arm64: dts: airoha: Add EN7581 clock node Lorenzo Bianconi
2024-04-04  8:47   ` AngeloGioacchino Del Regno
2024-04-04  8:57     ` Lorenzo Bianconi
2024-04-04  9:12       ` AngeloGioacchino Del Regno
2024-04-04  9:20         ` Lorenzo Bianconi
2024-04-03 16:20 ` [PATCH 3/4] clk: en7523: make pcie clk_ops accessible through of_device_id struct Lorenzo Bianconi
2024-04-03 16:20 ` [PATCH 4/4] clk: en7523: add EN7581 support Lorenzo Bianconi
2024-04-04  6:36   ` Krzysztof Kozlowski
2024-04-04  7:55     ` Lorenzo Bianconi [this message]
2024-04-04  9:09   ` AngeloGioacchino Del Regno
2024-04-05  8:17     ` Lorenzo Bianconi

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=Zg5c8Pg0XKJx9TP5@lore-desk \
    --to=lorenzo@kernel.org \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=catalin.marinas@arm.com \
    --cc=conor+dt@kernel.org \
    --cc=dd@embedd.com \
    --cc=devicetree@vger.kernel.org \
    --cc=john@phrozen.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=lorenzo.bianconi83@gmail.com \
    --cc=mturquette@baylibre.com \
    --cc=nbd@nbd.name \
    --cc=robh+dt@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=upstream@airoha.com \
    --cc=will@kernel.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;
as well as URLs for NNTP newsgroup(s).