public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Chen <peter.chen@kernel.org>
To: Xu Yang <xu.yang_2@nxp.com>
Cc: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org,
	gregkh@linuxfoundation.org, conor+dt@kernel.org,
	shawnguo@kernel.org, s.hauer@pengutronix.de, linux-imx@nxp.com,
	peng.fan@nxp.com, linux-usb@vger.kernel.org,
	devicetree@vger.kernel.org, jun.li@nxp.com
Subject: Re: [PATCH v2 3/3] usb: chipidea: imx: add one fsl picophy parameter tuning implementation
Date: Mon, 10 Jul 2023 11:12:54 +0800	[thread overview]
Message-ID: <20230710031254.GB2418446@nchen-desktop> (raw)
In-Reply-To: <20230627112126.1882666-3-xu.yang_2@nxp.com>

On 23-06-27 19:21:26, Xu Yang wrote:
> In some cases, the user may need to tune the rise/fall time of the
> high-speed transmitter waveform for USB Certification. This will add
> a parameter for this purpose. The value will be fetched from dtb and
> finally written to the register.
> 
> Signed-off-by: Xu Yang <xu.yang_2@nxp.com>

Acked-by: Peter Chen <peter.chen@kernel.org>

Peter
> 
> ---
> Changes in v2:
>  - rename parameter name
> ---
>  drivers/usb/chipidea/ci_hdrc_imx.c | 3 +++
>  drivers/usb/chipidea/ci_hdrc_imx.h | 1 +
>  drivers/usb/chipidea/usbmisc_imx.c | 9 +++++++++
>  3 files changed, 13 insertions(+)
> 
> diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c
> index 873539f9a2c0..159509c5fe58 100644
> --- a/drivers/usb/chipidea/ci_hdrc_imx.c
> +++ b/drivers/usb/chipidea/ci_hdrc_imx.c
> @@ -181,6 +181,9 @@ static struct imx_usbmisc_data *usbmisc_get_init_data(struct device *dev)
>  	if (of_property_read_u32(np, "samsung,picophy-dc-vol-level-adjust",
>  			&data->dc_vol_level_adjust))
>  		data->dc_vol_level_adjust = -1;
> +	if (of_property_read_u32(np, "fsl,picophy-rise-fall-time-adjust",
> +			&data->rise_fall_time_adjust))
> +		data->rise_fall_time_adjust = -1;
>  
>  	return data;
>  }
> diff --git a/drivers/usb/chipidea/ci_hdrc_imx.h b/drivers/usb/chipidea/ci_hdrc_imx.h
> index 7135b9a5d913..88b8da79d518 100644
> --- a/drivers/usb/chipidea/ci_hdrc_imx.h
> +++ b/drivers/usb/chipidea/ci_hdrc_imx.h
> @@ -28,6 +28,7 @@ struct imx_usbmisc_data {
>  	enum usb_dr_mode available_role; /* runtime usb dr mode */
>  	int emp_curr_control;
>  	int dc_vol_level_adjust;
> +	int rise_fall_time_adjust;
>  };
>  
>  int imx_usbmisc_init(struct imx_usbmisc_data *data);
> diff --git a/drivers/usb/chipidea/usbmisc_imx.c b/drivers/usb/chipidea/usbmisc_imx.c
> index 1c7932f22218..56570100ffb8 100644
> --- a/drivers/usb/chipidea/usbmisc_imx.c
> +++ b/drivers/usb/chipidea/usbmisc_imx.c
> @@ -130,6 +130,8 @@
>  #define MX7D_USB_OTG_PHY_CFG1		0x30
>  #define TXPREEMPAMPTUNE0_BIT		28
>  #define TXPREEMPAMPTUNE0_MASK		(3 << 28)
> +#define TXRISETUNE0_BIT			24
> +#define TXRISETUNE0_MASK		(3 << 24)
>  #define TXVREFTUNE0_BIT			20
>  #define TXVREFTUNE0_MASK		(0xf << 20)
>  
> @@ -673,6 +675,13 @@ static int usbmisc_imx7d_init(struct imx_usbmisc_data *data)
>  			reg |= (data->dc_vol_level_adjust << TXVREFTUNE0_BIT);
>  		}
>  
> +		if (data->rise_fall_time_adjust >= 0 &&
> +			data->rise_fall_time_adjust <=
> +			(TXRISETUNE0_MASK >> TXRISETUNE0_BIT)) {
> +			reg &= ~TXRISETUNE0_MASK;
> +			reg |= (data->rise_fall_time_adjust << TXRISETUNE0_BIT);
> +		}
> +
>  		writel(reg, usbmisc->base + MX7D_USB_OTG_PHY_CFG1);
>  	}
>  
> -- 
> 2.34.1
> 

-- 

Thanks,
Peter Chen

  reply	other threads:[~2023-07-10  3:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-27 11:21 [PATCH v2 1/3] usb: chipidea: imx: improve logic if samsung,picophy-* parameter is 0 Xu Yang
2023-06-27 11:21 ` [PATCH v2 2/3] dt-bindings: usb: ci-hdrc-usb2: add fsl,picophy-rise-fall-time-adjust property Xu Yang
2023-06-27 13:49   ` Krzysztof Kozlowski
2023-07-10  3:13   ` Peter Chen
2023-06-27 11:21 ` [PATCH v2 3/3] usb: chipidea: imx: add one fsl picophy parameter tuning implementation Xu Yang
2023-07-10  3:12   ` Peter Chen [this message]
2023-07-10  3:03 ` [PATCH v2 1/3] usb: chipidea: imx: improve logic if samsung,picophy-* parameter is 0 Peter Chen

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=20230710031254.GB2418446@nchen-desktop \
    --to=peter.chen@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jun.li@nxp.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=peng.fan@nxp.com \
    --cc=robh+dt@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=xu.yang_2@nxp.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox