Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp3629921ybg; Mon, 28 Oct 2019 16:14:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqwHWv/xfkn9ZcITYkEituhwNpJBUZIXqNybO/vi0JQ2aoJKyBojbp4HJ5duT8HNgqknzFsh X-Received: by 2002:a17:906:386:: with SMTP id b6mr387122eja.148.1572304451960; Mon, 28 Oct 2019 16:14:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572304451; cv=none; d=google.com; s=arc-20160816; b=cRgQ6s1ifklw6xqQ3TgRszVzvzFJc84ebJMin16OGKDUtaFEg8Oc/nEqkah1Ls3GE6 Ln2kNXADlA33pK+7EvWDIRh83XFWeTlu+Ugjt93kpH0NMiA5a5iQ+Zo4EqJaC5UAs4V9 879fj5SK5VKX9fdlY+AN/mUjozJ8Tom23oui5b/NLIlYL96iStUCeBtwJ8YqVljC5CVF rwmKn5dc7t+s3x1bg6mHpnhhUIuR7weRlaQDuL3svWMlldbmHttpgyd6rCG2vhXgzzP8 svsmAS2PMugvjYUKovt7yjpsUU6Y/DbgJ2s0BMNnSJuT6DI+s7RNmicEhc7CnbENUL+8 SJOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from; bh=BVnM9BmMjd1ZXivCKWV4jUC1PIlpRal7xkiQDCrgVSQ=; b=ga5rWFi8THCHKb2EuuZdy1a6//YerH5bosrOgMa0l2O2T2KZIpEqkYVzhbZ4VavuqB pwhKTJDmiZkrQ9doCceA415Ef7k74nXTSdpSUCEbyo3TROHsnfgXAs1D8RATZrPCwh7e Ij8c+U0FXxntYrHoRdfOshyKvJhxNTXfXdm6H+l3kl8JChnKk3r3l4MSEtsXrttFUtFo dGSrf9V5vUQI+VnIkkBvQfjfiRsfk+U5g/4WByI9YN2e1LxAsdraTM7oIiV225KfvH5N hAho5Pp7hzA35EpGyqXuwLrHina6bzeOAneHiAxjJNrrH+z2dV0INXCC73sx2P3D0JzK s1jA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a22si6848965eje.245.2019.10.28.16.13.47; Mon, 28 Oct 2019 16:14:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730147AbfJ1VId (ORCPT + 99 others); Mon, 28 Oct 2019 17:08:33 -0400 Received: from smtp09.smtpout.orange.fr ([80.12.242.131]:49338 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727119AbfJ1VId (ORCPT ); Mon, 28 Oct 2019 17:08:33 -0400 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 Cc: Daniel Mack , Haojian Zhuang , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Linus Walleij , Mark Brown , alsa-devel@alsa-project.org 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 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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