From patchwork Tue Feb 23 17:19:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Tinkham X-Patchwork-Id: 586985 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 6FE53140A68 for ; Wed, 24 Feb 2016 04:21:59 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=iwlroEYF; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754629AbcBWRVw (ORCPT ); Tue, 23 Feb 2016 12:21:52 -0500 Received: from mail-oi0-f47.google.com ([209.85.218.47]:35002 "EHLO mail-oi0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754572AbcBWRVr (ORCPT ); Tue, 23 Feb 2016 12:21:47 -0500 Received: by mail-oi0-f47.google.com with SMTP id x21so82890333oix.2; Tue, 23 Feb 2016 09:21:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=vlPE3ouIoM7ADC0a5lhCBZ4KENHseLPXP1wo7Z/cwvM=; b=iwlroEYF3ApYOX2YqE4D8ybUkWUQWVrzIRnxRePrZ6jkwejEzok7yIa41PF8HVB527 CBgtd2198zC7eGf8PpLhKqRU0eRSpFnI4oMxPyCfKAMxQBhCK/gfivnwekLcJZCBLyco C96reYN3RnqxNuuH20Mqkm6OUv4TDSvyFMJWD9eKcqiA5/zbB3MpfWzsY0viy3ibO5b4 ibK4+ghDNDO6ZwsgffGX5UMjj2TAbV1S8iiUfw9IaGbGc0CwGEvekfAm20qoX2woSGbz GP7JtDeelf5cLcS7DvUAE8nVsyxlxSVPeJrCfmNcIHU5KmdBFVXuGuwFauMUcatSHx4j 6aFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=vlPE3ouIoM7ADC0a5lhCBZ4KENHseLPXP1wo7Z/cwvM=; b=iodopohH3RFz67pGncO8uB0yz4WlQUgzOglK9SeuyOh9AiGM0kDLlaHtnrE7bcyVr9 MACo6MZ1G77da3qX9J6PUwuGqCJV1TwJUBBx5wfhoThr/Jpd4654AHIncuoR90Io8/bk HH63OUj96vTWf39wng/psuJn8w2d3o6SLjs337KerZi2YcuOhqJnuh61LXpXZkC0k3h+ 6d0XkpO4tUnrrAZlVzUSv4PoqyM2k+TVAEJLNVat46gQ0HvvHNyRnD+3JNTXPuKuOaN9 Ly6vLVdma2xraEpKI0yjCPcMvY1+iIhPFxrv4E22DPSSuY1pzEm2XMM6F1nVVVG9w4eT V3iw== X-Gm-Message-State: AG10YOR1X1U/m9G4gaseAuNec1V93FJTQWeuOWv/xpC7A3Kz9sya041DJlPmtVp9iXz3ow== X-Received: by 10.202.108.80 with SMTP id h77mr27188647oic.47.1456248106959; Tue, 23 Feb 2016 09:21:46 -0800 (PST) Received: from Argon.Mines.EDU (wl-dhcp192-151.Mines.EDU. [138.67.192.151]) by smtp.gmail.com with ESMTPSA id d1sm21085959oby.16.2016.02.23.09.21.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 23 Feb 2016 09:21:46 -0800 (PST) From: Jonathan Tinkham To: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, linux-tegra@vger.kernel.org Cc: lgirdwood@gmail.com, broonie@kernel.org, swarren@wwwdotorg.org, gnurou@gmail.com, thierry.reding@gmail.com, Jonathan Tinkham Subject: [PATCH] sound/soc/tegra: tegra_max98090: Invert headphone by GPIO flag Date: Tue, 23 Feb 2016 10:19:45 -0700 Message-Id: <1456247985-5563-2-git-send-email-sctincman@gmail.com> X-Mailer: git-send-email 2.7.1 In-Reply-To: <1456247985-5563-1-git-send-email-sctincman@gmail.com> References: <56CB6624.6030600@wwwdotorg.org> <1456247985-5563-1-git-send-email-sctincman@gmail.com> Sender: linux-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org Set the invert property for the headphone jack depending on the GPIO flag in the device-tree. This is similar to what is done for tegra_rt5640. Signed-off-by: Jonathan Tinkham --- sound/soc/tegra/tegra_max98090.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sound/soc/tegra/tegra_max98090.c b/sound/soc/tegra/tegra_max98090.c index 902da36..49b95c7 100644 --- a/sound/soc/tegra/tegra_max98090.c +++ b/sound/soc/tegra/tegra_max98090.c @@ -42,6 +42,7 @@ struct tegra_max98090 { struct tegra_asoc_utils_data util_data; int gpio_hp_det; + enum of_gpio_flags gpio_hp_det_flags; int gpio_mic_det; }; @@ -155,6 +156,7 @@ static int tegra_max98090_asoc_init(struct snd_soc_pcm_runtime *rtd) ARRAY_SIZE(tegra_max98090_hp_jack_pins)); tegra_max98090_hp_jack_gpio.gpio = machine->gpio_hp_det; + tegra_max98090_hp_jack_gpio.invert = (machine->gpio_hp_det_flags & OF_GPIO_ACTIVE_LOW); snd_soc_jack_add_gpios(&tegra_max98090_hp_jack, 1, &tegra_max98090_hp_jack_gpio); @@ -234,7 +236,8 @@ static int tegra_max98090_probe(struct platform_device *pdev) platform_set_drvdata(pdev, card); snd_soc_card_set_drvdata(card, machine); - machine->gpio_hp_det = of_get_named_gpio(np, "nvidia,hp-det-gpios", 0); + machine->gpio_hp_det = of_get_named_gpio_flags( + np, "nvidia,hp-det-gpios", 0, &machine->gpio_hp_det_flags); if (machine->gpio_hp_det == -EPROBE_DEFER) return -EPROBE_DEFER;