[PATCH 1/2] PCM038: Move USBH2 initialization to PCM970

Juergen Beisert jbe at pengutronix.de
Mon May 14 04:57:58 EDT 2012


Alexander Shiyan wrote:
> [...]
> @@ -260,19 +238,6 @@ static int pcm038_devices_init(void)
>  		PA29_PF_VSYNC,
>  		PA30_PF_CONTRAST,
>  		PA31_PF_OE_ACD,
> -		/* USB host 2 */
> -		PA0_PF_USBH2_CLK,
> -		PA1_PF_USBH2_DIR,
> -		PA2_PF_USBH2_DATA7,
> -		PA3_PF_USBH2_NXT,
> -		PA4_PF_USBH2_STP,
> -		PD19_AF_USBH2_DATA4,
> -		PD20_AF_USBH2_DATA3,
> -		PD21_AF_USBH2_DATA6,
> -		PD22_AF_USBH2_DATA0,
> -		PD23_AF_USBH2_DATA2,
> -		PD24_AF_USBH2_DATA1,
> -		PD26_AF_USBH2_DATA5,
>
> [...]
>
> +#ifdef CONFIG_USB
> +static void pcm970_usbh2_init(void)
> +{
> +	int i;
> +	uint32_t temp;
> +	unsigned int mode[] = {
> +		/* USB Host 2 */
> +		PA0_PF_USBH2_CLK,
> +		PA1_PF_USBH2_DIR,
> +		PA2_PF_USBH2_DATA7,
> +		PA3_PF_USBH2_NXT,
> +		PA4_PF_USBH2_STP,
> +		PD19_AF_USBH2_DATA4,
> +		PD20_AF_USBH2_DATA3,
> +		PD21_AF_USBH2_DATA6,
> +		PD22_AF_USBH2_DATA0,
> +		PD23_AF_USBH2_DATA2,
> +		PD24_AF_USBH2_DATA1,
> +		PD26_AF_USBH2_DATA5,
> +	};
>
> [...]

This changes the initialization of the pins form 'always' to 'sometimes". I 
feel better if pins are physically connected they also should be initialized. 
And if the USB software feature is disable they should get initialized as 
well to keep the signals in a sane state to not confuse externally attached 
devices (in this case it could be useful to configure them as GPIO instead 
with reasonable directions and levels).

jbe

-- 
Pengutronix e.K.                              | Juergen Beisert             |
Linux Solutions for Science and Industry      | http://www.pengutronix.de/  |



More information about the barebox mailing list