Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 200C0C54EBD for ; Mon, 9 Jan 2023 07:14:06 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7294285559; Mon, 9 Jan 2023 08:13:47 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=kemnade.info Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=kemnade.info header.i=@kemnade.info header.b="ivKEhWdk"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 50B8C854AE; Mon, 9 Jan 2023 08:13:43 +0100 (CET) Received: from mail.andi.de1.cc (mail.andi.de1.cc [IPv6:2a01:238:4321:8900:456f:ecd6:43e:202c]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id D57F285172 for ; Mon, 9 Jan 2023 08:13:40 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=kemnade.info Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=andreas@kemnade.info DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kemnade.info; s=20220719; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=W9mYeOJzZUD0bm/sozNGoAtZ3AsgaWUeUApaa+ncZs4=; b=ivKEhWdkB/H4nIC7dP2CBlAoiT d+TwQwu0p10SE4t5I/+wB1qvXVqQd7JDh8qiup/X8P9H3Bxu0SmY9q+hzG6+jIbn9hyUhZE1S3YTt FmEQkOswmU5z7LOnxk+x+D+W4zdnIOH2yepZSiCgZukCoVmDBYei2F8TQM+rBtoMrExhVxGiia/We G2REeNLVFE9hWay37qMCKQItNwM48up36WSpL7+rL0LJ12KeJd/4rZHVx1ab2tb6akzkprvH0rW+3 z/KjOSe5+qQCLLtBBYOEZm/M0ooETq88dTyuRCZy/eZ5ob/l+AzFL3yv0GaQE3BbV0W0uGxJalqlt Id/ulKhQ==; Received: from p200300ccff06a2001a3da2fffebfd33a.dip0.t-ipconnect.de ([2003:cc:ff06:a200:1a3d:a2ff:febf:d33a] helo=aktux) by mail.andi.de1.cc with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1pEmLk-0001P0-Hg; Mon, 09 Jan 2023 08:13:40 +0100 Received: from andi by aktux with local (Exim 4.94.2) (envelope-from ) id 1pEmLk-008VLq-1w; Mon, 09 Jan 2023 08:13:40 +0100 From: Andreas Kemnade To: marex@denx.de, andreas@kemnade.info, u-boot@lists.denx.de Subject: [PATCH v2 2/2] musb-new: omap2430: fix compiling in DM_USB_GADGET config Date: Mon, 9 Jan 2023 08:13:31 +0100 Message-Id: <20230109071331.2027082-3-andreas@kemnade.info> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230109071331.2027082-1-andreas@kemnade.info> References: <20230109071331.2027082-1-andreas@kemnade.info> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.103.6 at phobos.denx.de X-Virus-Status: Clean Add the separate IRQ handling function and change the registration. Signed-off-by: Andreas Kemnade --- drivers/usb/musb-new/omap2430.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/usb/musb-new/omap2430.c b/drivers/usb/musb-new/omap2430.c index 0d1fb03727..42e7abddbc 100644 --- a/drivers/usb/musb-new/omap2430.c +++ b/drivers/usb/musb-new/omap2430.c @@ -46,6 +46,15 @@ static inline void omap2430_low_level_init(struct musb *musb) musb_writel(musb->mregs, OTG_FORCESTDBY, l); } +#ifdef CONFIG_DM_USB_GADGET +int dm_usb_gadget_handle_interrupts(struct udevice *dev) +{ + struct musb_host_data *host = dev_get_priv(dev); + + host->host->isr(0, host->host); + return 0; +} +#endif static int omap2430_musb_init(struct musb *musb) { @@ -235,6 +244,16 @@ static int omap2430_musb_probe(struct udevice *dev) return -EIO; return musb_lowlevel_init(host); + } else if (CONFIG_IS_ENABLED(DM_USB_GADGET)) { + struct musb_host_data *host = dev_get_priv(dev); + + host->host = musb_init_controller(&plat->plat, + (struct device *)otg_board_data, + plat->base); + if (!host->host) + return -EIO; + + return usb_add_gadget_udc((struct device *)otg_board_data, &host->host->g); } musbp = musb_register(&plat->plat, (struct device *)otg_board_data, -- 2.30.2