From mboxrd@z Thu Jan 1 00:00:00 1970 From: Igor Grinberg Date: Mon, 10 Jun 2013 18:13:33 +0300 Subject: [U-Boot] [PATCH] usb: omap: ulpi: fix ulpi reading/writing functions In-Reply-To: <20130610142332.GA15098@panicking> References: <20130610142332.GA15098@panicking> Message-ID: <51B5ED1D.4080407@compulab.co.il> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 06/10/13 17:23, Michael Trimarchi wrote: > Fix ulpi reading and writing function. > * Both functions need to have the bit31 setted. > * Right now uboot use 0 to enumerate port 1 and 1 to > enumerate port 2 and so on. Omap code use 1 for port 1 and 2 for port 2. > Add a +1 fix the problem > > Signed-off-by: Michael Trimarchi Acked-by: Igor Grinberg > --- > drivers/usb/ulpi/omap-ulpi-viewport.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/usb/ulpi/omap-ulpi-viewport.c b/drivers/usb/ulpi/omap-ulpi-viewport.c > index 2a42033..4db7fa4 100644 > --- a/drivers/usb/ulpi/omap-ulpi-viewport.c > +++ b/drivers/usb/ulpi/omap-ulpi-viewport.c > @@ -61,7 +61,7 @@ static int ulpi_request(struct ulpi_viewport *ulpi_vp, u32 value) > > int ulpi_write(struct ulpi_viewport *ulpi_vp, u8 *reg, u32 value) > { > - u32 val = (OMAP_ULPI_START | (ulpi_vp->port_num & 0xf) << 24) | > + u32 val = OMAP_ULPI_START | (((ulpi_vp->port_num + 1) & 0xf) << 24) | > OMAP_ULPI_WR_OPSEL | ((u32)reg << 16) | (value & 0xff); > > return ulpi_request(ulpi_vp, val); > @@ -70,7 +70,7 @@ int ulpi_write(struct ulpi_viewport *ulpi_vp, u8 *reg, u32 value) > u32 ulpi_read(struct ulpi_viewport *ulpi_vp, u8 *reg) > { > int err; > - u32 val = ((ulpi_vp->port_num & 0xf) << 24) | > + u32 val = OMAP_ULPI_START | (((ulpi_vp->port_num + 1) & 0xf) << 24) | > OMAP_ULPI_RD_OPSEL | ((u32)reg << 16); > > err = ulpi_request(ulpi_vp, val); > -- Regards, Igor.