devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tomasz Figa <t.figa-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
To: Vivek Gautam
	<gautam.vivek-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
	linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	kishon-l0cyMroinI0@public.gmane.org
Cc: gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org,
	balbi-l0cyMroinI0@public.gmane.org,
	kgene.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org,
	k.debski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org,
	jg1.han-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org,
	sylvester.nawrocki-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Subject: Re: [PATCH V4 1/5] phy: Add new Exynos5 USB 3.0 PHY driver
Date: Wed, 09 Apr 2014 13:06:26 +0200	[thread overview]
Message-ID: <534529B2.2020107@samsung.com> (raw)
In-Reply-To: <1396967803-28868-2-git-send-email-gautam.vivek-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>

Hi Vivek,

Please see my comments inline.

On 08.04.2014 16:36, Vivek Gautam wrote:
> Add a new driver for the USB 3.0 PHY on Exynos5 series of SoCs.
> The new driver uses the generic PHY framework and will interact
> with DWC3 controller present on Exynos5 series of SoCs.
> Thereby, removing old phy-samsung-usb3 driver and related code
> used untill now which was based on usb/phy framework.
>
> Signed-off-by: Vivek Gautam <gautam.vivek-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
> ---
>   .../devicetree/bindings/phy/samsung-phy.txt        |   42 ++
>   drivers/phy/Kconfig                                |   11 +
>   drivers/phy/Makefile                               |    1 +
>   drivers/phy/phy-exynos5-usbdrd.c                   |  668 ++++++++++++++++++++
>   4 files changed, 722 insertions(+)
>   create mode 100644 drivers/phy/phy-exynos5-usbdrd.c

[snip]

> +	Additional clock required for Exynos5420:
> +	- usb30_sclk_100m: Additional special clock used for PHY operation
> +			   depicted as 'sclk_usbphy30' in CMU of Exynos5420.

Are you sure this isn't simply a gate for the ref clock, as it can be 
found on another SoC that is not upstream yet? I don't have 
documentation for Exynos 5420 so I can't tell, but I'd like to ask you 
to recheck this.

> +- samsung,syscon-phandle: phandle for syscon interface, which is used to
> +			  control pmu registers for power isolation.
> +- samsung,pmu-offset: phy power control register offset to pmu-system-controller
> +		      base.
> +- #phy-cells : from the generic PHY bindings, must be 1;
> +
> +For "samsung,exynos5250-usbdrd-phy" and "samsung,exynos5420-usbdrd-phy"
> +compatible PHYs, the second cell in the PHY specifier identifies the
> +PHY id, which is interpreted as follows:
> +  0 - UTMI+ type phy,
> +  1 - PIPE3 type phy,
> +
> +Example:
> +	usb3_phy: usbphy@12100000 {
> +		compatible = "samsung,exynos5250-usbdrd-phy";
> +		reg = <0x12100000 0x100>;
> +		clocks = <&clock 286>, <&clock 1>;
> +		clock-names = "phy", "usb3phy_refclk";

Binding description above doesn't mention "usb3phy_refclk" entry.

> +		samsung,syscon-phandle = <&pmu_syscon>;
> +		samsung,pmu-offset = <0x704>;
> +		#phy-cells = <1>;
> +	};

[snip]

> diff --git a/drivers/phy/phy-exynos5-usbdrd.c b/drivers/phy/phy-exynos5-usbdrd.c
> new file mode 100644
> index 0000000..ff54a7c
> --- /dev/null
> +++ b/drivers/phy/phy-exynos5-usbdrd.c

[snip]

