From patchwork Thu Oct 10 20:29:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 11184329 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 E71A8112B for ; Thu, 10 Oct 2019 20:39:31 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7B41B2190F for ; Thu, 10 Oct 2019 20:39:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="FJMrts/1" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7B41B2190F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arndb.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 60D461616; Thu, 10 Oct 2019 22:38:39 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 60D461616 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1570739969; bh=EC7y2vRxvAu4G5Rf8ylOw/+Q70ZuRDpISbAi7yc4J34=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=FJMrts/1Y+W1ooMMn7b2DiUsE3xcHs8Auvp2XNHDAwmT6twoeLh713LlYj7iuD3IJ FhmDwFa6lVHVy6LvAVd/2Kl4voyezWD8mP4ELECVeNcC3AdDWYQkH1SyFTPAbACJTx 0Uo3FtmWXqaC9wlyT35l612KLbrySiXBcxLiqbzQ= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 99150F80322; Thu, 10 Oct 2019 22:38:37 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id E6743F8038F; Thu, 10 Oct 2019 22:38:35 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_NONE, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 64A44F80113 for ; Thu, 10 Oct 2019 22:38:28 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 64A44F80113 Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.129]) with ESMTPA (Nemesis) id 1MvKTJ-1i0io918NN-00rJAB; Thu, 10 Oct 2019 22:38:12 +0200 From: Arnd Bergmann To: Kukjin Kim , Krzysztof Kozlowski , Ulf Hansson , Thierry Reding , Mark Brown , Greg Kroah-Hartman , Jiri Slaby , Sangbeom Kim , Sylwester Nawrocki , Liam Girdwood Date: Thu, 10 Oct 2019 22:29:55 +0200 Message-Id: <20191010203043.1241612-11-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20191010203043.1241612-1-arnd@arndb.de> References: <20191010202802.1132272-1-arnd@arndb.de> <20191010203043.1241612-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:DeCWCHOpOlptkpY1Z/HIZH2sQ5vntA19TvDZ7kwzXVESbUwtDT/ nya/g+yk9RmYCdn7Mnh6OP8xv47pVGRSws4DiX1LHA12gXOzQ1qn6lxQpZRRKqP7iAcdbOu l8p40rlKc+olt+OUsDEnNqYSWkVcmXc0U/jNtH57wqSdtcs66pZwaDfNStTfnXSHjMdAuUp DXP4NCRq3Rv4Wl6NcQjBg== X-UI-Out-Filterresults: notjunk:1;V03:K0:KPFFi7urTwk=:P0VUAx0mQV0RyAkge1tOF5 Z/OBFZSRG+nwpOLZGYULeoFGwoagH/2P2LEXzhRAW5zMvDhMqbJQ9mzjtzfnRNeEhVZ0gDYDJ CykC+d1CzLd+aW2GVrWocU5wdIZKVAUw2oYck3ZT1FdLuisDLLRlQ7ooz86osiHPW71TBFJ6t WXuQ3fwfJAgQ9rIth2pQBuJ1gpMig4USaOiJ3vhpUL65WUmTBdpPHyfLsHUmlLgcpvbvqIIfv n4P7ECrvi49H/eGtb18RgiEGiHPLzJO807ZMamHJapIyHua/szElJoTQFCPKNuYdAjV9DeTYk RdNLLkZNBGKwKMtKs4zm1QcO1qnkxdXIbrUY8PU7BWG4wBuLTwpgxMaapIiZF/bwwg8JJ6/6a 8y8/iEHqyoJ9xKOaKtfljEBDENzJN1GqRuyTpwv/12cIfBczoHDZQpbAb5rFd/bnswKf1lu0a dVVJpLcnkD6ihqNhDimLNkuOiK8TxYEwSj6KAnp7ExU955M50aatPaOjHGHXac0JTa7Mm/Kfp gJp/qGkOHKTLJW/vCb8IwwHfs7GYXefBiiwjIqkaLeIi/KYEL2VF9Mg0HTU42gmIPKD3Wqe95 q8txmDV6AE20P3VWTv0S2OIbEACrqPRaBu4im4BNZtZG7LcyBV3JkeK3B30+N5qCkfvZt8qKj U2QVc5t/ZrUMYEk7nZcq8nF4p5vJT/AkVOXRmnXLHMHkwxkVfuUWgeKebZ62c/HhMMtJ0QQ3a mtytbdoOtXYX3+AwX13fJNiqZrvW34Yt48Wg4UQbbwxucTrepEGTomVXxdK9NZ7NWFSnMnEUy h1MUWk7gsGxTlCkbcZ3fj1Sg+w94MIdMWSb6xCLtIHMV3Io+qK/kbjhlHaRiP/LqBeq61X6GA 5dQG3dEGuSPEkJVAfh0A== Cc: linux-pwm@vger.kernel.org, alsa-devel@alsa-project.org, linux-samsung-soc@vger.kernel.org, Arnd Bergmann , Bartlomiej Zolnierkiewicz , linux-kernel@vger.kernel.org, linus.walleij@linaro.org, linux-mmc@vger.kernel.org, Takashi Iwai , Mauro Carvalho Chehab , Faiz Abbas , =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= , linux-serial@vger.kernel.org, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Olof Johansson , linux-spi@vger.kernel.org, Sascha Hauer , linux-arm-kernel@lists.infradead.org Subject: [alsa-devel] [PATCH 11/36] ARM: s5pv210: split from plat-samsung X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" These can be build completely independently, so split the two Kconfig symbols. Signed-off-by: Arnd Bergmann Acked-by: Ulf Hansson Acked-by: Thierry Reding --- arch/arm/Kconfig.debug | 6 +++--- arch/arm/Makefile | 1 - arch/arm/plat-samsung/Kconfig | 2 +- drivers/mmc/host/Kconfig | 2 +- drivers/pwm/Kconfig | 2 +- drivers/spi/Kconfig | 2 +- drivers/tty/serial/Kconfig | 2 +- sound/soc/samsung/Kconfig | 2 +- 8 files changed, 9 insertions(+), 10 deletions(-) diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug index 9c4f2d6deb06..4c4e97ae4fcb 100644 --- a/arch/arm/Kconfig.debug +++ b/arch/arm/Kconfig.debug @@ -998,7 +998,7 @@ choice via SCIFA4 on Renesas SH-Mobile AG5 (SH73A0). config DEBUG_S3C_UART0 - depends on PLAT_SAMSUNG || ARCH_EXYNOS + depends on PLAT_SAMSUNG || ARCH_S5PV210 || ARCH_EXYNOS select DEBUG_EXYNOS_UART if ARCH_EXYNOS select DEBUG_S3C24XX_UART if ARCH_S3C24XX select DEBUG_S3C64XX_UART if ARCH_S3C64XX @@ -1010,7 +1010,7 @@ choice by the boot-loader before use. config DEBUG_S3C_UART1 - depends on PLAT_SAMSUNG || ARCH_EXYNOS + depends on PLAT_SAMSUNG || ARCH_S5PV210 || ARCH_EXYNOS select DEBUG_EXYNOS_UART if ARCH_EXYNOS select DEBUG_S3C24XX_UART if ARCH_S3C24XX select DEBUG_S3C64XX_UART if ARCH_S3C64XX @@ -1022,7 +1022,7 @@ choice by the boot-loader before use. config DEBUG_S3C_UART2 - depends on PLAT_SAMSUNG || ARCH_EXYNOS + depends on PLAT_SAMSUNG || ARCH_S5PV210 || ARCH_EXYNOS select DEBUG_EXYNOS_UART if ARCH_EXYNOS select DEBUG_S3C24XX_UART if ARCH_S3C24XX select DEBUG_S3C64XX_UART if ARCH_S3C64XX diff --git a/arch/arm/Makefile b/arch/arm/Makefile index f492d7c338fe..a1bc15cda751 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -235,7 +235,6 @@ machine-$(CONFIG_PLAT_SPEAR) += spear # by CONFIG_* macro name. plat-$(CONFIG_ARCH_OMAP) += omap plat-$(CONFIG_ARCH_S3C64XX) += samsung -plat-$(CONFIG_ARCH_S5PV210) += samsung plat-$(CONFIG_PLAT_ORION) += orion plat-$(CONFIG_PLAT_PXA) += pxa plat-$(CONFIG_PLAT_S3C24XX) += samsung diff --git a/arch/arm/plat-samsung/Kconfig b/arch/arm/plat-samsung/Kconfig index 740bdb23f38a..1530946cc672 100644 --- a/arch/arm/plat-samsung/Kconfig +++ b/arch/arm/plat-samsung/Kconfig @@ -4,7 +4,7 @@ config PLAT_SAMSUNG bool - depends on PLAT_S3C24XX || ARCH_S3C64XX || ARCH_S5PV210 + depends on PLAT_S3C24XX || ARCH_S3C64XX default y select GENERIC_IRQ_CHIP select NO_IOPORT_MAP diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig index 400a581c918c..16a0e5430b44 100644 --- a/drivers/mmc/host/Kconfig +++ b/drivers/mmc/host/Kconfig @@ -275,7 +275,7 @@ config MMC_SDHCI_TEGRA config MMC_SDHCI_S3C tristate "SDHCI support on Samsung S3C SoC" - depends on MMC_SDHCI && (PLAT_SAMSUNG || ARCH_EXYNOS) + depends on MMC_SDHCI && (PLAT_SAMSUNG || ARCH_S5PV210 || ARCH_EXYNOS) help This selects the Secure Digital Host Controller Interface (SDHCI) often referrered to as the HSMMC block in some of the Samsung S3C diff --git a/drivers/pwm/Kconfig b/drivers/pwm/Kconfig index e3a2518503ed..8eb738cac0c7 100644 --- a/drivers/pwm/Kconfig +++ b/drivers/pwm/Kconfig @@ -394,7 +394,7 @@ config PWM_ROCKCHIP config PWM_SAMSUNG tristate "Samsung PWM support" - depends on PLAT_SAMSUNG || ARCH_EXYNOS + depends on PLAT_SAMSUNG || ARCH_S5PV210 || ARCH_EXYNOS help Generic PWM framework driver for Samsung. diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig index 6f7fdcbb9151..355391ee643d 100644 --- a/drivers/spi/Kconfig +++ b/drivers/spi/Kconfig @@ -625,7 +625,7 @@ config SPI_S3C24XX_FIQ config SPI_S3C64XX tristate "Samsung S3C64XX series type SPI" - depends on (PLAT_SAMSUNG || ARCH_EXYNOS || COMPILE_TEST) + depends on (PLAT_SAMSUNG || ARCH_S5PV210 || ARCH_EXYNOS || COMPILE_TEST) help SPI driver for Samsung S3C64XX and newer SoCs. diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig index 4789b5d62f63..17f01cf3009c 100644 --- a/drivers/tty/serial/Kconfig +++ b/drivers/tty/serial/Kconfig @@ -237,7 +237,7 @@ config SERIAL_CLPS711X_CONSOLE config SERIAL_SAMSUNG tristate "Samsung SoC serial support" - depends on PLAT_SAMSUNG || ARCH_EXYNOS + depends on PLAT_SAMSUNG || ARCH_S5PV210 || ARCH_EXYNOS select SERIAL_CORE help Support for the on-chip UARTs on the Samsung S3C24XX series CPUs, diff --git a/sound/soc/samsung/Kconfig b/sound/soc/samsung/Kconfig index 638983123d8f..7a0035dd9995 100644 --- a/sound/soc/samsung/Kconfig +++ b/sound/soc/samsung/Kconfig @@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0-only menuconfig SND_SOC_SAMSUNG tristate "ASoC support for Samsung" - depends on PLAT_SAMSUNG || ARCH_EXYNOS || COMPILE_TEST + depends on PLAT_SAMSUNG || ARCH_S5PV210 || ARCH_EXYNOS || COMPILE_TEST depends on COMMON_CLK select SND_SOC_GENERIC_DMAENGINE_PCM ---help--- From patchwork Thu Oct 10 20:30:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 11184361 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 DE38C112B for ; Thu, 10 Oct 2019 20:44:39 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 73501218AC for ; Thu, 10 Oct 2019 20:44:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="HPeFcY2k" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 73501218AC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arndb.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 5D60A1660; Thu, 10 Oct 2019 22:43:47 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 5D60A1660 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1570740277; bh=2Mn2VrV30dQmYSdWG9zDsnJEqEpJ40opehF7ZjlrQE4=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=HPeFcY2kjxPXt5j+/SBNHTWbJSF/Mw86hvy+e3fNwfEwvrxOmsr1SgPys7Qt2YYFq wFNxgNAawj0rfzXoVHSGuLCt5x+a+90ighAyDAsMmqpqFjRbTPCgEiYdWcaifcVXQj Omf/cLaGh7q3ZrYTpGatOWur71N8H/aKUwl+LMTU= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 071A7F80322; Thu, 10 Oct 2019 22:43:47 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 59D5AF8038F; Thu, 10 Oct 2019 22:43:46 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_NONE, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id D671CF802BC for ; Thu, 10 Oct 2019 22:43:43 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D671CF802BC Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.129]) with ESMTPA (Nemesis) id 1MZAvp-1ieTO30iRt-00VBpT; Thu, 10 Oct 2019 22:43:02 +0200 From: Arnd Bergmann To: Kukjin Kim , Krzysztof Kozlowski , Sangbeom Kim , Sylwester Nawrocki , Liam Girdwood , Mark Brown Date: Thu, 10 Oct 2019 22:30:01 +0200 Message-Id: <20191010203043.1241612-17-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20191010203043.1241612-1-arnd@arndb.de> References: <20191010202802.1132272-1-arnd@arndb.de> <20191010203043.1241612-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:lmK9wS9sc6nMQoBUUXcAPPuQgSQ3WrsOcrUXsclaGNLYeBYgj79 5aHzgPRFU+EfSCkv/w11qKN7+Y8K/0guyK4AbiyvfzVoSum77d/2CHMU411Ibt3oiCw4uDV tr5vnswQPsH3wPeg5xBjK6DA33UwKnB41YHO47O+70JZ0MVQBhh2OO2KU+JTZvNcUdg3nQX aGjg0CD1N4zDhEoOfSuqg== X-UI-Out-Filterresults: notjunk:1;V03:K0:Yvd26aZbfwk=:tFDCEM6WoRw7PSv2HMlIkA UDyTbad1V5uW3cETaHlMreOiM37YfpqPFbnWifcy+Jm1D/JtP5L+rAMwnxrtPBPkQYdUdGehG Q90L4sHVWh/4NwFRsB3spxQu3ig3+yDwGn2X8uLrMPIa4Ki4oWoNYe2tFHDVTwssHG1Mz8OIt wHxJ7GZlTH2z4M+C9XT86IQ9h4tCFKbqCPmrt+/qsz8QGYrTmC5OUsAKyE/g8gwKyHTpdIPeo s0K3rbxVPM3Pb8dIcBDX+KacTaiDLb27df6M6mXHWHzeqJfVy6uuX/5DwBN9VYHaJxoTZ1+vp GXlSfAN7Fn6I+DWnPyYRq/P3UBKasLeG9yQ7mjRYF3U81zXECxizbkuOK8kSmls7pODeBWPmx PyhTKkuNn2izg+0UqD3HCjACW0QuyaRY3iSwtNfGJSBQyWT1KZNjNe8HnOcslgnCgVr0PZeAs gEbXIxPpJgeUGpA8jsE/BrPSv/HvWfm42rgfvRYjqY/rjLiT50Esl+ewU9sRCQGnA87hmTzR6 TNOE74NfD7AnnMwz2jCz50hFeXKyciAVmQrouHyoLGiDOxNeWY1T4enXAsGma86NuVlAJZYtQ ioukCRHpu+57HJ9q2ymKlsxoIimkQUU2Fc3aLro/PzrlmUX5iJtIxDSUS/M1YoW73wQAMgEPB 1RWvPMuABO4mJ4ZosHcopZj90hLaHlB+i0+ME5m2bD98h85eArL3qKXzyeeryWKlqOuSHpqG8 kPF17ELCdtkl/e+vFIV6WVpmdkMIfgrcGYdvHIt3b1D5toVEZQLURB1WYEW8eXr+D5HvEwXam KojAvcHdq+C+FcToe0Ayf84WuA+sHRFp4uQjCkkQ9Znt98ktkvEpaO0QEnAvIR5W84z5jY80/ iMCHQGfv/aP595ZU/naw== Cc: Ulf Hansson , linux-samsung-soc@vger.kernel.org, Arnd Bergmann , linux-kernel@vger.kernel.org, linus.walleij@linaro.org, Takashi Iwai , alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org Subject: [alsa-devel] [PATCH 17/36] ARM: s3c: h1940-audio: turn into platform driver X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Avoid machine specific headers by using a gpio lookup table combined with a platform_driver for this board. Signed-off-by: Arnd Bergmann --- arch/arm/mach-s3c24xx/mach-h1940.c | 18 ++++++++ sound/soc/samsung/h1940_uda1380.c | 71 ++++++++++-------------------- 2 files changed, 41 insertions(+), 48 deletions(-) diff --git a/arch/arm/mach-s3c24xx/mach-h1940.c b/arch/arm/mach-s3c24xx/mach-h1940.c index 74d6b68e91c7..922d53bacbdf 100644 --- a/arch/arm/mach-s3c24xx/mach-h1940.c +++ b/arch/arm/mach-s3c24xx/mach-h1940.c @@ -475,6 +475,22 @@ static struct gpiod_lookup_table h1940_mmc_gpio_table = { }, }; +static struct gpiod_lookup_table h1940_audio_gpio_table = { + .dev_id = "h1940-audio", + .table = { + GPIO_LOOKUP("H1940_LATCH", + H1940_LATCH_AUDIO_POWER - H1940_LATCH_GPIO(0), + "speaker-power", GPIO_ACTIVE_HIGH), + GPIO_LOOKUP("GPIOG", 4, "hp", GPIO_ACTIVE_HIGH), + { }, + }, +}; + +static struct platform_device h1940_audio = { + .name = "h1940-audio", + .id = -1, +}; + static struct pwm_lookup h1940_pwm_lookup[] = { PWM_LOOKUP("samsung-pwm", 0, "pwm-backlight", NULL, 36296, PWM_POLARITY_NORMAL), @@ -652,6 +668,7 @@ static struct platform_device *h1940_devices[] __initdata = { &s3c_device_ts, &power_supply, &h1940_battery, + &h1940_audio, }; static void __init h1940_map_io(void) @@ -691,6 +708,7 @@ static void __init h1940_init(void) s3c24xx_fb_set_platdata(&h1940_fb_info); gpiod_add_lookup_table(&h1940_mmc_gpio_table); + gpiod_add_lookup_table(&h1940_audio_gpio_table); s3c24xx_mci_set_platdata(&h1940_mmc_cfg); s3c24xx_udc_set_platdata(&h1940_udc_cfg); s3c24xx_ts_set_platdata(&h1940_ts_cfg); diff --git a/sound/soc/samsung/h1940_uda1380.c b/sound/soc/samsung/h1940_uda1380.c index a95c34e53a2b..5fc001b4effd 100644 --- a/sound/soc/samsung/h1940_uda1380.c +++ b/sound/soc/samsung/h1940_uda1380.c @@ -15,9 +15,6 @@ #include #include "regs-iis.h" -#include - -#include #include "s3c24xx-i2s.h" static const unsigned int rates[] = { @@ -31,6 +28,8 @@ static const struct snd_pcm_hw_constraint_list hw_rates = { .list = rates, }; +static struct gpio_desc *gpiod_speaker_power; + static struct snd_soc_jack hp_jack; static struct snd_soc_jack_pin hp_jack_pins[] = { @@ -47,7 +46,6 @@ static struct snd_soc_jack_pin hp_jack_pins[] = { static struct snd_soc_jack_gpio hp_jack_gpios[] = { { - .gpio = S3C2410_GPG(4), .name = "hp-gpio", .report = SND_JACK_HEADPHONE, .invert = 1, @@ -123,9 +121,9 @@ static int h1940_spk_power(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event) { if (SND_SOC_DAPM_EVENT_ON(event)) - gpio_set_value(S3C_GPIO_END + 9, 1); + gpiod_set_value(gpiod_speaker_power, 1); else - gpio_set_value(S3C_GPIO_END + 9, 0); + gpiod_set_value(gpiod_speaker_power, 0); return 0; } @@ -151,8 +149,6 @@ static const struct snd_soc_dapm_route audio_map[] = { {"VINM", NULL, "Mic Jack"}, }; -static struct platform_device *s3c24xx_snd_device; - static int h1940_uda1380_init(struct snd_soc_pcm_runtime *rtd) { snd_soc_card_jack_new(rtd->card, "Headphone Jack", SND_JACK_HEADPHONE, @@ -194,55 +190,34 @@ static struct snd_soc_card h1940_asoc = { .num_dapm_routes = ARRAY_SIZE(audio_map), }; -static int __init h1940_init(void) +static int h1940_probe(struct platform_device *pdev) { - int ret; + struct device *dev = &pdev->dev; - if (!machine_is_h1940()) - return -ENODEV; + h1940_asoc.dev = dev; + hp_jack_gpios[0].gpiod_dev = dev; + gpiod_speaker_power = devm_gpiod_get(&pdev->dev, "speaker-power", + GPIOD_OUT_LOW); - /* configure some gpios */ - ret = gpio_request(S3C_GPIO_END + 9, "speaker-power"); - if (ret) - goto err_out; - - ret = gpio_direction_output(S3C_GPIO_END + 9, 0); - if (ret) - goto err_gpio; - - s3c24xx_snd_device = platform_device_alloc("soc-audio", -1); - if (!s3c24xx_snd_device) { - ret = -ENOMEM; - goto err_gpio; + if (IS_ERR(gpiod_speaker_power)) { + dev_err(dev, "Could not get gpio\n"); + return PTR_ERR(gpiod_speaker_power); } - platform_set_drvdata(s3c24xx_snd_device, &h1940_asoc); - ret = platform_device_add(s3c24xx_snd_device); - - if (ret) - goto err_plat; - - return 0; - -err_plat: - platform_device_put(s3c24xx_snd_device); -err_gpio: - gpio_free(S3C_GPIO_END + 9); - -err_out: - return ret; -} - -static void __exit h1940_exit(void) -{ - platform_device_unregister(s3c24xx_snd_device); - gpio_free(S3C_GPIO_END + 9); + return devm_snd_soc_register_card(dev, &h1940_asoc); } -module_init(h1940_init); -module_exit(h1940_exit); +static struct platform_driver h1940_audio_driver = { + .driver = { + .name = "h1940-audio", + .pm = &snd_soc_pm_ops, + }, + .probe = h1940_probe, +}; +module_platform_driver(h1940_audio_driver); /* Module information */ MODULE_AUTHOR("Arnaud Patard, Vasily Khoruzhick"); MODULE_DESCRIPTION("ALSA SoC H1940"); MODULE_LICENSE("GPL"); +MODULE_ALIAS("platform:h1940-audio"); From patchwork Thu Oct 10 20:30:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 11184375 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 62C6714ED for ; Thu, 10 Oct 2019 20:45:36 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6D915206B6 for ; Thu, 10 Oct 2019 20:45:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="E7xvzDAm" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6D915206B6 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arndb.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 57045166F; Thu, 10 Oct 2019 22:44:43 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 57045166F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1570740333; bh=12DTMfn/t7dDzTFOFIPgbu7LzUpGfDZ8YIDNFmRqOLM=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=E7xvzDAmplzh6SGzDkmil0aZ3l/aEUgLRsj96qCNeeOde2sCQn5koqfDCW0fkmhDx fu17Dh61I6ie46lRV4Ppehz22/gScDlr81VSWiPkWXhyhkz2OTiCjaAq53se72s7Zb MjUD0Pr+SkU4Uy5RVYEbl3IVUGZ6oqce5cTzWh18= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id EE73BF802BC; Thu, 10 Oct 2019 22:44:11 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 6827DF804CB; Thu, 10 Oct 2019 22:44:10 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_NONE,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.187]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id E64FAF8045E for ; Thu, 10 Oct 2019 22:44:07 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz E64FAF8045E Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.129]) with ESMTPA (Nemesis) id 1MvKTJ-1i0iit3Hhh-00rJAB; Thu, 10 Oct 2019 22:43:26 +0200 From: Arnd Bergmann To: Kukjin Kim , Krzysztof Kozlowski , Sangbeom Kim , Sylwester Nawrocki , Liam Girdwood , Mark Brown Date: Thu, 10 Oct 2019 22:30:02 +0200 Message-Id: <20191010203043.1241612-18-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20191010203043.1241612-1-arnd@arndb.de> References: <20191010202802.1132272-1-arnd@arndb.de> <20191010203043.1241612-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:E/PWTX0ODVddzN9zfl588cxLhZigrWay5tj6I/VSq0zBeAZBVl/ Pg2AljjW3Ge51Sc7P0F0xcbqWnwKB06qeBicZLXQwT85V0JqdtHV5vRAF08PRH8dc/14zdF WTMGnlPwH5JkcHA81yXKVDNGSHT0NA/HcnAYqCGBokfcNXX/gtKury0/xWgyPkpnT0hFE4T 7JnLQyvtW8LH7gA6FqSVw== X-UI-Out-Filterresults: notjunk:1;V03:K0:nhMgLxHXEnI=:lW3e8hBLScTKZYjz4rT4KG 3eo5Nbp+ZaVxOTJriTSNETi7QY3XGfXPFLXqEpQ4zSohEqoKEjKucOm/xWizWh5WQbMR4IBYp STWrTf3B4C4c20HzNxcVZ4Qsost+e4iFgjfPd1EZYbqQoNs3uSMSIK6rUKaELUW7dClQEkQA8 P422P/yC0lMpKhnwCY5iGu0HAoZB+y4qAoyBq46BZeScNe9UydVJGbdfPQOcTuwEtJrgOgsP9 GJDqTFx6Dy/7hWXlBvXunhnbcAGTbpvw8nHP0ICxkueZdY7+ZOBCYvHgvakBqUAkAgeidxz4s q5g0Mj8qbZqZQNv7Rc8VQ97zJZg6W7MQPGwuWQvPSfRX/5OD5VeF0pBHZktaSLKIwSAa2+Q0v D5gz2RR0ZwjjJxoUTE2SsssKBw6XHYTrxu0C3QC6l894nelb8mhhK2g42PX6Qr+nsoQB6YN1c 5PvrgU4yAKrnpFf0x3Q8FiSiUk7Eg9F2O0EuUKOcG1y/4bIyh59OECkEBwwzKiNR2vuAAJcDp zecwKX3PHsfmIDDkWZ8B7oX6SP1zi1olkIa1SL1csXGnINI/Z8TZfHh1osw8OZnEZpPpSoj1e dIitQ1wkmEYnQaixB/xIjsd1ms1uUETf/7x/R4MOEeHdgqXFEgYONsqP7ReSVBfloSHF4T0uW 49rDZ2e3rfUjStgC9wQ4di4Lhw04NDjiSxv5PDy3dh8P3dQNdZCBgsewsk2zsWt1Wlp3i+BgD Dc2M48xWqtata/QCGakefWPxk7NBRnkVfllMK0YsoAf+BjXjWpNDN4OHd27hlkqYbSZ8pOKyl EFWV27nCjU0i+uxCbVVw9MHMsERevYPrVRmmmDwyGVx2qyiL5UomQsYnvSyZApWIV5SjFp3rX /AldcAlb09FyRXbam93g== Cc: alsa-devel@alsa-project.org, linux-samsung-soc@vger.kernel.org, Arnd Bergmann , linux-kernel@vger.kernel.org, linus.walleij@linaro.org, Takashi Iwai , linux-arm-kernel@lists.infradead.org Subject: [alsa-devel] [PATCH 18/36] ARM: s3c: gta02-audio: turn into platform driver X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Avoid machine specific headers by using a gpio lookup table combined with a platform_driver for this board. Signed-off-by: Arnd Bergmann --- arch/arm/mach-s3c24xx/mach-gta02.c | 17 ++++++ sound/soc/samsung/neo1973_wm8753.c | 85 +++++++++--------------------- 2 files changed, 43 insertions(+), 59 deletions(-) diff --git a/arch/arm/mach-s3c24xx/mach-gta02.c b/arch/arm/mach-s3c24xx/mach-gta02.c index 594901f3b8e5..526fd0933289 100644 --- a/arch/arm/mach-s3c24xx/mach-gta02.c +++ b/arch/arm/mach-s3c24xx/mach-gta02.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -474,6 +475,20 @@ static struct platform_device gta02_buttons_device = { }, }; +static struct gpiod_lookup_table gta02_audio_gpio_table = { + .dev_id = "neo1973-audio", + .table = { + GPIO_LOOKUP("GPIOJ", 2, "amp-shut", GPIO_ACTIVE_HIGH), + GPIO_LOOKUP("GPIOJ", 1, "hp", GPIO_ACTIVE_HIGH), + { }, + }, +}; + +static struct platform_device gta02_audio = { + .name = "neo1973-audio", + .id = -1, +}; + static void __init gta02_map_io(void) { s3c24xx_init_io(gta02_iodesc, ARRAY_SIZE(gta02_iodesc)); @@ -498,6 +513,7 @@ static struct platform_device *gta02_devices[] __initdata = { >a02_buttons_device, &s3c_device_adc, &s3c_device_ts, + >a02_audio, }; static void gta02_poweroff(void) @@ -524,6 +540,7 @@ static void __init gta02_machine_init(void) i2c_register_board_info(0, gta02_i2c_devs, ARRAY_SIZE(gta02_i2c_devs)); + gpiod_add_lookup_table(>a02_audio_gpio_table); platform_add_devices(gta02_devices, ARRAY_SIZE(gta02_devices)); pm_power_off = gta02_poweroff; diff --git a/sound/soc/samsung/neo1973_wm8753.c b/sound/soc/samsung/neo1973_wm8753.c index 38f536bafa09..b41e3dc297e7 100644 --- a/sound/soc/samsung/neo1973_wm8753.c +++ b/sound/soc/samsung/neo1973_wm8753.c @@ -11,14 +11,11 @@ #include #include -#include +#include #include -#include -#include #include "regs-iis.h" - #include "../codecs/wm8753.h" #include "s3c24xx-i2s.h" @@ -166,6 +163,7 @@ static struct snd_soc_ops neo1973_voice_ops = { .hw_free = neo1973_voice_hw_free, }; +static struct gpio_desc *gpiod_hp_in, *gpiod_amp_shut; static int gta02_speaker_enabled; static int lm4853_set_spk(struct snd_kcontrol *kcontrol, @@ -173,7 +171,7 @@ static int lm4853_set_spk(struct snd_kcontrol *kcontrol, { gta02_speaker_enabled = ucontrol->value.integer.value[0]; - gpio_set_value(S3C2410_GPJ(2), !gta02_speaker_enabled); + gpiod_set_value(gpiod_hp_in, !gta02_speaker_enabled); return 0; } @@ -188,7 +186,7 @@ static int lm4853_get_spk(struct snd_kcontrol *kcontrol, static int lm4853_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *k, int event) { - gpio_set_value(S3C2410_GPJ(1), SND_SOC_DAPM_EVENT_OFF(event)); + gpiod_set_value(gpiod_amp_shut, SND_SOC_DAPM_EVENT_OFF(event)); return 0; } @@ -308,13 +306,8 @@ static struct snd_soc_codec_conf neo1973_codec_conf[] = { }, }; -static const struct gpio neo1973_gta02_gpios[] = { - { S3C2410_GPJ(2), GPIOF_OUT_INIT_HIGH, "GTA02_HP_IN" }, - { S3C2410_GPJ(1), GPIOF_OUT_INIT_HIGH, "GTA02_AMP_SHUT" }, -}; - static struct snd_soc_card neo1973 = { - .name = "neo1973", + .name = "neo1973gta02", .owner = THIS_MODULE, .dai_link = neo1973_dai, .num_links = ARRAY_SIZE(neo1973_dai), @@ -332,62 +325,36 @@ static struct snd_soc_card neo1973 = { .fully_routed = true, }; -static struct platform_device *neo1973_snd_device; - -static int __init neo1973_init(void) +static int neo1973_probe(struct platform_device *pdev) { - int ret; - - if (!machine_is_neo1973_gta02()) - return -ENODEV; + struct device *dev = &pdev->dev; - if (machine_is_neo1973_gta02()) { - neo1973.name = "neo1973gta02"; - neo1973.num_aux_devs = 1; - - ret = gpio_request_array(neo1973_gta02_gpios, - ARRAY_SIZE(neo1973_gta02_gpios)); - if (ret) - return ret; + gpiod_hp_in = devm_gpiod_get(dev, "hp", GPIOD_OUT_HIGH); + if (IS_ERR(gpiod_hp_in)) { + dev_err(dev, "missing gpio %s\n", "hp"); + return PTR_ERR(gpiod_hp_in); } - - neo1973_snd_device = platform_device_alloc("soc-audio", -1); - if (!neo1973_snd_device) { - ret = -ENOMEM; - goto err_gpio_free; + gpiod_amp_shut = devm_gpiod_get(dev, "amp-shut", GPIOD_OUT_HIGH); + if (IS_ERR(gpiod_amp_shut)) { + dev_err(dev, "missing gpio %s\n", "amp-shut"); + return PTR_ERR(gpiod_amp_shut); } - platform_set_drvdata(neo1973_snd_device, &neo1973); - ret = platform_device_add(neo1973_snd_device); - - if (ret) - goto err_put_device; - - return 0; - -err_put_device: - platform_device_put(neo1973_snd_device); -err_gpio_free: - if (machine_is_neo1973_gta02()) { - gpio_free_array(neo1973_gta02_gpios, - ARRAY_SIZE(neo1973_gta02_gpios)); - } - return ret; + neo1973.dev = dev; + return devm_snd_soc_register_card(dev, &neo1973); } -module_init(neo1973_init); - -static void __exit neo1973_exit(void) -{ - platform_device_unregister(neo1973_snd_device); - if (machine_is_neo1973_gta02()) { - gpio_free_array(neo1973_gta02_gpios, - ARRAY_SIZE(neo1973_gta02_gpios)); - } -} -module_exit(neo1973_exit); +struct platform_driver neo1973_audio = { + .driver = { + .name = "neo1973-audio", + .pm = &snd_soc_pm_ops, + }, + .probe = neo1973_probe, +}; +module_platform_driver(neo1973_audio); /* Module information */ MODULE_AUTHOR("Graeme Gregory, graeme@openmoko.org, www.openmoko.org"); MODULE_DESCRIPTION("ALSA SoC WM8753 Neo1973 and Frerunner"); MODULE_LICENSE("GPL"); +MODULE_ALIAS("platform:neo1973-audio"); From patchwork Thu Oct 10 20:30:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 11184383 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 8FA241668 for ; Thu, 10 Oct 2019 20:46:29 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 20D5921835 for ; Thu, 10 Oct 2019 20:46:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="NMNbfnwB" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 20D5921835 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arndb.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 514A11677; Thu, 10 Oct 2019 22:45:37 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 514A11677 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1570740387; bh=FBE49eo+3HTRi40OZZttNXkP3BYZIzQ+V8qfv7CTchc=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=NMNbfnwBXmO0KxMc8QlUrVZ1vGZjamLtnTOWW+aaJg/gS9ZMV5HPwUBC/UHe70zFO w62HbsijVGqdHZ6gfjqhih3NFq+F2fVJxHC/Elz/t+yWPcmWsf6rLxHyr4Oi2dCWta I1dHvPavV/5uvB9VaOOiohz6YSUuXjFo4WbURYx0= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 42209F8060D; Thu, 10 Oct 2019 22:44:17 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 03495F8060E; Thu, 10 Oct 2019 22:44:15 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 780CBF805FD for ; Thu, 10 Oct 2019 22:44:13 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 780CBF805FD Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.129]) with ESMTPA (Nemesis) id 1Mth79-1hws9N0RtH-00v9BF; Thu, 10 Oct 2019 22:44:02 +0200 From: Arnd Bergmann To: Kukjin Kim , Krzysztof Kozlowski , Sangbeom Kim , Sylwester Nawrocki , Liam Girdwood , Mark Brown Date: Thu, 10 Oct 2019 22:30:03 +0200 Message-Id: <20191010203043.1241612-19-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20191010203043.1241612-1-arnd@arndb.de> References: <20191010202802.1132272-1-arnd@arndb.de> <20191010203043.1241612-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:wfNbW16IH/8q0rLeY8IHyXf66LWIWC8U3pThkVQcSDrkHT31+9v vSxG8oSXg+CP7yr/A/jTn4vRfKsNKGDB58f5hbPDeSbi5tQFy8/rxaJ4N0q5Ao2RUOW8n2+ 3wifuIaYS+qoAW8vLs1Il0nTgvTWpHRB+vHi0pS5wN5bCNJA7pZX6OPbCylScrja8E45VCv 7dzBwEvwMlK5gs3JSLAwA== X-UI-Out-Filterresults: notjunk:1;V03:K0:ILRXTWnhcB0=:dRAmk3oj1xyGKWAyP6W5pO +luDe78DLJdlKnkY66ohF9u+xItRim55TUBkC9+whJGE51aCh3+hVKj0nB1ZwMugTPJl3s8lj jFbaR6RhlfDgfYYm302LGcl2l8yhPqP26XpB343ZyuiIKBjM72WJ3jh+rij/VsLu3UOey0SfP 9fk1ALHICmY//RWOqQ25ypM52eXD4bUz3QhR5ugDZwMswGWexJs5LwNZy6s+Jsr02L8MQCYSv NcxsR3W/LFTx41U2g4UXT1HVLFmz6SUn1ywigup8+Hmc039sa9yyKHM5LyNv6xhmVg7/MPbt0 aLFpiKltf0EeI4+AQKLWV3nYdOv7/xp0oFn6BTvOIMzVbXn1CmLweoI6pWdMaMUNIRjQmNSft PSZlAMME0FCN7GiCAsWMwfX50FFgyG2EqPZ6FSLQfxlgUKJBzkms4JtpcZSslos54uILvhNoX Fu+pssdbfj0EPlK2udsNZfxYpKbq0ALaVht0aAnS9YFpUqcnS9HZymWN3RpmEWw6UYNl041gy tCMttOB8ZY/YvgN349VbrY5jlktb7TjZ2FMoqlXqppPGAL0hmZh7p8jIGxzRyWwie+rsKbdux qCV3usmIB5IlWaxTGDaVNydNKiR/T/7EBkJyXbA6Xuvs9aJrFXAWedRF9h43/3DoIXB34doDI AFa7l9hwJDVQ0ATfHogkZJBXfAEc15QEddIjt/LMCNKTbr8xTIibld/fBl8D6EG1RkTCU8cG0 iWolX3DGh7NjJWw0XwN/mU9g5Rw0/pSXzp0GO1k2cvl+5LFFSTlsSvQFTSC/6ZYIfLFOUMo1q AVcDENybVASfwb+I7NPpxah1QVFB8csB9FycNVTN9wvuQkgZz8wYDELxDy5SyaG98aTBJ+fUc 7buRF937lbAWyt64ZNPQ== Cc: Ulf Hansson , linux-samsung-soc@vger.kernel.org, Arnd Bergmann , linux-kernel@vger.kernel.org, linus.walleij@linaro.org, Takashi Iwai , alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org Subject: [alsa-devel] [PATCH 19/36] ARM: s3c: rx1950: turn into platform driver X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Avoid machine specific headers by using a gpio lookup table combined with a platform_driver for this board. Signed-off-by: Arnd Bergmann --- arch/arm/mach-s3c24xx/mach-rx1950.c | 16 +++++++ sound/soc/samsung/rx1950_uda1380.c | 72 +++++++++-------------------- 2 files changed, 39 insertions(+), 49 deletions(-) diff --git a/arch/arm/mach-s3c24xx/mach-rx1950.c b/arch/arm/mach-s3c24xx/mach-rx1950.c index 29f9b345a531..9f3b0f18cd36 100644 --- a/arch/arm/mach-s3c24xx/mach-rx1950.c +++ b/arch/arm/mach-s3c24xx/mach-rx1950.c @@ -724,6 +724,20 @@ static struct i2c_board_info rx1950_i2c_devices[] = { }, }; +static struct gpiod_lookup_table rx1950_audio_gpio_table = { + .dev_id = "rx1950-audio", + .table = { + GPIO_LOOKUP("GPIOG", 12, "hp-gpio", GPIO_ACTIVE_HIGH), + GPIO_LOOKUP("GPIOA", 1, "speaker-power", GPIO_ACTIVE_HIGH), + { }, + }, +}; + +static struct platform_device rx1950_audio = { + .name = "rx1950-audio", + .id = -1, +}; + static struct platform_device *rx1950_devices[] __initdata = { &s3c2410_device_dclk, &s3c_device_lcd, @@ -742,6 +756,7 @@ static struct platform_device *rx1950_devices[] __initdata = { &power_supply, &rx1950_battery, &rx1950_leds, + &rx1950_audio, }; static void __init rx1950_map_io(void) @@ -809,6 +824,7 @@ static void __init rx1950_init_machine(void) gpio_direction_output(S3C2410_GPJ(6), 0); pwm_add_table(rx1950_pwm_lookup, ARRAY_SIZE(rx1950_pwm_lookup)); + gpiod_add_lookup_table(&rx1950_audio_gpio_table); platform_add_devices(rx1950_devices, ARRAY_SIZE(rx1950_devices)); i2c_register_board_info(0, rx1950_i2c_devices, diff --git a/sound/soc/samsung/rx1950_uda1380.c b/sound/soc/samsung/rx1950_uda1380.c index 4b247e91ae5b..cf96eaaf6b4e 100644 --- a/sound/soc/samsung/rx1950_uda1380.c +++ b/sound/soc/samsung/rx1950_uda1380.c @@ -12,16 +12,13 @@ // Vasily Khoruzhick #include -#include +#include #include #include #include -#include #include "regs-iis.h" -#include - #include "s3c24xx-i2s.h" static int rx1950_uda1380_init(struct snd_soc_pcm_runtime *rtd); @@ -58,7 +55,6 @@ static struct snd_soc_jack_pin hp_jack_pins[] = { static struct snd_soc_jack_gpio hp_jack_gpios[] = { [0] = { - .gpio = S3C2410_GPG(12), .name = "hp-gpio", .report = SND_JACK_HEADPHONE, .invert = 1, @@ -123,8 +119,6 @@ static struct snd_soc_card rx1950_asoc = { .num_dapm_routes = ARRAY_SIZE(audio_map), }; -static struct platform_device *s3c24xx_snd_device; - static int rx1950_startup(struct snd_pcm_substream *substream) { struct snd_pcm_runtime *runtime = substream->runtime; @@ -134,13 +128,15 @@ static int rx1950_startup(struct snd_pcm_substream *substream) &hw_rates); } +struct gpio_desc *gpiod_speaker_power; + static int rx1950_spk_power(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event) { if (SND_SOC_DAPM_EVENT_ON(event)) - gpio_set_value(S3C2410_GPA(1), 1); + gpiod_set_value(gpiod_speaker_power, 1); else - gpio_set_value(S3C2410_GPA(1), 0); + gpiod_set_value(gpiod_speaker_power, 0); return 0; } @@ -214,57 +210,35 @@ static int rx1950_uda1380_init(struct snd_soc_pcm_runtime *rtd) return 0; } -static int __init rx1950_init(void) +static int rx1950_probe(struct platform_device *pdev) { - int ret; - - if (!machine_is_rx1950()) - return -ENODEV; + struct device *dev = &pdev->dev; /* configure some gpios */ - ret = gpio_request(S3C2410_GPA(1), "speaker-power"); - if (ret) - goto err_gpio; - - ret = gpio_direction_output(S3C2410_GPA(1), 0); - if (ret) - goto err_gpio_conf; - - s3c24xx_snd_device = platform_device_alloc("soc-audio", -1); - if (!s3c24xx_snd_device) { - ret = -ENOMEM; - goto err_plat_alloc; - } - - platform_set_drvdata(s3c24xx_snd_device, &rx1950_asoc); - ret = platform_device_add(s3c24xx_snd_device); - - if (ret) { - platform_device_put(s3c24xx_snd_device); - goto err_plat_add; + gpiod_speaker_power = devm_gpiod_get(dev, "speaker-power", GPIOD_OUT_LOW); + if (IS_ERR(gpiod_speaker_power)) { + dev_err(dev, "cannot get gpio\n"); + return PTR_ERR(gpiod_speaker_power); } - return 0; - -err_plat_add: -err_plat_alloc: -err_gpio_conf: - gpio_free(S3C2410_GPA(1)); + hp_jack_gpios[0].gpiod_dev = dev; + rx1950_asoc.dev = dev; -err_gpio: - return ret; + return devm_snd_soc_register_card(dev, &rx1950_asoc); } -static void __exit rx1950_exit(void) -{ - platform_device_unregister(s3c24xx_snd_device); - gpio_free(S3C2410_GPA(1)); -} +struct platform_driver rx1950_audio = { + .driver = { + .name = "rx1950-audio", + .pm = &snd_soc_pm_ops, + }, + .probe = rx1950_probe, +}; -module_init(rx1950_init); -module_exit(rx1950_exit); +module_platform_driver(rx1950_audio); /* Module information */ MODULE_AUTHOR("Vasily Khoruzhick"); MODULE_DESCRIPTION("ALSA SoC RX1950"); MODULE_LICENSE("GPL"); +MODULE_ALIAS("platform:rx1950-audio"); From patchwork Thu Oct 10 20:30:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 11184389 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 15B6314ED for ; Thu, 10 Oct 2019 20:47:15 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9F5B721A4C for ; Thu, 10 Oct 2019 20:47:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="puaCPFIL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9F5B721A4C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arndb.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id E14781664; Thu, 10 Oct 2019 22:46:22 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz E14781664 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1570740433; bh=RdZxNhlC1k+/JeUqGKFqviqnCu8pqzB9ZT6bRGfl3SI=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=puaCPFILpt9wxoYHMxyl3DXoNlzD5gL4n9VlXFOiW5htTCPD2U9nBCuaYTC3seDhi En/vLB9s3MqkNJxDvdWnI97Hv+QVjXWDneVPjvvITLKqo6+3yDx/4p3uO4/F2MY4/u Ibgd7zwUhmBJDT5qTk79AZ+/u31CbLuxrHIcEAUg= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 42BF6F8045E; Thu, 10 Oct 2019 22:44:58 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id D0D8CF8060E; Thu, 10 Oct 2019 22:44:56 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_NONE, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 3D0C2F80113 for ; Thu, 10 Oct 2019 22:44:50 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 3D0C2F80113 Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.129]) with ESMTPA (Nemesis) id 1M7NaW-1iAwan0z8u-007hQ6; Thu, 10 Oct 2019 22:44:45 +0200 From: Arnd Bergmann To: Kukjin Kim , Krzysztof Kozlowski , Sangbeom Kim , Sylwester Nawrocki , Liam Girdwood , Mark Brown Date: Thu, 10 Oct 2019 22:30:04 +0200 Message-Id: <20191010203043.1241612-20-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20191010203043.1241612-1-arnd@arndb.de> References: <20191010202802.1132272-1-arnd@arndb.de> <20191010203043.1241612-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:TeWf9ZvWfvjnb3Ve9QrAtsPxCA5VGsKiYGYpNXLQpoD0HmWO+Ks UTtAeH609AIi4hlmzjVR5LB64CsPOtEnktY3gel+r0tddNDxlQdqdcdSy7KM564GUqFF59d ESmRXscKVtl/UO1tJrchwYHtuWECrpBQBzr4bq2YAz0W0o7jcB1AM2n78yMQG2wHh8BZ546 +Jj6GGRLp22jZRUaAq+rA== X-UI-Out-Filterresults: notjunk:1;V03:K0:G145m/aL1hs=:sr15MrldjKsqqqKcPPsAcS rx9bG0hsaqZArUGQfG4daIX6hCQIS5LxphGu6LBkwmvBP/30bRfC1CkUGvVmXegk/siDAqHRG Y501U6N2nMX+QJxLZti0i/pwI4yJCcjRgeGCOTqpGpRuvvGopQYM14i6YPu+gL/dt9Cs4iKwe kvEmlYqxyk7+tb7DarBuMVaA7g8otT5ruEldzk3qEafRpxU3asRCO6sSrMk3IC5nwcKUsG4gJ +8QqVDTzDRFpzUvZGIUvjH/C94yTZtcG5drJLND3QQhBAEmyoVMSmVt0g1GjyRr15YgTQ+3/k Jj3x9IsbZswRcNFfNbmN75+LJowP52l7vdBr5wAsDZIgHZDN4F92JK8mf8LTqH1E9ny4DQS6c EQoPXfVWQT03Fr9LAUOr8D74IcL9OBAv0Q/LVlT1+uxdH36djNjxQgaaKp8sWvuwJJeatc9ay aGJgZGBybo1H4gcoNYFnwTdy73BjFoJgMEORAdS5y5ykx+3z1SqRHM9nUv5wY5afMV/MR2Yvu 6mB/feJh6PRTjGiK9zuSSwAK0amKACMBYIDLSz/hF5s02u9f4V+Hajg7XNwjO+Pauxqc5lOu6 it/vvYGArso57IO1So7zdk7/AJ3rKdC5adQ/NIwZWoMwZe7Rz/JXLuMmwsdtST9zLWLhjoYGM 2ZCfr/wEPA3FGGBMcqInS6Pn9eU3AOSLucH5tLtEy92m8UuInxw6NmabA3w4ez09+XtM34Ofm r/bsqjMw8wF24O+p+xW39i3gX9Ch01nynJxZ+Yg9yvwiqUID/LPO2e92M5d09j3Mb1AiNXKRE gXK+DMtndkWTpHz9FVFmCrLdKrd7HdihkyilJKK5fGN7NDtGUyq0SpmPYIcug/2gTiy0rNrp5 HAxLeTVvprdB6tPmZfVQ== Cc: alsa-devel@alsa-project.org, linux-samsung-soc@vger.kernel.org, Arnd Bergmann , linus.walleij@linaro.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [alsa-devel] [PATCH 20/36] ASoC: samsung: s3c2412-i2s: avoid hardcoded S3C2410_PA_IIS X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The constant requires indirectly including a machine header file, but it's not actually used any more since commit 87b132bc0315 ("ASoC: samsung: s3c24{xx,12}-i2s: port to use generic dmaengine API"), so remove it completely. Signed-off-by: Arnd Bergmann Acked-by: Mark Brown --- sound/soc/samsung/s3c-i2s-v2.c | 3 +-- sound/soc/samsung/s3c-i2s-v2.h | 3 +-- sound/soc/samsung/s3c2412-i2s.c | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/sound/soc/samsung/s3c-i2s-v2.c b/sound/soc/samsung/s3c-i2s-v2.c index 7e196b599be1..6a254fdaa6fb 100644 --- a/sound/soc/samsung/s3c-i2s-v2.c +++ b/sound/soc/samsung/s3c-i2s-v2.c @@ -616,8 +616,7 @@ int s3c_i2sv2_iis_calc_rate(struct s3c_i2sv2_rate_calc *info, EXPORT_SYMBOL_GPL(s3c_i2sv2_iis_calc_rate); int s3c_i2sv2_probe(struct snd_soc_dai *dai, - struct s3c_i2sv2_info *i2s, - unsigned long base) + struct s3c_i2sv2_info *i2s) { struct device *dev = dai->dev; unsigned int iismod; diff --git a/sound/soc/samsung/s3c-i2s-v2.h b/sound/soc/samsung/s3c-i2s-v2.h index fe42b77999fd..8c6fc0d3d77e 100644 --- a/sound/soc/samsung/s3c-i2s-v2.h +++ b/sound/soc/samsung/s3c-i2s-v2.h @@ -83,8 +83,7 @@ extern int s3c_i2sv2_iis_calc_rate(struct s3c_i2sv2_rate_calc *info, * @base: The base address for the registers. */ extern int s3c_i2sv2_probe(struct snd_soc_dai *dai, - struct s3c_i2sv2_info *i2s, - unsigned long base); + struct s3c_i2sv2_info *i2s); /** * s3c_i2sv2_cleanup - cleanup resources allocated in s3c_i2sv2_probe diff --git a/sound/soc/samsung/s3c2412-i2s.c b/sound/soc/samsung/s3c2412-i2s.c index 787a3f6e9f24..5bf571762e89 100644 --- a/sound/soc/samsung/s3c2412-i2s.c +++ b/sound/soc/samsung/s3c2412-i2s.c @@ -49,7 +49,7 @@ static int s3c2412_i2s_probe(struct snd_soc_dai *dai) snd_soc_dai_init_dma_data(dai, &s3c2412_i2s_pcm_stereo_out, &s3c2412_i2s_pcm_stereo_in); - ret = s3c_i2sv2_probe(dai, &s3c2412_i2s, S3C2410_PA_IIS); + ret = s3c_i2sv2_probe(dai, &s3c2412_i2s); if (ret) return ret; From patchwork Thu Oct 10 20:30:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 11184395 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 C10AA1668 for ; Thu, 10 Oct 2019 20:47:56 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 55677218AC for ; Thu, 10 Oct 2019 20:47:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="me0KPel0" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 55677218AC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arndb.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 9147D167F; Thu, 10 Oct 2019 22:47:04 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 9147D167F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1570740474; bh=X9Iv/KPrC4Kp1LLsPxlgKdFnuTVYpq6Vjv8a2svpZxs=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=me0KPel0Xa1P/zUvgK2LCpNIOnVjYSlyTngw+77khsEdxhytZ5G+GDCwtTDNhLNdV YPYuXsFsUwzM2jwYTBtTdZ2niQ4dtlbT86cSpZA1cfiQDWGhBxwWu2nWGBJtm4bcAr 2HC7TiU9+le0dkwnRW0v0zhXYzYTXL18Hmny+lIk= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 68FCDF8038F; Thu, 10 Oct 2019 22:46:46 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id F411DF80447; Thu, 10 Oct 2019 22:46:44 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_NONE, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.135]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 59406F802BC for ; Thu, 10 Oct 2019 22:46:41 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 59406F802BC Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.129]) with ESMTPA (Nemesis) id 1MXGSU-1iatlv2eSc-00YkjM; Thu, 10 Oct 2019 22:46:01 +0200 From: Arnd Bergmann To: Kukjin Kim , Krzysztof Kozlowski , Sangbeom Kim , Sylwester Nawrocki , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai Date: Thu, 10 Oct 2019 22:30:05 +0200 Message-Id: <20191010203043.1241612-21-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20191010203043.1241612-1-arnd@arndb.de> References: <20191010202802.1132272-1-arnd@arndb.de> <20191010203043.1241612-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:FbNz4MvRRGBncg5ezbVW89EBV/sK6D7IabepOWQf3wEPdeV2bB1 jHeI/tWAg9rmbqWA2OhJAcG3rS7xIQbQHlXhcZP9oMFhwW4GaaBEAdW2srX0WiYtRtLBTNF 6XBXu6/HMSUFl0iZC4Kvr9Rpn88WR8UnUnmGlNAzwwczLySawBLRWChz9V1moU20yfdaWEv ewIu+YHqjpXuy5Y5opLQA== X-UI-Out-Filterresults: notjunk:1;V03:K0:rHn01qD3zdo=:K3nBq2JE5bRE+bp5DAhXFd yMkVuBEICs69EQawP4PwOeeLyXNcw/WCQ052HWG0ysXqw+2+ds9Kyn8+PjaTSnmAZt2ymqIyS 57wbtGJ8L2lANV7HxCjpIItji1dPYcwKmmS4Vkqs4gsE1FLEY+A8EWVxLZefp12i3UznrQjCz 983txz5B8K7k9TKIZPVQ4tDyZ2l2jeQEKFv4otjtBVzLMNrT10ZPEQEe48zXcsX96NW9axeN/ 5MUqMS4TwcmXbBSBkhxAoHzEN2jG/4mGek5W8CPWCWG2CC6ohIDNC6RlURNa/FJOwZUdetMzT rcBfv+5CT+mxoZ0dA0udnMilT4Y4nrfSewO8ExoccnsoESsjFJrWV8lc21ATPdRpqy4cPOhF0 QkEzbIQTMbmos8vP0K0F+3dAxA3UMUx564tTICxTiy+yBmn+nuXGHPghvwxDJUshaDerRx17o /Lak4489Sry29SkCGakDMPZp59ghrTZOIp2w/E8PsGsf6wWzbAJ1QufRlDo+n7PketY/NCfth 1vEP9HdYuRTPHO5EP2NtAysK/i/OfVZfWIjcKleHHiNHqQ42JjZbPFNnEsR8bjkobX8TZkjLA NOKRWmPncCZlptvCWm3D6e8JdmrBFDQxzkdP/eP8faa27W1UVpqij51aSL6OPgEpE4yhRZ8Kz xqweltP7k9XKGIGXK0jNixcfHkap5v216H8HkSFP/CNgn3j+54DzpBEeT0UOyek506/nmrWoz XnUK1TxWYJjHt2zBCGsWBK0ipXQ1pm0ZfbUd85v6N/ur0o+VkbcN+3N/KdUZ9NFakD/BqXbmR tAUweKD7dBjLvig8tVQDcflpc0j8WnrH+P4Vd8gZa6GPPOitkJsFR2WT80cpqfEFViHpYF5HI CaJNUTKWbUSYJgbgM5aw== Cc: Ulf Hansson , linux-samsung-soc@vger.kernel.org, Arnd Bergmann , linus.walleij@linaro.org, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Subject: [alsa-devel] [PATCH 21/36] ARM: s3c: move iis pinctrl config into boards X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The s3c_gpio_cfgall_range() function is an internal interface of the samsung gpio driver and should not be called directly by drivers, so move the iis pin initialization into the boards. Note that the s3c2412-i2s driver has no boards using it in mainline linux, the driver gets selected for the jive machine but is never instantiated. Signed-off-by: Arnd Bergmann --- arch/arm/mach-s3c24xx/mach-gta02.c | 4 ++++ arch/arm/mach-s3c24xx/mach-h1940.c | 3 +++ arch/arm/mach-s3c24xx/mach-mini2440.c | 5 +++++ arch/arm/mach-s3c24xx/mach-n30.c | 5 +++++ arch/arm/mach-s3c24xx/mach-nexcoder.c | 5 +++++ arch/arm/mach-s3c24xx/mach-otom.c | 6 ++++++ arch/arm/mach-s3c24xx/mach-qt2410.c | 3 +++ arch/arm/mach-s3c24xx/mach-rx1950.c | 3 +++ arch/arm/mach-s3c24xx/mach-rx3715.c | 4 ++++ arch/arm/mach-s3c24xx/mach-smdk2410.c | 5 +++++ arch/arm/mach-s3c24xx/mach-smdk2413.c | 4 ++++ arch/arm/mach-s3c24xx/mach-smdk2440.c | 6 +++++- arch/arm/mach-s3c24xx/mach-vstms.c | 6 +++++- arch/arm/mach-s3c24xx/simtec-audio.c | 6 ++++++ sound/soc/samsung/s3c2412-i2s.c | 7 ------- sound/soc/samsung/s3c24xx-i2s.c | 7 ------- 16 files changed, 63 insertions(+), 16 deletions(-) diff --git a/arch/arm/mach-s3c24xx/mach-gta02.c b/arch/arm/mach-s3c24xx/mach-gta02.c index 526fd0933289..1ca0460d82f4 100644 --- a/arch/arm/mach-s3c24xx/mach-gta02.c +++ b/arch/arm/mach-s3c24xx/mach-gta02.c @@ -540,6 +540,10 @@ static void __init gta02_machine_init(void) i2c_register_board_info(0, gta02_i2c_devs, ARRAY_SIZE(gta02_i2c_devs)); + /* Configure the I2S pins (GPE0...GPE4) in correct mode */ + s3c_gpio_cfgall_range(S3C2410_GPE(0), 5, S3C_GPIO_SFN(2), + S3C_GPIO_PULL_NONE); + gpiod_add_lookup_table(>a02_audio_gpio_table); platform_add_devices(gta02_devices, ARRAY_SIZE(gta02_devices)); pm_power_off = gta02_poweroff; diff --git a/arch/arm/mach-s3c24xx/mach-h1940.c b/arch/arm/mach-s3c24xx/mach-h1940.c index 922d53bacbdf..11f705fb5e32 100644 --- a/arch/arm/mach-s3c24xx/mach-h1940.c +++ b/arch/arm/mach-s3c24xx/mach-h1940.c @@ -709,6 +709,9 @@ static void __init h1940_init(void) s3c24xx_fb_set_platdata(&h1940_fb_info); gpiod_add_lookup_table(&h1940_mmc_gpio_table); gpiod_add_lookup_table(&h1940_audio_gpio_table); + /* Configure the I2S pins (GPE0...GPE4) in correct mode */ + s3c_gpio_cfgall_range(S3C2410_GPE(0), 5, S3C_GPIO_SFN(2), + S3C_GPIO_PULL_NONE); s3c24xx_mci_set_platdata(&h1940_mmc_cfg); s3c24xx_udc_set_platdata(&h1940_udc_cfg); s3c24xx_ts_set_platdata(&h1940_ts_cfg); diff --git a/arch/arm/mach-s3c24xx/mach-mini2440.c b/arch/arm/mach-s3c24xx/mach-mini2440.c index 9035f868fb34..bb44b8704d64 100644 --- a/arch/arm/mach-s3c24xx/mach-mini2440.c +++ b/arch/arm/mach-s3c24xx/mach-mini2440.c @@ -685,6 +685,11 @@ static void __init mini2440_init(void) s3c_gpio_setpull(mini2440_buttons[i].gpio, S3C_GPIO_PULL_UP); s3c_gpio_cfgpin(mini2440_buttons[i].gpio, S3C2410_GPIO_INPUT); } + + /* Configure the I2S pins (GPE0...GPE4) in correct mode */ + s3c_gpio_cfgall_range(S3C2410_GPE(0), 5, S3C_GPIO_SFN(2), + S3C_GPIO_PULL_NONE); + if (features.lcd_index != -1) { int li; diff --git a/arch/arm/mach-s3c24xx/mach-n30.c b/arch/arm/mach-s3c24xx/mach-n30.c index d856f23939af..1836f1cc0992 100644 --- a/arch/arm/mach-s3c24xx/mach-n30.c +++ b/arch/arm/mach-s3c24xx/mach-n30.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include @@ -570,6 +571,10 @@ static void __init n30_init(void) S3C2410_MISCCR_USBSUSPND0 | S3C2410_MISCCR_USBSUSPND1, 0x0); + /* Configure the I2S pins (GPE0...GPE4) in correct mode */ + s3c_gpio_cfgall_range(S3C2410_GPE(0), 5, S3C_GPIO_SFN(2), + S3C_GPIO_PULL_NONE); + if (machine_is_n30()) { /* Turn off suspend on both USB ports, and switch the * selectable USB port to USB device mode. */ diff --git a/arch/arm/mach-s3c24xx/mach-nexcoder.c b/arch/arm/mach-s3c24xx/mach-nexcoder.c index c2f34758ccb6..a05c92b6de2e 100644 --- a/arch/arm/mach-s3c24xx/mach-nexcoder.c +++ b/arch/arm/mach-s3c24xx/mach-nexcoder.c @@ -145,6 +145,11 @@ static void __init nexcoder_init_time(void) static void __init nexcoder_init(void) { s3c_i2c0_set_platdata(NULL); + + /* Configure the I2S pins (GPE0...GPE4) in correct mode */ + s3c_gpio_cfgall_range(S3C2410_GPE(0), 5, S3C_GPIO_SFN(2), + S3C_GPIO_PULL_NONE); + platform_add_devices(nexcoder_devices, ARRAY_SIZE(nexcoder_devices)); }; diff --git a/arch/arm/mach-s3c24xx/mach-otom.c b/arch/arm/mach-s3c24xx/mach-otom.c index 4e24d89e870b..c834f16e5ba0 100644 --- a/arch/arm/mach-s3c24xx/mach-otom.c +++ b/arch/arm/mach-s3c24xx/mach-otom.c @@ -24,6 +24,8 @@ #include #include +#include +#include #include #include @@ -107,6 +109,10 @@ static void __init otom11_init_time(void) static void __init otom11_init(void) { s3c_i2c0_set_platdata(NULL); + + /* Configure the I2S pins (GPE0...GPE4) in correct mode */ + s3c_gpio_cfgall_range(S3C2410_GPE(0), 5, S3C_GPIO_SFN(2), + S3C_GPIO_PULL_NONE); platform_add_devices(otom11_devices, ARRAY_SIZE(otom11_devices)); } diff --git a/arch/arm/mach-s3c24xx/mach-qt2410.c b/arch/arm/mach-s3c24xx/mach-qt2410.c index 5d48e5b6e738..3cf8423c76c6 100644 --- a/arch/arm/mach-s3c24xx/mach-qt2410.c +++ b/arch/arm/mach-s3c24xx/mach-qt2410.c @@ -337,6 +337,9 @@ static void __init qt2410_machine_init(void) s3c24xx_udc_set_platdata(&qt2410_udc_cfg); s3c_i2c0_set_platdata(NULL); + /* Configure the I2S pins (GPE0...GPE4) in correct mode */ + s3c_gpio_cfgall_range(S3C2410_GPE(0), 5, S3C_GPIO_SFN(2), + S3C_GPIO_PULL_NONE); gpiod_add_lookup_table(&qt2410_spi_gpiod_table); platform_add_devices(qt2410_devices, ARRAY_SIZE(qt2410_devices)); s3c_pm_init(); diff --git a/arch/arm/mach-s3c24xx/mach-rx1950.c b/arch/arm/mach-s3c24xx/mach-rx1950.c index 9f3b0f18cd36..4eeede398775 100644 --- a/arch/arm/mach-s3c24xx/mach-rx1950.c +++ b/arch/arm/mach-s3c24xx/mach-rx1950.c @@ -825,6 +825,9 @@ static void __init rx1950_init_machine(void) pwm_add_table(rx1950_pwm_lookup, ARRAY_SIZE(rx1950_pwm_lookup)); gpiod_add_lookup_table(&rx1950_audio_gpio_table); + /* Configure the I2S pins (GPE0...GPE4) in correct mode */ + s3c_gpio_cfgall_range(S3C2410_GPE(0), 5, S3C_GPIO_SFN(2), + S3C_GPIO_PULL_NONE); platform_add_devices(rx1950_devices, ARRAY_SIZE(rx1950_devices)); i2c_register_board_info(0, rx1950_i2c_devices, diff --git a/arch/arm/mach-s3c24xx/mach-rx3715.c b/arch/arm/mach-s3c24xx/mach-rx3715.c index 529c6faf862f..2542c523ad46 100644 --- a/arch/arm/mach-s3c24xx/mach-rx3715.c +++ b/arch/arm/mach-s3c24xx/mach-rx3715.c @@ -39,6 +39,7 @@ #include #include #include +#include #include #include @@ -199,6 +200,9 @@ static void __init rx3715_init_machine(void) s3c_nand_set_platdata(&rx3715_nand_info); s3c24xx_fb_set_platdata(&rx3715_fb_info); + /* Configure the I2S pins (GPE0...GPE4) in correct mode */ + s3c_gpio_cfgall_range(S3C2410_GPE(0), 5, S3C_GPIO_SFN(2), + S3C_GPIO_PULL_NONE); platform_add_devices(rx3715_devices, ARRAY_SIZE(rx3715_devices)); } diff --git a/arch/arm/mach-s3c24xx/mach-smdk2410.c b/arch/arm/mach-s3c24xx/mach-smdk2410.c index 18dfef52c8bf..02adaac4d6df 100644 --- a/arch/arm/mach-s3c24xx/mach-smdk2410.c +++ b/arch/arm/mach-s3c24xx/mach-smdk2410.c @@ -19,6 +19,8 @@ #include #include #include +#include +#include #include #include @@ -94,6 +96,9 @@ static void __init smdk2410_init(void) { s3c_i2c0_set_platdata(NULL); platform_add_devices(smdk2410_devices, ARRAY_SIZE(smdk2410_devices)); + /* Configure the I2S pins (GPE0...GPE4) in correct mode */ + s3c_gpio_cfgall_range(S3C2410_GPE(0), 5, S3C_GPIO_SFN(2), + S3C_GPIO_PULL_NONE); smdk_machine_init(); } diff --git a/arch/arm/mach-s3c24xx/mach-smdk2413.c b/arch/arm/mach-s3c24xx/mach-smdk2413.c index ca80167f268d..2bba4f1fa7ee 100644 --- a/arch/arm/mach-s3c24xx/mach-smdk2413.c +++ b/arch/arm/mach-s3c24xx/mach-smdk2413.c @@ -37,6 +37,7 @@ #include #include #include +#include #include #include @@ -119,6 +120,9 @@ static void __init smdk2413_machine_init(void) s3c24xx_udc_set_platdata(&smdk2413_udc_cfg); s3c_i2c0_set_platdata(NULL); + /* Configure the I2S pins (GPE0...GPE4) in correct mode */ + s3c_gpio_cfgall_range(S3C2410_GPE(0), 5, S3C_GPIO_SFN(2), + S3C_GPIO_PULL_NONE); platform_add_devices(smdk2413_devices, ARRAY_SIZE(smdk2413_devices)); smdk_machine_init(); diff --git a/arch/arm/mach-s3c24xx/mach-smdk2440.c b/arch/arm/mach-s3c24xx/mach-smdk2440.c index 7bafcd8ea104..f0fceda3e8e6 100644 --- a/arch/arm/mach-s3c24xx/mach-smdk2440.c +++ b/arch/arm/mach-s3c24xx/mach-smdk2440.c @@ -29,6 +29,8 @@ #include #include +#include +#include #include #include @@ -167,7 +169,9 @@ static void __init smdk2440_machine_init(void) { s3c24xx_fb_set_platdata(&smdk2440_fb_info); s3c_i2c0_set_platdata(NULL); - + /* Configure the I2S pins (GPE0...GPE4) in correct mode */ + s3c_gpio_cfgall_range(S3C2410_GPE(0), 5, S3C_GPIO_SFN(2), + S3C_GPIO_PULL_NONE); platform_add_devices(smdk2440_devices, ARRAY_SIZE(smdk2440_devices)); smdk_machine_init(); } diff --git a/arch/arm/mach-s3c24xx/mach-vstms.c b/arch/arm/mach-s3c24xx/mach-vstms.c index d76b28b65e65..f333ca05de68 100644 --- a/arch/arm/mach-s3c24xx/mach-vstms.c +++ b/arch/arm/mach-s3c24xx/mach-vstms.c @@ -31,6 +31,8 @@ #include #include +#include +#include #include @@ -149,7 +151,9 @@ static void __init vstms_init(void) { s3c_i2c0_set_platdata(NULL); s3c_nand_set_platdata(&vstms_nand_info); - + /* Configure the I2S pins (GPE0...GPE4) in correct mode */ + s3c_gpio_cfgall_range(S3C2410_GPE(0), 5, S3C_GPIO_SFN(2), + S3C_GPIO_PULL_NONE); platform_add_devices(vstms_devices, ARRAY_SIZE(vstms_devices)); } diff --git a/arch/arm/mach-s3c24xx/simtec-audio.c b/arch/arm/mach-s3c24xx/simtec-audio.c index 12e17f82dae3..0c12ba4a4704 100644 --- a/arch/arm/mach-s3c24xx/simtec-audio.c +++ b/arch/arm/mach-s3c24xx/simtec-audio.c @@ -14,6 +14,8 @@ #include #include +#include +#include #include #include @@ -65,6 +67,10 @@ int __init simtec_audio_add(const char *name, bool has_lr_routing, if (has_lr_routing) simtec_audio_platdata.startup = simtec_audio_startup_lrroute; + /* Configure the I2S pins (GPE0...GPE4) in correct mode */ + s3c_gpio_cfgall_range(S3C2410_GPE(0), 5, S3C_GPIO_SFN(2), + S3C_GPIO_PULL_NONE); + platform_device_register(&s3c_device_iis); platform_device_register(&simtec_audio_dev); return 0; diff --git a/sound/soc/samsung/s3c2412-i2s.c b/sound/soc/samsung/s3c2412-i2s.c index 5bf571762e89..fd17765670f1 100644 --- a/sound/soc/samsung/s3c2412-i2s.c +++ b/sound/soc/samsung/s3c2412-i2s.c @@ -19,9 +19,6 @@ #include #include -#include -#include - #include "dma.h" #include "regs-i2s-v2.h" #include "s3c2412-i2s.h" @@ -70,10 +67,6 @@ static int s3c2412_i2s_probe(struct snd_soc_dai *dai) if (ret) goto err; - /* Configure the I2S pins (GPE0...GPE4) in correct mode */ - s3c_gpio_cfgall_range(S3C2410_GPE(0), 5, S3C_GPIO_SFN(2), - S3C_GPIO_PULL_NONE); - return 0; err: diff --git a/sound/soc/samsung/s3c24xx-i2s.c b/sound/soc/samsung/s3c24xx-i2s.c index 92bdaf0878f8..5ca263f6a39e 100644 --- a/sound/soc/samsung/s3c24xx-i2s.c +++ b/sound/soc/samsung/s3c24xx-i2s.c @@ -18,10 +18,7 @@ #include #include -#include -#include #include "regs-iis.h" - #include "dma.h" #include "s3c24xx-i2s.h" @@ -348,10 +345,6 @@ static int s3c24xx_i2s_probe(struct snd_soc_dai *dai) if (ret) return ret; - /* Configure the I2S pins (GPE0...GPE4) in correct mode */ - s3c_gpio_cfgall_range(S3C2410_GPE(0), 5, S3C_GPIO_SFN(2), - S3C_GPIO_PULL_NONE); - writel(S3C2410_IISCON_IISEN, s3c24xx_i2s.regs + S3C2410_IISCON); s3c24xx_snd_txctrl(0);