lkml.org 
[lkml]   [2020]   [Jan]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [PATCH 03/19] phy: qualcomm: Add Synopsys Hi-Speed USB PHY driver
From
Date
Hi Bryan,

On Wed, 2020-01-15 at 14:13 +0000, Bryan O'Donoghue wrote:
> From: Shawn Guo <shawn.guo@linaro.org>
>
> Adds Qualcomm QCS404 Hi-Speed USB PHY driver support. This PHY is usually
> is usually paired with Synopsys DWC3 USB controllers on Qualcomm SoCs.
>
> [bod: Updated qcom_snps_hsphy_set_mode to match new method signature
> Added disjunct on mode > 0
> Removed regulator_set_voltage() in favour of setting floor in dts
> Removed 'snps' and '28nm' from driver name]
>
> Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
> Cc: Andy Gross <agross@kernel.org>
> Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
> Cc: Kishon Vijay Abraham I <kishon@ti.com>
> Cc: Philipp Zabel <p.zabel@pengutronix.de>
> Cc: Jorge Ramirez-Ortiz <jorge.ramirez.ortiz@gmail.com>
> Cc: linux-arm-msm@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
> ---
> drivers/phy/qualcomm/Kconfig | 10 +
> drivers/phy/qualcomm/Makefile | 1 +
> drivers/phy/qualcomm/phy-qcom-qcs404-usb-hs.c | 415 ++++++++++++++++++
> 3 files changed, 426 insertions(+)
> create mode 100644 drivers/phy/qualcomm/phy-qcom-qcs404-usb-hs.c
>
[...]
> diff --git a/drivers/phy/qualcomm/phy-qcom-qcs404-usb-hs.c b/drivers/phy/qualcomm/phy-qcom-qcs404-usb-hs.c
> new file mode 100644
> index 000000000000..c09b786592b1
> --- /dev/null
> +++ b/drivers/phy/qualcomm/phy-qcom-qcs404-usb-hs.c
> @@ -0,0 +1,415 @@
[...]
> +static int qcom_snps_hsphy_probe(struct platform_device *pdev)
> +{
> + struct device *dev = &pdev->dev;
> + struct phy_provider *provider;
> + struct hsphy_priv *priv;
> + struct phy *phy;
> + int ret;
> + int i;
> +
> + priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
> + if (!priv)
> + return -ENOMEM;
> +
> + priv->base = devm_platform_ioremap_resource(pdev, 0);
> + if (IS_ERR(priv->base))
> + return PTR_ERR(priv->base);
> +
> + priv->num_clks = ARRAY_SIZE(qcom_snps_hsphy_clks);
> + priv->clks = devm_kcalloc(dev, priv->num_clks, sizeof(*priv->clks),
> + GFP_KERNEL);
> + if (!priv->clks)
> + return -ENOMEM;
> +
> + for (i = 0; i < priv->num_clks; i++)
> + priv->clks[i].id = qcom_snps_hsphy_clks[i];
> +
> + ret = devm_clk_bulk_get(dev, priv->num_clks, priv->clks);
> + if (ret)
> + return ret;
> +
> + priv->phy_reset = devm_reset_control_get(dev, "phy");
Please use devm_reset_control_get_exclusive(). I'd like drivers to
explicitly state whether they request exclusive or shared control.

> + if (IS_ERR(priv->phy_reset))
> + return PTR_ERR(priv->phy_reset);
> +
> + priv->por_reset = devm_reset_control_get(dev, "por");

Same here.

regards
Philipp

\
 
 \ /
  Last update: 2020-01-15 16:09    [W:0.093 / U:2.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site