lkml.org 
[lkml]   [2012]   [Sep]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v3] USB: PHY: Re-organize Tegra USB PHY driver
From
Hi,

On Fri, Sep 21, 2012 at 5:50 PM, Venu Byravarasu <vbyravarasu@nvidia.com> wrote:
> NVIDIA produces several Tegra SoCs viz Tegra20, Tegra30 etc.
> In order to support USB PHY drivers on these SoCs, existing
> PHY driver is split into SoC agnostic common USB PHY driver
> and Tegra20-specific USB phy driver. This will facilitate
> easy addition and deletion of phy drivers for Tegra SoCs.
>
> Signed-off-by: Venu Byravarasu <vbyravarasu@nvidia.com>
> ---
> delta from v2:
>
> Added an if condition to check for device_node to be not NULL,
> before dereferencing it.
>
> drivers/usb/host/ehci-tegra.c | 26 +-
> drivers/usb/phy/Makefile | 1 +
> .../usb/phy/{tegra_usb_phy.c => tegra2_usb_phy.c} | 421 +++----------
> drivers/usb/phy/tegra2_usb_phy.h | 140 ++++
> drivers/usb/phy/tegra_usb_phy.c | 688 +-------------------
> include/linux/usb/tegra_usb_phy.h | 34 +-
> 6 files changed, 298 insertions(+), 1012 deletions(-)
> copy drivers/usb/phy/{tegra_usb_phy.c => tegra2_usb_phy.c} (53%)
> create mode 100644 drivers/usb/phy/tegra2_usb_phy.h
>
> diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c
> index 6223d17..8199a6e 100644
> --- a/drivers/usb/host/ehci-tegra.c
> +++ b/drivers/usb/host/ehci-tegra.c
> @@ -618,6 +618,9 @@ static int tegra_ehci_probe(struct platform_device *pdev)
> int err = 0;
> int irq;
> int instance = pdev->id;
> + struct device_node *np = pdev->dev.of_node;
> + struct phy_params params;
> + int phy_type;
>
> pdata = pdev->dev.platform_data;
> if (!pdata) {
> @@ -701,14 +704,29 @@ static int tegra_ehci_probe(struct platform_device *pdev)
> break;
> default:
> err = -ENODEV;
> - dev_err(&pdev->dev, "unknown usb instance\n");
> + dev_err(&pdev->dev, "unknown usb inst:%d\n", instance);
> goto fail_io;
> }
> }
>
> + if (np) {
> + phy_type = of_property_match_string(np, "phy_type", "utmi");
> + if (phy_type >= 0)
> + params.type = TEGRA_USB_PHY_TYPE_UTMI;
> + else {
> + phy_type = of_property_match_string(np, "phy_type", "ulpi");
> + if (phy_type >= 0)
> + params.type = TEGRA_USB_PHY_TYPE_ULPI;
> + else
> + params.type = TEGRA_USB_PHY_TYPE_INVALID;
> + }
> + }
> +
> + params.mode = TEGRA_USB_PHY_MODE_HOST;
> + params.config = pdata->phy_config;

I fail to understand how pdata is not NULL in dt boot. I know i've
already given this comment and you replied that you dint see any
crash. But I'd like to know where and how pdata gets populated.

Thanks
Kishon


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