RE: [PATCH][v2]fsl/usb:Add controller version based ULPI and UTMI phy support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




-----Original Message-----
From: Greg KH [mailto:gregkh@xxxxxxxxxxxxxxxxxxx] 
Sent: Friday, February 03, 2012 12:42 AM
To: Mehresh Ramneek-B31383
Cc: linux-usb@xxxxxxxxxxxxxxx
Subject: Re: [PATCH][v2]fsl/usb:Add controller version based ULPI and UTMI phy support

On Mon, Jan 30, 2012 at 12:36:12PM +0530, Ramneek Mehresh wrote:
> Add support for ULPI and UTMI PHYs based on usb controller version 
> info read from device-tree
> 
> Example of USB Controller versioning info:
> Version 1.2 and below : MPC8536, MPC8315, etc Version 1.6 : P1020, 
> P1010, P2020, etc Version 2.2 : PSC9131, PSC9132, P3060, etc
> 
> Signed-off-by: Ramneek Mehresh <ramneek.mehresh@xxxxxxxxxxxxx>
> ---
> Changes for v2:
> 	- Incorporated Greg's comment
> 		- moved fsl_usb.h from drivers/usb/misc
> 		  to drivers/usb/host/fsl/
> 
>  drivers/usb/gadget/fsl_udc_core.c |   25 ++++++++++++++-
>  drivers/usb/gadget/fsl_usb2_udc.h |   13 ++++++++
>  drivers/usb/host/ehci-fsl.c       |   35 +++++++++++++++++----
>  drivers/usb/host/ehci-fsl.h       |   15 ++++++++-
>  drivers/usb/host/fsl/fsl_usb.h    |   61 +++++++++++++++++++++++++++++++++++++
>  5 files changed, 141 insertions(+), 8 deletions(-)  create mode 
> 100644 drivers/usb/host/fsl/fsl_usb.h
> 
> diff --git a/drivers/usb/gadget/fsl_udc_core.c 
> b/drivers/usb/gadget/fsl_udc_core.c
> index d7ea6c0..3c28887 100644
> --- a/drivers/usb/gadget/fsl_udc_core.c
> +++ b/drivers/usb/gadget/fsl_udc_core.c
> @@ -1,5 +1,5 @@
>  /*
> - * Copyright (C) 2004-2007,2011 Freescale Semiconductor, Inc.
> + * Copyright (C) 2004-2007,2011-2012 Freescale Semiconductor, Inc.
>   * All rights reserved.
>   *
>   * Author: Li Yang <leoli@xxxxxxxxxxxxx> @@ -48,6 +48,7 @@  #include 
> <asm/dma.h>
>  
>  #include "fsl_usb2_udc.h"
> +#include "../host/fsl/fsl_usb.h"
>  
>  #define	DRIVER_DESC	"Freescale High-Speed USB SOC Device Controller driver"
>  #define	DRIVER_AUTHOR	"Li Yang/Jiang Bo"
> @@ -245,23 +246,45 @@ static int dr_controller_setup(struct fsl_udc 
> *udc)  {
>  	unsigned int tmp, portctrl, ep_num;
>  	unsigned int max_no_of_ep;
> +	int contr_ver = usb_get_ver_info();
>  #ifndef CONFIG_ARCH_MXC
>  	unsigned int ctrl;
>  #endif
>  	unsigned long timeout;
>  #define FSL_UDC_RESET_TIMEOUT 1000
>  
> +	if (contr_ver < 0) {
> +		printk(KERN_WARNING"fsl_usb: Could not get controller"
> +			"version\n");

dev_warn() instead?

[Ramneek]: will use  
> +		return -ENODEV;
> +	}

So this will cause devices that previously did not have the version in them, to now break?  That's not nice, why not just not revert to the "old" functionality?
[Ramneek]: Hi Greg, I'm taking care of that. I have already sent a patch that includes usb controller version for all upstreamed fsl socs.
Going forward, this feature is required for fsl usb drivers so that we can prevent having SOC macros based code inside fsl usb driver code. This change will ensure that fsl usb driver is only concerned with the controller verison, and not the SOCs   

> +static void ehci_fsl_setup_phy(struct usb_hcd *hcd,
>  			       enum fsl_usb2_phy_modes phy_mode,
>  			       unsigned int port_offset)
>  {
> -	u32 portsc;
> +	u32 portsc, temp;
> +	struct ehci_hcd *ehci = hcd_to_ehci(hcd);
> +	void __iomem *non_ehci = hcd->regs;
> +	int contr_ver = usb_get_ver_info();
> +
> +	if (contr_ver < 0) {
> +		printk(KERN_WARNING"fsl_usb: Could not get controller"
> +			"version\n");
> +		return;
> +	}

Same here as above.

[Ramneek]: will use 
thanks,

greg k-h


--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux