summaryrefslogtreecommitdiff
path: root/drivers/usb/ulpi/ulpi.c
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2011-12-17 20:51:16 +0100
committerWolfgang Denk <wd@denx.de>2011-12-17 20:51:16 +0100
commit8b0affecb98f91142015ccf8c43653e1ad87c156 (patch)
treec8845c9e4ceef07fb7946326f137ad615f8acf9b /drivers/usb/ulpi/ulpi.c
parent509adc8b77f885e946449ed62191fbef7fe67b56 (diff)
parentb2fb47f1873ae812ce33129996a22b11a36d0aa9 (diff)
downloadu-boot-imx-8b0affecb98f91142015ccf8c43653e1ad87c156.zip
u-boot-imx-8b0affecb98f91142015ccf8c43653e1ad87c156.tar.gz
u-boot-imx-8b0affecb98f91142015ccf8c43653e1ad87c156.tar.bz2
Merge branch 'master' of git://git.denx.de/u-boot-usb
* 'master' of git://git.denx.de/u-boot-usb: USB: Use (get|put)_unaligned for accessing wMaxPacketSize usb:gadget:s5p Enable the USB Gadget framework at Exynos4210 (C210 Universal) README: add documentation for CONFIG_USB_ULPI* USB: ULPI: increase error case verbosity USB: ULPI: clean a mixup of return types USB: ULPI: switch argument type from u8 to unsigned
Diffstat (limited to 'drivers/usb/ulpi/ulpi.c')
-rw-r--r--drivers/usb/ulpi/ulpi.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/drivers/usb/ulpi/ulpi.c b/drivers/usb/ulpi/ulpi.c
index 805e29d..6202227 100644
--- a/drivers/usb/ulpi/ulpi.c
+++ b/drivers/usb/ulpi/ulpi.c
@@ -39,8 +39,8 @@ static struct ulpi_regs *ulpi = (struct ulpi_regs *)0;
static int ulpi_integrity_check(u32 ulpi_viewport)
{
- u32 err, val, tval = ULPI_TEST_VALUE;
- int i;
+ u32 val, tval = ULPI_TEST_VALUE;
+ int err, i;
/* Use the 'special' test value to check all bits */
for (i = 0; i < 2; i++, tval <<= 1) {
@@ -79,9 +79,9 @@ int ulpi_init(u32 ulpi_viewport)
return ulpi_integrity_check(ulpi_viewport);
}
-int ulpi_select_transceiver(u32 ulpi_viewport, u8 speed)
+int ulpi_select_transceiver(u32 ulpi_viewport, unsigned speed)
{
- u8 tspeed = ULPI_FC_FULL_SPEED;
+ u32 tspeed = ULPI_FC_FULL_SPEED;
u32 val;
switch (speed) {
@@ -92,8 +92,8 @@ int ulpi_select_transceiver(u32 ulpi_viewport, u8 speed)
tspeed = speed;
break;
default:
- printf("ULPI: %s: wrong transceiver speed specified, "
- "falling back to full speed\n", __func__);
+ printf("ULPI: %s: wrong transceiver speed specified: %u, "
+ "falling back to full speed\n", __func__, speed);
}
val = ulpi_read(ulpi_viewport, &ulpi->function_ctrl);
@@ -127,9 +127,9 @@ int ulpi_set_pd(u32 ulpi_viewport, int enable)
return ulpi_write(ulpi_viewport, reg, val);
}
-int ulpi_opmode_sel(u32 ulpi_viewport, u8 opmode)
+int ulpi_opmode_sel(u32 ulpi_viewport, unsigned opmode)
{
- u8 topmode = ULPI_FC_OPMODE_NORMAL;
+ u32 topmode = ULPI_FC_OPMODE_NORMAL;
u32 val;
switch (opmode) {
@@ -140,8 +140,8 @@ int ulpi_opmode_sel(u32 ulpi_viewport, u8 opmode)
topmode = opmode;
break;
default:
- printf("ULPI: %s: wrong OpMode specified, "
- "falling back to OpMode Normal\n", __func__);
+ printf("ULPI: %s: wrong OpMode specified: %u, "
+ "falling back to OpMode Normal\n", __func__, opmode);
}
val = ulpi_read(ulpi_viewport, &ulpi->function_ctrl);
@@ -154,15 +154,15 @@ int ulpi_opmode_sel(u32 ulpi_viewport, u8 opmode)
return ulpi_write(ulpi_viewport, &ulpi->function_ctrl, val);
}
-int ulpi_serial_mode_enable(u32 ulpi_viewport, u8 smode)
+int ulpi_serial_mode_enable(u32 ulpi_viewport, unsigned smode)
{
switch (smode) {
case ULPI_IFACE_6_PIN_SERIAL_MODE:
case ULPI_IFACE_3_PIN_SERIAL_MODE:
break;
default:
- printf("ULPI: %s: unrecognized Serial Mode specified\n",
- __func__);
+ printf("ULPI: %s: unrecognized Serial Mode specified: %u\n",
+ __func__, smode);
return ULPI_ERROR;
}
@@ -171,7 +171,7 @@ int ulpi_serial_mode_enable(u32 ulpi_viewport, u8 smode)
int ulpi_suspend(u32 ulpi_viewport)
{
- u32 err;
+ int err;
err = ulpi_write(ulpi_viewport, &ulpi->function_ctrl_clear,
ULPI_FC_SUSPENDM);
@@ -214,7 +214,7 @@ int ulpi_reset_wait(u32) __attribute__((weak, alias("__ulpi_reset_wait")));
int ulpi_reset(u32 ulpi_viewport)
{
- u32 err;
+ int err;
err = ulpi_write(ulpi_viewport,
&ulpi->function_ctrl_set, ULPI_FC_RESET);