From patchwork Sun Nov 15 17:09:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 11906519 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 608B8697 for ; Sun, 15 Nov 2020 17:10:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 46346221F9 for ; Sun, 15 Nov 2020 17:10:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="U84Dhcao" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727404AbgKORKC (ORCPT ); Sun, 15 Nov 2020 12:10:02 -0500 Received: from mail.kernel.org ([198.145.29.99]:38524 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726727AbgKORKC (ORCPT ); Sun, 15 Nov 2020 12:10:02 -0500 Received: from localhost.localdomain (adsl-84-226-167-205.adslplus.ch [84.226.167.205]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 12A4124198; Sun, 15 Nov 2020 17:09:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605460202; bh=nLQvhMPRPmn8OBYUS7haupcAM25cdbBYOxtHEx0ld1E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=U84DhcaoqGc5ScNqf/gUzmoe3lK2x7woUgZ2YR83LVYwL4il15/VjE1A83CrMWzD4 EqboYDLGRo+lHGcZ3VILVGxtMrtg4zqXdQ27FuDOoXg9eoSw7rFg7+xX2HLG+NpCGp Nf5csY7BoO+zqJ+LnWl6v2gXW/c48MlQgjuFwbAk= From: Krzysztof Kozlowski To: Maxime Ripard , Chen-Yu Tsai , Jernej Skrabec , Michael Turquette , Stephen Boyd , Mauro Carvalho Chehab , Sakari Ailus , Greg Kroah-Hartman , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-media@vger.kernel.org, devel@driverdev.osuosl.org, alsa-devel@alsa-project.org Cc: Krzysztof Kozlowski Subject: [PATCH 1/3] clk: fix redefinition of clk_prepare on MIPS with HAVE_LEGACY_CLK Date: Sun, 15 Nov 2020 18:09:48 +0100 Message-Id: <20201115170950.304460-2-krzk@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201115170950.304460-1-krzk@kernel.org> References: <20201115170950.304460-1-krzk@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org COMMON_CLK even though is a user-selectable symbol, is still selected by multiple other config options. COMMON_CLK should not be used when legacy clocks are provided by architecture, so it correctly depends on !HAVE_LEGACY_CLK. However it is possible to create a config which selects both COMMON_CLK (by SND_SUN8I_CODEC) and HAVE_LEGACY_CLK (by SOC_RT305X) which leads to compile errors (MIPS architecture): drivers/clk/clk.c:855:6: error: redefinition of ‘clk_unprepare’ In file included from drivers/clk/clk.c:9: include/linux/clk.h:263:20: note: previous definition of ‘clk_unprepare’ was here The definitions clk_bulk_prepare() (and unprepare) already have proper surrounding #ifdef so add them also for clk_prepare()/clk_unprepare(). Signed-off-by: Krzysztof Kozlowski --- drivers/clk/clk.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index f83dac54ed85..f4f68c7c2fb5 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -841,6 +841,7 @@ static void clk_core_unprepare_lock(struct clk_core *core) clk_prepare_unlock(); } +#ifdef CONFIG_HAVE_CLK_PREPARE /** * clk_unprepare - undo preparation of a clock source * @clk: the clk being unprepared @@ -860,6 +861,7 @@ void clk_unprepare(struct clk *clk) clk_core_unprepare_lock(clk->core); } EXPORT_SYMBOL_GPL(clk_unprepare); +#endif static int clk_core_prepare(struct clk_core *core) { @@ -921,6 +923,7 @@ static int clk_core_prepare_lock(struct clk_core *core) return ret; } +#ifdef CONFIG_HAVE_CLK_PREPARE /** * clk_prepare - prepare a clock source * @clk: the clk being prepared @@ -941,6 +944,7 @@ int clk_prepare(struct clk *clk) return clk_core_prepare_lock(clk->core); } EXPORT_SYMBOL_GPL(clk_prepare); +#endif /* CONFIG_HAVE_CLK_PREPARE */ static void clk_core_disable(struct clk_core *core) { From patchwork Sun Nov 15 17:09:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 11906521 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8706717CF for ; Sun, 15 Nov 2020 17:10:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6C552221F9 for ; Sun, 15 Nov 2020 17:10:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="0IRlXBDG" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727417AbgKORKG (ORCPT ); Sun, 15 Nov 2020 12:10:06 -0500 Received: from mail.kernel.org ([198.145.29.99]:38646 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726727AbgKORKF (ORCPT ); Sun, 15 Nov 2020 12:10:05 -0500 Received: from localhost.localdomain (adsl-84-226-167-205.adslplus.ch [84.226.167.205]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 82B152419B; Sun, 15 Nov 2020 17:10:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605460205; bh=10UkZIU1eXfGlQQ7EpZi0NHGj/dLX4A8AuYloIYXAN4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0IRlXBDG0xHkpXiOS2224BF2lLlgIVoxfYKt/M3XkMjasIQkT0eA4vNRSraIrWlvK zFNEo9s1kMOPs8G67u2ty4PKOgyVDrcUMp77G49yjwn4cRfkSs1uLnZYh4CrxIAegM FwVVXAqn+xbr2rRFHXsooXWynXNSKA8ynddQYaTw= From: Krzysztof Kozlowski To: Maxime Ripard , Chen-Yu Tsai , Jernej Skrabec , Michael Turquette , Stephen Boyd , Mauro Carvalho Chehab , Sakari Ailus , Greg Kroah-Hartman , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-media@vger.kernel.org, devel@driverdev.osuosl.org, alsa-devel@alsa-project.org Cc: Krzysztof Kozlowski Subject: [RFC 2/3] ARM: sunxi: do not select COMMON_CLK to fix builds Date: Sun, 15 Nov 2020 18:09:49 +0100 Message-Id: <20201115170950.304460-3-krzk@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201115170950.304460-1-krzk@kernel.org> References: <20201115170950.304460-1-krzk@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org COMMON_CLK is a user-selectable option with its own dependencies. The most important dependency is !HAVE_LEGACY_CLK. User-selectable drivers should not select COMMON_CLK because they will create a dependency cycle and build failures. For example on MIPS a configuration with COMMON_CLK (selected by SND_SUN8I_CODEC) and HAVE_LEGACY_CLK (selected by SOC_RT305X) is possible: WARNING: unmet direct dependencies detected for COMMON_CLK Depends on [n]: !HAVE_LEGACY_CLK [=y] Selected by [y]: - SND_SUN8I_CODEC [=y] && SOUND [=y] && !UML && SND [=y] && SND_SOC [=y] && (ARCH_SUNXI || COMPILE_TEST [=y]) && OF [=y] && (MACH_SUN8I || ARM64 && ARCH_SUNXI || COMPILE_TEST [=y]) /usr/bin/mips-linux-gnu-ld: drivers/clk/clk.o: in function `clk_set_rate': (.text+0xaeb4): multiple definition of `clk_set_rate'; arch/mips/ralink/clk.o:(.text+0x88): first defined here Signed-off-by: Krzysztof Kozlowski Reviewed-by: Samuel Holland --- arch/arm/mach-sunxi/Kconfig | 1 + sound/soc/sunxi/Kconfig | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig index eeadb1a4dcfe..4d9f9b6d329d 100644 --- a/arch/arm/mach-sunxi/Kconfig +++ b/arch/arm/mach-sunxi/Kconfig @@ -4,6 +4,7 @@ menuconfig ARCH_SUNXI depends on ARCH_MULTI_V5 || ARCH_MULTI_V7 select ARCH_HAS_RESET_CONTROLLER select CLKSRC_MMIO + select COMMON_CLK select GENERIC_IRQ_CHIP select GPIOLIB select PINCTRL diff --git a/sound/soc/sunxi/Kconfig b/sound/soc/sunxi/Kconfig index 69b9d8515335..ddcaaa98d3cb 100644 --- a/sound/soc/sunxi/Kconfig +++ b/sound/soc/sunxi/Kconfig @@ -14,7 +14,7 @@ config SND_SUN8I_CODEC tristate "Allwinner SUN8I audio codec" depends on OF depends on MACH_SUN8I || (ARM64 && ARCH_SUNXI) || COMPILE_TEST - select COMMON_CLK + depends on COMMON_CLK select REGMAP_MMIO help This option enables the digital part of the internal audio codec for From patchwork Sun Nov 15 17:09:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 11906523 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B68941668 for ; Sun, 15 Nov 2020 17:10:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9278C221F9 for ; Sun, 15 Nov 2020 17:10:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="V3qmWys4" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727294AbgKORKK (ORCPT ); Sun, 15 Nov 2020 12:10:10 -0500 Received: from mail.kernel.org ([198.145.29.99]:38782 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726727AbgKORKJ (ORCPT ); Sun, 15 Nov 2020 12:10:09 -0500 Received: from localhost.localdomain (adsl-84-226-167-205.adslplus.ch [84.226.167.205]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 002F9241A3; Sun, 15 Nov 2020 17:10:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605460209; bh=aEUp0B6gKWhexMWTFrPQ6syXXhv4DwFr18aY9X2Sbr4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V3qmWys4GJ+55sDezEl4qwyS2jtjIpQxwkjiulc5KFvkI+vJCfm4rOLTN9AT5rm0A JEbL/6hsbV5Rrd/6V9E5W4GCWcH05U1/mPxqBpjyu7Z4AaaGQdcFhlqtd4pdo+gZcR 5Q7MEWczSaK2Z4Rh4Qha8JOyb67INOYvrXzJIX/U= From: Krzysztof Kozlowski To: Maxime Ripard , Chen-Yu Tsai , Jernej Skrabec , Michael Turquette , Stephen Boyd , Mauro Carvalho Chehab , Sakari Ailus , Greg Kroah-Hartman , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, linux-media@vger.kernel.org, devel@driverdev.osuosl.org, alsa-devel@alsa-project.org Cc: Krzysztof Kozlowski Subject: [RFC 3/3] media: atomisp: do not select COMMON_CLK to fix builds Date: Sun, 15 Nov 2020 18:09:50 +0100 Message-Id: <20201115170950.304460-4-krzk@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201115170950.304460-1-krzk@kernel.org> References: <20201115170950.304460-1-krzk@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org COMMON_CLK is a user-selectable option with its own dependencies. The most important dependency is !HAVE_LEGACY_CLK. User-selectable drivers should not select COMMON_CLK because they will create a dependency cycle and build failures. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Stephen Boyd --- drivers/staging/media/atomisp/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/media/atomisp/Kconfig b/drivers/staging/media/atomisp/Kconfig index 37577bb72998..742edb261d85 100644 --- a/drivers/staging/media/atomisp/Kconfig +++ b/drivers/staging/media/atomisp/Kconfig @@ -2,9 +2,9 @@ menuconfig INTEL_ATOMISP bool "Enable support to Intel Atom ISP camera drivers" depends on X86 && EFI && PCI && ACPI + depends on COMMON_CLK select IOSF_MBI select MEDIA_CONTROLLER - select COMMON_CLK help Enable support for the Intel ISP2 camera interfaces and MIPI sensor drivers.