Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753369AbbFVRjJ (ORCPT ); Mon, 22 Jun 2015 13:39:09 -0400 Received: from mail-lb0-f182.google.com ([209.85.217.182]:34417 "EHLO mail-lb0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751268AbbFVRjC (ORCPT ); Mon, 22 Jun 2015 13:39:02 -0400 Message-ID: <55884831.6080409@cogentembedded.com> Date: Mon, 22 Jun 2015 20:38:57 +0300 From: Sergei Shtylyov Organization: Cogent Embedded User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Phil Edworthy , Kishon Vijay Abraham I , Yoshihiro Shimoda , Simon Horman CC: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, linux-sh@vger.kernel.org Subject: Re: [PATCH 1/3] usb: renesas_usbhs: Allow an OTG PHY driver to provide VBUS References: <1434984151-27274-1-git-send-email-phil.edworthy@renesas.com> <1434984151-27274-2-git-send-email-phil.edworthy@renesas.com> In-Reply-To: <1434984151-27274-2-git-send-email-phil.edworthy@renesas.com> 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 Content-Length: 2088 Lines: 69 Hello. On 06/22/2015 05:42 PM, Phil Edworthy wrote: > These changes allow a PHY driver to trigger a VBUS interrupt and > to provide the value of VBUS. > Signed-off-by: Phil Edworthy > --- > drivers/usb/renesas_usbhs/common.h | 2 ++ > drivers/usb/renesas_usbhs/mod.c | 3 +++ > drivers/usb/renesas_usbhs/mod_gadget.c | 38 ++++++++++++++++++++++++++++++++++ > 3 files changed, 43 insertions(+) > diff --git a/drivers/usb/renesas_usbhs/common.h b/drivers/usb/renesas_usbhs/common.h > index 8c5fc12..94a7aeb 100644 > --- a/drivers/usb/renesas_usbhs/common.h > +++ b/drivers/usb/renesas_usbhs/common.h > @@ -255,6 +255,8 @@ struct usbhs_priv { > struct renesas_usbhs_driver_param dparam; > > struct delayed_work notify_hotplug_work; > + int vbus_is_indirect; s/int/bool/. > + int vbus_indirect_value; Likewise. > struct platform_device *pdev; > > struct extcon_dev *edev; [...] > diff --git a/drivers/usb/renesas_usbhs/mod_gadget.c b/drivers/usb/renesas_usbhs/mod_gadget.c > index dc2aa32..2cfdb50 100644 > --- a/drivers/usb/renesas_usbhs/mod_gadget.c > +++ b/drivers/usb/renesas_usbhs/mod_gadget.c [...] > @@ -891,6 +895,17 @@ static int usbhsg_gadget_start(struct usb_gadget *gadget, > /* first hook up the driver ... */ > gpriv->driver = driver; > > + /* connect to bus through transceiver */ > + if (!IS_ERR_OR_NULL(gpriv->transceiver)) { > + ret = otg_set_peripheral(gpriv->transceiver->otg, > + &gpriv->gadget); > + if (ret) { > + dev_info(dev, "%s: can't bind to transceiver\n", dev_err(). [...] > @@ -994,6 +1028,10 @@ int usbhs_mod_gadget_probe(struct usbhs_priv *priv) > goto usbhs_mod_gadget_probe_err_gpriv; > } > > + gpriv->transceiver = usb_get_phy(USB_PHY_TYPE_UNDEFINED); > + dev_info(dev, "%s transceiver found\n", > + gpriv->transceiver ? "" : "No"); dev_info(dev, "%stransceiver found\n", gpriv->transceiver ? "" : "no "); WBR, Sergei -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in Please read the FAQ at http://www.tux.org/lkml/