From patchwork Fri Oct 16 15:40:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabien Parent X-Patchwork-Id: 1383430 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.a=rsa-sha256 header.s=20150623 header.b=oQDfOyuu; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CCVkk0Cbtz9sTL for ; Sat, 17 Oct 2020 02:41:50 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5129C824A4; Fri, 16 Oct 2020 17:40:35 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=baylibre-com.20150623.gappssmtp.com header.i=@baylibre-com.20150623.gappssmtp.com header.b="oQDfOyuu"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 12C50824BC; Fri, 16 Oct 2020 17:40:32 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 5DB0882461 for ; Fri, 16 Oct 2020 17:40:27 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=fparent@baylibre.com Received: by mail-wm1-x343.google.com with SMTP id k18so3400018wmj.5 for ; Fri, 16 Oct 2020 08:40:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=lAZ/XCMfo4hWubyb1I2pDene6etQrIEna1J+RmHPPgM=; b=oQDfOyuuKrWpiNoVfLmVh23BQATGJwRSaspRFMhp9adtsxneDljItDvecF+PoxYzIk P/b7p3SbeolA8913oDJfIDl1Jr3WL16PfmgPtekCkqtSeG+IPhTuPEu2bFh9+dEkeFvD +yv53thmKNhSk3MOolBqxKkyLFMNLPf1VIPirjeKlGhTXPTZ+ncvhwz+Jmve7S5M+t6h 1izOdubJ0BD+fNnq1Vi6yloDDLges5ET6JTE+svSl5dmIFXlnYaI2aVE9iXOs2a+9EKG d7TPlflwMyEVMH8lom8aIgaq0a/z6CPXMogFVB4DdpjvcDLdQrNl3DJ+B7bggIm1i4ud GidA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lAZ/XCMfo4hWubyb1I2pDene6etQrIEna1J+RmHPPgM=; b=qlZwUjEYieMoaRzZyDEj1zwEHMIn4fKaZMW0k66RtYgpbuqaAPsd7YMAWSPeASYrKn ghkmQUASl9GyXrS5uJnjbsFuqUKJdSsG/vlZ6pmT3H7rliGCcX+Q+k5dfUVzHpCA15VR +6rUVfUBh3J4g3AyVDe7H9sgYMViSuFW2HJKrWKe0v2EajJpBh3C8yE4mZFqso5PnnDu ZsFx9crGKcgFaiiKUtWCrbDLolqpeTVC7Cq3yOQUVFw87o5IvefmIuZTLQMBbFIsSGz5 XXAX33sjbGdSTfDXAEirBA5zFwq5iUqadntMwRO73eMGiN6yRLUqlpHEXVtqL2+WGget gyZg== X-Gm-Message-State: AOAM533EXKV6fqmJlEmILDFu90wMhw0er6Kje2IZDT2xTjd3QCr1jR7o MSGMSlhLeOqNDyZRZc1OHb3Ks7U41vukIw== X-Google-Smtp-Source: ABdhPJzBUfqxJlcw/8W1EWZs5fOGGY9edwxh714aKZCSkmHGMnsTUrmyRMaP1GdO5gggfnkmQjMdoA== X-Received: by 2002:a1c:7e82:: with SMTP id z124mr4366858wmc.8.1602862821488; Fri, 16 Oct 2020 08:40:21 -0700 (PDT) Received: from localhost.localdomain (211.163.185.81.rev.sfr.net. [81.185.163.211]) by smtp.gmail.com with ESMTPSA id n66sm3100020wmb.35.2020.10.16.08.40.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Oct 2020 08:40:20 -0700 (PDT) From: Fabien Parent To: u-boot@lists.denx.de, GSS_MTK_Uboot_upstream@mediatek.com Cc: weijie.gao@mediatek.com, ryder.lee@mediatek.com, Fabien Parent Subject: [PATCH 3/5] board: mediatek: pumpkin: initialize usb device Date: Fri, 16 Oct 2020 17:40:07 +0200 Message-Id: <20201016154009.3097917-4-fparent@baylibre.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201016154009.3097917-1-fparent@baylibre.com> References: <20201016154009.3097917-1-fparent@baylibre.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean Initialize USB device on pumpkin if it is enabled in the config. Signed-off-by: Fabien Parent --- board/mediatek/pumpkin/pumpkin.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/board/mediatek/pumpkin/pumpkin.c b/board/mediatek/pumpkin/pumpkin.c index 666e4d6a26fe..37daf1c51b92 100644 --- a/board/mediatek/pumpkin/pumpkin.c +++ b/board/mediatek/pumpkin/pumpkin.c @@ -4,8 +4,25 @@ */ #include +#include int board_init(void) { return 0; } + +int board_late_init(void) +{ + struct udevice *dev; + int ret; + + if (CONFIG_IS_ENABLED(USB_GADGET)) { + ret = uclass_get_device(UCLASS_USB_GADGET_GENERIC, 0, &dev); + if (ret) { + pr_err("%s: Cannot find USB device\n", __func__); + return ret; + } + } + + return 0; +}