Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3247590ybz; Sun, 3 May 2020 21:56:23 -0700 (PDT) X-Google-Smtp-Source: APiQypJv9cVjbTVCL5tNe3xsXtEVKF1K6X/AGzDNINWIU0q3o0LakoXx4xHPL8djQru27QoPKbIk X-Received: by 2002:a17:906:9482:: with SMTP id t2mr13002820ejx.241.1588568182995; Sun, 03 May 2020 21:56:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588568182; cv=none; d=google.com; s=arc-20160816; b=fYd1HmLBwXxZDRqT2P+Z7PltmT3Sq9pr1VGCZxuUNtjW29eYfX6PHoZEKKuSm7oAZG M7N2Ezcno+2TENl7Jc+uydXa3cM880sa07yUFJF7KCP3zJVzG9ypPNaASMy2ohsabwQ3 8GgBrEdSBnIsZFeaenPbaadEm8taYtpVyA1nmRS7hPuD4KjLS/Q7hTVd3e1dXY1yqE8x /xsVqKhg0awg4bt2S04KEtWfLDBX7GpEIJAWltEYasORaV6hizH9nnToCvUcJvy6Emws bW0T3dw5JAfvrrtM5i8Gz+cFcps9JzE7Q5nlshSBhj/PPffmcr4Q2Yd6siGa0UN2WiAN zGxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=68fwostdTEIu4e1eYM/xozH9ML01bWeSStjD0PufGGA=; b=dJ/4b/uJ76E1uyRPqcFUKAt2jNfSnajlaRxrfS09K5PLsO/eFjiyLeB3TdpLA2AerL 62MZZ7PLHqmRXudQBgrEFiNzIhS0oK5jvgAFH+kG6W7HJrWjhFCt85qZauO+9/249aBj mskx2J3xOP2sdqobL/2l0PiwbBN9DyJETVNIe1aw64Xn+PVVoGMRpYa5lJ0eRq1n8dKD ic1/x87xIF6phAi/PKUMFjq4hp9J1KG3uHi9VT99QLZMi5FmiOtfYxVkJ1mRDgs6ATll 74b1qMk56pZKfM26b1IeNc9JRUuo8T+H9XIQvAak841cT9usb9/qAAsJxUXW5/Jykk73 w6Yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=cZhxQs0B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rv10si6262096ejb.519.2020.05.03.21.55.48; Sun, 03 May 2020 21:56:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=cZhxQs0B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726351AbgEDEJA (ORCPT + 99 others); Mon, 4 May 2020 00:09:00 -0400 Received: from hqnvemgate26.nvidia.com ([216.228.121.65]:17434 "EHLO hqnvemgate26.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725770AbgEDEI7 (ORCPT ); Mon, 4 May 2020 00:08:59 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate26.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Sun, 03 May 2020 21:08:47 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Sun, 03 May 2020 21:08:59 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Sun, 03 May 2020 21:08:59 -0700 Received: from DRHQMAIL107.nvidia.com (10.27.9.16) by HQMAIL109.nvidia.com (172.20.187.15) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 4 May 2020 04:08:58 +0000 Received: from [10.19.66.205] (10.124.1.5) by DRHQMAIL107.nvidia.com (10.27.9.16) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 4 May 2020 04:08:55 +0000 Subject: Re: [PATCH V2 2/8] usb: gadget: tegra-xudc: Add vbus_draw support To: Thierry Reding CC: , , , , , , , , , References: <1586939108-10075-1-git-send-email-nkristam@nvidia.com> <1586939108-10075-3-git-send-email-nkristam@nvidia.com> <20200428095956.GB3592148@ulmo> X-Nvconfidentiality: public From: Nagarjuna Kristam Message-ID: Date: Mon, 4 May 2020 09:40:48 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <20200428095956.GB3592148@ulmo> X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To DRHQMAIL107.nvidia.com (10.27.9.16) Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1588565327; bh=68fwostdTEIu4e1eYM/xozH9ML01bWeSStjD0PufGGA=; h=X-PGP-Universal:Subject:To:CC:References:X-Nvconfidentiality:From: Message-ID:Date:User-Agent:MIME-Version:In-Reply-To: X-Originating-IP:X-ClientProxiedBy:Content-Type:Content-Language: Content-Transfer-Encoding; b=cZhxQs0Bnq4E1UPuXHP+ngvhGzFdSmgUjfPs5pn6DuizxrrzDEzLje6RUejp54E6+ yPy30jRk/x24CioXuqDwN0qH1dXjk0YSBN2DkrkKXorEwcotngSAALc147BWmLglTD cPFEVtztCWGJOvrIx4Wt1fE8dz79NO5zqXPjS4JRmbPHtxzM95KB57j6JSsmPkkTAz oLYr1WZggv1TpAkq7lTPLCasKT8DytlS4gx+mP+GKv3HYtYyt48FXvxiFBXC0laiq4 PHRzCYrVpma5zRHHPHaNHmEBs07xMYvH6lKYPUR36WipwdsIFmjY4vNklFi7rDvU9b J35MvePpyLqOQ== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 28-04-2020 15:29, Thierry Reding wrote: >> @@ -2042,6 +2044,19 @@ static int tegra_xudc_gadget_stop(struct usb_gadget *gadget) >> return 0; >> } >> >> +static int tegra_xudc_gadget_vbus_draw(struct usb_gadget *gadget, >> + unsigned int m_a) >> +{ >> + struct tegra_xudc *xudc = to_xudc(gadget); >> + >> + dev_dbg(xudc->dev, "%s: %u mA\n", __func__, m_a); >> + >> + if (xudc->curr_usbphy->chg_type == SDP_TYPE) >> + usb_phy_set_power(xudc->curr_usbphy, m_a); > Do we need to propagate the error code here in case the USB PHY for some > reason doesn't support the given current? Or is it guaranteed that we > always do support whatever is passed in here? > > Regardless of whether we support it or not, it might still be useful to > add proper handling, if for nothing else but to set a good example. > > Thierry Will update accordingly, propagate the return the code to caller.