From patchwork Tue Jun 13 21:08:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 105422 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp604030qgd; Tue, 13 Jun 2017 14:09:19 -0700 (PDT) X-Received: by 10.223.171.83 with SMTP id r19mr4246189wrc.7.1497388159264; Tue, 13 Jun 2017 14:09:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497388159; cv=none; d=google.com; s=arc-20160816; b=NrJAoR9aCO/rLffuaW7cf7z2sOfE7oKIzu4UHaZXKNRSdlTF1J+w6K0U92/72topyL CeI6LQ12fZpyLTWKJLlBZO6E5t2FMCjDWV8nxKpdih0TpfanzcELzVivkPw3rGIaGA8C WQRot96Ux6PaPDzOhufvYeCChGjT3ByqDMlMZ67E+hjSAmM8U1zf5C+4ZIn6RUyCvrZz 7CjtRWPqdxI5UBWbEruh0ichfHQfyrQIIpy8ew6/YwB+MgvxV4HiFfhTbWXRMpJ88kY+ jTCEBc3vEnp9M63k1caLtD2eZ7EsgH2og2AsV1cuLHd2OZMpkrF7uSb/6eOo7JmG6NT1 yhpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:date:message-id:in-reply-to:to:from :delivered-to:arc-authentication-results; bh=IA/q9gnlt0PFp+NAQYCWJzk8lNWdJUlIUMaWlPSurCM=; b=ICKMYgYcpZHl0KTQMYSAGKrf01L8g01qagqecOs/2RiKTRrL6MCRjFLyEMnDALd4er gMXq2TPuu7QZFpRZ2grPI+X5jqhenwfmrva6citR/qKCYMeBBjvi3EX975AukEpYceCB q8qSjTJRGT45SVHD6ymAFVr95NqmXE4q7WYJNUEbLIhrl2UtDXxtwq8jrljgnWZ//m3O O5rgp1iC+uehKZ1uABjQJK3IVgNTMJnNE2XlCiFQEAoPyqxMUUyU2ZSrnz+cgLZ0AHE6 k79hxd0F1nmaIU2Cxfem+D5ZxuXrHY+7UALpy6WrBkzqqR2iexdQc8dL9hZAxM5GF5tZ cehg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id f22si1315166wra.103.2017.06.13.14.09.19; Tue, 13 Jun 2017 14:09:19 -0700 (PDT) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id EDC0B267054; Tue, 13 Jun 2017 23:08:24 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 8B03D267044; Tue, 13 Jun 2017 23:08:18 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,SPF_PASS,T_RP_MATCHES_RCVD,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from mezzanine.sirena.org.uk (mezzanine.sirena.org.uk [106.187.55.193]) by alsa0.perex.cz (Postfix) with ESMTP id 4FDD4267045 for ; Tue, 13 Jun 2017 23:08:07 +0200 (CEST) Received: from [2001:470:1f1d:6b5::3] (helo=debutante) by mezzanine.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1dKt2g-0006zT-Hz; Tue, 13 Jun 2017 21:08:04 +0000 Received: from broonie by debutante with local (Exim 4.89) (envelope-from ) id 1dKt2e-0000MZ-0A; Tue, 13 Jun 2017 22:08:00 +0100 From: Mark Brown To: Andy Shevchenko In-Reply-To: <20170610163741.49214-1-andriy.shevchenko@linux.intel.com> Message-Id: Date: Tue, 13 Jun 2017 22:08:00 +0100 X-SA-Exim-Connect-IP: 2001:470:1f1d:6b5::3 X-SA-Exim-Mail-From: broonie@sirena.org.uk X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on mezzanine.sirena.org.uk) Cc: Nicolas Porcel , Mark Brown , Dmitry Torokhov , Liam Girdwood , alsa-devel@alsa-project.org Subject: [alsa-devel] Applied "ASoC: Intel: byt-max98090: Add GPIO ACPI mapping table" to the asoc tree X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org The patch ASoC: Intel: byt-max98090: Add GPIO ACPI mapping table has been applied to the asoc tree at git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark >From 7c197881e163f34679b941c75500a6c85560b7c9 Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Sat, 10 Jun 2017 19:37:41 +0300 Subject: [PATCH] ASoC: Intel: byt-max98090: Add GPIO ACPI mapping table In order to make GPIO ACPI library stricter prepare users of gpiod_get_index() to correctly behave when there no mapping is provided by firmware. Here we add explicit mapping between _CRS GpioIo() resources and their names used in the driver. Reviewed-by: Dmitry Torokhov Tested-by: Nicolas Porcel Signed-off-by: Andy Shevchenko Signed-off-by: Mark Brown --- sound/soc/intel/boards/byt-max98090.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) -- 2.11.0 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/intel/boards/byt-max98090.c b/sound/soc/intel/boards/byt-max98090.c index d9f81b8d915d..047be7fa0ce9 100644 --- a/sound/soc/intel/boards/byt-max98090.c +++ b/sound/soc/intel/boards/byt-max98090.c @@ -67,20 +67,27 @@ static struct snd_soc_jack_pin hs_jack_pins[] = { static struct snd_soc_jack_gpio hs_jack_gpios[] = { { - .name = "hp-gpio", - .idx = 0, + .name = "hp", .report = SND_JACK_HEADPHONE | SND_JACK_LINEOUT, .debounce_time = 200, }, { - .name = "mic-gpio", - .idx = 1, + .name = "mic", .invert = 1, .report = SND_JACK_MICROPHONE, .debounce_time = 200, }, }; +static const struct acpi_gpio_params hp_gpios = { 0, 0, false }; +static const struct acpi_gpio_params mic_gpios = { 1, 0, false }; + +static const struct acpi_gpio_mapping acpi_byt_max98090_gpios[] = { + { "hp-gpios", &hp_gpios, 1 }, + { "mic-gpios", &mic_gpios, 1 }, + {}, +}; + static int byt_max98090_init(struct snd_soc_pcm_runtime *runtime) { int ret; @@ -140,8 +147,9 @@ static struct snd_soc_card byt_max98090_card = { static int byt_max98090_probe(struct platform_device *pdev) { - int ret_val = 0; + struct device *dev = &pdev->dev; struct byt_max98090_private *priv; + int ret_val; priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_ATOMIC); if (!priv) { @@ -149,6 +157,10 @@ static int byt_max98090_probe(struct platform_device *pdev) return -ENOMEM; } + ret_val = devm_acpi_dev_add_driver_gpios(dev->parent, acpi_byt_max98090_gpios); + if (ret_val) + dev_dbg(dev, "Unable to add GPIO mapping table\n"); + byt_max98090_card.dev = &pdev->dev; snd_soc_card_set_drvdata(&byt_max98090_card, priv); ret_val = devm_snd_soc_register_card(&pdev->dev, &byt_max98090_card); @@ -158,7 +170,7 @@ static int byt_max98090_probe(struct platform_device *pdev) return ret_val; } - return ret_val; + return 0; } static int byt_max98090_remove(struct platform_device *pdev)