From patchwork Tue Sep 26 13:25:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 13399248 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 20722E7E636 for ; Tue, 26 Sep 2023 13:26:15 +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:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=7BeT8yumHPle4pqBFlMPbZb6UdWlzoW6ds601zKZfa0=; b=MbmpEVfxR/CEFY 5HeRkWVbxwAtzs4JGiRCSHjdvuB7cmQbfmOhGurhhj+Ouv3fve+rDoEMvjIBiN8dUrBgNWxpjNa+w xFQLRM13YjHXuqoivIw4XlOAUiVnz1ytJMEGq0mkM5c7w3B8eRpj6OG3PdfQHgH1WymuJT4tIy18x gsI9Gsrc5WR1RYr4FOC+dCM3MynYWYEcG47czlXHYipvgCgZJCdbcVA2l59d8XpAEedeDa0E3Zgcp D+mMUKjxTIoWPC/347qN5zcqlIcdOk3OJFTDf84Pv7VB749lCUfuUjnC88BXQqD1pqqvzRCPxQJ6Z dgChyal8MM6rFAKrK92Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1ql84R-00GSrG-0q; Tue, 26 Sep 2023 13:25:47 +0000 Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1ql84K-00GSoe-1E for linux-arm-kernel@lists.infradead.org; Tue, 26 Sep 2023 13:25:41 +0000 Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-503012f4e71so12013896e87.0 for ; Tue, 26 Sep 2023 06:25:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695734735; x=1696339535; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=7XQ+0fmcxQn7hNEx2giW0ptNoy4+ucZSflc29tgLhQk=; b=NqSNbnGpOtX/4lIa2NTISlVndIz0JtBFFxu0G6XTufMnOy5jnSPFHpXITh6ZufCdaB ZUKphaZn2PSZVQIJMi2abhBcV4QZbsow8/x3jiLlhnjTQHW7IbM4nK6x7QEbRrCLNT3A ChOsJJV4yIpTwLWCEFuxtZH+410iC3nRe/+cyzkAjUPRvrjoRvrIf3bGenpd/cq/N88c vhd5gcsf9tZqvq4g9DzGz0MCXdueMEtq2jnz/jpR25hzPHGp19Mo4Hls9F61kJ7jvmO5 qNNaO2bTm0ij9m4WNx4SPH/z2q58tWSckPSb68pgLLrQEwK9hbNx9c8PouOub/UBrU0i 70cQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695734735; x=1696339535; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7XQ+0fmcxQn7hNEx2giW0ptNoy4+ucZSflc29tgLhQk=; b=JG5KAmAb6QLyNvmdlkx3HEf/E3SzCom41f1EXoOM9ogSQP/hduMGjpLAGxHD8W1SEg 8i9xSKC4Z3n4nB0mk/eW9tbJ7YEIYqysF6WAmw2bIlSW9Iq2fo8QJZEHYY80mWQr7ugq vegPqYwAqksq2bxa4EkW/1WB/rrwbdyX6dVhvZCdwwf0LNJGln5ccpvE47sL/SvM84G7 bW67opKpgLcaj63I2rDfcZ4LkiPH6clOYDArUDvhAuD7TeUgZ07szYYLOWAi2bwoj7Hz gqmrF5sZDT3OUa1iQR7yIxwtfPS1fOpaYusCodW6qtozlP72eGrRuxipeU+CmzxwbP1p 0ZQw== X-Gm-Message-State: AOJu0Yxbs1uOBzIx3u7gS8QSHDBzJBQkrSxgdFs7CAK8j0G12+OjtvdW 0RL2s7r6LxihbVuTYPiotJsIJw== X-Google-Smtp-Source: AGHT+IFPY5U0WllM4x+pCqepZzgVMk893pXwxBLYC4R7FotIFz3M4lxB3pAWd8pzSINV2/2J4ivVlA== X-Received: by 2002:ac2:4c45:0:b0:501:c6d8:6029 with SMTP id o5-20020ac24c45000000b00501c6d86029mr998788lfk.33.1695734735650; Tue, 26 Sep 2023 06:25:35 -0700 (PDT) Received: from [127.0.1.1] ([85.235.12.238]) by smtp.gmail.com with ESMTPSA id eq25-20020a056512489900b0050307bf2bcdsm2221540lfb.247.2023.09.26.06.25.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 06:25:35 -0700 (PDT) From: Linus Walleij Date: Tue, 26 Sep 2023 15:25:29 +0200 Subject: [PATCH 1/5] ASoC: ti: Convert N810 ASoC to GPIO descriptors MIME-Version: 1.0 Message-Id: <20230926-descriptors-asoc-ti-v1-1-60cf4f8adbc5@linaro.org> References: <20230926-descriptors-asoc-ti-v1-0-60cf4f8adbc5@linaro.org> In-Reply-To: <20230926-descriptors-asoc-ti-v1-0-60cf4f8adbc5@linaro.org> To: Tony Lindgren , Peter Ujfalusi , Jarkko Nikula , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai Cc: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, alsa-devel@alsa-project.org, Linus Walleij X-Mailer: b4 0.12.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230926_062540_427051_EDA7FF79 X-CRM114-Status: GOOD ( 17.64 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The N810 uses GPIO descriptors pretty much exclusively, but not for ASoC, so let's fix it. Register the pins in a descriptor table in the machine since the ASoC device is not using device tree. Use static locals for the GPIO descriptors because I'm not able to experient with better state storage on any real hardware. Others using the N810 can come afterwards and improve this. Signed-off-by: Linus Walleij --- arch/arm/mach-omap2/board-n8x0.c | 10 ++++++++++ sound/soc/ti/n810.c | 31 +++++++++++++++++-------------- 2 files changed, 27 insertions(+), 14 deletions(-) diff --git a/arch/arm/mach-omap2/board-n8x0.c b/arch/arm/mach-omap2/board-n8x0.c index 8e3b5068d4ab..31755a378c73 100644 --- a/arch/arm/mach-omap2/board-n8x0.c +++ b/arch/arm/mach-omap2/board-n8x0.c @@ -498,6 +498,15 @@ struct menelaus_platform_data n8x0_menelaus_platform_data = { .late_init = n8x0_menelaus_late_init, }; +static struct gpiod_lookup_table nokia810_asoc_gpio_table = { + .dev_id = "soc-audio", + .table = { + GPIO_LOOKUP("gpio-0-15", 10, "headset", GPIO_ACTIVE_HIGH), + GPIO_LOOKUP("gpio-80-111", 21, "speaker", GPIO_ACTIVE_HIGH), + { } + }, +}; + static int __init n8x0_late_initcall(void) { if (!board_caps) @@ -505,6 +514,7 @@ static int __init n8x0_late_initcall(void) n8x0_mmc_init(); n8x0_usb_init(); + gpiod_add_lookup_table(&nokia810_asoc_gpio_table); return 0; } diff --git a/sound/soc/ti/n810.c b/sound/soc/ti/n810.c index ed217b34f846..71a2a90bad2b 100644 --- a/sound/soc/ti/n810.c +++ b/sound/soc/ti/n810.c @@ -15,14 +15,14 @@ #include #include -#include +#include #include #include #include "omap-mcbsp.h" -#define N810_HEADSET_AMP_GPIO 10 -#define N810_SPEAKER_AMP_GPIO 101 +static struct gpio_desc *n810_headset_amp; +static struct gpio_desc *n810_speaker_amp; enum { N810_JACK_DISABLED, @@ -187,9 +187,9 @@ static int n810_spk_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *k, int event) { if (SND_SOC_DAPM_EVENT_ON(event)) - gpio_set_value(N810_SPEAKER_AMP_GPIO, 1); + gpiod_set_value(n810_speaker_amp, 1); else - gpio_set_value(N810_SPEAKER_AMP_GPIO, 0); + gpiod_set_value(n810_speaker_amp, 0); return 0; } @@ -198,9 +198,9 @@ static int n810_jack_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *k, int event) { if (SND_SOC_DAPM_EVENT_ON(event)) - gpio_set_value(N810_HEADSET_AMP_GPIO, 1); + gpiod_set_value(n810_headset_amp, 1); else - gpio_set_value(N810_HEADSET_AMP_GPIO, 0); + gpiod_set_value(n810_headset_amp, 0); return 0; } @@ -327,14 +327,19 @@ static int __init n810_soc_init(void) clk_set_parent(sys_clkout2_src, func96m_clk); clk_set_rate(sys_clkout2, 12000000); - if (WARN_ON((gpio_request(N810_HEADSET_AMP_GPIO, "hs_amp") < 0) || - (gpio_request(N810_SPEAKER_AMP_GPIO, "spk_amp") < 0))) { - err = -EINVAL; + n810_headset_amp = devm_gpiod_get(&n810_snd_device->dev, + "headphone", GPIOD_OUT_LOW); + if (IS_ERR(n810_headset_amp)) { + err = PTR_ERR(n810_headset_amp); goto err4; } - gpio_direction_output(N810_HEADSET_AMP_GPIO, 0); - gpio_direction_output(N810_SPEAKER_AMP_GPIO, 0); + n810_speaker_amp = devm_gpiod_get(&n810_snd_device->dev, + "speaker", GPIOD_OUT_LOW); + if (IS_ERR(n810_speaker_amp)) { + err = PTR_ERR(n810_speaker_amp); + goto err4; + } return 0; err4: @@ -351,8 +356,6 @@ static int __init n810_soc_init(void) static void __exit n810_soc_exit(void) { - gpio_free(N810_SPEAKER_AMP_GPIO); - gpio_free(N810_HEADSET_AMP_GPIO); clk_put(sys_clkout2_src); clk_put(sys_clkout2); clk_put(func96m_clk); From patchwork Tue Sep 26 13:25:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 13399247 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 8A012E7E637 for ; Tue, 26 Sep 2023 13:26:13 +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:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=xlvHtFFz8B8jL5t2XD8NhqDkoH182ukB4BaCMNLdLWQ=; b=nFsYCEaXyqCrqz Rmcpw3MK0t4Wnu6SKaf0bPK9YTN7mjKQLGIw47c7T5qIvG9ewUEuZ54RbWpHV9EJlyxbLgBlkzAya 8ctFJAVXguwnzn4AWBtjvNxXHU4kzuy/6Y9JeTX4ycdqYHp+QcHAwJ61UpTvsR8L8/NJJyxaVxwr8 zqro3sepKqvha6PVonz7LhhPvmHkaLUzyPesL43pPv1MLhmuYicg8Ff/J6FQdjvBwU0gJioljLn/B mB67/U4FJCc3kOPWxJiisSueaCZqvykf9SDMhJChl66IIsWrPIjSFHM/fuMi+b2lMCJPpFjb+pIFR UZWSI7nr0kDSvZIY8Pxw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1ql84S-00GSs7-10; Tue, 26 Sep 2023 13:25:48 +0000 Received: from mail-lf1-x12a.google.com ([2a00:1450:4864:20::12a]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1ql84L-00GSoh-1E for linux-arm-kernel@lists.infradead.org; Tue, 26 Sep 2023 13:25:43 +0000 Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-50437f39c9dso11809528e87.3 for ; Tue, 26 Sep 2023 06:25:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695734737; x=1696339537; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=AQREjlFdBBHyFFcqZ7B0gSxB7/oIU5kFAtRf/hN0PRg=; b=WzcxSlXJyIzKTwVxt/U3TgWb2qlTkGfwB9KxOwaVnb5TRFN+TfV+lZFCIdwfEBYkMB IB7mFMb1mJ/dxxLA4BxDrnErWE8ool0P13fS4BJDny+U8ohGPhujzWU6jgcT5hzcsnNP U900dB6/DTSpg4KY3KMUKyC5Wtl+IAAjNlNYCuvqAUfHjzawnbt9IuIBmMlGV4e1kjOs FQgldXPCltoPsgd/sZMK4M3wX3geFC7IcyXXRY2URx2LXL/nPp0T4iPNkF3WM5MYS2FN ravs6RpFAY17RhnnLFx038k3zdHzXHNU5eErWZij4hAUl+rSMFulijRnwOBF+DBoM9n5 rqXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695734737; x=1696339537; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AQREjlFdBBHyFFcqZ7B0gSxB7/oIU5kFAtRf/hN0PRg=; b=k676bymYR5glLxKXTDdfOYPTLCKB5EunZxwNhDGN72rYSIXq0BFLJ+xTlP/T2cXUux zZUE4DVJL0SzFUlvx3Pli6WopP/OgSsRaYUPMOYm3MzZZin6HcHURbI+lZ9UkaQPCbnL 5LhSbiQ/CNiAj13BhdUKFoPDPc3Umb2T4TsDwVKcCCBYwOffNYc54m5PjLRbysk91mFb l2ulB+U4KB809G/rqwjI0d3+LWFWtfhEwlJ/oW8P7CckqtzjYSiVWANQRx0LM76IeHJf P493H3+3xaI1HUGFdCf7zj5qwnw9xu0CZJyNpUWpqm9IlT8jMJpRw2VeObM2y+W/FnkO uqdQ== X-Gm-Message-State: AOJu0YwEP7+SCiCoBAZftDuuDOcqOvL1M0b+TnPI+YOxq5d1058HvOTQ BYPT5ZgZKqPjTAlb3wyE17RXTQ== X-Google-Smtp-Source: AGHT+IHMuys/v1z41Pq9CuIIy/ftelPDGx7bWyJ6wtsGQexyv6AD5OHzXbCy8nEIXF0Y020uO07SZQ== X-Received: by 2002:a05:6512:104f:b0:500:b7dc:6c90 with SMTP id c15-20020a056512104f00b00500b7dc6c90mr9505051lfb.36.1695734736594; Tue, 26 Sep 2023 06:25:36 -0700 (PDT) Received: from [127.0.1.1] ([85.235.12.238]) by smtp.gmail.com with ESMTPSA id eq25-20020a056512489900b0050307bf2bcdsm2221540lfb.247.2023.09.26.06.25.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 06:25:36 -0700 (PDT) From: Linus Walleij Date: Tue, 26 Sep 2023 15:25:30 +0200 Subject: [PATCH 2/5] ASoC: ti: Convert RX51 to use exclusively GPIO descriptors MIME-Version: 1.0 Message-Id: <20230926-descriptors-asoc-ti-v1-2-60cf4f8adbc5@linaro.org> References: <20230926-descriptors-asoc-ti-v1-0-60cf4f8adbc5@linaro.org> In-Reply-To: <20230926-descriptors-asoc-ti-v1-0-60cf4f8adbc5@linaro.org> To: Tony Lindgren , Peter Ujfalusi , Jarkko Nikula , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai Cc: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, alsa-devel@alsa-project.org, Linus Walleij X-Mailer: b4 0.12.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230926_062541_419031_FBA09285 X-CRM114-Status: GOOD ( 19.00 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The RX51/Nokia n900 uses the legacy GPIO header to convert a GPIO back to the global GPIO numberspace and then the jack using it in the snd_soc_jack_add_gpios() call immediately looks up the corresponding descriptor again. The snd_soc_jack_add_gpios() handles GPIOs passed with devices just fine: pass in the device instead, and rename the GPIO to match the property in the device tree, and it should work all the same but without all the trouble. Signed-off-by: Linus Walleij Tested-by: Jarkko Nikula --- sound/soc/ti/rx51.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/sound/soc/ti/rx51.c b/sound/soc/ti/rx51.c index 322c398d209b..047f852c79a9 100644 --- a/sound/soc/ti/rx51.c +++ b/sound/soc/ti/rx51.c @@ -10,7 +10,6 @@ */ #include -#include #include #include #include @@ -33,7 +32,6 @@ enum { struct rx51_audio_pdata { struct gpio_desc *tvout_selection_gpio; - struct gpio_desc *jack_detection_gpio; struct gpio_desc *eci_sw_gpio; struct gpio_desc *speaker_amp_gpio; }; @@ -198,7 +196,7 @@ static struct snd_soc_jack rx51_av_jack; static struct snd_soc_jack_gpio rx51_av_jack_gpios[] = { { - .name = "avdet-gpio", + .name = "jack-detection", .report = SND_JACK_HEADSET, .invert = 1, .debounce_time = 200, @@ -263,7 +261,6 @@ static const struct snd_kcontrol_new aic34_rx51_controls[] = { static int rx51_aic34_init(struct snd_soc_pcm_runtime *rtd) { struct snd_soc_card *card = rtd->card; - struct rx51_audio_pdata *pdata = snd_soc_card_get_drvdata(card); int err; snd_soc_limit_volume(card, "TPA6130A2 Headphone Playback Volume", 42); @@ -283,9 +280,9 @@ static int rx51_aic34_init(struct snd_soc_pcm_runtime *rtd) return err; } - /* prepare gpio for snd_soc_jack_add_gpios */ - rx51_av_jack_gpios[0].gpio = desc_to_gpio(pdata->jack_detection_gpio); - devm_gpiod_put(card->dev, pdata->jack_detection_gpio); + rx51_av_jack_gpios[0].gpiod_dev = card->dev; + /* Name is assigned in the struct */ + rx51_av_jack_gpios[0].idx = 0; err = snd_soc_jack_add_gpios(&rx51_av_jack, ARRAY_SIZE(rx51_av_jack_gpios), @@ -425,14 +422,6 @@ static int rx51_soc_probe(struct platform_device *pdev) return PTR_ERR(pdata->tvout_selection_gpio); } - pdata->jack_detection_gpio = devm_gpiod_get(card->dev, - "jack-detection", - GPIOD_ASIS); - if (IS_ERR(pdata->jack_detection_gpio)) { - dev_err(card->dev, "could not get jack detection gpio\n"); - return PTR_ERR(pdata->jack_detection_gpio); - } - pdata->eci_sw_gpio = devm_gpiod_get(card->dev, "eci-switch", GPIOD_OUT_HIGH); if (IS_ERR(pdata->eci_sw_gpio)) { From patchwork Tue Sep 26 13:25:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 13399246 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 9074CE7E635 for ; Tue, 26 Sep 2023 13:26:11 +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:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=l8re13//KXviKjGAfbMt5LiUz/D6HWfYpq39MHadpK4=; b=MwbfGdcRgJex3a 6sJHRxc5PuPqcWw0VWI004zVsXhLDkpC4nMDLYVk6VOLIHfsMKo6wEj2XMwa2IHbRKOYb0J7/Ieiw nHBQLxZDTHit2n1StBAcVd/2DAMrL1EBlzAa5xxXoeMYCbN/pdRpui5eqTJag0t52VR7k8XR+2mYJ 8WY2LbILoC0ViIsD4Zr4dI1wmR/Ls1Qm0VlHT0fyPvHFgJZul/dHPK/C3NRUU9Mqsfs9s3Q6t1vdg YlAUNpFogNg/6/hBgV2ysdMhEUX/HlG+EPEtDThHva8B4A5fp2BTAlJNxWWX4GjPzIPk3uBReb8/Z U+6V4iQEGU1ZevoIm4uw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1ql84S-00GSsR-2i; Tue, 26 Sep 2023 13:25:48 +0000 Received: from mail-lf1-x12b.google.com ([2a00:1450:4864:20::12b]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1ql84M-00GSow-11 for linux-arm-kernel@lists.infradead.org; Tue, 26 Sep 2023 13:25:43 +0000 Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-504427aae4fso7906816e87.1 for ; Tue, 26 Sep 2023 06:25:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695734737; x=1696339537; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=PP4dsIT0hsQMnKCfQfmUy8AzAauOm+H9b2ueCh3mGC0=; b=O3Nx6/1zK2TZ3FG199rut2CNW1meSymADKY54hBdWBwediVnDJFKPCirdR1GOyFW13 8TrNoPof53/cm0nxvaxY05I08G4DXITjBWcXUvbKxdilt/oYRFowYMI/WutWqIuNjAvZ gB+fTn/QgvY5U8gd7efvHHtcM+DmtL/1c6K/QBvn3QkvCyGWYt5LD0uO9cdMqWOYpkBx mnYiNrC8mKH2vBF4wy65S3xDI/OBMHV0U6GUFBpGar1objmaswcXeue+MWCsKvQPMLXs pdp+dQPh17Gg2vFxdPcnTCtszDzABDqkxXQ/8E9XY3ZvZIa1GSADhDQpRJiwB6yMqojw xlrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695734737; x=1696339537; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PP4dsIT0hsQMnKCfQfmUy8AzAauOm+H9b2ueCh3mGC0=; b=piUbbn+UJINJeZ4W4VnyjS/fHPtw1EJgA2M++XO1UIwd6/3LOZbGgZf/CsrEYKXZIU O3LkYRRDJuxmmPBri64tBItKr/rECR8YLQEZ0eoo8St/aaivc+jswdu6aSCBLpmrTbWq 1DhjRPCAnAkqOi0k8bGtuCXbwq9xt4emiXVG+t6KKDVUgCDg2ksCHucXerXEJGWdd+Gy +sv4g5jwVSotzy+uDQwVCFoLGzvz9D8isRbOhLFCDArI2gDy1Sr3afPqEBWMl/uU6496 jLVUzxZHyQ7Xgki4IJVXZF623jk9Un6Se0JzH1dqOZCBZUMEFXxXEX820sJuepcPd4C2 iQLA== X-Gm-Message-State: AOJu0YyW4fmBFErHIOrEkt/pvxqPLy7rx1GocGJd+DrO6DYIAkP0Zkyb gn7hMSdSkmWnHAP2pLZ4pyOXaw== X-Google-Smtp-Source: AGHT+IHjNjM07GGKUJBQohAZCxjfCTTm3uisP+onS6McTyzKEkNGgzi9C5o8RDP6x4JphD2R52UnRg== X-Received: by 2002:a05:6512:304b:b0:503:2567:c42f with SMTP id b11-20020a056512304b00b005032567c42fmr1048278lfb.0.1695734737749; Tue, 26 Sep 2023 06:25:37 -0700 (PDT) Received: from [127.0.1.1] ([85.235.12.238]) by smtp.gmail.com with ESMTPSA id eq25-20020a056512489900b0050307bf2bcdsm2221540lfb.247.2023.09.26.06.25.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 06:25:37 -0700 (PDT) From: Linus Walleij Date: Tue, 26 Sep 2023 15:25:31 +0200 Subject: [PATCH 3/5] ASoC: ti: Convert TWL4030 to use GPIO descriptors MIME-Version: 1.0 Message-Id: <20230926-descriptors-asoc-ti-v1-3-60cf4f8adbc5@linaro.org> References: <20230926-descriptors-asoc-ti-v1-0-60cf4f8adbc5@linaro.org> In-Reply-To: <20230926-descriptors-asoc-ti-v1-0-60cf4f8adbc5@linaro.org> To: Tony Lindgren , Peter Ujfalusi , Jarkko Nikula , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai Cc: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, alsa-devel@alsa-project.org, Linus Walleij X-Mailer: b4 0.12.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230926_062542_359470_2D6DF52B X-CRM114-Status: GOOD ( 22.87 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The TWL4030 is actually only ever populated from the device tree, so we can just pass the right device and headphone jack GPIO name to snd_soc_jack_add_gpios() and it will pick the right GPIO right from the device tree. The platform data patch is unused (no in-tree users of the pdata method) but these can use GPIO descriptor tables rather than global GPIO numbers if they need this. Signed-off-by: Linus Walleij --- include/linux/platform_data/omap-twl4030.h | 3 --- sound/soc/ti/omap-twl4030.c | 20 ++++++++------------ 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/include/linux/platform_data/omap-twl4030.h b/include/linux/platform_data/omap-twl4030.h index 0dd851ea1c72..7fcb55fe21c9 100644 --- a/include/linux/platform_data/omap-twl4030.h +++ b/include/linux/platform_data/omap-twl4030.h @@ -37,9 +37,6 @@ struct omap_tw4030_pdata { bool has_digimic0; bool has_digimic1; u8 has_linein; - - /* Jack detect GPIO or <= 0 if it is not implemented */ - int jack_detect; }; #endif /* _OMAP_TWL4030_H_ */ diff --git a/sound/soc/ti/omap-twl4030.c b/sound/soc/ti/omap-twl4030.c index 950eec44503b..c7055bb424e6 100644 --- a/sound/soc/ti/omap-twl4030.c +++ b/sound/soc/ti/omap-twl4030.c @@ -20,8 +20,6 @@ #include #include #include -#include -#include #include #include @@ -31,7 +29,6 @@ #include "omap-mcbsp.h" struct omap_twl4030 { - int jack_detect; /* board can detect jack events */ struct snd_soc_jack hs_jack; }; @@ -130,7 +127,7 @@ static struct snd_soc_jack_pin hs_jack_pins[] = { /* Headset jack detection gpios */ static struct snd_soc_jack_gpio hs_jack_gpios[] = { { - .name = "hsdet-gpio", + .name = "ti,jack-det", .report = SND_JACK_HEADSET, .debounce_time = 200, }, @@ -151,9 +148,13 @@ static int omap_twl4030_init(struct snd_soc_pcm_runtime *rtd) struct omap_twl4030 *priv = snd_soc_card_get_drvdata(card); int ret = 0; - /* Headset jack detection only if it is supported */ - if (priv->jack_detect > 0) { - hs_jack_gpios[0].gpio = priv->jack_detect; + /* + * This is a bit of a hack, but the GPIO is optional so we + * only want to add the jack detection if the GPIO is there. + */ + if (of_property_present(card->dev->of_node, "ti,jack-det-gpio")) { + hs_jack_gpios[0].gpiod_dev = card->dev; + hs_jack_gpios[0].idx = 0; ret = snd_soc_card_jack_new_pins(rtd->card, "Headset Jack", SND_JACK_HEADSET, @@ -279,9 +280,6 @@ static int omap_twl4030_probe(struct platform_device *pdev) omap_twl4030_dai_links[1].platforms->of_node = dai_node; } - priv->jack_detect = of_get_named_gpio(node, - "ti,jack-det-gpio", 0); - /* Optional: audio routing can be provided */ prop = of_find_property(node, "ti,audio-routing", NULL); if (prop) { @@ -302,8 +300,6 @@ static int omap_twl4030_probe(struct platform_device *pdev) if (!pdata->voice_connected) card->num_links = 1; - - priv->jack_detect = pdata->jack_detect; } else { dev_err(&pdev->dev, "Missing pdata\n"); return -ENODEV; From patchwork Tue Sep 26 13:25:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 13399245 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 5FA02E7E636 for ; Tue, 26 Sep 2023 13:26:10 +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:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=BsXoRr+oxu26t4kpyJtOMob2L/v4aVCLs2vhqtgspYc=; b=qqXgR2J0oQdOkK 6eApviInBv9szPLSjO8dlDnWa3/Jt+5HeuL9dtxU6R3wuOcmENfNRoRPoMcZbp1hJFD+0n8aF2jxV 8DF6L/pn8R3I5QySesh7aUW4oGU2Fd9cDdmIJFsm+Bca2h9l0c+OL2Ypd0nn6vldu+tizTOuybohP r5U0XZ8Oq1Gb63NxjWvI0ZtGNEd01m8ZGLKPYLk6y5D7pL3dApyK7XHftNTjw0S9o2n4AStSGpqGE Mv2ptk8n2UyYTzzO83hHizu16S7g6SxVJxr4GCDvnolcte7MkasrOeTYCV6gE/wKCyhORD9nvyAKg 2eydvPBA+myIjz2HHHyQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1ql84R-00GSrl-2Y; Tue, 26 Sep 2023 13:25:47 +0000 Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1ql84K-00GSp9-1F for linux-arm-kernel@lists.infradead.org; Tue, 26 Sep 2023 13:25:42 +0000 Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-50336768615so15076904e87.0 for ; Tue, 26 Sep 2023 06:25:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695734738; x=1696339538; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=eSwx/b4rntThA+gqocWEhyhWPDC/t/D3gklrenCSnqA=; b=u5MC7eERtdIJ+OFWnyZTeDw7oRiRiUd9gS6ofq/lATfgEPEGoG2DExB0DdZmp+srBt 3MzDbMC79F6Nn3E6CKLOSwAnvtGP4oV+NS3GkUnEdse2NI80nRpMLHNsVYFl6tg1F/dL vfcc51hzRB1/liCw6ldBak1O20ogQ28h3Ewaa/vhKg819kssj88yt/lmgB/yAkKWsEnj e9F6Ek1Um1YL3/a6q4rzn46V/QN50PBDOdYx+6cYsloKe1dTpActdH/ieiQnp8p8AB8L kqxbPMWMWOX7pjAOKMJgfu+2oKw59JfhO5IKJ4ypbPEArBSrPLE53R4C6evRly5aZJey di5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695734738; x=1696339538; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eSwx/b4rntThA+gqocWEhyhWPDC/t/D3gklrenCSnqA=; b=oFjOz1KKq3S9unpYNeFqmVnwRdrm0vf76lMvHPNWJA86QrRF4Mep4J8RSd4deW6yKN ZZFUU8WEYjkx4KcD4RL9sZxe67ePtg0OSLAsws5AmdJFi5XF2PzJAIxiEL0IPnJSyBih oFG7Azm73fQFhRlWFuBH9KiG749eTGkEu6WGiNfSDsw3ETxopc/knFBxGDpaVnU4IMLV QLo79/llx1Q6eID6VZRQCJdITv/NW5jq6wFkcZyN+6SPyhaUpmZWJ7l/hhJzqKDxDTO4 Ekk70HabUZwYO2GFJt1z+ipQWYKIRd+rCXOVboNuZTlAjPQLeIzNPWGt4yrKEr1AgO5I wHIQ== X-Gm-Message-State: AOJu0YyFCiHQcYcbJhOf4bR35lJoZRZdfp6tXmQaeI9HDubsAPMOyL1y FxAWvBkQjybGCL6heRiW/J7CCJOL+QJQKbJNb2o= X-Google-Smtp-Source: AGHT+IHbc+35uDWrkEivnndc1O1s8dDLRqOAC93DpPEiyvRCo+RGrZSf7R/WlQvJuC7dgDELyQzkng== X-Received: by 2002:a19:f508:0:b0:503:3781:ac32 with SMTP id j8-20020a19f508000000b005033781ac32mr8255259lfb.41.1695734738627; Tue, 26 Sep 2023 06:25:38 -0700 (PDT) Received: from [127.0.1.1] ([85.235.12.238]) by smtp.gmail.com with ESMTPSA id eq25-20020a056512489900b0050307bf2bcdsm2221540lfb.247.2023.09.26.06.25.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 06:25:38 -0700 (PDT) From: Linus Walleij Date: Tue, 26 Sep 2023 15:25:32 +0200 Subject: [PATCH 4/5] ASoC: ti: Convert Pandora ASoC to GPIO descriptors MIME-Version: 1.0 Message-Id: <20230926-descriptors-asoc-ti-v1-4-60cf4f8adbc5@linaro.org> References: <20230926-descriptors-asoc-ti-v1-0-60cf4f8adbc5@linaro.org> In-Reply-To: <20230926-descriptors-asoc-ti-v1-0-60cf4f8adbc5@linaro.org> To: Tony Lindgren , Peter Ujfalusi , Jarkko Nikula , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai Cc: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, alsa-devel@alsa-project.org, Linus Walleij X-Mailer: b4 0.12.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230926_062540_440502_1C61D480 X-CRM114-Status: GOOD ( 19.95 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The Pandora uses GPIO descriptors pretty much exclusively, but not for ASoC, so let's fix it. Register the pins in a descriptor table in the machine since the ASoC device is not using device tree. Use static locals for the GPIO descriptors because I'm not able to experient with better state storage on any real hardware. Others using the Pandora can come afterwards and improve this. Signed-off-by: Linus Walleij --- arch/arm/mach-omap2/pdata-quirks.c | 10 ++++++ sound/soc/ti/omap3pandora.c | 63 ++++++++++++++------------------------ 2 files changed, 33 insertions(+), 40 deletions(-) diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c index c1c0121f478d..b947bacf23a3 100644 --- a/arch/arm/mach-omap2/pdata-quirks.c +++ b/arch/arm/mach-omap2/pdata-quirks.c @@ -275,9 +275,19 @@ static struct platform_device pandora_backlight = { .id = -1, }; +static struct gpiod_lookup_table pandora_soc_audio_gpios = { + .dev_id = "soc-audio", + .table = { + GPIO_LOOKUP("gpio-112-127", 6, "dac", GPIO_ACTIVE_HIGH), + GPIO_LOOKUP("gpio-0-15", 14, "amp", GPIO_ACTIVE_HIGH), + { } + }, +}; + static void __init omap3_pandora_legacy_init(void) { platform_device_register(&pandora_backlight); + gpiod_add_lookup_table(&pandora_soc_audio_gpios); } #endif /* CONFIG_ARCH_OMAP3 */ diff --git a/sound/soc/ti/omap3pandora.c b/sound/soc/ti/omap3pandora.c index a287e9747c2a..fa92ed97dfe3 100644 --- a/sound/soc/ti/omap3pandora.c +++ b/sound/soc/ti/omap3pandora.c @@ -7,7 +7,7 @@ #include #include -#include +#include #include #include #include @@ -21,12 +21,11 @@ #include "omap-mcbsp.h" -#define OMAP3_PANDORA_DAC_POWER_GPIO 118 -#define OMAP3_PANDORA_AMP_POWER_GPIO 14 - #define PREFIX "ASoC omap3pandora: " static struct regulator *omap3pandora_dac_reg; +static struct gpio_desc *dac_power_gpio; +static struct gpio_desc *amp_power_gpio; static int omap3pandora_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params) @@ -78,9 +77,9 @@ static int omap3pandora_dac_event(struct snd_soc_dapm_widget *w, return ret; } mdelay(1); - gpio_set_value(OMAP3_PANDORA_DAC_POWER_GPIO, 1); + gpiod_set_value(dac_power_gpio, 1); } else { - gpio_set_value(OMAP3_PANDORA_DAC_POWER_GPIO, 0); + gpiod_set_value(dac_power_gpio, 0); mdelay(1); regulator_disable(omap3pandora_dac_reg); } @@ -92,9 +91,9 @@ static int omap3pandora_hp_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *k, int event) { if (SND_SOC_DAPM_EVENT_ON(event)) - gpio_set_value(OMAP3_PANDORA_AMP_POWER_GPIO, 1); + gpiod_set_value(amp_power_gpio, 1); else - gpio_set_value(OMAP3_PANDORA_AMP_POWER_GPIO, 0); + gpiod_set_value(amp_power_gpio, 0); return 0; } @@ -229,35 +228,10 @@ static int __init omap3pandora_soc_init(void) pr_info("OMAP3 Pandora SoC init\n"); - ret = gpio_request(OMAP3_PANDORA_DAC_POWER_GPIO, "dac_power"); - if (ret) { - pr_err(PREFIX "Failed to get DAC power GPIO\n"); - return ret; - } - - ret = gpio_direction_output(OMAP3_PANDORA_DAC_POWER_GPIO, 0); - if (ret) { - pr_err(PREFIX "Failed to set DAC power GPIO direction\n"); - goto fail0; - } - - ret = gpio_request(OMAP3_PANDORA_AMP_POWER_GPIO, "amp_power"); - if (ret) { - pr_err(PREFIX "Failed to get amp power GPIO\n"); - goto fail0; - } - - ret = gpio_direction_output(OMAP3_PANDORA_AMP_POWER_GPIO, 0); - if (ret) { - pr_err(PREFIX "Failed to set amp power GPIO direction\n"); - goto fail1; - } - omap3pandora_snd_device = platform_device_alloc("soc-audio", -1); if (omap3pandora_snd_device == NULL) { pr_err(PREFIX "Platform device allocation failed\n"); - ret = -ENOMEM; - goto fail1; + return -ENOMEM; } platform_set_drvdata(omap3pandora_snd_device, &snd_soc_card_omap3pandora); @@ -268,6 +242,20 @@ static int __init omap3pandora_soc_init(void) goto fail2; } + dac_power_gpio = devm_gpiod_get(&omap3pandora_snd_device->dev, + "dac", GPIOD_OUT_LOW); + if (IS_ERR(dac_power_gpio)) { + ret = PTR_ERR(dac_power_gpio); + goto fail3; + } + + amp_power_gpio = devm_gpiod_get(&omap3pandora_snd_device->dev, + "amp", GPIOD_OUT_LOW); + if (IS_ERR(amp_power_gpio)) { + ret = PTR_ERR(amp_power_gpio); + goto fail3; + } + omap3pandora_dac_reg = regulator_get(&omap3pandora_snd_device->dev, "vcc"); if (IS_ERR(omap3pandora_dac_reg)) { pr_err(PREFIX "Failed to get DAC regulator from %s: %ld\n", @@ -283,10 +271,7 @@ static int __init omap3pandora_soc_init(void) platform_device_del(omap3pandora_snd_device); fail2: platform_device_put(omap3pandora_snd_device); -fail1: - gpio_free(OMAP3_PANDORA_AMP_POWER_GPIO); -fail0: - gpio_free(OMAP3_PANDORA_DAC_POWER_GPIO); + return ret; } module_init(omap3pandora_soc_init); @@ -295,8 +280,6 @@ static void __exit omap3pandora_soc_exit(void) { regulator_put(omap3pandora_dac_reg); platform_device_unregister(omap3pandora_snd_device); - gpio_free(OMAP3_PANDORA_AMP_POWER_GPIO); - gpio_free(OMAP3_PANDORA_DAC_POWER_GPIO); } module_exit(omap3pandora_soc_exit); From patchwork Tue Sep 26 13:25:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 13399249 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 59E85E7E635 for ; Tue, 26 Sep 2023 13:26:16 +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:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=8/ysXgSuu2x+RJmpxh58ybIhrnykRf9Rdxmjo10nbpc=; b=4QxCOy1LCJi1G0 hHssNCftIgA8mal1HIc9Q7XUr7iFzjdoMiQ+zthn3dK8wnoOt+hjnQuG4BXgZjPlRlfhwxPQ4i+CL RlM8Y0YeBMs0KOXQIV0dlwrNNsgEMuXigtCvFQLWBqeL5HdyNoJmFVi+4mHgRNhrjlfsLjuMuYnWe JnM9zosJgiC1pONeTqkSkuI8XsvkFN+3dNYor5HB3f1LbWN43o+ZYMMVhT1lVKZXTg9khydncmHfL UmCeR6ytpi+pEs2ahTb/rb6jf7EfnikSxGfWKYUxD3Pu5fUXyW33+SnSZ6ePmFU00RSuwrY5lgviQ naWbn19p4p3y5HscRcyw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1ql84T-00GSsk-1B; Tue, 26 Sep 2023 13:25:49 +0000 Received: from mail-lf1-x12c.google.com ([2a00:1450:4864:20::12c]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1ql84O-00GSpB-0s for linux-arm-kernel@lists.infradead.org; Tue, 26 Sep 2023 13:25:45 +0000 Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-503012f4e71so12014042e87.0 for ; Tue, 26 Sep 2023 06:25:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1695734739; x=1696339539; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=hr5amuTNg43g84vy8vdnricessR4/d7Wx6XjZcS7tVE=; b=hjF8u89o9+pxXamPqpruTmNQ7Wk40V60d482xW1LejVIG4ZTVq105FAgXyAdkJ/8Fe XDf4gnm9N+NV8xaRX1js19/PebJHnTDhpaq31lLqkGHBu6nUulOMVHL2x/q4YmKtXrkM 11sKHsSTJ1sMzCKcnl/8000Hwd37BENmSi6DDsoqwgTYaQM7TNjSwOQWr+6GJIu5Pt2R xyjx+GCccMUuUrXjiTdceCmxHxVv1S/PONV6EnaD47++ZomhUUgLk+TqX4khkofrOtkm 2UdWv77KaUAjEEglUH32spHEkifCasoQBbkZPzfp26nbtlG8K1bmAmDSwSNI5Ri/z2kU 8K0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695734739; x=1696339539; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hr5amuTNg43g84vy8vdnricessR4/d7Wx6XjZcS7tVE=; b=lw7vdBx3wg1AJ76Ycboq19HdCbRtvue4cVv/y6Z+1mBDggeVkVyh4/PvaKb6jOlbE9 LwV6bBniI9gvBpguaf4LEQmjPf6oH6Foe1YL6qgHVqbSoyILKR18YeASLvMM8yW1cl1Y WgWMvYCEHXA8Wh1VZhCyRcIFgxxHnbR5ktLaTpK1oXMt3khMUQXLnDt078TT1/SqGuDt xQHBbZwBf56T4o8cr2bJLKX48OMIOcH9FfdV29DKfxoAUIwxIDSqIIJYPi3b5c4a1t2p jg9EmAMJlV61nGuwvVssMqparLR9QTjXNontlRgo4AxOz7VTyk5UfsuJxiKCkvNC7akV 6UKA== X-Gm-Message-State: AOJu0Yz/wAZ4sj1685r7rrg5CTBI6/7S1oi5WLmF3JtOUNeZXvSCHB5w Bsph/70PTKQ2BMFjf+sv4kPvRQ== X-Google-Smtp-Source: AGHT+IGhCkADecUplAXbs0IyJ40nh2sd47gAxE7FjpqNC2VQj9VPtPn0k3sCnuX/N/x/fkycKRNmpg== X-Received: by 2002:a05:6512:114d:b0:501:bf37:262a with SMTP id m13-20020a056512114d00b00501bf37262amr1239953lfg.32.1695734739514; Tue, 26 Sep 2023 06:25:39 -0700 (PDT) Received: from [127.0.1.1] ([85.235.12.238]) by smtp.gmail.com with ESMTPSA id eq25-20020a056512489900b0050307bf2bcdsm2221540lfb.247.2023.09.26.06.25.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 06:25:39 -0700 (PDT) From: Linus Walleij Date: Tue, 26 Sep 2023 15:25:33 +0200 Subject: [PATCH 5/5] ASoC: ti: osk5912: Drop unused include MIME-Version: 1.0 Message-Id: <20230926-descriptors-asoc-ti-v1-5-60cf4f8adbc5@linaro.org> References: <20230926-descriptors-asoc-ti-v1-0-60cf4f8adbc5@linaro.org> In-Reply-To: <20230926-descriptors-asoc-ti-v1-0-60cf4f8adbc5@linaro.org> To: Tony Lindgren , Peter Ujfalusi , Jarkko Nikula , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai Cc: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, alsa-devel@alsa-project.org, Linus Walleij X-Mailer: b4 0.12.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230926_062544_307329_EA81467D X-CRM114-Status: GOOD ( 11.94 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This driver includes the legacy header but doesn't use it. Drop the include. Signed-off-by: Linus Walleij --- sound/soc/ti/osk5912.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sound/soc/ti/osk5912.c b/sound/soc/ti/osk5912.c index 2790c8915f55..12f0c3a15201 100644 --- a/sound/soc/ti/osk5912.c +++ b/sound/soc/ti/osk5912.c @@ -14,7 +14,6 @@ #include #include -#include #include #include