> +static int exynos5_usbdrd_phy_probe(struct platform_device *pdev)
> +{
> +	struct device *dev = &pdev->dev;
> +	struct device_node *node = dev->of_node;
> +	struct exynos5_usbdrd_phy *phy_drd;
> +	struct phy_provider *phy_provider;
> +	struct resource *res;
> +	const struct of_device_id *match;
> +	const struct exynos5_usbdrd_phy_drvdata *drv_data;
> +	struct regmap *reg_pmu;
> +	u32 pmu_offset;
> +	int i;
> +
> +	/*
> +	 * Exynos systems are completely DT enabled,
> +	 * so lets not have any platform data support for this driver.
> +	 */
> +	if (!node) {
> +		dev_err(dev, "no device node found\n");

This error message is not very meaningful. I'd rather use something like 
"This driver can be only instantiated using Device Tree".

> +		return -ENODEV;
> +	}
> +
> +	match = of_match_node(exynos5_usbdrd_phy_of_match, pdev->dev.of_node);
> +	if (!match) {
> +		dev_err(dev, "of_match_node() failed\n");
> +		return -EINVAL;
> +	}
> +	drv_data = match->data;
> +
> +	phy_drd = devm_kzalloc(dev, sizeof(*phy_drd), GFP_KERNEL);
> +	if (!phy_drd)
> +		return -ENOMEM;
> +
> +	dev_set_drvdata(dev, phy_drd);
> +	phy_drd->dev = dev;
> +
> +	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> +	phy_drd->reg_phy = devm_ioremap_resource(dev, res);
> +	if (IS_ERR(phy_drd->reg_phy)) {
> +		dev_err(dev, "Failed to map register memory (phy)\n");

devm_ioremap_resource() already prints an error message.

Best regards,
Tomasz
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2014-04-09 11:06 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-08 14:36 [PATCH V4 0/5] Add Exynos5 USB 3.0 phy driver based on generic PHY framework Vivek Gautam
2014-04-08 14:36 ` [PATCH V4 1/5] phy: Add new Exynos5 USB 3.0 PHY driver Vivek Gautam
     [not found]   ` <1396967803-28868-2-git-send-email-gautam.vivek-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2014-04-09 11:06     ` Tomasz Figa [this message]
2014-04-09 11:49       ` Vivek Gautam
2014-04-09 13:33         ` Tomasz Figa
     [not found]           ` <53454C11.7060607-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2014-04-10 11:39             ` Vivek Gautam
2014-04-15  6:09               ` Vivek Gautam
2014-04-16 13:44                 ` Tomasz Figa
     [not found]                   ` <534E892B.6090409-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2014-04-16 14:49                     ` Vivek Gautam
2014-04-22  2:18                       ` Jingoo Han
2014-04-22  3:35                         ` Vivek Gautam
2014-04-14 11:54       ` Kishon Vijay Abraham I
     [not found]         ` <534BCC91.8090108-l0cyMroinI0@public.gmane.org>
2014-04-14 12:05           ` Vivek Gautam
2014-04-14 13:05             ` Kishon Vijay Abraham I
2014-04-14 13:44               ` Tomasz Figa
2014-04-14 13:49                 ` Vivek Gautam
     [not found]                   ` <CAFp+6iHhUvLhAKGPARS8RUfmO8RGcTrumvYb7QjJXbFD1nUuig-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-04-14 14:21                     ` Sylwester Nawrocki
2014-04-15  5:07                       ` Vivek Gautam
2014-04-14 12:27   ` Kishon Vijay Abraham I
     [not found]     ` <534BD447.1080909-l0cyMroinI0@public.gmane.org>
2014-04-14 12:42       ` Vivek Gautam
2014-04-14 12:59         ` Kishon Vijay Abraham I
2014-04-14 13:20           ` Vivek Gautam
2014-04-14 13:26             ` Kishon Vijay Abraham I
2014-04-14 13:40               ` Vivek Gautam
2014-04-14 13:46                 ` Vivek Gautam
2014-04-14 13:49                 ` Tomasz Figa
     [not found]                   ` <534BE77E.5090902-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-04-15 13:59                     ` Kishon Vijay Abraham I
2014-04-14 14:37   ` Sylwester Nawrocki
2014-04-15  5:09     ` Vivek Gautam
     [not found]     ` <534BF28E.7040906-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2014-04-25  7:57       ` Tushar Behera
2014-04-25  8:08         ` Vivek Gautam
     [not found] ` <1396967803-28868-1-git-send-email-gautam.vivek-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2014-04-08 14:36   ` [PATCH v4 2/5] dt: exynos5420: Enable support for USB 3.0 PHY controller Vivek Gautam
     [not found]     ` <1396967803-28868-3-git-send-email-gautam.vivek-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2014-04-09 11:10       ` Tomasz Figa
2014-04-08 14:36 ` [PATCH V4 3/5] dt: exynos5420: Enable support for DWC3 controller Vivek Gautam
2014-04-09 11:11   ` Tomasz Figa
2014-04-08 14:36 ` [PATCH V4 4/5] dt: exynos5250: Enable support for generic USB DRD phy Vivek Gautam
     [not found]   ` <1396967803-28868-5-git-send-email-gautam.vivek-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2014-04-09 11:11     ` Tomasz Figa
2014-04-08 14:36 ` [PATCH V4 5/5] usb-phy: samsung-usb3: Remove older phy-samsung-usb3 driver Vivek Gautam
2014-04-09 11:13   ` Tomasz Figa
2014-04-09 11:34     ` Vivek Gautam
2014-04-16 13:33       ` Richard Genoud
2014-04-16 14:42         ` Vivek Gautam

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=534529B2.2020107@samsung.com \
    --to=t.figa-sze3o3uu22jbdgjk7y7tuq@public.gmane.org \
    --cc=balbi-l0cyMroinI0@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=gautam.vivek-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    --cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
    --cc=jg1.han-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    --cc=k.debski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    --cc=kgene.kim-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    --cc=kishon-l0cyMroinI0@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=sylvester.nawrocki-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.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).