From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932964AbbJHNuz (ORCPT ); Thu, 8 Oct 2015 09:50:55 -0400 Received: from mail-lb0-f179.google.com ([209.85.217.179]:33601 "EHLO mail-lb0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932809AbbJHNuv (ORCPT ); Thu, 8 Oct 2015 09:50:51 -0400 Subject: Re: [PATCH] usb: musb: dsps: implement vbus_status method To: Roman Alyautdin , balbi@ti.com References: <1444228816-4497-1-git-send-email-ralyautdin@dev.rtsoft.ru> Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org From: Sergei Shtylyov Message-ID: <561674B9.1040101@cogentembedded.com> Date: Thu, 8 Oct 2015 16:50:49 +0300 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <1444228816-4497-1-git-send-email-ralyautdin@dev.rtsoft.ru> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello. On 10/7/2015 5:40 PM, Roman Alyautdin wrote: > Implement vbus_status method of musb_platform_ops that allows > musb_core to properly represent the VBUS status of musb_dsps devices in > corresponding sysfs entry > > Signed-off-by: Roman Alyautdin > --- > drivers/usb/musb/musb_dsps.c | 13 +++++++++++++ > 1 file changed, 13 insertions(+) > > diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c > index 84512d1..9c00edf 100644 > --- a/drivers/usb/musb/musb_dsps.c > +++ b/drivers/usb/musb/musb_dsps.c > @@ -632,6 +632,18 @@ static void dsps_read_fifo32(struct musb_hw_ep *hw_ep, u16 len, u8 *dst) > } > } > > +static int dsps_musb_vbus_status(struct musb *musb) > +{ > + void __iomem *mregs = musb->mregs; > + u8 devctl; > + > + devctl = dsps_readb(mregs, MUSB_DEVCTL); > + if ((devctl & MUSB_DEVCTL_VBUS) == (3 << MUSB_DEVCTL_VBUS_SHIFT)) I don't see why this has to be is implemented in the DSPS glue layer. The DevCtl register is a standard MUSB one. [...] MBR, Sergei