All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vinod Koul <vkoul@kernel.org>
To: Lucas Stach <l.stach@pengutronix.de>
Cc: Kishon Vijay Abraham I <kishon@kernel.org>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	NXP Linux Team <linux-imx@nxp.com>,
	linux-phy@lists.infradead.org, devicetree@vger.kernel.org,
	patchwork-lst@pengutronix.de, Inki Dae <inki.dae@samsung.com>,
	Seung-Woo Kim <sw0312.kim@samsung.com>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Sandor Yu <Sandor.yu@nxp.com>
Subject: Re: [PATCH v2 2/2] phy: freescale: add Samsung HDMI PHY
Date: Thu, 7 Sep 2023 14:27:33 -0700	[thread overview]
Message-ID: <ZPpARWs94i1fZzB0@matsya> (raw)
In-Reply-To: <a04d38095bb7d904f01b6ea60f1cb77971a9314f.camel@pengutronix.de>

On 05-09-23, 12:23, Lucas Stach wrote:

> > lots of magic numbers!
> 
> Yes. Those are mostly tuning values for the PLL and I don't know if
> there is any computational way to come up with those numbers, so we're
> just using the values validated in downstream.

ok

> 
> > 
> > > +};
> > > +
> > > +struct reg_settings {
> > > +	u8 reg;
> > > +	u8 val;
> > > +};
> > > +
> > > +const struct reg_settings common_phy_cfg[] = {
> > > +	{ PHY_REG_00, 0x00 }, { PHY_REG_01, 0xD1 },
> > > +	{ PHY_REG_08, 0x4f }, { PHY_REG_09, 0x30 },
> > > +	{ PHY_REG_10, 0x33 }, { PHY_REG_11, 0x65 },
> > > +	/* REG12 pixclk specific */
> > > +	/* REG13 pixclk specific */
> > > +	/* REG14 pixclk specific */
> > > +	{ PHY_REG_15, 0x80 }, { PHY_REG_16, 0x6C },
> > > +	{ PHY_REG_17, 0xF2 }, { PHY_REG_18, 0x67 },
> > > +	{ PHY_REG_19, 0x00 }, { PHY_REG_20, 0x10 },
> > > +	/* REG21 pixclk specific */
> > > +	{ PHY_REG_22, 0x30 }, { PHY_REG_23, 0x32 },
> > > +	{ PHY_REG_24, 0x60 }, { PHY_REG_25, 0x8F },
> > > +	{ PHY_REG_26, 0x00 }, { PHY_REG_27, 0x00 },
> > > +	{ PHY_REG_28, 0x08 }, { PHY_REG_29, 0x00 },
> > > +	{ PHY_REG_30, 0x00 }, { PHY_REG_31, 0x00 },
> > > +	{ PHY_REG_32, 0x00 }, { PHY_REG_33, 0x80 },
> > > +	{ PHY_REG_34, 0x00 }, { PHY_REG_35, 0x00 },
> > > +	{ PHY_REG_36, 0x00 }, { PHY_REG_37, 0x00 },
> > > +	{ PHY_REG_38, 0x00 }, { PHY_REG_39, 0x00 },
> > > +	{ PHY_REG_40, 0x00 }, { PHY_REG_41, 0xE0 },
> > > +	{ PHY_REG_42, 0x83 }, { PHY_REG_43, 0x0F },
> > > +	{ PHY_REG_44, 0x3E }, { PHY_REG_45, 0xF8 },
> > > +	{ PHY_REG_46, 0x00 }, { PHY_REG_47, 0x00 }
> > > +};
> > > +
> > > +struct fsl_samsung_hdmi_phy {
> > > +	struct device *dev;
> > > +	void __iomem *regs;
> > > +	struct clk *apbclk;
> > > +	struct clk *refclk;
> > > +
> > > +	/* clk provider */
> > > +	struct clk_hw hw;
> > > +	const struct phy_config *cur_cfg;
> > > +};
> > > +
> > > +static inline struct fsl_samsung_hdmi_phy *
> > > +to_fsl_samsung_hdmi_phy(struct clk_hw *hw)
> > > +{
> > > +	return container_of(hw, struct fsl_samsung_hdmi_phy, hw);
> > > +}
> > > +
> > > +static void
> > > +fsl_samsung_hdmi_phy_configure_pixclk(struct fsl_samsung_hdmi_phy *phy,
> > > +				      const struct phy_config *cfg)
> > > +{
> > > +	u8 div;
> > > +
> > > +	switch (cfg->pixclk) {
> > > +	case  22250000 ...  33750000:	div = 0xf; break;
> > > +	case  35000000 ...  40000000:	div = 0xb; break;
> > > +	case  43200000 ...  47500000:	div = 0x9; break;
> > > +	case  50349650 ...  63500000:	div = 0x7; break;
> > > +	case  67500000 ...  90000000:	div = 0x5; break;
> > > +	case  94000000 ... 148500000:	div = 0x3; break;
> > > +	case 154000000 ... 297000000:	div = 0x1; break;
> > 
> > lets do proper linux style please
> 
> Do you mean moving the statements to separate lines?

Yes pls. Also check with scripts/checkpatch.pl --strict

-- 
~Vinod

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

WARNING: multiple messages have this Message-ID (diff)
From: Vinod Koul <vkoul@kernel.org>
To: Lucas Stach <l.stach@pengutronix.de>
Cc: Kishon Vijay Abraham I <kishon@kernel.org>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	NXP Linux Team <linux-imx@nxp.com>,
	linux-phy@lists.infradead.org, devicetree@vger.kernel.org,
	patchwork-lst@pengutronix.de, Inki Dae <inki.dae@samsung.com>,
	Seung-Woo Kim <sw0312.kim@samsung.com>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Sandor Yu <Sandor.yu@nxp.com>
Subject: Re: [PATCH v2 2/2] phy: freescale: add Samsung HDMI PHY
Date: Thu, 7 Sep 2023 14:27:33 -0700	[thread overview]
Message-ID: <ZPpARWs94i1fZzB0@matsya> (raw)
In-Reply-To: <a04d38095bb7d904f01b6ea60f1cb77971a9314f.camel@pengutronix.de>

On 05-09-23, 12:23, Lucas Stach wrote:

> > lots of magic numbers!
> 
> Yes. Those are mostly tuning values for the PLL and I don't know if
> there is any computational way to come up with those numbers, so we're
> just using the values validated in downstream.

ok

> 
> > 
> > > +};
> > > +
> > > +struct reg_settings {
> > > +	u8 reg;
> > > +	u8 val;
> > > +};
> > > +
> > > +const struct reg_settings common_phy_cfg[] = {
> > > +	{ PHY_REG_00, 0x00 }, { PHY_REG_01, 0xD1 },
> > > +	{ PHY_REG_08, 0x4f }, { PHY_REG_09, 0x30 },
> > > +	{ PHY_REG_10, 0x33 }, { PHY_REG_11, 0x65 },
> > > +	/* REG12 pixclk specific */
> > > +	/* REG13 pixclk specific */
> > > +	/* REG14 pixclk specific */
> > > +	{ PHY_REG_15, 0x80 }, { PHY_REG_16, 0x6C },
> > > +	{ PHY_REG_17, 0xF2 }, { PHY_REG_18, 0x67 },
> > > +	{ PHY_REG_19, 0x00 }, { PHY_REG_20, 0x10 },
> > > +	/* REG21 pixclk specific */
> > > +	{ PHY_REG_22, 0x30 }, { PHY_REG_23, 0x32 },
> > > +	{ PHY_REG_24, 0x60 }, { PHY_REG_25, 0x8F },
> > > +	{ PHY_REG_26, 0x00 }, { PHY_REG_27, 0x00 },
> > > +	{ PHY_REG_28, 0x08 }, { PHY_REG_29, 0x00 },
> > > +	{ PHY_REG_30, 0x00 }, { PHY_REG_31, 0x00 },
> > > +	{ PHY_REG_32, 0x00 }, { PHY_REG_33, 0x80 },
> > > +	{ PHY_REG_34, 0x00 }, { PHY_REG_35, 0x00 },
> > > +	{ PHY_REG_36, 0x00 }, { PHY_REG_37, 0x00 },
> > > +	{ PHY_REG_38, 0x00 }, { PHY_REG_39, 0x00 },
> > > +	{ PHY_REG_40, 0x00 }, { PHY_REG_41, 0xE0 },
> > > +	{ PHY_REG_42, 0x83 }, { PHY_REG_43, 0x0F },
> > > +	{ PHY_REG_44, 0x3E }, { PHY_REG_45, 0xF8 },
> > > +	{ PHY_REG_46, 0x00 }, { PHY_REG_47, 0x00 }
> > > +};
> > > +
> > > +struct fsl_samsung_hdmi_phy {
> > > +	struct device *dev;
> > > +	void __iomem *regs;
> > > +	struct clk *apbclk;
> > > +	struct clk *refclk;
> > > +
> > > +	/* clk provider */
> > > +	struct clk_hw hw;
> > > +	const struct phy_config *cur_cfg;
> > > +};
> > > +
> > > +static inline struct fsl_samsung_hdmi_phy *
> > > +to_fsl_samsung_hdmi_phy(struct clk_hw *hw)
> > > +{
> > > +	return container_of(hw, struct fsl_samsung_hdmi_phy, hw);
> > > +}
> > > +
> > > +static void
> > > +fsl_samsung_hdmi_phy_configure_pixclk(struct fsl_samsung_hdmi_phy *phy,
> > > +				      const struct phy_config *cfg)
> > > +{
> > > +	u8 div;
> > > +
> > > +	switch (cfg->pixclk) {
> > > +	case  22250000 ...  33750000:	div = 0xf; break;
> > > +	case  35000000 ...  40000000:	div = 0xb; break;
> > > +	case  43200000 ...  47500000:	div = 0x9; break;
> > > +	case  50349650 ...  63500000:	div = 0x7; break;
> > > +	case  67500000 ...  90000000:	div = 0x5; break;
> > > +	case  94000000 ... 148500000:	div = 0x3; break;
> > > +	case 154000000 ... 297000000:	div = 0x1; break;
> > 
> > lets do proper linux style please
> 
> Do you mean moving the statements to separate lines?

Yes pls. Also check with scripts/checkpatch.pl --strict

-- 
~Vinod

  reply	other threads:[~2023-09-07 21:27 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-15 20:10 [PATCH v2 1/2] dt-bindings: phy: add binding for the i.MX8MP HDMI PHY Lucas Stach
2022-12-15 20:10 ` Lucas Stach
2022-12-15 20:11 ` [PATCH v2 2/2] phy: freescale: add Samsung " Lucas Stach
2022-12-15 20:11   ` Lucas Stach
2022-12-16  9:15   ` Marco Felsch
2022-12-16  9:15     ` Marco Felsch
2023-01-13 17:54   ` Vinod Koul
2023-01-13 17:54     ` Vinod Koul
2023-09-05 10:23     ` Lucas Stach
2023-09-05 10:23       ` Lucas Stach
2023-09-07 21:27       ` Vinod Koul [this message]
2023-09-07 21:27         ` Vinod Koul
2023-03-03 17:11   ` Luca Ceresoli
2023-03-03 17:11     ` Luca Ceresoli
2023-03-07 13:00   ` Richard Leitner
2023-03-07 13:00     ` Richard Leitner
2023-07-25  7:34   ` Frieder Schrempf
2023-07-25  7:34     ` Frieder Schrempf
  -- strict thread matches above, loose matches on Subject: below --
2024-01-06 22:19 [PATCH V2 1/2] dt-bindings: phy: add binding for the i.MX8MP " Adam Ford
2024-01-06 22:19 ` [PATCH V2 2/2] phy: freescale: add Samsung " Adam Ford
2024-01-06 22:19   ` Adam Ford
2024-01-06 22:19   ` Adam Ford
2024-01-06 22:19   ` Adam Ford
2024-01-08 15:03   ` Alexander Stein
2024-01-08 15:03     ` Alexander Stein
2024-01-08 15:03     ` Alexander Stein
2024-01-08 15:03     ` Alexander Stein
2024-01-27  2:56     ` Adam Ford
2024-01-27  2:56       ` Adam Ford
2024-01-27  2:56       ` Adam Ford
2024-01-27  2:56       ` Adam Ford
2024-01-30 17:00   ` Vinod Koul
2024-01-30 17:00     ` Vinod Koul
2024-01-30 17:00     ` Vinod Koul
2024-01-30 17:00     ` Vinod Koul
2024-01-31  2:44     ` Adam Ford
2024-01-31  2:44       ` Adam Ford
2024-01-31  2:44       ` Adam Ford
2024-01-31  2:44       ` Adam Ford
2024-02-02 11:20   ` Luca Ceresoli
2024-02-02 11:20     ` Luca Ceresoli
2024-02-02 11:20     ` Luca Ceresoli
2024-02-02 13:15     ` Adam Ford
2024-02-02 13:15       ` Adam Ford
2024-02-02 13:15       ` Adam Ford

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=ZPpARWs94i1fZzB0@matsya \
    --to=vkoul@kernel.org \
    --cc=Sandor.yu@nxp.com \
    --cc=devicetree@vger.kernel.org \
    --cc=inki.dae@samsung.com \
    --cc=kernel@pengutronix.de \
    --cc=kishon@kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=kyungmin.park@samsung.com \
    --cc=l.stach@pengutronix.de \
    --cc=linux-imx@nxp.com \
    --cc=linux-phy@lists.infradead.org \
    --cc=patchwork-lst@pengutronix.de \
    --cc=robh+dt@kernel.org \
    --cc=sw0312.kim@samsung.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.