From patchwork Mon Nov 23 16:38:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tejas Joglekar X-Patchwork-Id: 11925715 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9BAD0C63697 for ; Mon, 23 Nov 2020 16:39:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 463BC20757 for ; Mon, 23 Nov 2020 16:39:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=synopsys.com header.i=@synopsys.com header.b="MGurgf/E" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730653AbgKWQjF (ORCPT ); Mon, 23 Nov 2020 11:39:05 -0500 Received: from smtprelay-out1.synopsys.com ([149.117.87.133]:34298 "EHLO smtprelay-out1.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729294AbgKWQjF (ORCPT ); Mon, 23 Nov 2020 11:39:05 -0500 Received: from mailhost.synopsys.com (mdc-mailhost2.synopsys.com [10.225.0.210]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id BE2E3C095F; Mon, 23 Nov 2020 16:39:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1606149544; bh=jy/hTMdS2l33xUmBAXbX1JccNnVQ9AiMjULVgOFzCRA=; h=Date:In-Reply-To:References:From:Subject:To:Cc:From; b=MGurgf/EF+y1inqGiEQ7qL/avEvYW4HmwX/vq7EfXkXxDFdKkiA4EP6xoeryBfklI //ZUckLxVYy62/Thdlpc5Tq+KeV1tyAukh8SfUAqcWHWJp5lr02hbXGZn+HUfQcFbi ayOfgcBBaAL/0AjaGBl4rXjRImYOne600uAMSKS+CTBfSolPfXdUNvR27cIA2Cil+l 7GEitmMMjgDGKKyH6Eg2XsItfnVUblznvfdbN+BABmCUw4YBhXWIWBHlpazarxM497 hE9/ftk4Dlj/aO5cWXzfwPRoktj5I+6GFCFCo2FdGKE/YvJPxDC1a0v+VxcIBlLnOL CsKRTsXkpIqdQ== Received: from tejas-VirtualBox (joglekar-e7480.internal.synopsys.com [10.146.24.135]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mailhost.synopsys.com (Postfix) with ESMTPSA id A33ADA005D; Mon, 23 Nov 2020 16:39:01 +0000 (UTC) Received: by tejas-VirtualBox (sSMTP sendmail emulation); Mon, 23 Nov 2020 22:08:59 +0530 Date: Mon, 23 Nov 2020 22:08:59 +0530 Message-Id: <0b96cb765bb154cf0e83a436e7fed8882f566cf9.1606149078.git.joglekar@synopsys.com> In-Reply-To: References: X-SNPS-Relay: synopsys.com From: Tejas Joglekar Subject: [PATCH v6 3/3] usb: dwc3: Pass quirk as platform data To: Felipe Balbi , Greg Kroah-Hartman , Tejas Joglekar , linux-usb@vger.kernel.org Cc: John Youn Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org This commit adds the platform device data to setup the XHCI_SG_TRB_CACHE_SIZE_QUIRK quirk. DWC3 hosts which are PCI devices does not use OF to create platform device but create xhci-plat platform device at runtime. So this patch allows parent device to supply the quirk through platform data. Signed-off-by: Tejas Joglekar --- drivers/usb/dwc3/host.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c index e195176580de..0434bc8cec12 100644 --- a/drivers/usb/dwc3/host.c +++ b/drivers/usb/dwc3/host.c @@ -11,6 +11,11 @@ #include #include "core.h" +#include "../host/xhci-plat.h" + +static const struct xhci_plat_priv dwc3_pdata = { + .quirks = XHCI_SG_TRB_CACHE_SIZE_QUIRK, +}; static int dwc3_host_get_irq(struct dwc3 *dwc) { @@ -87,6 +92,11 @@ int dwc3_host_init(struct dwc3 *dwc) goto err; } + ret = platform_device_add_data(xhci, &dwc3_pdata, sizeof(dwc3_pdata)); + if (ret) { + dev_err(dwc->dev, "couldn't add platform data to xHCI device\n"); + goto err; + } memset(props, 0, sizeof(struct property_entry) * ARRAY_SIZE(props)); if (dwc->usb3_lpm_capable)