Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp893688ybg; Mon, 27 Jul 2020 02:26:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzBa7AJNoeUWnsmCLysUzlpCNBjwOYfGVNQeQIscYePCkIW1OyN4ntcsbOQIDCbQ0yno9XT X-Received: by 2002:aa7:c353:: with SMTP id j19mr20246540edr.219.1595841982104; Mon, 27 Jul 2020 02:26:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595841982; cv=none; d=google.com; s=arc-20160816; b=IcBfkT6XJSQg2jpTIOugYBfFP8uOg60p0SBHf3ITf5Um39p501AUG1fYFwj2b9PlG6 W9RiVW1cu7DlmlH9ZVhnNICXSRlkMZM14JrCNNHZ3p8Eh1qYBqbPWzqrA667+FjAH8BW svY4s/gZe8Y08H1nm1r7+oYTFkOkaqeUnD9e/XvRrsIJEJv+lDyaMZOm2htoXuXl9CGU 9Jv4nGN54bX1Th5wT9l45PgKWBzD48byZdK4BHJeNeiQ0o8Ipx5U71I7tWEVlHAsHXl2 oSoM+fsPtyXix1EIMZ+yqVn16jIX85ju/bsrIAXzK+PBFudG3MhPcJT5NivJ1H5o+ytp aejw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=KqrGpfhCTxLFWDel/tVEdmr+NCW1g/j7ZfQPc5nmx8w=; b=qodH5GJLp8hKgkzSSXQ+8gtqB+Mk4r+6aJmdpRQa/jtggiPcmNTnURy6fKDeiyvZpe MwhHQusBoK2Tx5u4Wf2BFmmUsLqIwcZbq6RVhH3JGRbGA9wFkiZNinW24FmxnWFoWgyT 18gcItEFc/26jVZYgPWyEsi1D3vZ+5rsRIBd+BaRiVvlORvyP4cWMS+GiNXsB87Oh20L AdYE/g12UBUXxGw/OksIi00jqKk/04EZnSFG144BtKJf3YYBhokXxeq+fAnuh/CHWUJU eNiRCUNeCQPjtU6k5mf9u0f3MtGrgszgm0/Y1sJnasMPd0BmQfyPNfyISgLyAD993ja0 zPug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=sdI+0a1s; 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=st.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k12si5248231edl.489.2020.07.27.02.26.00; Mon, 27 Jul 2020 02:26: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=@st.com header.s=STMicroelectronics header.b=sdI+0a1s; 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=st.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728178AbgG0JYY (ORCPT + 99 others); Mon, 27 Jul 2020 05:24:24 -0400 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:1947 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728117AbgG0JYM (ORCPT ); Mon, 27 Jul 2020 05:24:12 -0400 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 06R9DeFS018852; Mon, 27 Jul 2020 11:23:58 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=KqrGpfhCTxLFWDel/tVEdmr+NCW1g/j7ZfQPc5nmx8w=; b=sdI+0a1sipz/jRI0Vdedyggf2XY7ZsEiZgv7XWpBO2RPDAn+ED6fwyrb+wm6TOKmaqrn W0f4Xo5sPw7NzbVfyau7cmMaRtwq3zS7QsWVaiEykRG8PEFUERlJOAgvfDWUM628hMoa XYsqn7Py1n8Gh+nZlybvV7Br3E8gcimoSQZjGDO94Lo1AhtfXO5jx7VQR8y1QsHEmh79 Ano62P8bcsYn8o3eVuZdubZJyRaLkc2qCF8ZdCjoR2wTos/nuphJc0yWINyNBh3aQQ99 tiAC8s1YTv2DuSSlg5MrvS1mYbZ4/h84095bZZv3ltm3tNntWdhcIlh9c/1uN/PIvPgL PQ== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 32g9v98jab-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 27 Jul 2020 11:23:58 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 43DA4100034; Mon, 27 Jul 2020 11:23:58 +0200 (CEST) Received: from Webmail-eu.st.com (sfhdag3node2.st.com [10.75.127.8]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 3421B2AE6B3; Mon, 27 Jul 2020 11:23:58 +0200 (CEST) Received: from localhost (10.75.127.44) by SFHDAG3NODE2.st.com (10.75.127.8) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Mon, 27 Jul 2020 11:23:57 +0200 From: Amelie Delaunay To: Minas Harutyunyan , Felipe Balbi , Greg Kroah-Hartman , Rob Herring , Maxime Coquelin , Alexandre Torgue CC: , , , , , Fabrice Gasnier , Amelie Delaunay , Martin Blumenstingl Subject: [PATCH v4 3/3] usb: dwc2: don't use ID/Vbus detection if usb-role-switch on STM32MP15 SoCs Date: Mon, 27 Jul 2020 11:23:46 +0200 Message-ID: <20200727092346.19780-4-amelie.delaunay@st.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200727092346.19780-1-amelie.delaunay@st.com> References: <20200727092346.19780-1-amelie.delaunay@st.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.75.127.44] X-ClientProxiedBy: SFHDAG1NODE1.st.com (10.75.127.1) To SFHDAG3NODE2.st.com (10.75.127.8) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-07-27_06:2020-07-27,2020-07-27 signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If usb-role-switch is present in the device tree, it means that ID and Vbus signals are not connected to the OTG controller but to an external component (GPIOs, Type-C controller). In this configuration, usb role switch is used to force valid sessions on STM32MP15 SoCs. Acked-by: Minas Harutyunyan Signed-off-by: Amelie Delaunay --- No changes in v4. --- drivers/usb/dwc2/params.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/usb/dwc2/params.c b/drivers/usb/dwc2/params.c index a3611cdd1dea..65f8596f6795 100644 --- a/drivers/usb/dwc2/params.c +++ b/drivers/usb/dwc2/params.c @@ -183,9 +183,11 @@ static void dwc2_set_stm32mp15_fsotg_params(struct dwc2_hsotg *hsotg) static void dwc2_set_stm32mp15_hsotg_params(struct dwc2_hsotg *hsotg) { struct dwc2_core_params *p = &hsotg->params; + struct device_node *np = hsotg->dev->of_node; p->otg_cap = DWC2_CAP_PARAM_NO_HNP_SRP_CAPABLE; - p->activate_stm_id_vb_detection = true; + p->activate_stm_id_vb_detection = + !of_property_read_bool(np, "usb-role-switch"); p->host_rx_fifo_size = 440; p->host_nperio_tx_fifo_size = 256; p->host_perio_tx_fifo_size = 256; -- 2.17.1