From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755315Ab2IQJFl (ORCPT ); Mon, 17 Sep 2012 05:05:41 -0400 Received: from antcom.de ([188.40.178.216]:56050 "EHLO chuck.antcom.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753861Ab2IQJFk (ORCPT ); Mon, 17 Sep 2012 05:05:40 -0400 Message-ID: <5056E7E0.5030207@antcom.de> Date: Mon, 17 Sep 2012 11:05:36 +0200 From: Roland Stigge Organization: ANTCOM IT Research & Development User-Agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.5) Gecko/20120624 Icedove/10.0.5 MIME-Version: 1.0 To: Alexandre Pereira da Silva CC: Felipe Balbi , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] usb: gadget: lpc32xx_udc: Fix compatibility with STOTG04 References: <1347481810-21554-1-git-send-email-aletes.xgr@gmail.com> In-Reply-To: <1347481810-21554-1-git-send-email-aletes.xgr@gmail.com> X-Enigmail-Version: 1.4 OpenPGP: url=subkeys.pgp.net Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/12/2012 10:30 PM, Alexandre Pereira da Silva wrote: > The STOTG04 is an replacement for ISP1301. > > Most of the registers on STOTG04 are the same as on ISP1301, but the > register ISP1301_I2C_OTG_CONTROL_2 (address 0x10) doesn't exist on the > ST part. > > This is a work around for this by using the interrupt source register that > should behave the same on both parts and has the needed information. > > Signed-off-by: Alexandre Pereira da Silva Tested-by: Roland Stigge > --- > drivers/usb/gadget/lpc32xx_udc.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/usb/gadget/lpc32xx_udc.c b/drivers/usb/gadget/lpc32xx_udc.c > index f696fb9..21a9861 100644 > --- a/drivers/usb/gadget/lpc32xx_udc.c > +++ b/drivers/usb/gadget/lpc32xx_udc.c > @@ -2930,10 +2930,10 @@ static void vbus_work(struct work_struct *work) > > /* Get the VBUS status from the transceiver */ > value = i2c_smbus_read_byte_data(udc->isp1301_i2c_client, > - ISP1301_I2C_OTG_CONTROL_2); > + ISP1301_I2C_INTERRUPT_SOURCE); > > /* VBUS on or off? */ > - if (value & OTG_B_SESS_VLD) > + if (value & INT_SESS_VLD) > udc->vbus = 1; > else > udc->vbus = 0;