From mboxrd@z Thu Jan 1 00:00:00 1970 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5777DC433F5 for ; Tue, 19 Apr 2022 16:41:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8D2EF10F0D8; Tue, 19 Apr 2022 16:41:46 +0000 (UTC) Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by gabe.freedesktop.org (Postfix) with ESMTPS id D935010F105 for ; Tue, 19 Apr 2022 16:41:45 +0000 (UTC) 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 66E976184D; Tue, 19 Apr 2022 16:41:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7B048C385A5; Tue, 19 Apr 2022 16:41:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1650386504; bh=F7MBpdNOWf67bimqHOji31bTXpJ1ZCUAsldDqvgUu28=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M9+kiqJIfUhfsFE1H4YAU921VV0VonfY9j1NKObGUwzCjRXR46YiY5Nj5Dl5rsV5L iADk6/ddM85QG95gOh8OUVYyoEgAxa4D3s0bKJkfzDri4GMhVZSzQQuTx0F/9H+wsJ MVlTyeihlRVWFJ5B3aJxEUdAG2tMIaPk7ers3/ONTltRkZsg/z88XIF9SNvMLClZls I6TvEKcDx5DRBX76OZrUNtcSo4m6dLcfqZX2lAkhvSfR9zZVl354Yk7Zy6TbAGL6Ya K7sfhczH1+GW+wFu7/eCNYeSzMXgdYelcxwq9ivucHJV+x+FdLYDsJhrGZDEpOBDtI Wp06/+3vmFtwg== From: Arnd Bergmann To: robert.jarzmik@free.fr, linux-arm-kernel@lists.infradead.org Subject: [PATCH 22/48] ARM: pxa: z2: use gpio lookup for audio device Date: Tue, 19 Apr 2022 18:37:44 +0200 Message-Id: <20220419163810.2118169-23-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20220419163810.2118169-1-arnd@kernel.org> References: <20220419163810.2118169-1-arnd@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ulf Hansson , linux-usb@vger.kernel.org, "Rafael J. Wysocki" , Viresh Kumar , linux-fbdev@vger.kernel.org, Dominik Brodowski , linux-mips@vger.kernel.org, linux-ide@vger.kernel.org, linux-mtd@lists.infradead.org, Tomas Cech , linux-clk@vger.kernel.org, linux-leds@vger.kernel.org, linux-rtc@vger.kernel.org, Helge Deller , Marek Vasut , Paul Parsons , Sergey Lapin , Arnd Bergmann , linux-pm@vger.kernel.org, linux-input@vger.kernel.org, Haojian Zhuang , Lubomir Rintel , Mark Brown , dri-devel@lists.freedesktop.org, Thomas Bogendoerfer , Stephen Boyd , patches@opensource.cirrus.com, Dmitry Torokhov , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Michael Turquette , alsa-devel@alsa-project.org, Daniel Mack Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Arnd Bergmann The audio device is allocated by the audio driver, and it uses a gpio number from the mach/z2.h header file. Change it to use a gpio lookup table for the device allocated by the driver to keep the header file local to the machine. Acked-by: Mark Brown Cc: alsa-devel@alsa-project.org Reviewed-by: Linus Walleij Acked-by: Robert Jarzmik Signed-off-by: Arnd Bergmann --- arch/arm/mach-pxa/z2.c | 11 +++++++++++ sound/soc/pxa/z2.c | 5 ++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-pxa/z2.c b/arch/arm/mach-pxa/z2.c index 7eaeda269927..bb854e903c8f 100644 --- a/arch/arm/mach-pxa/z2.c +++ b/arch/arm/mach-pxa/z2.c @@ -651,6 +651,15 @@ static void __init z2_spi_init(void) static inline void z2_spi_init(void) {} #endif +static struct gpiod_lookup_table z2_audio_gpio_table = { + .dev_id = "soc-audio", + .table = { + GPIO_LOOKUP("gpio-pxa", GPIO37_ZIPITZ2_HEADSET_DETECT, + "hsdet-gpio", GPIO_ACTIVE_HIGH), + { }, + }, +}; + /****************************************************************************** * Core power regulator ******************************************************************************/ @@ -755,6 +764,8 @@ static void __init z2_init(void) z2_keys_init(); z2_pmic_init(); + gpiod_add_lookup_table(&z2_audio_gpio_table); + pm_power_off = z2_power_off; } diff --git a/sound/soc/pxa/z2.c b/sound/soc/pxa/z2.c index dc6c48e4738b..7f1c6bc69510 100644 --- a/sound/soc/pxa/z2.c +++ b/sound/soc/pxa/z2.c @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include @@ -22,7 +22,6 @@ #include #include -#include #include "../codecs/wm8750.h" #include "pxa2xx-i2s.h" @@ -89,7 +88,6 @@ static struct snd_soc_jack_pin hs_jack_pins[] = { /* Headset jack detection gpios */ static struct snd_soc_jack_gpio hs_jack_gpios[] = { { - .gpio = GPIO37_ZIPITZ2_HEADSET_DETECT, .name = "hsdet-gpio", .report = SND_JACK_HEADSET, .debounce_time = 200, @@ -195,6 +193,7 @@ static int __init z2_init(void) if (!z2_snd_device) return -ENOMEM; + hs_jack_gpios[0].gpiod_dev = &z2_snd_device->dev; platform_set_drvdata(z2_snd_device, &snd_soc_z2); ret = platform_device_add(z2_snd_device); -- 2.29.2 From mboxrd@z Thu Jan 1 00:00:00 1970 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 DCE7CC47080 for ; Tue, 19 Apr 2022 16:44:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238253AbiDSQo7 (ORCPT ); Tue, 19 Apr 2022 12:44:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355091AbiDSQoa (ORCPT ); Tue, 19 Apr 2022 12:44:30 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D1C323BF4; Tue, 19 Apr 2022 09:41: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 ams.source.kernel.org (Postfix) with ESMTPS id 0DEB5B819DE; Tue, 19 Apr 2022 16:41:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7B048C385A5; Tue, 19 Apr 2022 16:41:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1650386504; bh=F7MBpdNOWf67bimqHOji31bTXpJ1ZCUAsldDqvgUu28=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M9+kiqJIfUhfsFE1H4YAU921VV0VonfY9j1NKObGUwzCjRXR46YiY5Nj5Dl5rsV5L iADk6/ddM85QG95gOh8OUVYyoEgAxa4D3s0bKJkfzDri4GMhVZSzQQuTx0F/9H+wsJ MVlTyeihlRVWFJ5B3aJxEUdAG2tMIaPk7ers3/ONTltRkZsg/z88XIF9SNvMLClZls I6TvEKcDx5DRBX76OZrUNtcSo4m6dLcfqZX2lAkhvSfR9zZVl354Yk7Zy6TbAGL6Ya K7sfhczH1+GW+wFu7/eCNYeSzMXgdYelcxwq9ivucHJV+x+FdLYDsJhrGZDEpOBDtI Wp06/+3vmFtwg== From: Arnd Bergmann To: robert.jarzmik@free.fr, linux-arm-kernel@lists.infradead.org Cc: Arnd Bergmann , Daniel Mack , Haojian Zhuang , Marek Vasut , Philipp Zabel , Lubomir Rintel , Paul Parsons , Tomas Cech , Sergey Lapin , Thomas Bogendoerfer , Michael Turquette , Stephen Boyd , "Rafael J. Wysocki" , Viresh Kumar , Dmitry Torokhov , Ulf Hansson , Dominik Brodowski , Helge Deller , Mark Brown , Linus Walleij , linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-ide@vger.kernel.org, linux-clk@vger.kernel.org, linux-pm@vger.kernel.org, linux-input@vger.kernel.org, patches@opensource.cirrus.com, linux-leds@vger.kernel.org, linux-mmc@vger.kernel.org, linux-mtd@lists.infradead.org, linux-rtc@vger.kernel.org, linux-usb@vger.kernel.org, linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, alsa-devel@alsa-project.org Subject: [PATCH 22/48] ARM: pxa: z2: use gpio lookup for audio device Date: Tue, 19 Apr 2022 18:37:44 +0200 Message-Id: <20220419163810.2118169-23-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20220419163810.2118169-1-arnd@kernel.org> References: <20220419163810.2118169-1-arnd@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org From: Arnd Bergmann The audio device is allocated by the audio driver, and it uses a gpio number from the mach/z2.h header file. Change it to use a gpio lookup table for the device allocated by the driver to keep the header file local to the machine. Acked-by: Mark Brown Cc: alsa-devel@alsa-project.org Reviewed-by: Linus Walleij Acked-by: Robert Jarzmik Signed-off-by: Arnd Bergmann --- arch/arm/mach-pxa/z2.c | 11 +++++++++++ sound/soc/pxa/z2.c | 5 ++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-pxa/z2.c b/arch/arm/mach-pxa/z2.c index 7eaeda269927..bb854e903c8f 100644 --- a/arch/arm/mach-pxa/z2.c +++ b/arch/arm/mach-pxa/z2.c @@ -651,6 +651,15 @@ static void __init z2_spi_init(void) static inline void z2_spi_init(void) {} #endif +static struct gpiod_lookup_table z2_audio_gpio_table = { + .dev_id = "soc-audio", + .table = { + GPIO_LOOKUP("gpio-pxa", GPIO37_ZIPITZ2_HEADSET_DETECT, + "hsdet-gpio", GPIO_ACTIVE_HIGH), + { }, + }, +}; + /****************************************************************************** * Core power regulator ******************************************************************************/ @@ -755,6 +764,8 @@ static void __init z2_init(void) z2_keys_init(); z2_pmic_init(); + gpiod_add_lookup_table(&z2_audio_gpio_table); + pm_power_off = z2_power_off; } diff --git a/sound/soc/pxa/z2.c b/sound/soc/pxa/z2.c index dc6c48e4738b..7f1c6bc69510 100644 --- a/sound/soc/pxa/z2.c +++ b/sound/soc/pxa/z2.c @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include @@ -22,7 +22,6 @@ #include #include -#include #include "../codecs/wm8750.h" #include "pxa2xx-i2s.h" @@ -89,7 +88,6 @@ static struct snd_soc_jack_pin hs_jack_pins[] = { /* Headset jack detection gpios */ static struct snd_soc_jack_gpio hs_jack_gpios[] = { { - .gpio = GPIO37_ZIPITZ2_HEADSET_DETECT, .name = "hsdet-gpio", .report = SND_JACK_HEADSET, .debounce_time = 200, @@ -195,6 +193,7 @@ static int __init z2_init(void) if (!z2_snd_device) return -ENOMEM; + hs_jack_gpios[0].gpiod_dev = &z2_snd_device->dev; platform_set_drvdata(z2_snd_device, &snd_soc_z2); ret = platform_device_add(z2_snd_device); -- 2.29.2 From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3AD4CC43219 for ; Tue, 19 Apr 2022 17:04:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=TDVj3Rw9UESdofSip89mYEwwYv7uwR9CMMBJhSO7YB4=; b=CoRTbv5+XNGsfZ UsVMS9hb6XMvKI8P5VRPBwYSMvNzCprpe2hOQ1Mu1wqY28tcEPefg1NEzej20IjSzivAmZ1Krd6dB SH0rXZ3UuYUBcZSiFjhZemnVqdnS+q6/qoJAQW+MK3w0cZLXPWm4Cd+AlO3VXbN/5pFefE9alrN9y AFzXFCho6orKqxWFDbJKt5s/iszDjKdkMP0idRuY/DR3m6+vZ0FR2EuU1rhbSQ/003G7ZjnHVpxfq NyXTwOMIS7Tsdv+4BhQIBmhQTlbRyK0dpdB6izQZ1af2//Rwl2jnDoWQiUkxmaBaZ0fT3biZIv8G8 Xx9OTPwH56lruZvrUw1g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ngrGd-0057ue-Cd; Tue, 19 Apr 2022 17:03:55 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ngqvB-004xDd-VV; Tue, 19 Apr 2022 16:41:47 +0000 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 66E976184D; Tue, 19 Apr 2022 16:41:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7B048C385A5; Tue, 19 Apr 2022 16:41:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1650386504; bh=F7MBpdNOWf67bimqHOji31bTXpJ1ZCUAsldDqvgUu28=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M9+kiqJIfUhfsFE1H4YAU921VV0VonfY9j1NKObGUwzCjRXR46YiY5Nj5Dl5rsV5L iADk6/ddM85QG95gOh8OUVYyoEgAxa4D3s0bKJkfzDri4GMhVZSzQQuTx0F/9H+wsJ MVlTyeihlRVWFJ5B3aJxEUdAG2tMIaPk7ers3/ONTltRkZsg/z88XIF9SNvMLClZls I6TvEKcDx5DRBX76OZrUNtcSo4m6dLcfqZX2lAkhvSfR9zZVl354Yk7Zy6TbAGL6Ya K7sfhczH1+GW+wFu7/eCNYeSzMXgdYelcxwq9ivucHJV+x+FdLYDsJhrGZDEpOBDtI Wp06/+3vmFtwg== From: Arnd Bergmann To: robert.jarzmik@free.fr, linux-arm-kernel@lists.infradead.org Cc: Arnd Bergmann , Daniel Mack , Haojian Zhuang , Marek Vasut , Philipp Zabel , Lubomir Rintel , Paul Parsons , Tomas Cech , Sergey Lapin , Thomas Bogendoerfer , Michael Turquette , Stephen Boyd , "Rafael J. Wysocki" , Viresh Kumar , Dmitry Torokhov , Ulf Hansson , Dominik Brodowski , Helge Deller , Mark Brown , Linus Walleij , linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-ide@vger.kernel.org, linux-clk@vger.kernel.org, linux-pm@vger.kernel.org, linux-input@vger.kernel.org, patches@opensource.cirrus.com, linux-leds@vger.kernel.org, linux-mmc@vger.kernel.org, linux-mtd@lists.infradead.org, linux-rtc@vger.kernel.org, linux-usb@vger.kernel.org, linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, alsa-devel@alsa-project.org Subject: [PATCH 22/48] ARM: pxa: z2: use gpio lookup for audio device Date: Tue, 19 Apr 2022 18:37:44 +0200 Message-Id: <20220419163810.2118169-23-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20220419163810.2118169-1-arnd@kernel.org> References: <20220419163810.2118169-1-arnd@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220419_094146_158301_9C246B2E X-CRM114-Status: GOOD ( 22.13 ) X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-mtd" Errors-To: linux-mtd-bounces+linux-mtd=archiver.kernel.org@lists.infradead.org From: Arnd Bergmann The audio device is allocated by the audio driver, and it uses a gpio number from the mach/z2.h header file. Change it to use a gpio lookup table for the device allocated by the driver to keep the header file local to the machine. Acked-by: Mark Brown Cc: alsa-devel@alsa-project.org Reviewed-by: Linus Walleij Acked-by: Robert Jarzmik Signed-off-by: Arnd Bergmann --- arch/arm/mach-pxa/z2.c | 11 +++++++++++ sound/soc/pxa/z2.c | 5 ++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-pxa/z2.c b/arch/arm/mach-pxa/z2.c index 7eaeda269927..bb854e903c8f 100644 --- a/arch/arm/mach-pxa/z2.c +++ b/arch/arm/mach-pxa/z2.c @@ -651,6 +651,15 @@ static void __init z2_spi_init(void) static inline void z2_spi_init(void) {} #endif +static struct gpiod_lookup_table z2_audio_gpio_table = { + .dev_id = "soc-audio", + .table = { + GPIO_LOOKUP("gpio-pxa", GPIO37_ZIPITZ2_HEADSET_DETECT, + "hsdet-gpio", GPIO_ACTIVE_HIGH), + { }, + }, +}; + /****************************************************************************** * Core power regulator ******************************************************************************/ @@ -755,6 +764,8 @@ static void __init z2_init(void) z2_keys_init(); z2_pmic_init(); + gpiod_add_lookup_table(&z2_audio_gpio_table); + pm_power_off = z2_power_off; } diff --git a/sound/soc/pxa/z2.c b/sound/soc/pxa/z2.c index dc6c48e4738b..7f1c6bc69510 100644 --- a/sound/soc/pxa/z2.c +++ b/sound/soc/pxa/z2.c @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include @@ -22,7 +22,6 @@ #include #include -#include #include "../codecs/wm8750.h" #include "pxa2xx-i2s.h" @@ -89,7 +88,6 @@ static struct snd_soc_jack_pin hs_jack_pins[] = { /* Headset jack detection gpios */ static struct snd_soc_jack_gpio hs_jack_gpios[] = { { - .gpio = GPIO37_ZIPITZ2_HEADSET_DETECT, .name = "hsdet-gpio", .report = SND_JACK_HEADSET, .debounce_time = 200, @@ -195,6 +193,7 @@ static int __init z2_init(void) if (!z2_snd_device) return -ENOMEM; + hs_jack_gpios[0].gpiod_dev = &z2_snd_device->dev; platform_set_drvdata(z2_snd_device, &snd_soc_z2); ret = platform_device_add(z2_snd_device); -- 2.29.2 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 33EB7C433F5 for ; Tue, 19 Apr 2022 17:04:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=997lYRhONrzqBzaZZGtwfpvW7ZIwNjjzMTmwnOWL9Fk=; b=WynQWLkx0Fh5To 8Y5BamZRYX1YSxriApoojlbELUvQ8z1F9q5WC/PVrctA9j9C5pZPHFxMBRzQg4Vp40mGiVgzE6FzG xZ72VKLMTdpKVNCi1FXf9CnmHP1fiarRuuppQSvnWEoTFRbfMgspyK7dgnQVnVHsDC5YkOLd0R9WM 3GjrEZaS3EZCQnJJkL75YsNz3AMI/9IFQ0eWIQEQD9YuhHiTLJuL4ARvi/+xwtbXq3MLzJP7KsUaZ 4HQFfl7ehbEyXJYmxORPeXzPatAntF8GIiz7j7u6PgWy7LdXT285ITvdUJjrMtoFN03c7smMCYlui N66Jf9mvNunQ38NMjW3Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ngrFv-0057Vu-5U; Tue, 19 Apr 2022 17:03:11 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ngqvB-004xDd-VV; Tue, 19 Apr 2022 16:41:47 +0000 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 66E976184D; Tue, 19 Apr 2022 16:41:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7B048C385A5; Tue, 19 Apr 2022 16:41:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1650386504; bh=F7MBpdNOWf67bimqHOji31bTXpJ1ZCUAsldDqvgUu28=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M9+kiqJIfUhfsFE1H4YAU921VV0VonfY9j1NKObGUwzCjRXR46YiY5Nj5Dl5rsV5L iADk6/ddM85QG95gOh8OUVYyoEgAxa4D3s0bKJkfzDri4GMhVZSzQQuTx0F/9H+wsJ MVlTyeihlRVWFJ5B3aJxEUdAG2tMIaPk7ers3/ONTltRkZsg/z88XIF9SNvMLClZls I6TvEKcDx5DRBX76OZrUNtcSo4m6dLcfqZX2lAkhvSfR9zZVl354Yk7Zy6TbAGL6Ya K7sfhczH1+GW+wFu7/eCNYeSzMXgdYelcxwq9ivucHJV+x+FdLYDsJhrGZDEpOBDtI Wp06/+3vmFtwg== From: Arnd Bergmann To: robert.jarzmik@free.fr, linux-arm-kernel@lists.infradead.org Cc: Arnd Bergmann , Daniel Mack , Haojian Zhuang , Marek Vasut , Philipp Zabel , Lubomir Rintel , Paul Parsons , Tomas Cech , Sergey Lapin , Thomas Bogendoerfer , Michael Turquette , Stephen Boyd , "Rafael J. Wysocki" , Viresh Kumar , Dmitry Torokhov , Ulf Hansson , Dominik Brodowski , Helge Deller , Mark Brown , Linus Walleij , linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-ide@vger.kernel.org, linux-clk@vger.kernel.org, linux-pm@vger.kernel.org, linux-input@vger.kernel.org, patches@opensource.cirrus.com, linux-leds@vger.kernel.org, linux-mmc@vger.kernel.org, linux-mtd@lists.infradead.org, linux-rtc@vger.kernel.org, linux-usb@vger.kernel.org, linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, alsa-devel@alsa-project.org Subject: [PATCH 22/48] ARM: pxa: z2: use gpio lookup for audio device Date: Tue, 19 Apr 2022 18:37:44 +0200 Message-Id: <20220419163810.2118169-23-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20220419163810.2118169-1-arnd@kernel.org> References: <20220419163810.2118169-1-arnd@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220419_094146_158301_9C246B2E X-CRM114-Status: GOOD ( 22.13 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Arnd Bergmann The audio device is allocated by the audio driver, and it uses a gpio number from the mach/z2.h header file. Change it to use a gpio lookup table for the device allocated by the driver to keep the header file local to the machine. Acked-by: Mark Brown Cc: alsa-devel@alsa-project.org Reviewed-by: Linus Walleij Acked-by: Robert Jarzmik Signed-off-by: Arnd Bergmann --- arch/arm/mach-pxa/z2.c | 11 +++++++++++ sound/soc/pxa/z2.c | 5 ++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-pxa/z2.c b/arch/arm/mach-pxa/z2.c index 7eaeda269927..bb854e903c8f 100644 --- a/arch/arm/mach-pxa/z2.c +++ b/arch/arm/mach-pxa/z2.c @@ -651,6 +651,15 @@ static void __init z2_spi_init(void) static inline void z2_spi_init(void) {} #endif +static struct gpiod_lookup_table z2_audio_gpio_table = { + .dev_id = "soc-audio", + .table = { + GPIO_LOOKUP("gpio-pxa", GPIO37_ZIPITZ2_HEADSET_DETECT, + "hsdet-gpio", GPIO_ACTIVE_HIGH), + { }, + }, +}; + /****************************************************************************** * Core power regulator ******************************************************************************/ @@ -755,6 +764,8 @@ static void __init z2_init(void) z2_keys_init(); z2_pmic_init(); + gpiod_add_lookup_table(&z2_audio_gpio_table); + pm_power_off = z2_power_off; } diff --git a/sound/soc/pxa/z2.c b/sound/soc/pxa/z2.c index dc6c48e4738b..7f1c6bc69510 100644 --- a/sound/soc/pxa/z2.c +++ b/sound/soc/pxa/z2.c @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include @@ -22,7 +22,6 @@ #include #include -#include #include "../codecs/wm8750.h" #include "pxa2xx-i2s.h" @@ -89,7 +88,6 @@ static struct snd_soc_jack_pin hs_jack_pins[] = { /* Headset jack detection gpios */ static struct snd_soc_jack_gpio hs_jack_gpios[] = { { - .gpio = GPIO37_ZIPITZ2_HEADSET_DETECT, .name = "hsdet-gpio", .report = SND_JACK_HEADSET, .debounce_time = 200, @@ -195,6 +193,7 @@ static int __init z2_init(void) if (!z2_snd_device) return -ENOMEM; + hs_jack_gpios[0].gpiod_dev = &z2_snd_device->dev; platform_set_drvdata(z2_snd_device, &snd_soc_z2); ret = platform_device_add(z2_snd_device); -- 2.29.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id B4831C433F5 for ; Fri, 22 Apr 2022 13:41:48 +0000 (UTC) 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 EEBC61673; Fri, 22 Apr 2022 15:40:56 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz EEBC61673 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1650634907; bh=F7MBpdNOWf67bimqHOji31bTXpJ1ZCUAsldDqvgUu28=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=AByteaukx454LMIBELgfERiHfNgOzIvcUCRrl1iv+YnyX0SpVqgm++aXCiaBdLyR2 iN6qxYYnlYh8c+cC5hlc6ALbpDzbb4tceIHxodGOnQ4P/gZpyGhvKnA2hjy+DB3IZJ WXlxWkz8ZIAq+8wtxjMJd7OeE6Yt4hn3oXHtcLN8= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 7968FF80608; Fri, 22 Apr 2022 15:32:09 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id A8B8EF8025D; Tue, 19 Apr 2022 18:41:52 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id CBD0FF80237 for ; Tue, 19 Apr 2022 18:41:46 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz CBD0FF80237 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="M9+kiqJI" 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 66E976184D; Tue, 19 Apr 2022 16:41:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7B048C385A5; Tue, 19 Apr 2022 16:41:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1650386504; bh=F7MBpdNOWf67bimqHOji31bTXpJ1ZCUAsldDqvgUu28=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M9+kiqJIfUhfsFE1H4YAU921VV0VonfY9j1NKObGUwzCjRXR46YiY5Nj5Dl5rsV5L iADk6/ddM85QG95gOh8OUVYyoEgAxa4D3s0bKJkfzDri4GMhVZSzQQuTx0F/9H+wsJ MVlTyeihlRVWFJ5B3aJxEUdAG2tMIaPk7ers3/ONTltRkZsg/z88XIF9SNvMLClZls I6TvEKcDx5DRBX76OZrUNtcSo4m6dLcfqZX2lAkhvSfR9zZVl354Yk7Zy6TbAGL6Ya K7sfhczH1+GW+wFu7/eCNYeSzMXgdYelcxwq9ivucHJV+x+FdLYDsJhrGZDEpOBDtI Wp06/+3vmFtwg== From: Arnd Bergmann To: robert.jarzmik@free.fr, linux-arm-kernel@lists.infradead.org Subject: [PATCH 22/48] ARM: pxa: z2: use gpio lookup for audio device Date: Tue, 19 Apr 2022 18:37:44 +0200 Message-Id: <20220419163810.2118169-23-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20220419163810.2118169-1-arnd@kernel.org> References: <20220419163810.2118169-1-arnd@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Fri, 22 Apr 2022 15:31:41 +0200 Cc: Ulf Hansson , linux-usb@vger.kernel.org, Philipp Zabel , "Rafael J. Wysocki" , Viresh Kumar , Sergey Lapin , linux-fbdev@vger.kernel.org, Dominik Brodowski , linux-kernel@vger.kernel.org, linux-ide@vger.kernel.org, linux-mtd@lists.infradead.org, Tomas Cech , linux-clk@vger.kernel.org, linux-leds@vger.kernel.org, linux-rtc@vger.kernel.org, Helge Deller , Marek Vasut , Paul Parsons , Linus Walleij , Arnd Bergmann , linux-pm@vger.kernel.org, linux-input@vger.kernel.org, Haojian Zhuang , Lubomir Rintel , Mark Brown , dri-devel@lists.freedesktop.org, Thomas Bogendoerfer , Stephen Boyd , patches@opensource.cirrus.com, Dmitry Torokhov , linux-mmc@vger.kernel.org, linux-mips@vger.kernel.org, Michael Turquette , alsa-devel@alsa-project.org, Daniel Mack 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" From: Arnd Bergmann The audio device is allocated by the audio driver, and it uses a gpio number from the mach/z2.h header file. Change it to use a gpio lookup table for the device allocated by the driver to keep the header file local to the machine. Acked-by: Mark Brown Cc: alsa-devel@alsa-project.org Reviewed-by: Linus Walleij Acked-by: Robert Jarzmik Signed-off-by: Arnd Bergmann --- arch/arm/mach-pxa/z2.c | 11 +++++++++++ sound/soc/pxa/z2.c | 5 ++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-pxa/z2.c b/arch/arm/mach-pxa/z2.c index 7eaeda269927..bb854e903c8f 100644 --- a/arch/arm/mach-pxa/z2.c +++ b/arch/arm/mach-pxa/z2.c @@ -651,6 +651,15 @@ static void __init z2_spi_init(void) static inline void z2_spi_init(void) {} #endif +static struct gpiod_lookup_table z2_audio_gpio_table = { + .dev_id = "soc-audio", + .table = { + GPIO_LOOKUP("gpio-pxa", GPIO37_ZIPITZ2_HEADSET_DETECT, + "hsdet-gpio", GPIO_ACTIVE_HIGH), + { }, + }, +}; + /****************************************************************************** * Core power regulator ******************************************************************************/ @@ -755,6 +764,8 @@ static void __init z2_init(void) z2_keys_init(); z2_pmic_init(); + gpiod_add_lookup_table(&z2_audio_gpio_table); + pm_power_off = z2_power_off; } diff --git a/sound/soc/pxa/z2.c b/sound/soc/pxa/z2.c index dc6c48e4738b..7f1c6bc69510 100644 --- a/sound/soc/pxa/z2.c +++ b/sound/soc/pxa/z2.c @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include @@ -22,7 +22,6 @@ #include #include -#include #include "../codecs/wm8750.h" #include "pxa2xx-i2s.h" @@ -89,7 +88,6 @@ static struct snd_soc_jack_pin hs_jack_pins[] = { /* Headset jack detection gpios */ static struct snd_soc_jack_gpio hs_jack_gpios[] = { { - .gpio = GPIO37_ZIPITZ2_HEADSET_DETECT, .name = "hsdet-gpio", .report = SND_JACK_HEADSET, .debounce_time = 200, @@ -195,6 +193,7 @@ static int __init z2_init(void) if (!z2_snd_device) return -ENOMEM; + hs_jack_gpios[0].gpiod_dev = &z2_snd_device->dev; platform_set_drvdata(z2_snd_device, &snd_soc_z2); ret = platform_device_add(z2_snd_device); -- 2.29.2