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 X-Spam-Level: X-Spam-Status: No, score=-6.7 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0B60ACA9EC0 for ; Mon, 28 Oct 2019 21:08:37 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id D265F21924 for ; Mon, 28 Oct 2019 21:08:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="gjaqbpUi" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D265F21924 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=free.fr Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:In-Reply-To: Date:References:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=fHikwptWucagL5dbu0BuV2L4CpJ194QNVDCoAgZ0qYM=; b=gjaqbpUiu099GB YYsNL7tF1Vg+qz5to3oeQ4cXEs9pKOZPSktiv02DGhOwS7tNR+pHiVY4wDxKrcVieMRO4Ie6AeS2r i7ayXINvXhpihamQT1fJMFv5oe3vxT52+31pQoz+4feJuPFn19iqxR+1SWBiTlscFdO6Qn/VhiubR iN1jTYuaWUMaYepZyXHGIJ5HsHdasOfHxmp8G5kiqhwBxL3wwIiKg748dNAnOoDLENrFrFE+bohW0 oLB8QQqMpwIBQCd46/TsX9Db/ngoKnmtBEUnEvqY09ClAiIArjTrRr65Uk85u2OB1xHZV4k+Gza0m etrCWq+5zccqx0n0t5PA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iPCFg-00013K-Io; Mon, 28 Oct 2019 21:08:36 +0000 Received: from smtp09.smtpout.orange.fr ([80.12.242.131] helo=smtp.smtpout.orange.fr) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iPCFd-00012i-J2 for linux-arm-kernel@lists.infradead.org; Mon, 28 Oct 2019 21:08:35 +0000 Received: from belgarion ([90.55.204.252]) by mwinf5d17 with ME id K98W2100G5TFNlm0398XDJ; Mon, 28 Oct 2019 22:08:31 +0100 X-ME-Helo: belgarion X-ME-Auth: amFyem1pay5yb2JlcnRAb3JhbmdlLmZy X-ME-Date: Mon, 28 Oct 2019 22:08:31 +0100 X-ME-IP: 90.55.204.252 From: Robert Jarzmik To: Arnd Bergmann Subject: Re: [PATCH 21/46] ARM: pxa: spitz: use gpio descriptors for audio References: <20191018154052.1276506-1-arnd@arndb.de> <20191018154201.1276638-21-arnd@arndb.de> X-URL: http://belgarath.falguerolles.org/ Date: Mon, 28 Oct 2019 22:08:30 +0100 In-Reply-To: <20191018154201.1276638-21-arnd@arndb.de> (Arnd Bergmann's message of "Fri, 18 Oct 2019 17:41:36 +0200") Message-ID: <87o8y0lgs1.fsf@belgarion.home> User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/26 (gnu/linux) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191028_140833_907427_6887F483 X-CRM114-Status: GOOD ( 21.96 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alsa-devel@alsa-project.org, Linus Walleij , linux-kernel@vger.kernel.org, Haojian Zhuang , Mark Brown , Daniel Mack , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Arnd Bergmann writes: > The audio driver should not use a hardwired gpio number > from the header. Change it to use a lookup table. > > Cc: Mark Brown > Cc: alsa-devel@alsa-project.org > Signed-off-by: Arnd Bergmann > --- > arch/arm/mach-pxa/spitz.c | 33 ++++++++++- > arch/arm/mach-pxa/{include/mach => }/spitz.h | 2 +- > arch/arm/mach-pxa/spitz_pm.c | 2 +- > sound/soc/pxa/spitz.c | 58 ++++++++------------ > 4 files changed, 57 insertions(+), 38 deletions(-) > rename arch/arm/mach-pxa/{include/mach => }/spitz.h (99%) > > diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c > index a4fdc399d152..6028fd83c44d 100644 > --- a/arch/arm/mach-pxa/spitz.c > +++ b/arch/arm/mach-pxa/spitz.c > @@ -44,7 +44,7 @@ > #include > #include > #include > -#include > +#include "spitz.h" > #include "sharpsl_pm.h" > #include > > @@ -948,11 +948,42 @@ static void __init spitz_i2c_init(void) > static inline void spitz_i2c_init(void) {} > #endif > > +static struct gpiod_lookup_table spitz_audio_gpio_table = { > + .dev_id = "spitz-audio", > + .table = { > + GPIO_LOOKUP("sharp-scoop.0", SPITZ_GPIO_MUTE_L - SPITZ_SCP_GPIO_BASE, > + "mute-l", GPIO_ACTIVE_HIGH), > + GPIO_LOOKUP("sharp-scoop.0", SPITZ_GPIO_MUTE_R - SPITZ_SCP_GPIO_BASE, > + "mute-r", GPIO_ACTIVE_HIGH), > + GPIO_LOOKUP("sharp-scoop.1", SPITZ_GPIO_MIC_BIAS - SPITZ_SCP2_GPIO_BASE, > + "mic", GPIO_ACTIVE_HIGH), > + { }, > + }, > +}; > + > +static struct gpiod_lookup_table akita_audio_gpio_table = { > + .dev_id = "spitz-audio", > + .table = { > + GPIO_LOOKUP("sharp-scoop.0", SPITZ_GPIO_MUTE_L - SPITZ_SCP_GPIO_BASE, > + "mute-l", GPIO_ACTIVE_HIGH), > + GPIO_LOOKUP("sharp-scoop.0", SPITZ_GPIO_MUTE_R - SPITZ_SCP_GPIO_BASE, > + "mute-r", GPIO_ACTIVE_HIGH), > + GPIO_LOOKUP("gpio-pxa", AKITA_GPIO_MIC_BIAS - AKITA_IOEXP_GPIO_BASE, > + "mic", GPIO_ACTIVE_HIGH), This last one looks a bit dubious, as it looks like a gpio on a gpio expander, could you cross-check that "gpio-pxa" shouldn't be an I2C expander gpio please ? Cheers. -- Robert _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel