From patchwork Tue Apr 19 13:36:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 563940 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E1B4FC4321E for ; Tue, 19 Apr 2022 13:37:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352407AbiDSNki (ORCPT ); Tue, 19 Apr 2022 09:40:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238412AbiDSNkf (ORCPT ); Tue, 19 Apr 2022 09:40:35 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46EE437A8F; Tue, 19 Apr 2022 06:37:49 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id F22EBB8197F; Tue, 19 Apr 2022 13:37:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3D00DC385AF; Tue, 19 Apr 2022 13:37:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1650375466; bh=uk85dachbI2QOyzEdf35KpbxClyHjIWRAqDWzdDgdhI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mruYOH8ME/Vh1wQ1pMChS4oLgW9pQabgidhmksrUD2v1VpjqEkYSVaL8F5/Jx1fJt iWfATQhXYZ2HF/JTCtVwo5XrFWHmaEHiE6zg5UuUIOuzgkBcy0V016jiFYV+rfjvg4 nbWIXvEBktWlCb8U/NzpxCV5jRa0vQe1kx5vmEE+PwnJ8xlKsar1yUF2Ek65ppTRI1 gNA1cS2olATNCQ5F6ThWgt7qsMKQf7IGjg6mb0lxFK6DB8LW3fweuNrfnHKFsjWXSP 2dckRazl0o0Sf/B+mK1VM7FPMYVZMNP94kAS5WiC3zL0qcWam2pXKjNXDyEDSaifQB FGhlzS9XXadRA== From: Arnd Bergmann To: linux-omap@vger.kernel.org, tony@atomide.com, aaro.koskinen@iki.fi, jmkrzyszt@gmail.com Cc: Arnd Bergmann , Russell King , Paul Walmsley , Kevin Hilman , Peter Ujfalusi , Vinod Koul , Dmitry Torokhov , Ulf Hansson , Dominik Brodowski , Mark Brown , Felipe Balbi , Alan Stern , Lee Jones , Daniel Thompson , Jingoo Han , Helge Deller , Linus Walleij , Krzysztof Kozlowski , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, dmaengine@vger.kernel.org, linux-input@vger.kernel.org, linux-mmc@vger.kernel.org, linux-serial@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, alsa-devel@alsa-project.org Subject: [PATCH 01/41] video: fbdev: omapfb: lcd_ams_delta: fix unused variable warning Date: Tue, 19 Apr 2022 15:36:43 +0200 Message-Id: <20220419133723.1394715-2-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20220419133723.1394715-1-arnd@kernel.org> References: <20220419133723.1394715-1-arnd@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org From: Arnd Bergmann A recent cleanup patch removed the only reference to a local variable in some configurations. Move the variable into the one block it is still used in, inside of an #ifdef, to avoid this warning. Fixes: 9d773f103b89 ("video: fbdev: omapfb: lcd_ams_delta: Make use of the helper function dev_err_probe()") Signed-off-by: Arnd Bergmann --- drivers/video/fbdev/omap/lcd_ams_delta.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/video/fbdev/omap/lcd_ams_delta.c b/drivers/video/fbdev/omap/lcd_ams_delta.c index bbf871f9d862..01944ce46aa1 100644 --- a/drivers/video/fbdev/omap/lcd_ams_delta.c +++ b/drivers/video/fbdev/omap/lcd_ams_delta.c @@ -128,7 +128,6 @@ static struct lcd_panel ams_delta_panel = { static int ams_delta_panel_probe(struct platform_device *pdev) { struct lcd_device *lcd_device = NULL; - int ret; gpiod_vblen = devm_gpiod_get(&pdev->dev, "vblen", GPIOD_OUT_LOW); if (IS_ERR(gpiod_vblen)) @@ -145,7 +144,7 @@ static int ams_delta_panel_probe(struct platform_device *pdev) &ams_delta_lcd_ops); if (IS_ERR(lcd_device)) { - ret = PTR_ERR(lcd_device); + int ret = PTR_ERR(lcd_device); dev_err(&pdev->dev, "failed to register device\n"); return ret; } From patchwork Tue Apr 19 13:36:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 563939 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AEDFBC43219 for ; Tue, 19 Apr 2022 13:38:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352434AbiDSNlA (ORCPT ); Tue, 19 Apr 2022 09:41:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352470AbiDSNky (ORCPT ); Tue, 19 Apr 2022 09:40:54 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7009037ABD; Tue, 19 Apr 2022 06:38:02 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id ABF2A616A8; Tue, 19 Apr 2022 13:38:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 626C6C385B4; Tue, 19 Apr 2022 13:37:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1650375481; bh=Cy+wwzOaVgtjDqQCWI06PLYznih6Y2ND7QxFqe4Xpd0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cTxet9qASIyT4pT7/bXgoG7K+343ypyZ3dk2jesY6LllhVU667bteRuuDsMlY1+38 MpXUOXEEZJ1GFmvK1Wx6WWHwUEkzBncehUftqSKvdHbmu1mZlvF9uk/QSI3ydWScQY 9164an8c0Bq2tcooKmOSSORP4/BqxFTRLl0RwGOSPJ/f8XnzC+knL6+AWXbOqxXrO9 jT2WrNqUQlrcLED9/1qX0uSI65WM5jAAklzubs7u45qvte+7LIosfAKSCdPdO+U+yK aa3n07UtWnFgQdNlFXT8HmdCFVXag+AgGjv8BrQWmXVQUtFozHDJ7jeNiH6wjN8YAr +oetnkGXMv64A== From: Arnd Bergmann To: linux-omap@vger.kernel.org, tony@atomide.com, aaro.koskinen@iki.fi, jmkrzyszt@gmail.com Cc: Arnd Bergmann , Russell King , Paul Walmsley , Kevin Hilman , Peter Ujfalusi , Vinod Koul , Dmitry Torokhov , Ulf Hansson , Dominik Brodowski , Mark Brown , Felipe Balbi , Alan Stern , Lee Jones , Daniel Thompson , Jingoo Han , Helge Deller , Linus Walleij , Krzysztof Kozlowski , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, dmaengine@vger.kernel.org, linux-input@vger.kernel.org, linux-mmc@vger.kernel.org, linux-serial@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, alsa-devel@alsa-project.org, Bartlomiej Zolnierkiewicz Subject: [PATCH 03/41] ARM: omap1: move lcd_dma code into omapfb driver Date: Tue, 19 Apr 2022 15:36:45 +0200 Message-Id: <20220419133723.1394715-4-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20220419133723.1394715-1-arnd@kernel.org> References: <20220419133723.1394715-1-arnd@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org From: Arnd Bergmann The omapfb driver is split into platform specific code for omap1, and driver code that is also specific to omap1. Moving both parts into the driver directory simplifies the structure and avoids the dependency on certain omap machine header files. As mach/lcd_dma.h can not be included from include/linux/omap-dma.h any more now, move the omap_lcd_dma_running() declaration into the omap-dma header, which matches where it is defined. Acked-by: Bartlomiej Zolnierkiewicz Signed-off-by: Arnd Bergmann --- arch/arm/mach-omap1/Makefile | 4 -- arch/arm/mach-omap1/include/mach/lcdc.h | 44 ------------------- drivers/video/fbdev/Makefile | 2 +- drivers/video/fbdev/omap/Makefile | 5 +++ .../video/fbdev/omap}/lcd_dma.c | 4 +- .../video/fbdev/omap}/lcd_dma.h | 2 - drivers/video/fbdev/omap/lcdc.c | 2 +- drivers/video/fbdev/omap/lcdc.h | 35 +++++++++++++++ drivers/video/fbdev/omap/sossi.c | 1 + include/linux/omap-dma.h | 4 +- 10 files changed, 48 insertions(+), 55 deletions(-) delete mode 100644 arch/arm/mach-omap1/include/mach/lcdc.h rename {arch/arm/mach-omap1 => drivers/video/fbdev/omap}/lcd_dma.c (99%) rename {arch/arm/mach-omap1/include/mach => drivers/video/fbdev/omap}/lcd_dma.h (98%) diff --git a/arch/arm/mach-omap1/Makefile b/arch/arm/mach-omap1/Makefile index c757a52d0801..450bbf552b57 100644 --- a/arch/arm/mach-omap1/Makefile +++ b/arch/arm/mach-omap1/Makefile @@ -57,7 +57,3 @@ obj-$(CONFIG_ARCH_OMAP730) += gpio7xx.o obj-$(CONFIG_ARCH_OMAP850) += gpio7xx.o obj-$(CONFIG_ARCH_OMAP15XX) += gpio15xx.o obj-$(CONFIG_ARCH_OMAP16XX) += gpio16xx.o - -ifneq ($(CONFIG_FB_OMAP),) -obj-y += lcd_dma.o -endif diff --git a/arch/arm/mach-omap1/include/mach/lcdc.h b/arch/arm/mach-omap1/include/mach/lcdc.h deleted file mode 100644 index 7152db1f5361..000000000000 --- a/arch/arm/mach-omap1/include/mach/lcdc.h +++ /dev/null @@ -1,44 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-or-later */ -/* - * arch/arm/mach-omap1/include/mach/lcdc.h - * - * Extracted from drivers/video/omap/lcdc.c - * Copyright (C) 2004 Nokia Corporation - * Author: Imre Deak - */ -#ifndef __MACH_LCDC_H__ -#define __MACH_LCDC_H__ - -#define OMAP_LCDC_BASE 0xfffec000 -#define OMAP_LCDC_SIZE 256 -#define OMAP_LCDC_IRQ INT_LCD_CTRL - -#define OMAP_LCDC_CONTROL (OMAP_LCDC_BASE + 0x00) -#define OMAP_LCDC_TIMING0 (OMAP_LCDC_BASE + 0x04) -#define OMAP_LCDC_TIMING1 (OMAP_LCDC_BASE + 0x08) -#define OMAP_LCDC_TIMING2 (OMAP_LCDC_BASE + 0x0c) -#define OMAP_LCDC_STATUS (OMAP_LCDC_BASE + 0x10) -#define OMAP_LCDC_SUBPANEL (OMAP_LCDC_BASE + 0x14) -#define OMAP_LCDC_LINE_INT (OMAP_LCDC_BASE + 0x18) -#define OMAP_LCDC_DISPLAY_STATUS (OMAP_LCDC_BASE + 0x1c) - -#define OMAP_LCDC_STAT_DONE (1 << 0) -#define OMAP_LCDC_STAT_VSYNC (1 << 1) -#define OMAP_LCDC_STAT_SYNC_LOST (1 << 2) -#define OMAP_LCDC_STAT_ABC (1 << 3) -#define OMAP_LCDC_STAT_LINE_INT (1 << 4) -#define OMAP_LCDC_STAT_FUF (1 << 5) -#define OMAP_LCDC_STAT_LOADED_PALETTE (1 << 6) - -#define OMAP_LCDC_CTRL_LCD_EN (1 << 0) -#define OMAP_LCDC_CTRL_LCD_TFT (1 << 7) -#define OMAP_LCDC_CTRL_LINE_IRQ_CLR_SEL (1 << 10) - -#define OMAP_LCDC_IRQ_VSYNC (1 << 2) -#define OMAP_LCDC_IRQ_DONE (1 << 3) -#define OMAP_LCDC_IRQ_LOADED_PALETTE (1 << 4) -#define OMAP_LCDC_IRQ_LINE_NIRQ (1 << 5) -#define OMAP_LCDC_IRQ_LINE (1 << 6) -#define OMAP_LCDC_IRQ_MASK (((1 << 5) - 1) << 2) - -#endif /* __MACH_LCDC_H__ */ diff --git a/drivers/video/fbdev/Makefile b/drivers/video/fbdev/Makefile index 477b9624b703..7795c4126706 100644 --- a/drivers/video/fbdev/Makefile +++ b/drivers/video/fbdev/Makefile @@ -110,7 +110,7 @@ obj-$(CONFIG_FB_UDL) += udlfb.o obj-$(CONFIG_FB_SMSCUFX) += smscufx.o obj-$(CONFIG_FB_XILINX) += xilinxfb.o obj-$(CONFIG_FB_SH_MOBILE_LCDC) += sh_mobile_lcdcfb.o -obj-$(CONFIG_FB_OMAP) += omap/ +obj-y += omap/ obj-y += omap2/ obj-$(CONFIG_XEN_FBDEV_FRONTEND) += xen-fbfront.o obj-$(CONFIG_FB_CARMINE) += carminefb.o diff --git a/drivers/video/fbdev/omap/Makefile b/drivers/video/fbdev/omap/Makefile index daaa73a94e7f..b88e02f5cb1f 100644 --- a/drivers/video/fbdev/omap/Makefile +++ b/drivers/video/fbdev/omap/Makefile @@ -5,6 +5,11 @@ obj-$(CONFIG_FB_OMAP) += omapfb.o +ifdef CONFIG_FB_OMAP +# must be built-in +obj-y += lcd_dma.o +endif + objs-yy := omapfb_main.o lcdc.o objs-y$(CONFIG_FB_OMAP_LCDC_EXTERNAL) += sossi.o diff --git a/arch/arm/mach-omap1/lcd_dma.c b/drivers/video/fbdev/omap/lcd_dma.c similarity index 99% rename from arch/arm/mach-omap1/lcd_dma.c rename to drivers/video/fbdev/omap/lcd_dma.c index a72ac0c02b4f..867a63c06f42 100644 --- a/arch/arm/mach-omap1/lcd_dma.c +++ b/drivers/video/fbdev/omap/lcd_dma.c @@ -26,7 +26,9 @@ #include #include -#include + +#include "lcdc.h" +#include "lcd_dma.h" int omap_lcd_dma_running(void) { diff --git a/arch/arm/mach-omap1/include/mach/lcd_dma.h b/drivers/video/fbdev/omap/lcd_dma.h similarity index 98% rename from arch/arm/mach-omap1/include/mach/lcd_dma.h rename to drivers/video/fbdev/omap/lcd_dma.h index 1a3c0cf17899..1b4780197381 100644 --- a/arch/arm/mach-omap1/include/mach/lcd_dma.h +++ b/drivers/video/fbdev/omap/lcd_dma.h @@ -60,6 +60,4 @@ extern void omap_set_lcd_dma_b1_vxres(unsigned long vxres); extern void omap_set_lcd_dma_b1_mirror(int mirror); extern void omap_set_lcd_dma_b1_scale(unsigned int xscale, unsigned int yscale); -extern int omap_lcd_dma_running(void); - #endif /* __MACH_OMAP1_LCD_DMA_H__ */ diff --git a/drivers/video/fbdev/omap/lcdc.c b/drivers/video/fbdev/omap/lcdc.c index 7317c9aad677..d9a23f6cf7fc 100644 --- a/drivers/video/fbdev/omap/lcdc.c +++ b/drivers/video/fbdev/omap/lcdc.c @@ -17,7 +17,6 @@ #include #include -#include #include #include @@ -25,6 +24,7 @@ #include "omapfb.h" #include "lcdc.h" +#include "lcd_dma.h" #define MODULE_NAME "lcdc" diff --git a/drivers/video/fbdev/omap/lcdc.h b/drivers/video/fbdev/omap/lcdc.h index 8a7607d861c1..cbbfd9b9e949 100644 --- a/drivers/video/fbdev/omap/lcdc.h +++ b/drivers/video/fbdev/omap/lcdc.h @@ -1,6 +1,41 @@ /* SPDX-License-Identifier: GPL-2.0 */ #ifndef LCDC_H #define LCDC_H +/* + * Copyright (C) 2004 Nokia Corporation + * Author: Imre Deak + */ +#define OMAP_LCDC_BASE 0xfffec000 +#define OMAP_LCDC_SIZE 256 +#define OMAP_LCDC_IRQ INT_LCD_CTRL + +#define OMAP_LCDC_CONTROL (OMAP_LCDC_BASE + 0x00) +#define OMAP_LCDC_TIMING0 (OMAP_LCDC_BASE + 0x04) +#define OMAP_LCDC_TIMING1 (OMAP_LCDC_BASE + 0x08) +#define OMAP_LCDC_TIMING2 (OMAP_LCDC_BASE + 0x0c) +#define OMAP_LCDC_STATUS (OMAP_LCDC_BASE + 0x10) +#define OMAP_LCDC_SUBPANEL (OMAP_LCDC_BASE + 0x14) +#define OMAP_LCDC_LINE_INT (OMAP_LCDC_BASE + 0x18) +#define OMAP_LCDC_DISPLAY_STATUS (OMAP_LCDC_BASE + 0x1c) + +#define OMAP_LCDC_STAT_DONE (1 << 0) +#define OMAP_LCDC_STAT_VSYNC (1 << 1) +#define OMAP_LCDC_STAT_SYNC_LOST (1 << 2) +#define OMAP_LCDC_STAT_ABC (1 << 3) +#define OMAP_LCDC_STAT_LINE_INT (1 << 4) +#define OMAP_LCDC_STAT_FUF (1 << 5) +#define OMAP_LCDC_STAT_LOADED_PALETTE (1 << 6) + +#define OMAP_LCDC_CTRL_LCD_EN (1 << 0) +#define OMAP_LCDC_CTRL_LCD_TFT (1 << 7) +#define OMAP_LCDC_CTRL_LINE_IRQ_CLR_SEL (1 << 10) + +#define OMAP_LCDC_IRQ_VSYNC (1 << 2) +#define OMAP_LCDC_IRQ_DONE (1 << 3) +#define OMAP_LCDC_IRQ_LOADED_PALETTE (1 << 4) +#define OMAP_LCDC_IRQ_LINE_NIRQ (1 << 5) +#define OMAP_LCDC_IRQ_LINE (1 << 6) +#define OMAP_LCDC_IRQ_MASK (((1 << 5) - 1) << 2) int omap_lcdc_set_dma_callback(void (*callback)(void *data), void *data); void omap_lcdc_free_dma_callback(void); diff --git a/drivers/video/fbdev/omap/sossi.c b/drivers/video/fbdev/omap/sossi.c index 80ac67f27f0d..d3c755b293ea 100644 --- a/drivers/video/fbdev/omap/sossi.c +++ b/drivers/video/fbdev/omap/sossi.c @@ -15,6 +15,7 @@ #include #include "omapfb.h" +#include "lcd_dma.h" #include "lcdc.h" #define MODULE_NAME "omapfb-sossi" diff --git a/include/linux/omap-dma.h b/include/linux/omap-dma.h index 5c5c93ad6b50..441f5f0919c6 100644 --- a/include/linux/omap-dma.h +++ b/include/linux/omap-dma.h @@ -328,8 +328,8 @@ extern dma_addr_t omap_get_dma_dst_pos(int lch); extern int omap_get_dma_active_status(int lch); extern int omap_dma_running(void); -#if defined(CONFIG_ARCH_OMAP1) && IS_ENABLED(CONFIG_FB_OMAP) -#include +#if IS_ENABLED(CONFIG_FB_OMAP) +extern int omap_lcd_dma_running(void); #else static inline int omap_lcd_dma_running(void) { From patchwork Tue Apr 19 13:36:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 563938 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 30A48C4167D for ; Tue, 19 Apr 2022 13:38:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352485AbiDSNlj (ORCPT ); Tue, 19 Apr 2022 09:41:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352521AbiDSNlO (ORCPT ); Tue, 19 Apr 2022 09:41:14 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6649D381B1; Tue, 19 Apr 2022 06:38:18 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 1C771B8197D; Tue, 19 Apr 2022 13:38:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D9A31C385AA; Tue, 19 Apr 2022 13:38:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1650375495; bh=oZtauX33c1zFZCWuCbZTTaJ18jk9xVoX5IhxwTCNxww=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TZAucFVWO41am0SQC0JdPxHsfpXAegfeSL0T5ZxjYhle79NFeZasi7CnlTRQ0kpDT RgJM48CCiZkSwr4OLl5xcJVMcoWUkzpDQ+b/HHC4/3BwGofVK53JoNPEDoPYfu3s0/ x72kXCh33mfbDuG6tyL+6K0tZ9V1e1g5XAq/l+jHQMeIW99BJGZv3/09jXJgLVa6/U T9y58wvo3eiTOXnZahzwQj6xcZW39JaD0b53mh/EEoJgWFgbFV7lbhOfTelyFNZ6JU WcuMxrVRFRsUUAC/roo/+B34yzjcsMkJbIMP/ScuvmFAz2o/Fdbnk2IFbC7fFUY5ZA YUEvYSBt6/XRg== From: Arnd Bergmann To: linux-omap@vger.kernel.org, tony@atomide.com, aaro.koskinen@iki.fi, jmkrzyszt@gmail.com Cc: Arnd Bergmann , Russell King , Paul Walmsley , Kevin Hilman , Peter Ujfalusi , Vinod Koul , Dmitry Torokhov , Ulf Hansson , Dominik Brodowski , Mark Brown , Felipe Balbi , Alan Stern , Lee Jones , Daniel Thompson , Jingoo Han , Helge Deller , Linus Walleij , Krzysztof Kozlowski , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, dmaengine@vger.kernel.org, linux-input@vger.kernel.org, linux-mmc@vger.kernel.org, linux-serial@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, alsa-devel@alsa-project.org, Bartlomiej Zolnierkiewicz Subject: [PATCH 05/41] fbdev: omap: pass irqs as resource Date: Tue, 19 Apr 2022 15:36:47 +0200 Message-Id: <20220419133723.1394715-6-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20220419133723.1394715-1-arnd@kernel.org> References: <20220419133723.1394715-1-arnd@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org From: Arnd Bergmann To avoid relying on the mach/irqs.h header, stop using OMAP_LCDC_IRQ and INT_1610_SoSSI_MATCH directly in the driver code, but instead pass these as resources. Acked-by: Bartlomiej Zolnierkiewicz Signed-off-by: Arnd Bergmann --- arch/arm/mach-omap1/fb.c | 19 ++++++++++++++++++- drivers/video/fbdev/omap/lcdc.c | 6 +++--- drivers/video/fbdev/omap/omapfb.h | 2 ++ drivers/video/fbdev/omap/omapfb_main.c | 16 +++++++++++++++- drivers/video/fbdev/omap/sossi.c | 2 +- 5 files changed, 39 insertions(+), 6 deletions(-) diff --git a/arch/arm/mach-omap1/fb.c b/arch/arm/mach-omap1/fb.c index 0e32a959f254..b093375afc27 100644 --- a/arch/arm/mach-omap1/fb.c +++ b/arch/arm/mach-omap1/fb.c @@ -17,9 +17,12 @@ #include #include #include +#include #include +#include + #if IS_ENABLED(CONFIG_FB_OMAP) static bool omapfb_lcd_configured; @@ -27,6 +30,19 @@ static struct omapfb_platform_data omapfb_config; static u64 omap_fb_dma_mask = ~(u32)0; +struct resource omap_fb_resources[] = { + { + .name = "irq", + .start = INT_LCD_CTRL, + .flags = IORESOURCE_IRQ, + }, + { + .name = "irq", + .start = INT_SOSSI_MATCH, + .flags = IORESOURCE_IRQ, + }, +}; + static struct platform_device omap_fb_device = { .name = "omapfb", .id = -1, @@ -35,7 +51,8 @@ static struct platform_device omap_fb_device = { .coherent_dma_mask = DMA_BIT_MASK(32), .platform_data = &omapfb_config, }, - .num_resources = 0, + .num_resources = ARRAY_SIZE(omap_fb_resources), + .resource = omap_fb_resources, }; void __init omapfb_set_lcd_config(const struct omap_lcd_config *config) diff --git a/drivers/video/fbdev/omap/lcdc.c b/drivers/video/fbdev/omap/lcdc.c index d9a23f6cf7fc..d9731d12bd72 100644 --- a/drivers/video/fbdev/omap/lcdc.c +++ b/drivers/video/fbdev/omap/lcdc.c @@ -713,7 +713,7 @@ static int omap_lcdc_init(struct omapfb_device *fbdev, int ext_mode, } clk_enable(lcdc.lcd_ck); - r = request_irq(OMAP_LCDC_IRQ, lcdc_irq_handler, 0, MODULE_NAME, fbdev); + r = request_irq(fbdev->int_irq, lcdc_irq_handler, 0, MODULE_NAME, fbdev); if (r) { dev_err(fbdev->dev, "unable to get IRQ\n"); goto fail2; @@ -744,7 +744,7 @@ static int omap_lcdc_init(struct omapfb_device *fbdev, int ext_mode, fail4: omap_free_lcd_dma(); fail3: - free_irq(OMAP_LCDC_IRQ, lcdc.fbdev); + free_irq(fbdev->int_irq, lcdc.fbdev); fail2: clk_disable(lcdc.lcd_ck); fail1: @@ -759,7 +759,7 @@ static void omap_lcdc_cleanup(void) free_palette_ram(); free_fbmem(); omap_free_lcd_dma(); - free_irq(OMAP_LCDC_IRQ, lcdc.fbdev); + free_irq(lcdc.fbdev->int_irq, lcdc.fbdev); clk_disable(lcdc.lcd_ck); clk_put(lcdc.lcd_ck); } diff --git a/drivers/video/fbdev/omap/omapfb.h b/drivers/video/fbdev/omap/omapfb.h index d930152c289c..313a051fe7a4 100644 --- a/drivers/video/fbdev/omap/omapfb.h +++ b/drivers/video/fbdev/omap/omapfb.h @@ -204,6 +204,8 @@ struct omapfb_device { struct lcd_panel *panel; /* LCD panel */ const struct lcd_ctrl *ctrl; /* LCD controller */ const struct lcd_ctrl *int_ctrl; /* internal LCD ctrl */ + int ext_irq; + int int_irq; struct lcd_ctrl_extif *ext_if; /* LCD ctrl external interface */ struct device *dev; diff --git a/drivers/video/fbdev/omap/omapfb_main.c b/drivers/video/fbdev/omap/omapfb_main.c index 083388a4ceeb..b8fd509f11e4 100644 --- a/drivers/video/fbdev/omap/omapfb_main.c +++ b/drivers/video/fbdev/omap/omapfb_main.c @@ -1624,7 +1624,7 @@ static int omapfb_do_probe(struct platform_device *pdev, init_state = 0; - if (pdev->num_resources != 0) { + if (pdev->num_resources != 2) { dev_err(&pdev->dev, "probed for an unknown device\n"); r = -ENODEV; goto cleanup; @@ -1643,6 +1643,20 @@ static int omapfb_do_probe(struct platform_device *pdev, r = -ENOMEM; goto cleanup; } + fbdev->int_irq = platform_get_irq(pdev, 0); + if (!fbdev->int_irq) { + dev_err(&pdev->dev, "unable to get irq\n"); + r = ENXIO; + goto cleanup; + } + + fbdev->ext_irq = platform_get_irq(pdev, 1); + if (!fbdev->ext_irq) { + dev_err(&pdev->dev, "unable to get irq\n"); + r = ENXIO; + goto cleanup; + } + init_state++; fbdev->dev = &pdev->dev; diff --git a/drivers/video/fbdev/omap/sossi.c b/drivers/video/fbdev/omap/sossi.c index d3c755b293ea..ade9d452254c 100644 --- a/drivers/video/fbdev/omap/sossi.c +++ b/drivers/video/fbdev/omap/sossi.c @@ -639,7 +639,7 @@ static int sossi_init(struct omapfb_device *fbdev) l &= ~(1 << 31); /* REORDERING */ sossi_write_reg(SOSSI_INIT1_REG, l); - if ((r = request_irq(INT_1610_SoSSI_MATCH, sossi_match_irq, + if ((r = request_irq(fbdev->ext_irq, sossi_match_irq, IRQ_TYPE_EDGE_FALLING, "sossi_match", sossi.fbdev->dev)) < 0) { dev_err(sossi.fbdev->dev, "can't get SoSSI match IRQ\n"); From patchwork Tue Apr 19 13:36:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 563937 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AA56EC43219 for ; Tue, 19 Apr 2022 13:39:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243557AbiDSNl6 (ORCPT ); Tue, 19 Apr 2022 09:41:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352457AbiDSNlk (ORCPT ); Tue, 19 Apr 2022 09:41:40 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 788A937BF2; Tue, 19 Apr 2022 06:38:34 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 01BBFB81984; Tue, 19 Apr 2022 13:38:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 34216C385AF; Tue, 19 Apr 2022 13:38:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1650375511; bh=Np8s2Gyq1pdxV543cfr46FIWCXKZK9Cd/nCYrVx5ojg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u5Gaksw3FT9LBCaZ1FZNe8UJOhDf4P4PqbufxWi5GEe7OYntcB42H8c3bgHyO62oB YAdwuypnRsFBzvZg/CQTzl0wpdrX8smgAmy4Xvzmeeb+gSSG7VJHhtngUJtirQ4aQE kwOJRGQhqx1bnHTdmxQ9qWFSM1cfG749KVfrvCdIABwperZeQJ/HBUXbNskkLz5tWu HhZFFoyzK0SPPg2WPkbJsQ35m2A5fj9NvteJg7sZ7/2EkTy16rcBdWSylBLHQPT42w 3ZiJ+HedXTHY49GMokr8k6po2meO2DCSaIcFBOZ4tfeeJFIP4Xetmxwter86nvYge4 1E6rtQNCe70CQ== From: Arnd Bergmann To: linux-omap@vger.kernel.org, tony@atomide.com, aaro.koskinen@iki.fi, jmkrzyszt@gmail.com Cc: Arnd Bergmann , Russell King , Paul Walmsley , Kevin Hilman , Peter Ujfalusi , Vinod Koul , Dmitry Torokhov , Ulf Hansson , Dominik Brodowski , Mark Brown , Felipe Balbi , Alan Stern , Lee Jones , Daniel Thompson , Jingoo Han , Helge Deller , Linus Walleij , Krzysztof Kozlowski , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, dmaengine@vger.kernel.org, linux-input@vger.kernel.org, linux-mmc@vger.kernel.org, linux-serial@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, alsa-devel@alsa-project.org, Felipe Balbi Subject: [PATCH 07/41] ARM: omap1: move mach/usb.h to include/linux/soc Date: Tue, 19 Apr 2022 15:36:49 +0200 Message-Id: <20220419133723.1394715-8-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20220419133723.1394715-1-arnd@kernel.org> References: <20220419133723.1394715-1-arnd@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org From: Arnd Bergmann The register definitions in this header are used in at least four different places, with little hope of completely cleaning that up. Split up the file into a portion that becomes a linux-wide header under include/linux/soc/ti/, and the parts that are actually only needed by board files. Acked-by: Felipe Balbi Signed-off-by: Arnd Bergmann --- arch/arm/mach-omap1/board-ams-delta.c | 2 +- arch/arm/mach-omap1/board-generic.c | 2 +- arch/arm/mach-omap1/board-h2.c | 2 +- arch/arm/mach-omap1/board-h3.c | 2 +- arch/arm/mach-omap1/board-htcherald.c | 2 +- arch/arm/mach-omap1/board-innovator.c | 2 +- arch/arm/mach-omap1/board-nokia770.c | 2 +- arch/arm/mach-omap1/board-osk.c | 2 +- arch/arm/mach-omap1/board-palmte.c | 2 +- arch/arm/mach-omap1/board-palmtt.c | 2 +- arch/arm/mach-omap1/board-palmz71.c | 2 +- arch/arm/mach-omap1/board-sx1.c | 2 +- arch/arm/mach-omap1/clock_data.c | 2 +- arch/arm/mach-omap1/usb.c | 2 +- arch/arm/mach-omap1/usb.h | 25 +++++++++++++++++ drivers/usb/gadget/udc/omap_udc.c | 3 +- drivers/usb/host/ohci-omap.c | 4 +-- drivers/usb/phy/phy-isp1301-omap.c | 2 +- .../usb.h => include/linux/soc/ti/omap1-usb.h | 28 ++++++------------- 19 files changed, 52 insertions(+), 38 deletions(-) create mode 100644 arch/arm/mach-omap1/usb.h rename arch/arm/mach-omap1/include/mach/usb.h => include/linux/soc/ti/omap1-usb.h (86%) diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c index 12d61ad98395..5b0e99319990 100644 --- a/arch/arm/mach-omap1/board-ams-delta.c +++ b/arch/arm/mach-omap1/board-ams-delta.c @@ -38,7 +38,7 @@ #include #include -#include +#include "usb.h" #include "ams-delta-fiq.h" #include "board-ams-delta.h" diff --git a/arch/arm/mach-omap1/board-generic.c b/arch/arm/mach-omap1/board-generic.c index c62554990115..8ef0a9b17e92 100644 --- a/arch/arm/mach-omap1/board-generic.c +++ b/arch/arm/mach-omap1/board-generic.c @@ -21,7 +21,7 @@ #include -#include +#include "usb.h" #include "common.h" diff --git a/arch/arm/mach-omap1/board-h2.c b/arch/arm/mach-omap1/board-h2.c index 977b0b744c22..b8cf0d84f8ab 100644 --- a/arch/arm/mach-omap1/board-h2.c +++ b/arch/arm/mach-omap1/board-h2.c @@ -42,7 +42,7 @@ #include "flash.h" #include -#include +#include "usb.h" #include "common.h" #include "board-h2.h" diff --git a/arch/arm/mach-omap1/board-h3.c b/arch/arm/mach-omap1/board-h3.c index 4249984f9c30..86260498c344 100644 --- a/arch/arm/mach-omap1/board-h3.c +++ b/arch/arm/mach-omap1/board-h3.c @@ -45,7 +45,7 @@ #include #include -#include +#include "usb.h" #include "common.h" #include "board-h3.h" diff --git a/arch/arm/mach-omap1/board-htcherald.c b/arch/arm/mach-omap1/board-htcherald.c index 258304edf23e..f7220b60eb61 100644 --- a/arch/arm/mach-omap1/board-htcherald.c +++ b/arch/arm/mach-omap1/board-htcherald.c @@ -31,7 +31,7 @@ #include "mmc.h" #include -#include +#include "usb.h" #include "common.h" diff --git a/arch/arm/mach-omap1/board-innovator.c b/arch/arm/mach-omap1/board-innovator.c index 2425f1bacb33..e7d6735d4701 100644 --- a/arch/arm/mach-omap1/board-innovator.c +++ b/arch/arm/mach-omap1/board-innovator.c @@ -34,7 +34,7 @@ #include #include -#include +#include "usb.h" #include "iomap.h" #include "common.h" diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c index 11511ae2e0a2..e43c852103f5 100644 --- a/arch/arm/mach-omap1/board-nokia770.c +++ b/arch/arm/mach-omap1/board-nokia770.c @@ -31,7 +31,7 @@ #include #include -#include +#include "usb.h" #include "common.h" #include "clock.h" diff --git a/arch/arm/mach-omap1/board-osk.c b/arch/arm/mach-omap1/board-osk.c index e18b6f13300e..b627a4351cf0 100644 --- a/arch/arm/mach-omap1/board-osk.c +++ b/arch/arm/mach-omap1/board-osk.c @@ -52,7 +52,7 @@ #include #include -#include +#include "usb.h" #include "common.h" diff --git a/arch/arm/mach-omap1/board-palmte.c b/arch/arm/mach-omap1/board-palmte.c index ce6f0fcd9d12..4ac981c5cf74 100644 --- a/arch/arm/mach-omap1/board-palmte.c +++ b/arch/arm/mach-omap1/board-palmte.c @@ -38,7 +38,7 @@ #include #include -#include +#include "usb.h" #include "mmc.h" #include "common.h" diff --git a/arch/arm/mach-omap1/board-palmtt.c b/arch/arm/mach-omap1/board-palmtt.c index 8a08311c4e05..e48ae5fbe1b1 100644 --- a/arch/arm/mach-omap1/board-palmtt.c +++ b/arch/arm/mach-omap1/board-palmtt.c @@ -38,7 +38,7 @@ #include #include -#include +#include "usb.h" #include "common.h" diff --git a/arch/arm/mach-omap1/board-palmz71.c b/arch/arm/mach-omap1/board-palmz71.c index 034e5bc6a029..37db0ab31528 100644 --- a/arch/arm/mach-omap1/board-palmz71.c +++ b/arch/arm/mach-omap1/board-palmz71.c @@ -40,7 +40,7 @@ #include #include -#include +#include "usb.h" #include "common.h" diff --git a/arch/arm/mach-omap1/board-sx1.c b/arch/arm/mach-omap1/board-sx1.c index bb9ec345e204..0965b1b689ec 100644 --- a/arch/arm/mach-omap1/board-sx1.c +++ b/arch/arm/mach-omap1/board-sx1.c @@ -38,7 +38,7 @@ #include "board-sx1.h" #include -#include +#include "usb.h" #include "common.h" diff --git a/arch/arm/mach-omap1/clock_data.c b/arch/arm/mach-omap1/clock_data.c index 3ebcd96efbff..ef46c5f67cf9 100644 --- a/arch/arm/mach-omap1/clock_data.c +++ b/arch/arm/mach-omap1/clock_data.c @@ -22,7 +22,7 @@ #include "soc.h" #include -#include /* for OTG_BASE */ +#include "usb.h" /* for OTG_BASE */ #include "iomap.h" #include "clock.h" diff --git a/arch/arm/mach-omap1/usb.c b/arch/arm/mach-omap1/usb.c index e60831c82b78..fa658054fc57 100644 --- a/arch/arm/mach-omap1/usb.c +++ b/arch/arm/mach-omap1/usb.c @@ -17,7 +17,7 @@ #include -#include +#include "usb.h" #include "common.h" diff --git a/arch/arm/mach-omap1/usb.h b/arch/arm/mach-omap1/usb.h new file mode 100644 index 000000000000..08c9344c46e3 --- /dev/null +++ b/arch/arm/mach-omap1/usb.h @@ -0,0 +1,25 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * fixme correct answer depends on hmc_mode, + * as does (on omap1) any nonzero value for config->otg port number + */ +#include +#include + +#if IS_ENABLED(CONFIG_USB_OMAP) +#define is_usb0_device(config) 1 +#else +#define is_usb0_device(config) 0 +#endif + +#if IS_ENABLED(CONFIG_USB_SUPPORT) +void omap1_usb_init(struct omap_usb_config *pdata); +#else +static inline void omap1_usb_init(struct omap_usb_config *pdata) +{ +} +#endif + +#define OMAP1_OHCI_BASE 0xfffba000 +#define OMAP2_OHCI_BASE 0x4805e000 +#define OMAP_OHCI_BASE OMAP1_OHCI_BASE diff --git a/drivers/usb/gadget/udc/omap_udc.c b/drivers/usb/gadget/udc/omap_udc.c index 2d9815dad2ff..b1da584585cf 100644 --- a/drivers/usb/gadget/udc/omap_udc.c +++ b/drivers/usb/gadget/udc/omap_udc.c @@ -40,8 +40,9 @@ #include #include +#include -#include +#include #include "omap_udc.h" diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c index 45dcf8292072..7be1ffefc40e 100644 --- a/drivers/usb/host/ohci-omap.c +++ b/drivers/usb/host/ohci-omap.c @@ -25,6 +25,8 @@ #include #include #include +#include +#include #include #include #include @@ -37,8 +39,6 @@ #include #include -#include - #define DRIVER_DESC "OHCI OMAP driver" diff --git a/drivers/usb/phy/phy-isp1301-omap.c b/drivers/usb/phy/phy-isp1301-omap.c index 190699b38b41..88aade82b82b 100644 --- a/drivers/usb/phy/phy-isp1301-omap.c +++ b/drivers/usb/phy/phy-isp1301-omap.c @@ -25,7 +25,7 @@ #include -#include +#include #undef VERBOSE diff --git a/arch/arm/mach-omap1/include/mach/usb.h b/include/linux/soc/ti/omap1-usb.h similarity index 86% rename from arch/arm/mach-omap1/include/mach/usb.h rename to include/linux/soc/ti/omap1-usb.h index 5429d86c7190..67488698601a 100644 --- a/arch/arm/mach-omap1/include/mach/usb.h +++ b/include/linux/soc/ti/omap1-usb.h @@ -1,34 +1,20 @@ /* SPDX-License-Identifier: GPL-2.0 */ +#ifndef __SOC_TI_OMAP1_USB +#define __SOC_TI_OMAP1_USB /* - * FIXME correct answer depends on hmc_mode, - * as does (on omap1) any nonzero value for config->otg port number + * Constants in this file are used all over the place, in platform + * code, as well as the udc, phy and ohci drivers. + * This is not a great design, but unlikely to get fixed after + * such a long time. Don't do this elsewhere. */ -#if IS_ENABLED(CONFIG_USB_OMAP) -#define is_usb0_device(config) 1 -#else -#define is_usb0_device(config) 0 -#endif - -#include - -#if IS_ENABLED(CONFIG_USB_SUPPORT) -void omap1_usb_init(struct omap_usb_config *pdata); -#else -static inline void omap1_usb_init(struct omap_usb_config *pdata) -{ -} -#endif #define OMAP1_OTG_BASE 0xfffb0400 #define OMAP1_UDC_BASE 0xfffb4000 -#define OMAP1_OHCI_BASE 0xfffba000 -#define OMAP2_OHCI_BASE 0x4805e000 #define OMAP2_UDC_BASE 0x4805e200 #define OMAP2_OTG_BASE 0x4805e300 #define OTG_BASE OMAP1_OTG_BASE #define UDC_BASE OMAP1_UDC_BASE -#define OMAP_OHCI_BASE OMAP1_OHCI_BASE /* * OTG and transceiver registers, for OMAPs starting with ARM926 @@ -126,3 +112,5 @@ static inline void omap1_usb_init(struct omap_usb_config *pdata) # define CONF_USB0_ISOLATE_R (1 << 3) # define CONF_USB_PWRDN_DM_R (1 << 2) # define CONF_USB_PWRDN_DP_R (1 << 1) + +#endif From patchwork Tue Apr 19 13:36:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 563936 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1066CC433EF for ; Tue, 19 Apr 2022 13:39:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352538AbiDSNmO (ORCPT ); Tue, 19 Apr 2022 09:42:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352456AbiDSNlq (ORCPT ); Tue, 19 Apr 2022 09:41:46 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9FBBB3818A; Tue, 19 Apr 2022 06:38:47 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 39F0D6169B; Tue, 19 Apr 2022 13:38:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BFE78C385A5; Tue, 19 Apr 2022 13:38:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1650375526; bh=RR8FHUt8/oVOHCndemgdv0yQ+gJWVi08oSUPSCA8r+A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FjyAQX1V1Mtq5rmgyreMTZhE3/aJBxgkMqWfV0riRO23vuyzYq/zn4LgLEsRpPY/l DQmmsn9xT0+qY3/PXuyKKsFDGMgZhu8Ddawg3jVOO+PbTKZTwvJLooQWJOrl+HaB/O AN85kED9oV3T2m4YPSPzkaicNd85/MKhtRTpzOZrR1O1IwS5AGlDoe22qvgRvyYVmp 0q0Z8oey3GPFsFg0mzWOUndrW5ruI9D+QP02L6mUJV+H5efX4UhX5GpUaq3ZRQjLzt xg9dQpFAlmTyoWXkYs+Cvc8YFJt1I6n7of27SYxlG1Q2NZgRo7lBZYbAsDvPq2cz0n ZD+j1qthwTwyg== From: Arnd Bergmann To: linux-omap@vger.kernel.org, tony@atomide.com, aaro.koskinen@iki.fi, jmkrzyszt@gmail.com Cc: Arnd Bergmann , Russell King , Paul Walmsley , Kevin Hilman , Peter Ujfalusi , Vinod Koul , Dmitry Torokhov , Ulf Hansson , Dominik Brodowski , Mark Brown , Felipe Balbi , Alan Stern , Lee Jones , Daniel Thompson , Jingoo Han , Helge Deller , Linus Walleij , Krzysztof Kozlowski , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, dmaengine@vger.kernel.org, linux-input@vger.kernel.org, linux-mmc@vger.kernel.org, linux-serial@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, alsa-devel@alsa-project.org Subject: [PATCH 09/41] ARM: omap1: move perseus spi pinconf to board file Date: Tue, 19 Apr 2022 15:36:51 +0200 Message-Id: <20220419133723.1394715-10-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20220419133723.1394715-1-arnd@kernel.org> References: <20220419133723.1394715-1-arnd@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org From: Arnd Bergmann The driver has always had a FIXME about this, and it seems like this trivial code move avoids a mach header inclusion, so just do it. With that out of the way, and the header file inclusions changed to global files, the driver can also be compile-tested on other platforms. Acked-by: Mark Brown Signed-off-by: Arnd Bergmann --- arch/arm/mach-omap1/board-perseus2.c | 6 ++++++ drivers/spi/Kconfig | 2 +- drivers/spi/spi-omap-uwire.c | 15 +++------------ 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/arch/arm/mach-omap1/board-perseus2.c b/arch/arm/mach-omap1/board-perseus2.c index 1aeeb7337d29..da0155107d85 100644 --- a/arch/arm/mach-omap1/board-perseus2.c +++ b/arch/arm/mach-omap1/board-perseus2.c @@ -289,6 +289,12 @@ static void __init omap_perseus2_init(void) omap_cfg_reg(F4_7XX_KBC3); omap_cfg_reg(E3_7XX_KBC4); + if (IS_ENABLED(CONFIG_SPI_OMAP_UWIRE)) { + /* configure pins: MPU_UW_nSCS1, MPU_UW_SDO, MPU_UW_SCLK */ + int val = omap_readl(OMAP7XX_IO_CONF_9) & ~0x00EEE000; + omap_writel(val | 0x00AAA000, OMAP7XX_IO_CONF_9); + } + platform_add_devices(devices, ARRAY_SIZE(devices)); omap_serial_init(); diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig index d2815eb361c0..6c28ca232444 100644 --- a/drivers/spi/Kconfig +++ b/drivers/spi/Kconfig @@ -631,7 +631,7 @@ config SPI_OCTEON config SPI_OMAP_UWIRE tristate "OMAP1 MicroWire" - depends on ARCH_OMAP1 + depends on ARCH_OMAP1 || (ARM && COMPILE_TEST) select SPI_BITBANG help This hooks up to the MicroWire controller on OMAP1 chips. diff --git a/drivers/spi/spi-omap-uwire.c b/drivers/spi/spi-omap-uwire.c index 087172a193fa..29198e6815b2 100644 --- a/drivers/spi/spi-omap-uwire.c +++ b/drivers/spi/spi-omap-uwire.c @@ -44,13 +44,10 @@ #include #include -#include #include - -#include - -#include /* OMAP7XX_IO_CONF registers */ - +#include +#include +#include /* FIXME address is now a platform device resource, * and irqs should show there too... @@ -548,12 +545,6 @@ static int __init omap_uwire_init(void) omap_cfg_reg(N14_1610_UWIRE_CS0); omap_cfg_reg(N15_1610_UWIRE_CS1); } - if (machine_is_omap_perseus2()) { - /* configure pins: MPU_UW_nSCS1, MPU_UW_SDO, MPU_UW_SCLK */ - int val = omap_readl(OMAP7XX_IO_CONF_9) & ~0x00EEE000; - omap_writel(val | 0x00AAA000, OMAP7XX_IO_CONF_9); - } - return platform_driver_register(&uwire_driver); } From patchwork Tue Apr 19 13:36:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 563928 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9A90EC43217 for ; Tue, 19 Apr 2022 13:42:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352587AbiDSNpK (ORCPT ); Tue, 19 Apr 2022 09:45:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352613AbiDSNl4 (ORCPT ); Tue, 19 Apr 2022 09:41:56 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C45BD37BF3; Tue, 19 Apr 2022 06:39:11 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 8176FB81982; Tue, 19 Apr 2022 13:39:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2380AC385A8; Tue, 19 Apr 2022 13:39:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1650375549; bh=vO/bPd1PQ9hX0L2CV68DjG3d21RjoFDCbeNW9JFFn4s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i/7k/0F4r+E1Ur3z329l1Cj5g6ftB8oHQwHSKR1c5qv5Sg7DTH6Yfai9kN/3xqIG2 6IN+CC95Vy2J9Ecwiqu9jWLiRWHVIRsEYbraSEFksjcs4ejGoj4CLQt1bPvfSrevg1 Yq0O4PA1y1h2ip/jGL8GEaPuT5rLYGT2eKrRRFBMDLn3T+XmQZzgJHZaYZjmp5Ifqh zPEF1FobgULdceNOjlrrAVUkcHB8AklSGR/iVkkqLtnOeADz098ACszzEAEOTLv0jD wNQhDFHsfHDookQXljdeMUAjhviMzHxOZBk30q/fEeERal0vp7CC5caie0j1VqHLTj MLWQvzBYRx05A== From: Arnd Bergmann To: linux-omap@vger.kernel.org, tony@atomide.com, aaro.koskinen@iki.fi, jmkrzyszt@gmail.com Cc: Arnd Bergmann , Russell King , Paul Walmsley , Kevin Hilman , Peter Ujfalusi , Vinod Koul , Dmitry Torokhov , Ulf Hansson , Dominik Brodowski , Mark Brown , Felipe Balbi , Alan Stern , Lee Jones , Daniel Thompson , Jingoo Han , Helge Deller , Linus Walleij , Krzysztof Kozlowski , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, dmaengine@vger.kernel.org, linux-input@vger.kernel.org, linux-mmc@vger.kernel.org, linux-serial@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, alsa-devel@alsa-project.org, Greg Kroah-Hartman , Felipe Balbi Subject: [PATCH 12/41] usb: omap: avoid mach/*.h headers Date: Tue, 19 Apr 2022 15:36:54 +0200 Message-Id: <20220419133723.1394715-13-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20220419133723.1394715-1-arnd@kernel.org> References: <20220419133723.1394715-1-arnd@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org From: Arnd Bergmann The omap usb drivers still rely on mach/*.h headers that are explicitly or implicitly included, but all the required definitions are now in include/linux/soc/ti/, so use those instead and allow compile-testing on other architectures. Acked-by: Greg Kroah-Hartman Acked-by: Felipe Balbi Signed-off-by: Arnd Bergmann --- drivers/usb/gadget/udc/Kconfig | 2 +- drivers/usb/gadget/udc/omap_udc.c | 2 ++ drivers/usb/host/Kconfig | 2 +- drivers/usb/host/ohci-omap.c | 7 +++---- drivers/usb/phy/Kconfig | 3 ++- drivers/usb/phy/phy-isp1301-omap.c | 4 ++-- 6 files changed, 11 insertions(+), 9 deletions(-) diff --git a/drivers/usb/gadget/udc/Kconfig b/drivers/usb/gadget/udc/Kconfig index 69394dc1cdfb..cee934dce4f0 100644 --- a/drivers/usb/gadget/udc/Kconfig +++ b/drivers/usb/gadget/udc/Kconfig @@ -128,7 +128,7 @@ config USB_GR_UDC config USB_OMAP tristate "OMAP USB Device Controller" - depends on ARCH_OMAP1 + depends on ARCH_OMAP1 || (ARCH_OMAP && COMPILE_TEST) depends on ISP1301_OMAP || !(MACH_OMAP_H2 || MACH_OMAP_H3) help Many Texas Instruments OMAP processors have flexible full diff --git a/drivers/usb/gadget/udc/omap_udc.c b/drivers/usb/gadget/udc/omap_udc.c index b1da584585cf..5096d24915ce 100644 --- a/drivers/usb/gadget/udc/omap_udc.c +++ b/drivers/usb/gadget/udc/omap_udc.c @@ -43,6 +43,8 @@ #include #include +#include +#include #include "omap_udc.h" diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig index 57ca5f97a3dc..682b3d2da623 100644 --- a/drivers/usb/host/Kconfig +++ b/drivers/usb/host/Kconfig @@ -214,7 +214,7 @@ config USB_EHCI_HCD_NPCM7XX config USB_EHCI_HCD_OMAP tristate "EHCI support for OMAP3 and later chips" - depends on ARCH_OMAP + depends on ARCH_OMAP || COMPILE_TEST depends on NOP_USB_XCEIV default y help diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c index 7be1ffefc40e..750a90c41a0a 100644 --- a/drivers/usb/host/ohci-omap.c +++ b/drivers/usb/host/ohci-omap.c @@ -27,6 +27,9 @@ #include #include #include +#include +#include +#include #include #include #include @@ -36,10 +39,6 @@ #include #include -#include - -#include - #define DRIVER_DESC "OHCI OMAP driver" struct ohci_omap_priv { diff --git a/drivers/usb/phy/Kconfig b/drivers/usb/phy/Kconfig index 52eebcb88c1f..2acbe41fbf7e 100644 --- a/drivers/usb/phy/Kconfig +++ b/drivers/usb/phy/Kconfig @@ -30,7 +30,8 @@ config FSL_USB2_OTG config ISP1301_OMAP tristate "Philips ISP1301 with OMAP OTG" - depends on I2C && ARCH_OMAP_OTG + depends on I2C + depends on ARCH_OMAP_OTG || (ARM && COMPILE_TEST) depends on USB depends on USB_GADGET || !USB_GADGET # if USB_GADGET=m, this can't be 'y' select USB_PHY diff --git a/drivers/usb/phy/phy-isp1301-omap.c b/drivers/usb/phy/phy-isp1301-omap.c index 88aade82b82b..f8bd93fe69cd 100644 --- a/drivers/usb/phy/phy-isp1301-omap.c +++ b/drivers/usb/phy/phy-isp1301-omap.c @@ -23,9 +23,9 @@ #include #include -#include - +#include #include +#include #undef VERBOSE From patchwork Tue Apr 19 13:36:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 563931 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 72A7DC433F5 for ; Tue, 19 Apr 2022 13:41:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237438AbiDSNoN (ORCPT ); Tue, 19 Apr 2022 09:44:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352696AbiDSNmi (ORCPT ); Tue, 19 Apr 2022 09:42:38 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D53038DA8; Tue, 19 Apr 2022 06:39:40 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id CDCF6B8197F; Tue, 19 Apr 2022 13:39:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E95D2C385B7; Tue, 19 Apr 2022 13:39:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1650375577; bh=/1rRcvDuoUNuJnmYPxOkUtRPrNjTWfgWCQQLuGK0bF0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HzTn7rZS28K28plwPgCJQ1ghRASliQgI+2FNpVIvzNFzUi1UMK5PsDjZfQF3E1zqt mnS9gOUBto2VoRVRCx4Yuj8lbyW2OmCu+xl6Yg/lQSI7z3yCggGhd8SZLzhUTKkV0G 4ogMF4OyTC9vLOk3qkrtZxw01Hx1kngOU7CkWOkrZ7irrMS32QrmiusUzBa73hEit/ zPGdRbq5Q5uW64+CqYtjA3PCCVDipYSV0x3AONDo7ffgU5sraeCgGnABr+zWsns3bI fd00kWQV003loXXb9YePqTFuhXdVkfreFhqu2YPTGCtBIjFiNHdyrGAFpEfaT8V4vz PhMvBlCy/tvnA== From: Arnd Bergmann To: linux-omap@vger.kernel.org, tony@atomide.com, aaro.koskinen@iki.fi, jmkrzyszt@gmail.com Cc: Arnd Bergmann , Russell King , Paul Walmsley , Kevin Hilman , Peter Ujfalusi , Vinod Koul , Dmitry Torokhov , Ulf Hansson , Dominik Brodowski , Mark Brown , Felipe Balbi , Alan Stern , Lee Jones , Daniel Thompson , Jingoo Han , Helge Deller , Linus Walleij , Krzysztof Kozlowski , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, dmaengine@vger.kernel.org, linux-input@vger.kernel.org, linux-mmc@vger.kernel.org, linux-serial@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, alsa-devel@alsa-project.org, Felipe Balbi Subject: [PATCH 16/41] ARM: omap1: innovator: move ohci phy power handling to board file Date: Tue, 19 Apr 2022 15:36:58 +0200 Message-Id: <20220419133723.1394715-17-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20220419133723.1394715-1-arnd@kernel.org> References: <20220419133723.1394715-1-arnd@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org From: Arnd Bergmann The innovator board needs a special case for its phy control. Move the corresponding code into the board file and out of the common code by adding another callback. Acked-by: Felipe Balbi Signed-off-by: Arnd Bergmann --- arch/arm/mach-omap1/board-innovator.c | 19 +++++++++++++++ drivers/usb/host/ohci-omap.c | 31 ++++--------------------- include/linux/platform_data/usb-omap1.h | 2 ++ 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/arch/arm/mach-omap1/board-innovator.c b/arch/arm/mach-omap1/board-innovator.c index e7d6735d4701..f169e172421d 100644 --- a/arch/arm/mach-omap1/board-innovator.c +++ b/arch/arm/mach-omap1/board-innovator.c @@ -290,6 +290,23 @@ static void __init innovator_init_smc91x(void) } #ifdef CONFIG_ARCH_OMAP15XX +/* + * Board specific gang-switched transceiver power on/off. + */ +static int innovator_omap_ohci_transceiver_power(int on) +{ + if (on) + __raw_writeb(__raw_readb(INNOVATOR_FPGA_CAM_USB_CONTROL) + | ((1 << 5/*usb1*/) | (1 << 3/*usb2*/)), + INNOVATOR_FPGA_CAM_USB_CONTROL); + else + __raw_writeb(__raw_readb(INNOVATOR_FPGA_CAM_USB_CONTROL) + & ~((1 << 5/*usb1*/) | (1 << 3/*usb2*/)), + INNOVATOR_FPGA_CAM_USB_CONTROL); + + return 0; +} + static struct omap_usb_config innovator1510_usb_config __initdata = { /* for bundled non-standard host and peripheral cables */ .hmc_mode = 4, @@ -300,6 +317,8 @@ static struct omap_usb_config innovator1510_usb_config __initdata = { .register_dev = 1, .pins[0] = 2, + + .transceiver_power = innovator_omap_ohci_transceiver_power, }; static const struct omap_lcd_config innovator1510_lcd_config __initconst = { diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c index 750a90c41a0a..069791d25abb 100644 --- a/drivers/usb/host/ohci-omap.c +++ b/drivers/usb/host/ohci-omap.c @@ -67,31 +67,6 @@ static void omap_ohci_clock_power(struct ohci_omap_priv *priv, int on) } } -/* - * Board specific gang-switched transceiver power on/off. - * NOTE: OSK supplies power from DC, not battery. - */ -static int omap_ohci_transceiver_power(struct ohci_omap_priv *priv, int on) -{ - if (on) { - if (machine_is_omap_innovator() && cpu_is_omap1510()) - __raw_writeb(__raw_readb(INNOVATOR_FPGA_CAM_USB_CONTROL) - | ((1 << 5/*usb1*/) | (1 << 3/*usb2*/)), - INNOVATOR_FPGA_CAM_USB_CONTROL); - else if (priv->power) - gpiod_set_value_cansleep(priv->power, 0); - } else { - if (machine_is_omap_innovator() && cpu_is_omap1510()) - __raw_writeb(__raw_readb(INNOVATOR_FPGA_CAM_USB_CONTROL) - & ~((1 << 5/*usb1*/) | (1 << 3/*usb2*/)), - INNOVATOR_FPGA_CAM_USB_CONTROL); - else if (priv->power) - gpiod_set_value_cansleep(priv->power, 1); - } - - return 0; -} - #ifdef CONFIG_USB_OTG static void start_hnp(struct ohci_hcd *ohci) @@ -202,7 +177,11 @@ static int ohci_omap_reset(struct usb_hcd *hcd) } /* FIXME hub_wq hub requests should manage power switching */ - omap_ohci_transceiver_power(priv, 1); + if (config->transceiver_power) + return config->transceiver_power(1); + + if (priv->power) + gpiod_set_value_cansleep(priv->power, 0); /* board init will have already handled HMC and mux setup. * any external transceiver should already be initialized diff --git a/include/linux/platform_data/usb-omap1.h b/include/linux/platform_data/usb-omap1.h index 878e572a78bf..e7b8dc92a269 100644 --- a/include/linux/platform_data/usb-omap1.h +++ b/include/linux/platform_data/usb-omap1.h @@ -50,6 +50,8 @@ struct omap_usb_config { int (*ocpi_enable)(void); void (*lb_reset)(void); + + int (*transceiver_power)(int on); }; #endif /* __LINUX_USB_OMAP1_H */ From patchwork Tue Apr 19 13:36:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 563934 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A9C88C4167B for ; Tue, 19 Apr 2022 13:41:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352771AbiDSNnz (ORCPT ); Tue, 19 Apr 2022 09:43:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352737AbiDSNml (ORCPT ); Tue, 19 Apr 2022 09:42:41 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B96543914F; Tue, 19 Apr 2022 06:39:45 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 437EB616A3; Tue, 19 Apr 2022 13:39:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 11D9CC385A7; Tue, 19 Apr 2022 13:39:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1650375584; bh=x1mvWl2U7fZILb5TbyNkFpMm6/MypG7RO5sXAsxLvRg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PZTxNL5DSXCYDgJG8/+vLbglm3Bhpk5h/Ugh3KUJ531orszQSnNDG73cQlb4bZj0Z HBwfwm3Fn7Q0EsAJCI4GK9LiCXzD1yNHN8VW/FO14KinCNU1FkRN0TGkYURwKC6MQ+ DTiCUh0nUOK7+AnvZnl6/cpsoi3FJisdZmBonypOAIOjqDOfu07w90A2ngtcRTl0k/ tn3+f7kw7MCBRbxGjZrMN+Jpn0HXe4XH2X02BuHpYN9z5uaKHSEmxpZnVQHVMccNtZ ujjtywF56S80y2RETVswGMcLzlBjDwf5rDrx3BJsgCkT53Z2c14D77ga1UB6uWLFWf 6ZqDHxa1AcOJg== From: Arnd Bergmann To: linux-omap@vger.kernel.org, tony@atomide.com, aaro.koskinen@iki.fi, jmkrzyszt@gmail.com Cc: Arnd Bergmann , Russell King , Paul Walmsley , Kevin Hilman , Peter Ujfalusi , Vinod Koul , Dmitry Torokhov , Ulf Hansson , Dominik Brodowski , Mark Brown , Felipe Balbi , Alan Stern , Lee Jones , Daniel Thompson , Jingoo Han , Helge Deller , Linus Walleij , Krzysztof Kozlowski , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, dmaengine@vger.kernel.org, linux-input@vger.kernel.org, linux-mmc@vger.kernel.org, linux-serial@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, alsa-devel@alsa-project.org Subject: [PATCH 17/41] ARM: omap1: move 32k counter from plat-omap to mach-omap1 Date: Tue, 19 Apr 2022 15:36:59 +0200 Message-Id: <20220419133723.1394715-18-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20220419133723.1394715-1-arnd@kernel.org> References: <20220419133723.1394715-1-arnd@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org From: Arnd Bergmann omap2 stopped using this code with commit 8d39ff3d1696 ("ARM: OMAP2+: Remove unused legacy code for timer"), so just move it to mach-omap1 now, along with the other half of that driver. Signed-off-by: Arnd Bergmann --- arch/arm/mach-omap1/Kconfig | 16 +++ arch/arm/mach-omap1/timer32k.c | 96 ++++++++++++++- arch/arm/plat-omap/Kconfig | 17 --- arch/arm/plat-omap/Makefile | 2 +- arch/arm/plat-omap/counter_32k.c | 114 ------------------ arch/arm/plat-omap/include/plat/counter-32k.h | 1 - 6 files changed, 110 insertions(+), 136 deletions(-) delete mode 100644 arch/arm/plat-omap/counter_32k.c delete mode 100644 arch/arm/plat-omap/include/plat/counter-32k.h diff --git a/arch/arm/mach-omap1/Kconfig b/arch/arm/mach-omap1/Kconfig index 208c700c2455..04155b5ce978 100644 --- a/arch/arm/mach-omap1/Kconfig +++ b/arch/arm/mach-omap1/Kconfig @@ -53,6 +53,22 @@ config OMAP_MUX_WARNINGS to change the pin multiplexing setup. When there are no warnings printed, it's safe to deselect OMAP_MUX for your product. +config OMAP_32K_TIMER + bool "Use 32KHz timer" + depends on ARCH_OMAP16XX + default ARCH_OMAP16XX + help + Select this option if you want to enable the OMAP 32KHz timer. + This timer saves power compared to the OMAP_MPU_TIMER, and has + support for no tick during idle. The 32KHz timer provides less + intra-tick resolution than OMAP_MPU_TIMER. The 32KHz timer is + currently only available for OMAP16XX, 24XX, 34XX, OMAP4/5 and DRA7XX. + + On OMAP2PLUS this value is only used for CONFIG_HZ and + CLOCK_TICK_RATE compile time calculation. + The actual timer selection is done in the board file + through the (DT_)MACHINE_START structure. + comment "OMAP Board Type" config MACH_OMAP_INNOVATOR diff --git a/arch/arm/mach-omap1/timer32k.c b/arch/arm/mach-omap1/timer32k.c index 780fdf03c3ce..11958ccd894d 100644 --- a/arch/arm/mach-omap1/timer32k.c +++ b/arch/arm/mach-omap1/timer32k.c @@ -45,15 +45,13 @@ #include #include #include +#include #include #include #include -#include - #include - #include "common.h" /* @@ -159,6 +157,98 @@ static __init void omap_init_32k_timer(void) OMAP_32K_TICKS_PER_SEC, 1, 0xfffffffe); } +/* OMAP2_32KSYNCNT_CR_OFF: offset of 32ksync counter register */ +#define OMAP2_32KSYNCNT_REV_OFF 0x0 +#define OMAP2_32KSYNCNT_REV_SCHEME (0x3 << 30) +#define OMAP2_32KSYNCNT_CR_OFF_LOW 0x10 +#define OMAP2_32KSYNCNT_CR_OFF_HIGH 0x30 + +/* + * 32KHz clocksource ... always available, on pretty most chips except + * OMAP 730 and 1510. Other timers could be used as clocksources, with + * higher resolution in free-running counter modes (e.g. 12 MHz xtal), + * but systems won't necessarily want to spend resources that way. + */ +static void __iomem *sync32k_cnt_reg; + +static u64 notrace omap_32k_read_sched_clock(void) +{ + return sync32k_cnt_reg ? readl_relaxed(sync32k_cnt_reg) : 0; +} + +/** + * omap_read_persistent_clock64 - Return time from a persistent clock. + * + * Reads the time from a source which isn't disabled during PM, the + * 32k sync timer. Convert the cycles elapsed since last read into + * nsecs and adds to a monotonically increasing timespec64. + */ +static struct timespec64 persistent_ts; +static cycles_t cycles; +static unsigned int persistent_mult, persistent_shift; + +static void omap_read_persistent_clock64(struct timespec64 *ts) +{ + unsigned long long nsecs; + cycles_t last_cycles; + + last_cycles = cycles; + cycles = sync32k_cnt_reg ? readl_relaxed(sync32k_cnt_reg) : 0; + + nsecs = clocksource_cyc2ns(cycles - last_cycles, + persistent_mult, persistent_shift); + + timespec64_add_ns(&persistent_ts, nsecs); + + *ts = persistent_ts; +} + +/** + * omap_init_clocksource_32k - setup and register counter 32k as a + * kernel clocksource + * @pbase: base addr of counter_32k module + * @size: size of counter_32k to map + * + * Returns 0 upon success or negative error code upon failure. + * + */ +int __init omap_init_clocksource_32k(void __iomem *vbase) +{ + int ret; + + /* + * 32k sync Counter IP register offsets vary between the + * highlander version and the legacy ones. + * The 'SCHEME' bits(30-31) of the revision register is used + * to identify the version. + */ + if (readl_relaxed(vbase + OMAP2_32KSYNCNT_REV_OFF) & + OMAP2_32KSYNCNT_REV_SCHEME) + sync32k_cnt_reg = vbase + OMAP2_32KSYNCNT_CR_OFF_HIGH; + else + sync32k_cnt_reg = vbase + OMAP2_32KSYNCNT_CR_OFF_LOW; + + /* + * 120000 rough estimate from the calculations in + * __clocksource_update_freq_scale. + */ + clocks_calc_mult_shift(&persistent_mult, &persistent_shift, + 32768, NSEC_PER_SEC, 120000); + + ret = clocksource_mmio_init(sync32k_cnt_reg, "32k_counter", 32768, + 250, 32, clocksource_mmio_readl_up); + if (ret) { + pr_err("32k_counter: can't register clocksource\n"); + return ret; + } + + sched_clock_register(omap_32k_read_sched_clock, 32, 32768); + register_persistent_clock(omap_read_persistent_clock64); + pr_info("OMAP clocksource: 32k_counter at 32768 Hz\n"); + + return 0; +} + /* * --------------------------------------------------------------------------- * Timer initialization diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig index 272670ef1e92..dfa19d5030e3 100644 --- a/arch/arm/plat-omap/Kconfig +++ b/arch/arm/plat-omap/Kconfig @@ -72,23 +72,6 @@ config OMAP_MPU_TIMER timer provides more intra-tick resolution than the 32KHz timer, but consumes more power. -config OMAP_32K_TIMER - bool "Use 32KHz timer" - depends on ARCH_OMAP16XX || ARCH_OMAP2PLUS - default y if (ARCH_OMAP16XX || ARCH_OMAP2PLUS) - help - Select this option if you want to enable the OMAP 32KHz timer. - This timer saves power compared to the OMAP_MPU_TIMER, and has - support for no tick during idle. The 32KHz timer provides less - intra-tick resolution than OMAP_MPU_TIMER. The 32KHz timer is - currently only available for OMAP16XX, 24XX, 34XX, OMAP4/5 and DRA7XX. - - On OMAP2PLUS this value is only used for CONFIG_HZ and - CLOCK_TICK_RATE compile time calculation. - The actual timer selection is done in the board file - through the (DT_)MACHINE_START structure. - - config OMAP3_L2_AUX_SECURE_SAVE_RESTORE bool "OMAP3 HS/EMU save and restore for L2 AUX control register" depends on ARCH_OMAP3 && PM diff --git a/arch/arm/plat-omap/Makefile b/arch/arm/plat-omap/Makefile index 371f2ed00eda..98a7b607873a 100644 --- a/arch/arm/plat-omap/Makefile +++ b/arch/arm/plat-omap/Makefile @@ -6,7 +6,7 @@ ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/arch/arm/plat-omap/include # Common support -obj-y := sram.o dma.o counter_32k.o +obj-y := sram.o dma.o # omap_device support (OMAP2+ only at the moment) diff --git a/arch/arm/plat-omap/counter_32k.c b/arch/arm/plat-omap/counter_32k.c deleted file mode 100644 index 7a729ade2105..000000000000 --- a/arch/arm/plat-omap/counter_32k.c +++ /dev/null @@ -1,114 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-only -/* - * OMAP 32ksynctimer/counter_32k-related code - * - * Copyright (C) 2009 Texas Instruments - * Copyright (C) 2010 Nokia Corporation - * Tony Lindgren - * Added OMAP4 support - Santosh Shilimkar - * - * NOTE: This timer is not the same timer as the old OMAP1 MPU timer. - */ -#include -#include -#include -#include -#include -#include -#include - -#include - -#include - -/* OMAP2_32KSYNCNT_CR_OFF: offset of 32ksync counter register */ -#define OMAP2_32KSYNCNT_REV_OFF 0x0 -#define OMAP2_32KSYNCNT_REV_SCHEME (0x3 << 30) -#define OMAP2_32KSYNCNT_CR_OFF_LOW 0x10 -#define OMAP2_32KSYNCNT_CR_OFF_HIGH 0x30 - -/* - * 32KHz clocksource ... always available, on pretty most chips except - * OMAP 730 and 1510. Other timers could be used as clocksources, with - * higher resolution in free-running counter modes (e.g. 12 MHz xtal), - * but systems won't necessarily want to spend resources that way. - */ -static void __iomem *sync32k_cnt_reg; - -static u64 notrace omap_32k_read_sched_clock(void) -{ - return sync32k_cnt_reg ? readl_relaxed(sync32k_cnt_reg) : 0; -} - -/** - * omap_read_persistent_clock64 - Return time from a persistent clock. - * - * Reads the time from a source which isn't disabled during PM, the - * 32k sync timer. Convert the cycles elapsed since last read into - * nsecs and adds to a monotonically increasing timespec64. - */ -static struct timespec64 persistent_ts; -static cycles_t cycles; -static unsigned int persistent_mult, persistent_shift; - -static void omap_read_persistent_clock64(struct timespec64 *ts) -{ - unsigned long long nsecs; - cycles_t last_cycles; - - last_cycles = cycles; - cycles = sync32k_cnt_reg ? readl_relaxed(sync32k_cnt_reg) : 0; - - nsecs = clocksource_cyc2ns(cycles - last_cycles, - persistent_mult, persistent_shift); - - timespec64_add_ns(&persistent_ts, nsecs); - - *ts = persistent_ts; -} - -/** - * omap_init_clocksource_32k - setup and register counter 32k as a - * kernel clocksource - * @pbase: base addr of counter_32k module - * @size: size of counter_32k to map - * - * Returns 0 upon success or negative error code upon failure. - * - */ -int __init omap_init_clocksource_32k(void __iomem *vbase) -{ - int ret; - - /* - * 32k sync Counter IP register offsets vary between the - * highlander version and the legacy ones. - * The 'SCHEME' bits(30-31) of the revision register is used - * to identify the version. - */ - if (readl_relaxed(vbase + OMAP2_32KSYNCNT_REV_OFF) & - OMAP2_32KSYNCNT_REV_SCHEME) - sync32k_cnt_reg = vbase + OMAP2_32KSYNCNT_CR_OFF_HIGH; - else - sync32k_cnt_reg = vbase + OMAP2_32KSYNCNT_CR_OFF_LOW; - - /* - * 120000 rough estimate from the calculations in - * __clocksource_update_freq_scale. - */ - clocks_calc_mult_shift(&persistent_mult, &persistent_shift, - 32768, NSEC_PER_SEC, 120000); - - ret = clocksource_mmio_init(sync32k_cnt_reg, "32k_counter", 32768, - 250, 32, clocksource_mmio_readl_up); - if (ret) { - pr_err("32k_counter: can't register clocksource\n"); - return ret; - } - - sched_clock_register(omap_32k_read_sched_clock, 32, 32768); - register_persistent_clock(omap_read_persistent_clock64); - pr_info("OMAP clocksource: 32k_counter at 32768 Hz\n"); - - return 0; -} diff --git a/arch/arm/plat-omap/include/plat/counter-32k.h b/arch/arm/plat-omap/include/plat/counter-32k.h deleted file mode 100644 index da000d482ff2..000000000000 --- a/arch/arm/plat-omap/include/plat/counter-32k.h +++ /dev/null @@ -1 +0,0 @@ -int omap_init_clocksource_32k(void __iomem *vbase); From patchwork Tue Apr 19 13:37:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 563935 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EDE3DC433FE for ; Tue, 19 Apr 2022 13:41:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352756AbiDSNnv (ORCPT ); Tue, 19 Apr 2022 09:43:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352765AbiDSNmo (ORCPT ); Tue, 19 Apr 2022 09:42:44 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42E8B2DF3; Tue, 19 Apr 2022 06:39:55 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id C9235B81982; Tue, 19 Apr 2022 13:39:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 356D1C385B0; Tue, 19 Apr 2022 13:39:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1650375592; bh=8q6Kcm45o4hfMaS4KO2xUUwlzHF/dRLSCx2ycbmM2jM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OgmmYGrmtBNTwP0hCIY2RRe2mYaIftLuJ9OAVdYZvDleZcdZ/6LPlvQThD8t4drPE e4GTt4uIWh8cT6kZaI5XpPeUyLnOtfrJOYRguM9hj4PAws3Nw6EJsErSkHU1o96SDp CJK1ClRy1PNIBDwJEdrTaAupJfBbsWzoUyxDI/TgIMrsKD8viQ8fdfp8EJGbT+yU0/ 8XgF5eboJCt8z5/M3YL3N4OJjP2al4MR7iSjKD4PDfsLgdyuBVPNvGv/0iJ/g176J+ GpCXmp/q9iOjw7VrGYG72DN9pQVr66GHwhD+MR1FtySUnjMsgDitc2xmLrwnqX0sN8 yniK00Bea96aQ== From: Arnd Bergmann To: linux-omap@vger.kernel.org, tony@atomide.com, aaro.koskinen@iki.fi, jmkrzyszt@gmail.com Cc: Arnd Bergmann , Russell King , Paul Walmsley , Kevin Hilman , Peter Ujfalusi , Vinod Koul , Dmitry Torokhov , Ulf Hansson , Dominik Brodowski , Mark Brown , Felipe Balbi , Alan Stern , Lee Jones , Daniel Thompson , Jingoo Han , Helge Deller , Linus Walleij , Krzysztof Kozlowski , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, dmaengine@vger.kernel.org, linux-input@vger.kernel.org, linux-mmc@vger.kernel.org, linux-serial@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, alsa-devel@alsa-project.org Subject: [PATCH 18/41] ARM: omap: remove debug-leds driver Date: Tue, 19 Apr 2022 15:37:00 +0200 Message-Id: <20220419133723.1394715-19-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20220419133723.1394715-1-arnd@kernel.org> References: <20220419133723.1394715-1-arnd@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org From: Arnd Bergmann It has been impossible to select this driver for six years without anyone noticing, so just kill it completely. Fixes: 54ea18e8866a ("ARM: OMAP2+: Remove board file for H4") Signed-off-by: Arnd Bergmann --- arch/arm/plat-omap/Kconfig | 10 -- arch/arm/plat-omap/Makefile | 4 - arch/arm/plat-omap/debug-leds.c | 171 -------------------------------- 3 files changed, 185 deletions(-) delete mode 100644 arch/arm/plat-omap/debug-leds.c diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig index dfa19d5030e3..dc53ea8e5bbb 100644 --- a/arch/arm/plat-omap/Kconfig +++ b/arch/arm/plat-omap/Kconfig @@ -11,16 +11,6 @@ config ARCH_OMAP_OTG comment "OMAP Feature Selections" -config OMAP_DEBUG_DEVICES - bool - help - For debug cards on TI reference boards. - -config OMAP_DEBUG_LEDS - def_bool y if NEW_LEDS - depends on OMAP_DEBUG_DEVICES - select LEDS_CLASS - config POWER_AVS_OMAP bool "AVS(Adaptive Voltage Scaling) support for OMAP IP versions 1&2" depends on (ARCH_OMAP3 || ARCH_OMAP4) && PM diff --git a/arch/arm/plat-omap/Makefile b/arch/arm/plat-omap/Makefile index 98a7b607873a..68ccec9de106 100644 --- a/arch/arm/plat-omap/Makefile +++ b/arch/arm/plat-omap/Makefile @@ -7,7 +7,3 @@ ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/arch/arm/plat-omap/include # Common support obj-y := sram.o dma.o - -# omap_device support (OMAP2+ only at the moment) - -obj-$(CONFIG_OMAP_DEBUG_LEDS) += debug-leds.o diff --git a/arch/arm/plat-omap/debug-leds.c b/arch/arm/plat-omap/debug-leds.c deleted file mode 100644 index 2b698d074874..000000000000 --- a/arch/arm/plat-omap/debug-leds.c +++ /dev/null @@ -1,171 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-only -/* - * linux/arch/arm/plat-omap/debug-leds.c - * - * Copyright 2011 by Bryan Wu - * Copyright 2003 by Texas Instruments Incorporated - */ - -#include -#include -#include -#include -#include -#include -#include - -#include - -/* Many OMAP development platforms reuse the same "debug board"; these - * platforms include H2, H3, H4, and Perseus2. There are 16 LEDs on the - * debug board (all green), accessed through FPGA registers. - */ - -/* NOTE: most boards don't have a static mapping for the FPGA ... */ -struct h2p2_dbg_fpga { - /* offset 0x00 */ - u16 smc91x[8]; - /* offset 0x10 */ - u16 fpga_rev; - u16 board_rev; - u16 gpio_outputs; - u16 leds; - /* offset 0x18 */ - u16 misc_inputs; - u16 lan_status; - u16 lan_reset; - u16 reserved0; - /* offset 0x20 */ - u16 ps2_data; - u16 ps2_ctrl; - /* plus also 4 rs232 ports ... */ -}; - -static struct h2p2_dbg_fpga __iomem *fpga; - -static u16 fpga_led_state; - -struct dbg_led { - struct led_classdev cdev; - u16 mask; -}; - -static const struct { - const char *name; - const char *trigger; -} dbg_leds[] = { - { "dbg:d4", "heartbeat", }, - { "dbg:d5", "cpu0", }, - { "dbg:d6", "default-on", }, - { "dbg:d7", }, - { "dbg:d8", }, - { "dbg:d9", }, - { "dbg:d10", }, - { "dbg:d11", }, - { "dbg:d12", }, - { "dbg:d13", }, - { "dbg:d14", }, - { "dbg:d15", }, - { "dbg:d16", }, - { "dbg:d17", }, - { "dbg:d18", }, - { "dbg:d19", }, -}; - -/* - * The triggers lines up below will only be used if the - * LED triggers are compiled in. - */ -static void dbg_led_set(struct led_classdev *cdev, - enum led_brightness b) -{ - struct dbg_led *led = container_of(cdev, struct dbg_led, cdev); - u16 reg; - - reg = readw_relaxed(&fpga->leds); - if (b != LED_OFF) - reg |= led->mask; - else - reg &= ~led->mask; - writew_relaxed(reg, &fpga->leds); -} - -static enum led_brightness dbg_led_get(struct led_classdev *cdev) -{ - struct dbg_led *led = container_of(cdev, struct dbg_led, cdev); - u16 reg; - - reg = readw_relaxed(&fpga->leds); - return (reg & led->mask) ? LED_FULL : LED_OFF; -} - -static int fpga_probe(struct platform_device *pdev) -{ - struct resource *iomem; - int i; - - iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!iomem) - return -ENODEV; - - fpga = ioremap(iomem->start, resource_size(iomem)); - writew_relaxed(0xff, &fpga->leds); - - for (i = 0; i < ARRAY_SIZE(dbg_leds); i++) { - struct dbg_led *led; - - led = kzalloc(sizeof(*led), GFP_KERNEL); - if (!led) - break; - - led->cdev.name = dbg_leds[i].name; - led->cdev.brightness_set = dbg_led_set; - led->cdev.brightness_get = dbg_led_get; - led->cdev.default_trigger = dbg_leds[i].trigger; - led->mask = BIT(i); - - if (led_classdev_register(NULL, &led->cdev) < 0) { - kfree(led); - break; - } - } - - return 0; -} - -static int fpga_suspend_noirq(struct device *dev) -{ - fpga_led_state = readw_relaxed(&fpga->leds); - writew_relaxed(0xff, &fpga->leds); - - return 0; -} - -static int fpga_resume_noirq(struct device *dev) -{ - writew_relaxed(~fpga_led_state, &fpga->leds); - return 0; -} - -static const struct dev_pm_ops fpga_dev_pm_ops = { - .suspend_noirq = fpga_suspend_noirq, - .resume_noirq = fpga_resume_noirq, -}; - -static struct platform_driver led_driver = { - .driver.name = "omap_dbg_led", - .driver.pm = &fpga_dev_pm_ops, - .probe = fpga_probe, -}; - -static int __init fpga_init(void) -{ - if (machine_is_omap_h4() - || machine_is_omap_h3() - || machine_is_omap_h2() - || machine_is_omap_perseus2() - ) - return platform_driver_register(&led_driver); - return 0; -} -fs_initcall(fpga_init); From patchwork Tue Apr 19 13:37:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 563933 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id ADADDC433EF for ; Tue, 19 Apr 2022 13:41:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352712AbiDSNoA (ORCPT ); Tue, 19 Apr 2022 09:44:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352797AbiDSNmt (ORCPT ); Tue, 19 Apr 2022 09:42:49 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6A6737BF6; Tue, 19 Apr 2022 06:40:02 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 7289CB81984; Tue, 19 Apr 2022 13:40:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EC917C385AE; Tue, 19 Apr 2022 13:39:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1650375600; bh=zW9EXgIwrT6e9se5HepqxV0X/iuSevgZPTTCehW8dB0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vHI0qQByX+c/7bvvFxsJDZg8Rk3Tmicri/PsugtdLSnLPggMHo6v2ctc+djyVus3N ui0ORHPtKfuy3WL0CumRMeBMzGHFm0UT+AP+rOrkATXgVT5fIgx6GErLIT2RrsL1Ec IZnzmJ8Dnh78euRrjLA7zfaPZJirZjn2+Ns06Fju3HP4p2eONLIleIC49bfNsZO5hd z5fjeKu5u4euWVq8Y01KsxQPT+uo12m/zcR2VMTIGaMdkSl1elVAK6Ja0/bpG1+umE 1lBMBmTCxncgj2s+VWFf/59RsmLfL2r5TKijMH37jw/Ys1Zb+TJYoC5rYrhTKbwaRm wVS3j8bExN97Q== From: Arnd Bergmann To: linux-omap@vger.kernel.org, tony@atomide.com, aaro.koskinen@iki.fi, jmkrzyszt@gmail.com Cc: Arnd Bergmann , Russell King , Paul Walmsley , Kevin Hilman , Peter Ujfalusi , Vinod Koul , Dmitry Torokhov , Ulf Hansson , Dominik Brodowski , Mark Brown , Felipe Balbi , Alan Stern , Lee Jones , Daniel Thompson , Jingoo Han , Helge Deller , Linus Walleij , Krzysztof Kozlowski , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, dmaengine@vger.kernel.org, linux-input@vger.kernel.org, linux-mmc@vger.kernel.org, linux-serial@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, alsa-devel@alsa-project.org Subject: [PATCH 19/41] ARM: omap: dma: make usb support optional Date: Tue, 19 Apr 2022 15:37:01 +0200 Message-Id: <20220419133723.1394715-20-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20220419133723.1394715-1-arnd@kernel.org> References: <20220419133723.1394715-1-arnd@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org From: Arnd Bergmann Most of the plat-omap/dma.c code is specific to the USB driver. Hide that code when it is not in use, to make it clearer which parts are actually still required. Signed-off-by: Arnd Bergmann --- arch/arm/plat-omap/dma.c | 45 +++++++++++++++++----------------- drivers/usb/gadget/udc/Kconfig | 2 +- include/linux/omap-dma.h | 5 +++- 3 files changed, 27 insertions(+), 25 deletions(-) diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c index 700ba9b600e7..b7757864d0aa 100644 --- a/arch/arm/plat-omap/dma.c +++ b/arch/arm/plat-omap/dma.c @@ -66,7 +66,6 @@ enum { DMA_CHAIN_STARTED, DMA_CHAIN_NOTSTARTED }; static struct omap_system_dma_plat_info *p; static struct omap_dma_dev_attr *d; -static void omap_clear_dma(int lch); static int enable_1510_mode; static u32 errata; @@ -90,19 +89,16 @@ static int omap_dma_reserve_channels; static DEFINE_SPINLOCK(dma_chan_lock); static struct omap_dma_lch *dma_chan; -static inline void disable_lnk(int lch); -static void omap_disable_channel_irq(int lch); -static inline void omap_enable_channel_irq(int lch); - -#ifdef CONFIG_ARCH_OMAP15XX -/* Returns 1 if the DMA module is in OMAP1510-compatible mode, 0 otherwise */ -static int omap_dma_in_1510_mode(void) +static inline void omap_disable_channel_irq(int lch) { - return enable_1510_mode; + /* disable channel interrupts */ + p->dma_write(0, CICR, lch); + /* Clear CSR */ + if (dma_omap1()) + p->dma_read(CSR, lch); + else + p->dma_write(OMAP2_DMA_CSR_CLEAR_MASK, CSR, lch); } -#else -#define omap_dma_in_1510_mode() 0 -#endif #ifdef CONFIG_ARCH_OMAP1 static inline void set_gdma_dev(int req, int dev) @@ -169,6 +165,17 @@ void omap_set_dma_priority(int lch, int dst_port, int priority) #endif EXPORT_SYMBOL(omap_set_dma_priority); +#if IS_ENABLED(CONFIG_USB_OMAP) +#ifdef CONFIG_ARCH_OMAP15XX +/* Returns 1 if the DMA module is in OMAP1510-compatible mode, 0 otherwise */ +static int omap_dma_in_1510_mode(void) +{ + return enable_1510_mode; +} +#else +#define omap_dma_in_1510_mode() 0 +#endif + void omap_set_dma_transfer_params(int lch, int data_type, int elem_count, int frame_count, int sync_mode, int dma_trigger, int src_or_dst_synch) @@ -418,17 +425,6 @@ static inline void omap_enable_channel_irq(int lch) p->dma_write(dma_chan[lch].enabled_irqs, CICR, lch); } -static inline void omap_disable_channel_irq(int lch) -{ - /* disable channel interrupts */ - p->dma_write(0, CICR, lch); - /* Clear CSR */ - if (dma_omap1()) - p->dma_read(CSR, lch); - else - p->dma_write(OMAP2_DMA_CSR_CLEAR_MASK, CSR, lch); -} - void omap_disable_dma_irq(int lch, u16 bits) { dma_chan[lch].enabled_irqs &= ~bits; @@ -473,6 +469,7 @@ static inline void disable_lnk(int lch) p->dma_write(l, CLNK_CTRL, lch); dma_chan[lch].flags &= ~OMAP_DMA_ACTIVE; } +#endif int omap_request_dma(int dev_id, const char *dev_name, void (*callback)(int lch, u16 ch_status, void *data), @@ -572,6 +569,7 @@ static void omap_clear_dma(int lch) local_irq_restore(flags); } +#if IS_ENABLED(CONFIG_USB_OMAP) void omap_start_dma(int lch) { u32 l; @@ -792,6 +790,7 @@ int omap_get_dma_active_status(int lch) return (p->dma_read(CCR, lch) & OMAP_DMA_CCR_EN) != 0; } EXPORT_SYMBOL(omap_get_dma_active_status); +#endif int omap_dma_running(void) { diff --git a/drivers/usb/gadget/udc/Kconfig b/drivers/usb/gadget/udc/Kconfig index cee934dce4f0..69394dc1cdfb 100644 --- a/drivers/usb/gadget/udc/Kconfig +++ b/drivers/usb/gadget/udc/Kconfig @@ -128,7 +128,7 @@ config USB_GR_UDC config USB_OMAP tristate "OMAP USB Device Controller" - depends on ARCH_OMAP1 || (ARCH_OMAP && COMPILE_TEST) + depends on ARCH_OMAP1 depends on ISP1301_OMAP || !(MACH_OMAP_H2 || MACH_OMAP_H3) help Many Texas Instruments OMAP processors have flexible full diff --git a/include/linux/omap-dma.h b/include/linux/omap-dma.h index 5e228428fda1..07fa58ae9902 100644 --- a/include/linux/omap-dma.h +++ b/include/linux/omap-dma.h @@ -299,8 +299,9 @@ extern void omap_set_dma_priority(int lch, int dst_port, int priority); extern int omap_request_dma(int dev_id, const char *dev_name, void (*callback)(int lch, u16 ch_status, void *data), void *data, int *dma_ch); -extern void omap_disable_dma_irq(int ch, u16 irq_bits); extern void omap_free_dma(int ch); +#if IS_ENABLED(CONFIG_USB_OMAP) +extern void omap_disable_dma_irq(int ch, u16 irq_bits); extern void omap_start_dma(int lch); extern void omap_stop_dma(int lch); extern void omap_set_dma_transfer_params(int lch, int data_type, @@ -326,6 +327,8 @@ extern void omap_set_dma_dest_burst_mode(int lch, extern dma_addr_t omap_get_dma_src_pos(int lch); extern dma_addr_t omap_get_dma_dst_pos(int lch); extern int omap_get_dma_active_status(int lch); +#endif + extern int omap_dma_running(void); #if IS_ENABLED(CONFIG_FB_OMAP) From patchwork Tue Apr 19 13:37:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 563932 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3F9F7C433F5 for ; Tue, 19 Apr 2022 13:41:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235917AbiDSNoH (ORCPT ); Tue, 19 Apr 2022 09:44:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352809AbiDSNmx (ORCPT ); Tue, 19 Apr 2022 09:42:53 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BBE9182; Tue, 19 Apr 2022 06:40:10 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 4B94DB81983; Tue, 19 Apr 2022 13:40:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9990AC385AF; Tue, 19 Apr 2022 13:40:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1650375608; bh=9+ljq5dQueH2G15TUC+ZLkwgSkKDWfTDa0M3UxfDvzI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UZEWjobJJdf/97+RsHjNB+jMk4tP3Pl4vgk6cxlQnhU41tj2I/yINK+gRoMdoNOUR Y7MRcUEAGnlNliwHS5DlBG2gtVRR+NX39wFuq/IGF0bnCo9HD4/Ko6wpnFF46X1ylv iALan+QzhQpH4nbYopoyAajxQA2oBzcqItCFMpy/SY9vH4HlIcvpT8NRLMP54afeyx u1+GxMJCkZOQYlBflCn6XehmD8eQEUOxgT0Tgy+CE5qdUt9iLLhEzYm8twoL8sueZd +tmqfAeeno42q0iwsr0p6BakCbrKJuvbO2sq+/dI7pXW42969rnsk5HKJ4ZbkYUR14 LrA6BeSwSde3w== From: Arnd Bergmann To: linux-omap@vger.kernel.org, tony@atomide.com, aaro.koskinen@iki.fi, jmkrzyszt@gmail.com Cc: Arnd Bergmann , Russell King , Paul Walmsley , Kevin Hilman , Peter Ujfalusi , Vinod Koul , Dmitry Torokhov , Ulf Hansson , Dominik Brodowski , Mark Brown , Felipe Balbi , Alan Stern , Lee Jones , Daniel Thompson , Jingoo Han , Helge Deller , Linus Walleij , Krzysztof Kozlowski , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, dmaengine@vger.kernel.org, linux-input@vger.kernel.org, linux-mmc@vger.kernel.org, linux-serial@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, alsa-devel@alsa-project.org Subject: [PATCH 20/41] dma: omap: hide legacy interface Date: Tue, 19 Apr 2022 15:37:02 +0200 Message-Id: <20220419133723.1394715-21-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20220419133723.1394715-1-arnd@kernel.org> References: <20220419133723.1394715-1-arnd@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org From: Arnd Bergmann The legacy interface for omap-dma is only used on OMAP1, and the same is true for the non-DT case. Make both of these conditional on CONFIG_ARCH_OMAP1 being set to simplify the dependency. The non-OMAP stub functions in include/linux/omap-dma.h are note needed any more either now, because they are only called on OMAP1. Signed-off-by: Arnd Bergmann Acked-By: Vinod Koul --- drivers/dma/ti/omap-dma.c | 19 +++++++++++++------ include/linux/omap-dma.h | 22 ---------------------- 2 files changed, 13 insertions(+), 28 deletions(-) diff --git a/drivers/dma/ti/omap-dma.c b/drivers/dma/ti/omap-dma.c index 8e52a0dc1f78..27f5019bdc1e 100644 --- a/drivers/dma/ti/omap-dma.c +++ b/drivers/dma/ti/omap-dma.c @@ -699,6 +699,11 @@ static void omap_dma_put_lch(struct omap_dmadev *od, int lch) mutex_unlock(&od->lch_lock); } +static inline bool omap_dma_legacy(struct omap_dmadev *od) +{ + return IS_ENABLED(CONFIG_ARCH_OMAP1) && od->legacy; +} + static int omap_dma_alloc_chan_resources(struct dma_chan *chan) { struct omap_dmadev *od = to_omap_dma_dev(chan->device); @@ -706,7 +711,7 @@ static int omap_dma_alloc_chan_resources(struct dma_chan *chan) struct device *dev = od->ddev.dev; int ret; - if (od->legacy) { + if (omap_dma_legacy(od)) { ret = omap_request_dma(c->dma_sig, "DMA engine", omap_dma_callback, c, &c->dma_ch); } else { @@ -718,7 +723,7 @@ static int omap_dma_alloc_chan_resources(struct dma_chan *chan) if (ret >= 0) { omap_dma_assign(od, c, c->dma_ch); - if (!od->legacy) { + if (!omap_dma_legacy(od)) { unsigned val; spin_lock_irq(&od->irq_lock); @@ -757,7 +762,7 @@ static void omap_dma_free_chan_resources(struct dma_chan *chan) struct omap_dmadev *od = to_omap_dma_dev(chan->device); struct omap_chan *c = to_omap_dma_chan(chan); - if (!od->legacy) { + if (!omap_dma_legacy(od)) { spin_lock_irq(&od->irq_lock); od->irq_enable_mask &= ~BIT(c->dma_ch); omap_dma_glbl_write(od, IRQENABLE_L1, od->irq_enable_mask); @@ -768,7 +773,7 @@ static void omap_dma_free_chan_resources(struct dma_chan *chan) od->lch_map[c->dma_ch] = NULL; vchan_free_chan_resources(&c->vc); - if (od->legacy) + if (omap_dma_legacy(od)) omap_free_dma(c->dma_ch); else omap_dma_put_lch(od, c->dma_ch); @@ -1674,12 +1679,14 @@ static int omap_dma_probe(struct platform_device *pdev) dev_err(&pdev->dev, "omap_system_dma_plat_info is missing"); return -ENODEV; } - } else { + } else if (IS_ENABLED(CONFIG_ARCH_OMAP1)) { od->cfg = &default_cfg; od->plat = omap_get_plat_info(); if (!od->plat) return -EPROBE_DEFER; + } else { + return -ENODEV; } od->reg_map = od->plat->reg_map; @@ -1855,7 +1862,7 @@ static int omap_dma_remove(struct platform_device *pdev) dma_async_device_unregister(&od->ddev); - if (!od->legacy) { + if (!omap_dma_legacy(od)) { /* Disable all interrupts */ omap_dma_glbl_write(od, IRQENABLE_L0, 0); } diff --git a/include/linux/omap-dma.h b/include/linux/omap-dma.h index 07fa58ae9902..254b4e10511b 100644 --- a/include/linux/omap-dma.h +++ b/include/linux/omap-dma.h @@ -292,7 +292,6 @@ struct omap_system_dma_plat_info { #define dma_omap15xx() __dma_omap15xx(d) #define dma_omap16xx() __dma_omap16xx(d) -#if defined(CONFIG_ARCH_OMAP) extern struct omap_system_dma_plat_info *omap_get_plat_info(void); extern void omap_set_dma_priority(int lch, int dst_port, int priority); @@ -340,25 +339,4 @@ static inline int omap_lcd_dma_running(void) } #endif -#else /* CONFIG_ARCH_OMAP */ -static inline void omap_set_dma_priority(int lch, int dst_port, int priority) -{ -} - -static inline struct omap_system_dma_plat_info *omap_get_plat_info(void) -{ - return NULL; -} - -static inline int omap_request_dma(int dev_id, const char *dev_name, - void (*callback)(int lch, u16 ch_status, void *data), - void *data, int *dma_ch) -{ - return -ENODEV; -} - -static inline void omap_free_dma(int ch) { } - -#endif /* CONFIG_ARCH_OMAP */ - #endif /* __LINUX_OMAP_DMA_H */ From patchwork Tue Apr 19 13:37:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 563927 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E2FE1C433EF for ; Tue, 19 Apr 2022 13:42:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352647AbiDSNpN (ORCPT ); Tue, 19 Apr 2022 09:45:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244173AbiDSNnQ (ORCPT ); Tue, 19 Apr 2022 09:43:16 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A4DD182; Tue, 19 Apr 2022 06:40:33 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 91168B81981; Tue, 19 Apr 2022 13:40:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9BA25C385AF; Tue, 19 Apr 2022 13:40:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1650375630; bh=Y28p7Ny9YomGZamqZAIMduIfzMd9ilwbgGj96GOTejs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eUHAFjoiHuXtqZ4ZQCCCjrNWBObk3OpvdAoRndhAbYTT/dWpoD2ncZTLJ89QVYpaG E3ATSEWOwtxhMgdoVM3aoUvIYenIeLY8VecZ74Q1zfAO0JlMqhoBixhEDM2LhMCyTM Bg8EvhbdgtMjbcznvJxbbq6hNISkYGTTR4Tv2UoKdlOSU7hMkR/ruvdJ/iC72Zem7f i9ZFFfE2l05LHOqtf8V/dIsD5stadiF0iLdtFAAfv026f+K1DHAgxo/HxMLDoMG0LJ KlL7TLBkRPDFumi0yT4sk8TbBxJfJ8Zsfkwpvwn7UIjjyX9tWqdiDl36pA3xGyphWy 6yb1hp9ibLpEg== From: Arnd Bergmann To: linux-omap@vger.kernel.org, tony@atomide.com, aaro.koskinen@iki.fi, jmkrzyszt@gmail.com Cc: Arnd Bergmann , Russell King , Paul Walmsley , Kevin Hilman , Peter Ujfalusi , Vinod Koul , Dmitry Torokhov , Ulf Hansson , Dominik Brodowski , Mark Brown , Felipe Balbi , Alan Stern , Lee Jones , Daniel Thompson , Jingoo Han , Helge Deller , Linus Walleij , Krzysztof Kozlowski , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, dmaengine@vger.kernel.org, linux-input@vger.kernel.org, linux-mmc@vger.kernel.org, linux-serial@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, alsa-devel@alsa-project.org Subject: [PATCH 23/41] ARM: omap: split up arch/arm/plat-omap/Kconfig Date: Tue, 19 Apr 2022 15:37:05 +0200 Message-Id: <20220419133723.1394715-24-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20220419133723.1394715-1-arnd@kernel.org> References: <20220419133723.1394715-1-arnd@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org From: Arnd Bergmann All the remaining features in here are either omap1 or omap2plus specific, so move them into the respective Kconfig files. Signed-off-by: Arnd Bergmann --- arch/arm/Kconfig | 2 - arch/arm/mach-omap1/Kconfig | 37 +++++++++++++++ arch/arm/mach-omap2/Kconfig | 49 ++++++++++++++++++++ arch/arm/plat-omap/Kconfig | 92 ------------------------------------- 4 files changed, 86 insertions(+), 94 deletions(-) delete mode 100644 arch/arm/plat-omap/Kconfig diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 2e8091e2d8a8..700655e31b04 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -656,8 +656,6 @@ source "arch/arm/mach-npcm/Kconfig" source "arch/arm/mach-nspire/Kconfig" -source "arch/arm/plat-omap/Kconfig" - source "arch/arm/mach-omap1/Kconfig" source "arch/arm/mach-omap2/Kconfig" diff --git a/arch/arm/mach-omap1/Kconfig b/arch/arm/mach-omap1/Kconfig index 04155b5ce978..93ea86954a84 100644 --- a/arch/arm/mach-omap1/Kconfig +++ b/arch/arm/mach-omap1/Kconfig @@ -28,6 +28,11 @@ config ARCH_OMAP16XX select CPU_ARM926T select OMAP_DM_TIMER +config ARCH_OMAP + bool + +comment "OMAP Feature Selections" + config OMAP_MUX bool "OMAP multiplexing support" default y @@ -69,6 +74,38 @@ config OMAP_32K_TIMER The actual timer selection is done in the board file through the (DT_)MACHINE_START structure. +config OMAP_MPU_TIMER + bool "Use mpu timer" + depends on ARCH_OMAP1 + help + Select this option if you want to use the OMAP mpu timer. This + timer provides more intra-tick resolution than the 32KHz timer, + but consumes more power. + +config OMAP_SERIAL_WAKE + bool "Enable wake-up events for serial ports" + depends on ARCH_OMAP1 && OMAP_MUX + default y + help + Select this option if you want to have your system wake up + to data on the serial RX line. This allows you to wake the + system from serial console. + +config OMAP_RESET_CLOCKS + bool "Reset unused clocks during boot" + depends on ARCH_OMAP + help + Say Y if you want to reset unused clocks during boot. + This option saves power, but assumes all drivers are + using the clock framework. Broken drivers that do not + yet use clock framework may not work with this option. + If you are booting from another operating system, you + probably do not want this option enabled until your + device drivers work properly. + +config ARCH_OMAP_OTG + bool + comment "OMAP Board Type" config MACH_OMAP_INNOVATOR diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig index 02c253de9b6e..a8adbb4d478a 100644 --- a/arch/arm/mach-omap2/Kconfig +++ b/arch/arm/mach-omap2/Kconfig @@ -123,6 +123,8 @@ config OMAP_INTERCONNECT_BARRIER bool select ARM_HEAVY_MB +config ARCH_OMAP + bool if ARCH_OMAP2PLUS @@ -153,6 +155,53 @@ config SOC_HAS_REALTIME_COUNTER depends on SOC_OMAP5 || SOC_DRA7XX default y +config POWER_AVS_OMAP + bool "AVS(Adaptive Voltage Scaling) support for OMAP IP versions 1&2" + depends on (ARCH_OMAP3 || ARCH_OMAP4) && PM + select POWER_SUPPLY + help + Say Y to enable AVS(Adaptive Voltage Scaling) + support on OMAP containing the version 1 or + version 2 of the SmartReflex IP. + V1 is the 65nm version used in OMAP3430. + V2 is the update for the 45nm version of the IP used in OMAP3630 + and OMAP4430 + + Please note, that by default SmartReflex is only + initialized and not enabled. To enable the automatic voltage + compensation for vdd mpu and vdd core from user space, + user must write 1 to + /debug/smartreflex/sr_/autocomp, + where X is mpu_iva or core for OMAP3. + Optionally autocompensation can be enabled in the kernel + by default during system init via the enable_on_init flag + which an be passed as platform data to the smartreflex driver. + +config POWER_AVS_OMAP_CLASS3 + bool "Class 3 mode of Smartreflex Implementation" + depends on POWER_AVS_OMAP && TWL4030_CORE + help + Say Y to enable Class 3 implementation of Smartreflex + + Class 3 implementation of Smartreflex employs continuous hardware + voltage calibration. + +config OMAP3_L2_AUX_SECURE_SAVE_RESTORE + bool "OMAP3 HS/EMU save and restore for L2 AUX control register" + depends on ARCH_OMAP3 && PM + help + Without this option, L2 Auxiliary control register contents are + lost during off-mode entry on HS/EMU devices. This feature + requires support from PPA / boot-loader in HS/EMU devices, which + currently does not exist by default. + +config OMAP3_L2_AUX_SECURE_SERVICE_SET_ID + int "Service ID for the support routine to set L2 AUX control" + depends on OMAP3_L2_AUX_SECURE_SAVE_RESTORE + default 43 + help + PPA routine service ID for setting L2 auxiliary control register. + comment "OMAP Core Type" depends on ARCH_OMAP2 diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig deleted file mode 100644 index dc53ea8e5bbb..000000000000 --- a/arch/arm/plat-omap/Kconfig +++ /dev/null @@ -1,92 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0 -config ARCH_OMAP - bool - -if ARCH_OMAP - -menu "TI OMAP Common Features" - -config ARCH_OMAP_OTG - bool - -comment "OMAP Feature Selections" - -config POWER_AVS_OMAP - bool "AVS(Adaptive Voltage Scaling) support for OMAP IP versions 1&2" - depends on (ARCH_OMAP3 || ARCH_OMAP4) && PM - select POWER_SUPPLY - help - Say Y to enable AVS(Adaptive Voltage Scaling) - support on OMAP containing the version 1 or - version 2 of the SmartReflex IP. - V1 is the 65nm version used in OMAP3430. - V2 is the update for the 45nm version of the IP used in OMAP3630 - and OMAP4430 - - Please note, that by default SmartReflex is only - initialized and not enabled. To enable the automatic voltage - compensation for vdd mpu and vdd core from user space, - user must write 1 to - /debug/smartreflex/sr_/autocomp, - where X is mpu_iva or core for OMAP3. - Optionally autocompensation can be enabled in the kernel - by default during system init via the enable_on_init flag - which an be passed as platform data to the smartreflex driver. - -config POWER_AVS_OMAP_CLASS3 - bool "Class 3 mode of Smartreflex Implementation" - depends on POWER_AVS_OMAP && TWL4030_CORE - help - Say Y to enable Class 3 implementation of Smartreflex - - Class 3 implementation of Smartreflex employs continuous hardware - voltage calibration. - -config OMAP_RESET_CLOCKS - bool "Reset unused clocks during boot" - depends on ARCH_OMAP - help - Say Y if you want to reset unused clocks during boot. - This option saves power, but assumes all drivers are - using the clock framework. Broken drivers that do not - yet use clock framework may not work with this option. - If you are booting from another operating system, you - probably do not want this option enabled until your - device drivers work properly. - -config OMAP_MPU_TIMER - bool "Use mpu timer" - depends on ARCH_OMAP1 - help - Select this option if you want to use the OMAP mpu timer. This - timer provides more intra-tick resolution than the 32KHz timer, - but consumes more power. - -config OMAP3_L2_AUX_SECURE_SAVE_RESTORE - bool "OMAP3 HS/EMU save and restore for L2 AUX control register" - depends on ARCH_OMAP3 && PM - help - Without this option, L2 Auxiliary control register contents are - lost during off-mode entry on HS/EMU devices. This feature - requires support from PPA / boot-loader in HS/EMU devices, which - currently does not exist by default. - -config OMAP3_L2_AUX_SECURE_SERVICE_SET_ID - int "Service ID for the support routine to set L2 AUX control" - depends on OMAP3_L2_AUX_SECURE_SAVE_RESTORE - default 43 - help - PPA routine service ID for setting L2 auxiliary control register. - -config OMAP_SERIAL_WAKE - bool "Enable wake-up events for serial ports" - depends on ARCH_OMAP1 && OMAP_MUX - default y - help - Select this option if you want to have your system wake up - to data on the serial RX line. This allows you to wake the - system from serial console. - -endmenu - -endif From patchwork Tue Apr 19 13:37:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 563930 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 449CCC433EF for ; Tue, 19 Apr 2022 13:42:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352608AbiDSNpB (ORCPT ); Tue, 19 Apr 2022 09:45:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234497AbiDSNn2 (ORCPT ); Tue, 19 Apr 2022 09:43:28 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5885324F; Tue, 19 Apr 2022 06:40:46 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EA3C661693; Tue, 19 Apr 2022 13:40:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8F781C385AF; Tue, 19 Apr 2022 13:40:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1650375645; bh=LP9bbU3MqE1mo0qlsHP17AGtQ9utDR1mCwd3GRyFRr4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M/YHCSpeMYgwnnRYACPWzb5HEoTcv0Uo+NjAgUJua+1h56xSW2dsYBRjZfK1E2BdW ufGtCxWaK9OFsPZeVaEUcov5M3hta5Q+TJb3cdQu3RTCCHtk2DsusHYPyQF7LJHnTI IL8FxI+oDR/0/IzsSioLFjIlnMk2NFJMoFJ3B6APAiFOTW85BTHE0LXGnXdGVfGd13 wCsvqkLvGaTKrsfN+TZgA0RrRTWoDmZBdsDJObGLaggZ6D5MCMY5yAp86WDvGn4KIc 1iB23i3dMqJKuazzVP/9pqxdegdyW0H0DLYhyKg4JgYtwpC2ocseM+UbPIVSebgCgU 9Edk9oMYpOBkA== From: Arnd Bergmann To: linux-omap@vger.kernel.org, tony@atomide.com, aaro.koskinen@iki.fi, jmkrzyszt@gmail.com Cc: Arnd Bergmann , Russell King , Paul Walmsley , Kevin Hilman , Peter Ujfalusi , Vinod Koul , Dmitry Torokhov , Ulf Hansson , Dominik Brodowski , Mark Brown , Felipe Balbi , Alan Stern , Lee Jones , Daniel Thompson , Jingoo Han , Helge Deller , Linus Walleij , Krzysztof Kozlowski , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, dmaengine@vger.kernel.org, linux-input@vger.kernel.org, linux-mmc@vger.kernel.org, linux-serial@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, alsa-devel@alsa-project.org Subject: [PATCH 25/41] ARM: omap: remove empty plat-omap directory Date: Tue, 19 Apr 2022 15:37:07 +0200 Message-Id: <20220419133723.1394715-26-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20220419133723.1394715-1-arnd@kernel.org> References: <20220419133723.1394715-1-arnd@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org From: Arnd Bergmann The last file in this directory is gone, and it can be removed as well. Signed-off-by: Arnd Bergmann --- arch/arm/Makefile | 1 - arch/arm/plat-omap/Makefile | 9 --------- 2 files changed, 10 deletions(-) delete mode 100644 arch/arm/plat-omap/Makefile diff --git a/arch/arm/Makefile b/arch/arm/Makefile index a2391b8de5a5..7bcf59d0d315 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -228,7 +228,6 @@ machine-$(CONFIG_PLAT_SPEAR) += spear # Platform directory name. This list is sorted alphanumerically # by CONFIG_* macro name. -plat-$(CONFIG_ARCH_OMAP) += omap plat-$(CONFIG_PLAT_ORION) += orion plat-$(CONFIG_PLAT_PXA) += pxa plat-$(CONFIG_PLAT_VERSATILE) += versatile diff --git a/arch/arm/plat-omap/Makefile b/arch/arm/plat-omap/Makefile deleted file mode 100644 index fefce2e1eaf3..000000000000 --- a/arch/arm/plat-omap/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-only -# -# Makefile for the linux kernel. -# - -ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/arch/arm/plat-omap/include - -# Common support -obj-y := From patchwork Tue Apr 19 13:37:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 563926 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 26E4BC433F5 for ; Tue, 19 Apr 2022 13:42:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352630AbiDSNpS (ORCPT ); Tue, 19 Apr 2022 09:45:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352699AbiDSNnh (ORCPT ); Tue, 19 Apr 2022 09:43:37 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 102ED24F; Tue, 19 Apr 2022 06:40:55 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id C68D6B8197F; Tue, 19 Apr 2022 13:40:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CD49CC385AA; Tue, 19 Apr 2022 13:40:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1650375652; bh=++wgzzP18IgZjv9gq3IHjeFk3mw3AxMESGKM1bss8GE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t77plAsS6dzi52zALntxTrIsGvlZ7TVWnBbbBL6BHh9HDB22Vsg+GSU1TUGr/L7yo 4VED/jnUp/m/iprQbhEzkF/oCLBhn5mjye8/COB4ccOhKBk+sJixyUn/j4z5hhYvAS fOMPXYC1p6lswgiO83CT8qRkpbcih1isQSb5qwxzvrTQT+MaBaR+iH3FJlzRpZeFL+ xLv4MH8XhKivg2WwM9SJ6+BOtF2fIbLSMuGDS0PC2ZNc4r0d6HSPSj40prxX3RgJXN wDqi6ESmFTYAF/uvoZWrHFUtV7uChc7cszyCFCMHFQ8dub8SswJUKqRzrKaa1+D2F9 cs9GhVWEGvR5A== From: Arnd Bergmann To: linux-omap@vger.kernel.org, tony@atomide.com, aaro.koskinen@iki.fi, jmkrzyszt@gmail.com Cc: Arnd Bergmann , Russell King , Paul Walmsley , Kevin Hilman , Peter Ujfalusi , Vinod Koul , Dmitry Torokhov , Ulf Hansson , Dominik Brodowski , Mark Brown , Felipe Balbi , Alan Stern , Lee Jones , Daniel Thompson , Jingoo Han , Helge Deller , Linus Walleij , Krzysztof Kozlowski , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, dmaengine@vger.kernel.org, linux-input@vger.kernel.org, linux-mmc@vger.kernel.org, linux-serial@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, alsa-devel@alsa-project.org Subject: [PATCH 26/41] ARM: omap1: relocate static I/O mapping Date: Tue, 19 Apr 2022 15:37:08 +0200 Message-Id: <20220419133723.1394715-27-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20220419133723.1394715-1-arnd@kernel.org> References: <20220419133723.1394715-1-arnd@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org From: Arnd Bergmann The address range 0xfee00000-0xfeffffff is used for PCI and PCMCIA I/O port mappings, but OMAP1 has its static mappings there as well. Move the OMAP1 addresses a little higher to avoid crashing at boot. Signed-off-by: Arnd Bergmann --- arch/arm/Kconfig.debug | 6 +++--- arch/arm/mach-omap1/include/mach/hardware.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug index 0c9497d549e3..f57b449000f7 100644 --- a/arch/arm/Kconfig.debug +++ b/arch/arm/Kconfig.debug @@ -1837,9 +1837,9 @@ config DEBUG_UART_VIRT default 0xfec00000 if ARCH_IXP4XX && !CPU_BIG_ENDIAN default 0xfec00003 if ARCH_IXP4XX && CPU_BIG_ENDIAN default 0xfef36000 if DEBUG_HIGHBANK_UART - default 0xfefb0000 if DEBUG_OMAP1UART1 || DEBUG_OMAP7XXUART1 - default 0xfefb0800 if DEBUG_OMAP1UART2 || DEBUG_OMAP7XXUART2 - default 0xfefb9800 if DEBUG_OMAP1UART3 || DEBUG_OMAP7XXUART3 + default 0xff000000 if DEBUG_OMAP1UART1 || DEBUG_OMAP7XXUART1 + default 0xff000800 if DEBUG_OMAP1UART2 || DEBUG_OMAP7XXUART2 + default 0xff009800 if DEBUG_OMAP1UART3 || DEBUG_OMAP7XXUART3 default 0xffd01000 if DEBUG_HIP01_UART default DEBUG_UART_PHYS if !MMU depends on DEBUG_LL_UART_8250 || DEBUG_LL_UART_PL01X || \ diff --git a/arch/arm/mach-omap1/include/mach/hardware.h b/arch/arm/mach-omap1/include/mach/hardware.h index 05c5cd3e95f4..e3522e601ccd 100644 --- a/arch/arm/mach-omap1/include/mach/hardware.h +++ b/arch/arm/mach-omap1/include/mach/hardware.h @@ -63,7 +63,7 @@ static inline u32 omap_cs3_phys(void) #endif /* ifndef __ASSEMBLER__ */ -#define OMAP1_IO_OFFSET 0x01000000 /* Virtual IO = 0xfefb0000 */ +#define OMAP1_IO_OFFSET 0x00fb0000 /* Virtual IO = 0xff000000 */ #define OMAP1_IO_ADDRESS(pa) IOMEM((pa) - OMAP1_IO_OFFSET) #include From patchwork Tue Apr 19 13:37:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 563929 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B4D3EC4332F for ; Tue, 19 Apr 2022 13:42:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352678AbiDSNpJ (ORCPT ); Tue, 19 Apr 2022 09:45:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244866AbiDSNnp (ORCPT ); Tue, 19 Apr 2022 09:43:45 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F8E8182; Tue, 19 Apr 2022 06:41:02 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id DF144B8197F; Tue, 19 Apr 2022 13:41:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1808EC385A5; Tue, 19 Apr 2022 13:40:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1650375659; bh=0G3cWV48CpbBHTE2pnfpd8IteUQx33zVzk5I5jOHq28=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tcaHuW+qziDrvzUpHuEMFKwFU24gmYLLaVW/lH4YSmvt7xGUnfF0sNVHp802pMZbG K6J/uNMNn5vL9mXzi8X3zRI/z8lzVEB3EuRwjjxKiFdSM+arUaoowF1MoiFyyH8XVV /v4R5gyMXGZMU1ta0p9hOmph2xXY8RLU5gpqA4zETCrSrM5Xh09D1z+ACK4EbozYv5 9Sive/zvlpYwCeQ4lV4Bn/MYQu9361EX6fnn4oEfAgmr8UYhW5oVkAM1jX9gnVVYhJ ZhuIwaJaHXeGR4SyNhWN+K44rhkpWMXYC38ShwJwl87he4xwz0XOvHfjHqz/624Ycs 325kt1woDgtcA== From: Arnd Bergmann To: linux-omap@vger.kernel.org, tony@atomide.com, aaro.koskinen@iki.fi, jmkrzyszt@gmail.com Cc: Arnd Bergmann , Russell King , Paul Walmsley , Kevin Hilman , Peter Ujfalusi , Vinod Koul , Dmitry Torokhov , Ulf Hansson , Dominik Brodowski , Mark Brown , Felipe Balbi , Alan Stern , Lee Jones , Daniel Thompson , Jingoo Han , Helge Deller , Linus Walleij , Krzysztof Kozlowski , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, dmaengine@vger.kernel.org, linux-input@vger.kernel.org, linux-mmc@vger.kernel.org, linux-serial@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, alsa-devel@alsa-project.org Subject: [PATCH 27/41] ARM: omap1: use pci_remap_iospace() for omap_cf Date: Tue, 19 Apr 2022 15:37:09 +0200 Message-Id: <20220419133723.1394715-28-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20220419133723.1394715-1-arnd@kernel.org> References: <20220419133723.1394715-1-arnd@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org From: Arnd Bergmann The ISA I/O space handling in omap_cf is incompatible with PCI drivers in a multiplatform kernel, and requires a custom mach/io.h. Change the driver to use pci_remap_iospace() like PCI drivers do, so the generic ioport access can work across platforms. To actually use that code, we have to select CONFIG_PCI here. Signed-off-by: Arnd Bergmann --- arch/arm/Kconfig | 2 +- arch/arm/mach-omap1/include/mach/io.h | 45 --------------------------- drivers/pcmcia/omap_cf.c | 10 +++--- 3 files changed, 5 insertions(+), 52 deletions(-) delete mode 100644 arch/arm/mach-omap1/include/mach/io.h diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 700655e31b04..a57ad0928edc 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -487,11 +487,11 @@ config ARCH_OMAP1 bool "TI OMAP1" select ARCH_OMAP select CLKSRC_MMIO + select FORCE_PCI if PCCARD select GENERIC_IRQ_CHIP select GPIOLIB select HAVE_LEGACY_CLK select IRQ_DOMAIN - select NEED_MACH_IO_H if PCCARD select NEED_MACH_MEMORY_H select SPARSE_IRQ help diff --git a/arch/arm/mach-omap1/include/mach/io.h b/arch/arm/mach-omap1/include/mach/io.h deleted file mode 100644 index ce4f8005b26f..000000000000 --- a/arch/arm/mach-omap1/include/mach/io.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * arch/arm/mach-omap1/include/mach/io.h - * - * IO definitions for TI OMAP processors and boards - * - * Copied from arch/arm/mach-sa1100/include/mach/io.h - * Copyright (C) 1997-1999 Russell King - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN - * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 675 Mass Ave, Cambridge, MA 02139, USA. - * - * Modifications: - * 06-12-1997 RMK Created. - * 07-04-1999 RMK Major cleanup - */ - -#ifndef __ASM_ARM_ARCH_IO_H -#define __ASM_ARM_ARCH_IO_H - -#define IO_SPACE_LIMIT 0xffffffff - -/* - * We don't actually have real ISA nor PCI buses, but there is so many - * drivers out there that might just work if we fake them... - */ -#define __io(a) __typesafe_io(a) - -#endif diff --git a/drivers/pcmcia/omap_cf.c b/drivers/pcmcia/omap_cf.c index 093022ce7d91..1972a8f6fa8e 100644 --- a/drivers/pcmcia/omap_cf.c +++ b/drivers/pcmcia/omap_cf.c @@ -205,6 +205,7 @@ static int __init omap_cf_probe(struct platform_device *pdev) int irq; int status; struct resource *res; + struct resource iospace = DEFINE_RES_IO(SZ_64, SZ_4K); seg = (int) pdev->dev.platform_data; if (seg == 0 || seg > 3) @@ -235,9 +236,9 @@ static int __init omap_cf_probe(struct platform_device *pdev) cf->phys_cf = res->start; /* pcmcia layer only remaps "real" memory */ - cf->socket.io_offset = (unsigned long) - ioremap(cf->phys_cf + SZ_4K, SZ_2K); - if (!cf->socket.io_offset) { + cf->socket.io_offset = iospace.start; + status = pci_remap_iospace(&iospace, cf->phys_cf + SZ_4K); + if (status) { status = -ENOMEM; goto fail1; } @@ -285,8 +286,6 @@ static int __init omap_cf_probe(struct platform_device *pdev) fail2: release_mem_region(cf->phys_cf, SZ_8K); fail1: - if (cf->socket.io_offset) - iounmap((void __iomem *) cf->socket.io_offset); free_irq(irq, cf); fail0: kfree(cf); @@ -300,7 +299,6 @@ static int __exit omap_cf_remove(struct platform_device *pdev) cf->active = 0; pcmcia_unregister_socket(&cf->socket); del_timer_sync(&cf->timer); - iounmap((void __iomem *) cf->socket.io_offset); release_mem_region(cf->phys_cf, SZ_8K); free_irq(cf->irq, cf); kfree(cf); From patchwork Tue Apr 19 13:37:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 563925 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1E3E7C433EF for ; Tue, 19 Apr 2022 13:44:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239891AbiDSNqy (ORCPT ); Tue, 19 Apr 2022 09:46:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243252AbiDSNpW (ORCPT ); Tue, 19 Apr 2022 09:45:22 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4E1938DA8; Tue, 19 Apr 2022 06:41:34 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 57A0AB81987; Tue, 19 Apr 2022 13:41:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7BB39C385A8; Tue, 19 Apr 2022 13:41:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1650375692; bh=tnWw7oBH8X/XBSc06dB4T/Xrxth9FWCIgmXAbL0gUiI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l353b3xn7RP12XuOF9Cs9zO9tge/orX72WpKCH58E7muL7FyXckbWebpZVTgREpYO 94nj83AEJ8G4ma3/hGOjwiDA7u44mm32sOWTOmedTY1j9E754Khi/eBhNw7sZcR/fP sEELa4g6tqqCHlME51Brhwnr6YLWLyI8Af7wRGM8o8xD8amnnB09engI4zVkiclXXu mCNS0Sb+wp3+DZySStUMonTFolm2Ob9v/CLQNN4JWPX7Aweoh7N2XbyQM1ddcyBgBz 1g2qalhGNLlbW40TdlyWoLmDXnGz4w+LLuOQpSk9G4QwyJjZxE6HKbSgWD1lwNbvb3 UwCXSJ2vUo86g== From: Arnd Bergmann To: linux-omap@vger.kernel.org, tony@atomide.com, aaro.koskinen@iki.fi, jmkrzyszt@gmail.com Cc: Arnd Bergmann , Russell King , Paul Walmsley , Kevin Hilman , Peter Ujfalusi , Vinod Koul , Dmitry Torokhov , Ulf Hansson , Dominik Brodowski , Mark Brown , Felipe Balbi , Alan Stern , Lee Jones , Daniel Thompson , Jingoo Han , Helge Deller , Linus Walleij , Krzysztof Kozlowski , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, dmaengine@vger.kernel.org, linux-input@vger.kernel.org, linux-mmc@vger.kernel.org, linux-serial@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, alsa-devel@alsa-project.org Subject: [PATCH 31/41] ARM: OMAP1: clock: Fix early UART rate issues Date: Tue, 19 Apr 2022 15:37:13 +0200 Message-Id: <20220419133723.1394715-32-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20220419133723.1394715-1-arnd@kernel.org> References: <20220419133723.1394715-1-arnd@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org From: Janusz Krzysztofik Commit ef772f2ee31e ("ARM: OMAP: Fix CONFIG_DEBUG_LL") was supposed to fix low level debugging, most possibly by early enabling UART clocks. The fix actually introduced early reset of most bits of MOD_CONF_CTRL_0 register, with the exception of UART1 and UART2 clock related bits which were set high. However, UART1 clock bit can play different roles on different OMAP1 variants. On OMAP1610 it enables the clock as intended, but on OMAP1510 it switches the clock rate from 12 to 48 MHz. Even worth, for UART2 the bit changes its clock rate also on OMAP1610. As a result, UART rates set by a bootloader can be unintentionally changed early on kernel boot and low level debugging broken, not fixed. Besides, reset of all other bits was not justified. Don't touch register bits not related to UART clocks. Also, don't touch the bit of UART2 clock. Make sure UART1 and UART3 are enabled early on relevant OMAP1610 machine types while preserving bootloader UART clock rates on others. Signed-off-by: Janusz Krzysztofik Signed-off-by: Arnd Bergmann --- arch/arm/mach-omap1/clock_data.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/arm/mach-omap1/clock_data.c b/arch/arm/mach-omap1/clock_data.c index 36f04da4b939..57d3752babf8 100644 --- a/arch/arm/mach-omap1/clock_data.c +++ b/arch/arm/mach-omap1/clock_data.c @@ -766,11 +766,11 @@ int __init omap1_clk_init(void) u32 reg; #ifdef CONFIG_DEBUG_LL - /* - * Resets some clocks that may be left on from bootloader, - * but leaves serial clocks on. - */ - omap_writel(0x3 << 29, MOD_CONF_CTRL_0); + /* Make sure UART clocks are enabled early */ + if (cpu_is_omap16xx()) + omap_writel(omap_readl(MOD_CONF_CTRL_0) | + CONF_MOD_UART1_CLK_MODE_R | + CONF_MOD_UART3_CLK_MODE_R, MOD_CONF_CTRL_0); #endif /* USB_REQ_EN will be disabled later if necessary (usb_dc_ck) */ From patchwork Tue Apr 19 13:37:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 563923 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F13F1C4332F for ; Tue, 19 Apr 2022 13:46:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352655AbiDSNsz (ORCPT ); Tue, 19 Apr 2022 09:48:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352864AbiDSNpY (ORCPT ); Tue, 19 Apr 2022 09:45:24 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8183939173; Tue, 19 Apr 2022 06:41:42 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 238BDB8198B; Tue, 19 Apr 2022 13:41:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 85ADEC385B0; Tue, 19 Apr 2022 13:41:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1650375699; bh=UESTNhRpqCdmOp1XFvzi39fpM7sULzK7+yHauqukJgM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qN9Y+eXIXoBe7y4TGwmSZZVExIPvDiGiWQet4fH81EnPncUzwHNWtwJGsY0JYakO5 ieE4QfHwXAynpvZYZ8I/rORqxFxxcrHC8uhh9dPC5cMy5EFTa1VMfxpra8+tJNdEGG y/nxkofQTm0FspP0LVUYlssfbUKsMywSyPappcPTyOe/CcTltiL0WCa18tUiJ5htqe P7yjD5xk7TGFmi/cCP8q3ujCRWlK/rt27yUduttq75nsmlB26koCVmVI39ToEeDgJ3 4QYMXy9PKlQiS9e/fHPi6ZUa8bAMf16ReuxZRt8ni4Y+YGTV+WxebK/v6W2sjZcyA9 IDq9aNHMe6VJg== From: Arnd Bergmann To: linux-omap@vger.kernel.org, tony@atomide.com, aaro.koskinen@iki.fi, jmkrzyszt@gmail.com Cc: Arnd Bergmann , Russell King , Paul Walmsley , Kevin Hilman , Peter Ujfalusi , Vinod Koul , Dmitry Torokhov , Ulf Hansson , Dominik Brodowski , Mark Brown , Felipe Balbi , Alan Stern , Lee Jones , Daniel Thompson , Jingoo Han , Helge Deller , Linus Walleij , Krzysztof Kozlowski , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, dmaengine@vger.kernel.org, linux-input@vger.kernel.org, linux-mmc@vger.kernel.org, linux-serial@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, alsa-devel@alsa-project.org Subject: [PATCH 32/41] ARM: OMAP1: clock: Fix UART rate reporting algorithm Date: Tue, 19 Apr 2022 15:37:14 +0200 Message-Id: <20220419133723.1394715-33-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20220419133723.1394715-1-arnd@kernel.org> References: <20220419133723.1394715-1-arnd@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org From: Janusz Krzysztofik Since its introduction to the mainline kernel, omap1_uart_recalc() helper makes incorrect use of clk->enable_bit as a ready to use bitmap mask while it only provides the bit number. Fix it. Signed-off-by: Janusz Krzysztofik Signed-off-by: Arnd Bergmann --- arch/arm/mach-omap1/clock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-omap1/clock.c b/arch/arm/mach-omap1/clock.c index 44877554eb41..42e094e781ce 100644 --- a/arch/arm/mach-omap1/clock.c +++ b/arch/arm/mach-omap1/clock.c @@ -41,7 +41,7 @@ static DEFINE_SPINLOCK(clockfw_lock); unsigned long omap1_uart_recalc(struct clk *clk) { unsigned int val = __raw_readl(clk->enable_reg); - return val & clk->enable_bit ? 48000000 : 12000000; + return val & 1 << clk->enable_bit ? 48000000 : 12000000; } unsigned long omap1_sossi_recalc(struct clk *clk) From patchwork Tue Apr 19 13:37:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 563924 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BC4DDC43219 for ; Tue, 19 Apr 2022 13:46:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245341AbiDSNsw (ORCPT ); Tue, 19 Apr 2022 09:48:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352930AbiDSNri (ORCPT ); Tue, 19 Apr 2022 09:47:38 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94D35396A3; Tue, 19 Apr 2022 06:41:57 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 4D927B81989; Tue, 19 Apr 2022 13:41:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1BEDAC385A7; Tue, 19 Apr 2022 13:41:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1650375715; bh=G7R/+rDcrqJrNt8dUwADm5Egv0xkIUTxO8ciErqFtk0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YHGoZlohuS2JgLOhYhCZMFxaUN1Y+HHoJ/YVPLZp7vCduTgmqkayQKXajDhUPyzKd Zw+VuabZI/Z/zUnS9e+NNz9Ez4+ZtPDkOL4OLlhLrloQ+AJvPS0QO1iYDv8tI5bLRf nuSKDdKTYFPVL4xbBFv9TGc44BTfEff9oQ5RrIpvKqT0SOIjiF7Dfl3kq0BalXCprk NWFSU4pjGWpfaAp9OzYmoO11yKu8KADVKnLEUwtNUeAGga8OA9KsCxXCO6pNJmXp3Z cjM+2jNEsAjQu5ecXU/0xHR8UqdU5JPwhpNVuo62gjAo3uWz7YFbqRe7SKVD5IsdtH qbq82O/KVjaWw== From: Arnd Bergmann To: linux-omap@vger.kernel.org, tony@atomide.com, aaro.koskinen@iki.fi, jmkrzyszt@gmail.com Cc: Arnd Bergmann , Russell King , Paul Walmsley , Kevin Hilman , Peter Ujfalusi , Vinod Koul , Dmitry Torokhov , Ulf Hansson , Dominik Brodowski , Mark Brown , Felipe Balbi , Alan Stern , Lee Jones , Daniel Thompson , Jingoo Han , Helge Deller , Linus Walleij , Krzysztof Kozlowski , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, dmaengine@vger.kernel.org, linux-input@vger.kernel.org, linux-mmc@vger.kernel.org, linux-serial@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, alsa-devel@alsa-project.org Subject: [PATCH 34/41] ARM: OMAP1: clock: Remove noop code Date: Tue, 19 Apr 2022 15:37:16 +0200 Message-Id: <20220419133723.1394715-35-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20220419133723.1394715-1-arnd@kernel.org> References: <20220419133723.1394715-1-arnd@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org From: Janusz Krzysztofik There are some OMAP1 clock code bits that have no effect: - crystal_type variable is set to 0 but never changed, then crystal_type == 2 condition is never true and ck_ref.rate never set to 19200000, - clk->ops->allow_idle() is called from omap_clk_enable_autoidle_all() but that op is not configured for any clock, then the function does nothing and the op field is not needed, - ENABLE_ON_INIT flag is set for some clocks but is never checked by any code, then not needed. Drop that code. Signed-off-by: Janusz Krzysztofik Signed-off-by: Arnd Bergmann --- arch/arm/mach-omap1/clock.c | 17 ----------------- arch/arm/mach-omap1/clock.h | 3 --- arch/arm/mach-omap1/clock_data.c | 8 +------- 3 files changed, 1 insertion(+), 27 deletions(-) diff --git a/arch/arm/mach-omap1/clock.c b/arch/arm/mach-omap1/clock.c index 5ea8ec026a85..e5bd4d3b742d 100644 --- a/arch/arm/mach-omap1/clock.c +++ b/arch/arm/mach-omap1/clock.c @@ -798,22 +798,6 @@ void clk_unregister(struct clk *clk) } EXPORT_SYMBOL(clk_unregister); -int omap_clk_enable_autoidle_all(void) -{ - struct clk *c; - unsigned long flags; - - spin_lock_irqsave(&clockfw_lock, flags); - - list_for_each_entry(c, &clocks, node) - if (c->ops->allow_idle) - c->ops->allow_idle(c); - - spin_unlock_irqrestore(&clockfw_lock, flags); - - return 0; -} - /* * Low level helpers */ @@ -871,7 +855,6 @@ static int __init clk_disable_unused(void) return 0; } late_initcall(clk_disable_unused); -late_initcall(omap_clk_enable_autoidle_all); #endif #if defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS) diff --git a/arch/arm/mach-omap1/clock.h b/arch/arm/mach-omap1/clock.h index 7bebd488f1be..8025e4a22469 100644 --- a/arch/arm/mach-omap1/clock.h +++ b/arch/arm/mach-omap1/clock.h @@ -53,7 +53,6 @@ struct omap_clk { struct clkops { int (*enable)(struct clk *); void (*disable)(struct clk *); - void (*allow_idle)(struct clk *); }; /* @@ -64,7 +63,6 @@ struct clkops { #define ENABLE_REG_32BIT (1 << 0) /* Use 32-bit access */ #define CLOCK_IDLE_CONTROL (1 << 1) #define CLOCK_NO_IDLE_PARENT (1 << 2) -#define ENABLE_ON_INIT (1 << 3) /* Enable upon framework init */ /** * struct clk - OMAP struct clk @@ -135,7 +133,6 @@ extern void clk_unregister(struct clk *clk); extern void propagate_rate(struct clk *clk); extern unsigned long followparent_recalc(struct clk *clk); unsigned long omap_fixed_divisor_recalc(struct clk *clk); -extern int omap_clk_enable_autoidle_all(void); extern const struct clkops clkops_null; diff --git a/arch/arm/mach-omap1/clock_data.c b/arch/arm/mach-omap1/clock_data.c index 57d3752babf8..9b9c9fcc61c2 100644 --- a/arch/arm/mach-omap1/clock_data.c +++ b/arch/arm/mach-omap1/clock_data.c @@ -92,8 +92,7 @@ static struct arm_idlect1_clk ck_dpll1out = { .name = "ck_dpll1out", .ops = &clkops_generic, .parent = &ck_dpll1, - .flags = CLOCK_IDLE_CONTROL | ENABLE_REG_32BIT | - ENABLE_ON_INIT, + .flags = CLOCK_IDLE_CONTROL | ENABLE_REG_32BIT, .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2), .enable_bit = EN_CKOUT_ARM, .recalc = &followparent_recalc, @@ -146,7 +145,6 @@ static struct clk arm_gpio_ck = { .name = "ick", .ops = &clkops_generic, .parent = &ck_dpll1, - .flags = ENABLE_ON_INIT, .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT2), .enable_bit = EN_GPIOCK, .recalc = &followparent_recalc, @@ -316,7 +314,6 @@ static struct clk tc2_ck = { .name = "tc2_ck", .ops = &clkops_generic, .parent = &tc_ck.clk, - .flags = ENABLE_ON_INIT, .enable_reg = OMAP1_IO_ADDRESS(ARM_IDLECT3), .enable_bit = EN_TC2_CK, .recalc = &followparent_recalc, @@ -762,7 +759,6 @@ u32 cpu_mask; int __init omap1_clk_init(void) { struct omap_clk *c; - int crystal_type = 0; /* Default 12 MHz */ u32 reg; #ifdef CONFIG_DEBUG_LL @@ -810,8 +806,6 @@ int __init omap1_clk_init(void) if (cpu_is_omap7xx()) ck_ref.rate = 13000000; - if (cpu_is_omap16xx() && crystal_type == 2) - ck_ref.rate = 19200000; pr_info("Clocks: ARM_SYSST: 0x%04x DPLL_CTL: 0x%04x ARM_CKCTL: 0x%04x\n", omap_readw(ARM_SYSST), omap_readw(DPLL_CTL), From patchwork Tue Apr 19 13:37:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 563922 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 01F7DC433FE for ; Tue, 19 Apr 2022 13:46:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343842AbiDSNtF (ORCPT ); Tue, 19 Apr 2022 09:49:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353132AbiDSNr7 (ORCPT ); Tue, 19 Apr 2022 09:47:59 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA2D139829; Tue, 19 Apr 2022 06:42:19 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 452BDB81984; Tue, 19 Apr 2022 13:42:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E8E3AC385B2; Tue, 19 Apr 2022 13:42:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1650375736; bh=ICLjpcLGmyRuFirMful6PPWmOkZPtiGZzfFqAVH/t+Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hvhVwA0NzLazBIGSe0oT0p3Um3CHpAVWQS3Ak93wRIZbI7fSuj4m8N5nOBDcUeqPR gg6oecruNrCF+lKyJ22gDsDgeD4f58TkcrVcOJhpEfQKq0l9fXJUZDysrlPaAYrYdy HM2+bS3l9baDro+/uv1y7gBVl8ayYnO98JhJ4qhRzGc7g0eh0bUu4K1jPLqmuVD72I Tta1ve3oS40cpTyjsSDol1Hce510U2JEw+ghqj9X7GZYYmv/pk7FjMOMYyKc88H2iq raBSAsmMH65yZss3CrvJXSegF1I1GYazdtvupzXRVR7szoVBxpQBB73wWmN7W1YYGv JDzzUYpxD+HAw== From: Arnd Bergmann To: linux-omap@vger.kernel.org, tony@atomide.com, aaro.koskinen@iki.fi, jmkrzyszt@gmail.com Cc: Arnd Bergmann , Russell King , Paul Walmsley , Kevin Hilman , Peter Ujfalusi , Vinod Koul , Dmitry Torokhov , Ulf Hansson , Dominik Brodowski , Mark Brown , Felipe Balbi , Alan Stern , Lee Jones , Daniel Thompson , Jingoo Han , Helge Deller , Linus Walleij , Krzysztof Kozlowski , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, dmaengine@vger.kernel.org, linux-input@vger.kernel.org, linux-mmc@vger.kernel.org, linux-serial@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, alsa-devel@alsa-project.org Subject: [PATCH 37/41] [MERGED] video: fbdev: omap: Make it CCF clk API compatible Date: Tue, 19 Apr 2022 15:37:19 +0200 Message-Id: <20220419133723.1394715-38-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20220419133723.1394715-1-arnd@kernel.org> References: <20220419133723.1394715-1-arnd@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org From: Janusz Krzysztofik OMAP1 LCDC drivers now omit clk_prepare/unprepare() steps, not supported by OMAP1 custom implementation of clock API. However, non-CCF stubs of those functions exist for use on such platforms until converted to CCF. Update the drivers to be compatible with CCF implementation of clock API. Signed-off-by: Janusz Krzysztofik Signed-off-by: Arnd Bergmann --- drivers/video/fbdev/omap/hwa742.c | 6 +++--- drivers/video/fbdev/omap/lcdc.c | 6 +++--- drivers/video/fbdev/omap/sossi.c | 5 +++-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/video/fbdev/omap/hwa742.c b/drivers/video/fbdev/omap/hwa742.c index b191bef22d98..9d9fe5c3a7a1 100644 --- a/drivers/video/fbdev/omap/hwa742.c +++ b/drivers/video/fbdev/omap/hwa742.c @@ -964,7 +964,7 @@ static int hwa742_init(struct omapfb_device *fbdev, int ext_mode, if ((r = calc_extif_timings(ext_clk, &extif_mem_div)) < 0) goto err3; hwa742.extif->set_timings(&hwa742.reg_timings); - clk_enable(hwa742.sys_ck); + clk_prepare_enable(hwa742.sys_ck); calc_hwa742_clk_rates(ext_clk, &sys_clk, &pix_clk); if ((r = calc_extif_timings(sys_clk, &extif_mem_div)) < 0) @@ -1023,7 +1023,7 @@ static int hwa742_init(struct omapfb_device *fbdev, int ext_mode, return 0; err4: - clk_disable(hwa742.sys_ck); + clk_disable_unprepare(hwa742.sys_ck); err3: hwa742.extif->cleanup(); err2: @@ -1037,7 +1037,7 @@ static void hwa742_cleanup(void) hwa742_set_update_mode(OMAPFB_UPDATE_DISABLED); hwa742.extif->cleanup(); hwa742.int_ctrl->cleanup(); - clk_disable(hwa742.sys_ck); + clk_disable_unprepare(hwa742.sys_ck); } struct lcd_ctrl hwa742_ctrl = { diff --git a/drivers/video/fbdev/omap/lcdc.c b/drivers/video/fbdev/omap/lcdc.c index 4c9091bd936d..e7ce783e5215 100644 --- a/drivers/video/fbdev/omap/lcdc.c +++ b/drivers/video/fbdev/omap/lcdc.c @@ -713,7 +713,7 @@ static int omap_lcdc_init(struct omapfb_device *fbdev, int ext_mode, dev_err(fbdev->dev, "failed to adjust LCD rate\n"); goto fail1; } - clk_enable(lcdc.lcd_ck); + clk_prepare_enable(lcdc.lcd_ck); r = request_irq(fbdev->int_irq, lcdc_irq_handler, 0, MODULE_NAME, fbdev); if (r) { @@ -748,7 +748,7 @@ static int omap_lcdc_init(struct omapfb_device *fbdev, int ext_mode, fail3: free_irq(fbdev->int_irq, lcdc.fbdev); fail2: - clk_disable(lcdc.lcd_ck); + clk_disable_unprepare(lcdc.lcd_ck); fail1: clk_put(lcdc.lcd_ck); fail0: @@ -762,7 +762,7 @@ static void omap_lcdc_cleanup(void) free_fbmem(); omap_free_lcd_dma(); free_irq(lcdc.fbdev->int_irq, lcdc.fbdev); - clk_disable(lcdc.lcd_ck); + clk_disable_unprepare(lcdc.lcd_ck); clk_put(lcdc.lcd_ck); } diff --git a/drivers/video/fbdev/omap/sossi.c b/drivers/video/fbdev/omap/sossi.c index 6b99d89fbe6e..c90eb8ca58af 100644 --- a/drivers/video/fbdev/omap/sossi.c +++ b/drivers/video/fbdev/omap/sossi.c @@ -600,7 +600,7 @@ static int sossi_init(struct omapfb_device *fbdev) l &= ~CONF_SOSSI_RESET_R; omap_writel(l, MOD_CONF_CTRL_1); - clk_enable(sossi.fck); + clk_prepare_enable(sossi.fck); l = omap_readl(ARM_IDLECT2); l &= ~(1 << 8); /* DMACK_REQ */ omap_writel(l, ARM_IDLECT2); @@ -651,7 +651,7 @@ static int sossi_init(struct omapfb_device *fbdev) return 0; err: - clk_disable(sossi.fck); + clk_disable_unprepare(sossi.fck); clk_put(sossi.fck); return r; } @@ -659,6 +659,7 @@ static int sossi_init(struct omapfb_device *fbdev) static void sossi_cleanup(void) { omap_lcdc_free_dma_callback(); + clk_unprepare(sossi.fck); clk_put(sossi.fck); iounmap(sossi.base); } From patchwork Tue Apr 19 13:37:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 563921 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 80A03C43219 for ; Tue, 19 Apr 2022 13:46:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352778AbiDSNtH (ORCPT ); Tue, 19 Apr 2022 09:49:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353245AbiDSNsN (ORCPT ); Tue, 19 Apr 2022 09:48:13 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0529F38798; Tue, 19 Apr 2022 06:42:32 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A982A61726; Tue, 19 Apr 2022 13:42:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 82131C385AF; Tue, 19 Apr 2022 13:42:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1650375751; bh=VizbppVwzPYdQPDTL7NxrAMjSGA3HHnCFb6Pzlcg7cg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ewcomR5Y+ebhEER2jEsmmEKS/5FV86pDTEgeOQLxiozH7E0tm578fLHS1YYtVXf6Y D9fxFVuX1bjJa3WJD1rU9pxOwPFHjkiSj0XoD3GwlA9L252sd9q8N/PHPkjkvFCtAn k9k7I3mGsf29zuf2FaLzo9lrKBip8FJn5AMZkfh+pAPB7jcGBApFAL7YRSSvm96zlr UUQxLcM59kgkggbLPetkP6H/llR+WY7zHgb6OvzSaqxVdVRU74hWZ02nmqay1W/nN0 Z36YNnqN7DBeFOPhQT8ZAba7fOItSy31B3qvefulS0ykv74DV92yrMGAp61HVmMz42 +DpY44FhKTZZA== From: Arnd Bergmann To: linux-omap@vger.kernel.org, tony@atomide.com, aaro.koskinen@iki.fi, jmkrzyszt@gmail.com Cc: Arnd Bergmann , Russell King , Paul Walmsley , Kevin Hilman , Peter Ujfalusi , Vinod Koul , Dmitry Torokhov , Ulf Hansson , Dominik Brodowski , Mark Brown , Felipe Balbi , Alan Stern , Lee Jones , Daniel Thompson , Jingoo Han , Helge Deller , Linus Walleij , Krzysztof Kozlowski , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, dmaengine@vger.kernel.org, linux-input@vger.kernel.org, linux-mmc@vger.kernel.org, linux-serial@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, alsa-devel@alsa-project.org Subject: [PATCH 39/41] [MERGED] ASoC: ti: osk5912: Make it CCF clk API compatible Date: Tue, 19 Apr 2022 15:37:21 +0200 Message-Id: <20220419133723.1394715-40-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20220419133723.1394715-1-arnd@kernel.org> References: <20220419133723.1394715-1-arnd@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org From: Janusz Krzysztofik The driver, OMAP1 specific, now omits clk_prepare/unprepare() steps, not supported by OMAP1 custom implementation of clock API. However, non-CCF stubs of those functions exist for use on such platforms until converted to CCF. Update the driver to be compatible with CCF implementation of clock API. v2: use clk_prepare_enable/clk_disable_unprepare() (Peter) Signed-off-by: Janusz Krzysztofik Signed-off-by: Arnd Bergmann --- sound/soc/ti/osk5912.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/ti/osk5912.c b/sound/soc/ti/osk5912.c index 40e29dda7e7a..2790c8915f55 100644 --- a/sound/soc/ti/osk5912.c +++ b/sound/soc/ti/osk5912.c @@ -27,12 +27,12 @@ static struct clk *tlv320aic23_mclk; static int osk_startup(struct snd_pcm_substream *substream) { - return clk_enable(tlv320aic23_mclk); + return clk_prepare_enable(tlv320aic23_mclk); } static void osk_shutdown(struct snd_pcm_substream *substream) { - clk_disable(tlv320aic23_mclk); + clk_disable_unprepare(tlv320aic23_mclk); } static int osk_hw_params(struct snd_pcm_substream *substream,