Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp651871yba; Mon, 1 Apr 2019 13:57:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqz3nLBe2wQiH4wkX5clBzNJul55KC7/RNNgbT4JP28UH6iemVYCd/qNP7PQOwOj3M/xVWxT X-Received: by 2002:a17:902:6b48:: with SMTP id g8mr65811182plt.21.1554152230983; Mon, 01 Apr 2019 13:57:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554152230; cv=none; d=google.com; s=arc-20160816; b=JaRsXAl0t6OK6TugI8A1HBOyp3v4UhehqLVubplhAPDI9aA/IACPthZw8RLcpdnG2D vsINKSVTEQ2o/le2pIb2cUFB1qajY0mqOTgEXZiA0cQpK/2F9layeEMug39UahNCEjKL MARwTEgA9RteEMFfsQ+G/+r2u64ECydzvsNDmceCl7J4fzRxro1bBJId9bXMedxPBsHo R8llxuAB0Kq/LiZ+CA6mQMY3NqfIwmETc1To8Nlq/1BUWbv14srF2PsyUwnpnRXY0woe d2Q18knpDcBvDs+ZtVAOTZcCpKgTZ6QQMsAExudM3Or5LVH7Q6oTcuFlQbwT0hYhCMVN 2jSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Xrpr7Hq7dqaYL2Eo6DwUdVyXfie7eGeQXHVNyEFIVsc=; b=RvMprRhoMZ7dyCI4/aJjNi2WGzrXAM31ULyRRWdCwagRnKy5SgQ1TWEBifmQ3eXhFt McHvUpiOTwGrM9Hdg8D4ZTsY1n6sh9euUvqmoofCwRhEd+k3tICpBVLVuIfyjdizR2K6 g6/1bBNr1EOlpYqssr1oLOMPm0zfFk9EEfAc2JXDN54n7E9c2RnTpltp+TAs/rdzwqhz 5WOcO7VztDgNjXcMSpxDCPXaLBmYriWiuNduKy/+IzXv1vxF3SlIuX6PsMaUyt6IBGKq Wm/KUFujPQ8s9T6RExMzyfZr+NBtQJP5JSNtEjjqwu4s1VD5vai9HX913TwPWZ5/V9fk unuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=c125njDp; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x8si9423414pll.207.2019.04.01.13.56.54; Mon, 01 Apr 2019 13:57:10 -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; dkim=pass header.i=@chromium.org header.s=google header.b=c125njDp; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727489AbfDAUzn (ORCPT + 99 others); Mon, 1 Apr 2019 16:55:43 -0400 Received: from mail-it1-f195.google.com ([209.85.166.195]:38338 "EHLO mail-it1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726725AbfDAUzm (ORCPT ); Mon, 1 Apr 2019 16:55:42 -0400 Received: by mail-it1-f195.google.com with SMTP id f22so1532506ita.3 for ; Mon, 01 Apr 2019 13:55:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Xrpr7Hq7dqaYL2Eo6DwUdVyXfie7eGeQXHVNyEFIVsc=; b=c125njDpcb+GViLFb7oVcDNQe5ZLS36m3H9L16x9knOSqaFwlnxDs+rGkawwSxJbev wzsTkjX3Y24BpRuyMM2PCZy92/gdYSpJwe6icQto/kqdVd40+EGD10UN9tvr2k3M8eOQ CSTTzL1rJRZkv/p3B9Xk++JR9RnhbLzOnsg4U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Xrpr7Hq7dqaYL2Eo6DwUdVyXfie7eGeQXHVNyEFIVsc=; b=hu4sFpg2ItqHBpqvkY1a44TU9aZWAXQkMELY/LXWFdK4tDIghmz944KVK3mr0+Nwk9 /pHCRaGj4nHePOwp9xzRFwFCSzdl8t0RQ4V996w1p7VMm9aaMMElTwByhI8lDnSc+Ojo oSqAvQbboe/zwUmrfUV4XJPBeuM2fL3fpoo15/tbz/1TV6XhP0B3GjV6hjuVw0N7gtpW RTZyDGnhfkrHVSVsGu5uQEi67VTh5Bhb3PhOoW0cnEZejJPFwKIZlIqHp/ec5YP+WIra h5/OPRBQUk2A/q0s3YtAJBb+fBxBGb4PpLej5O19jjl7FFOAmxuncdb1V1tnTmv887xb j8AA== X-Gm-Message-State: APjAAAVv+JHGJc3wE/MouVyrK+49Ko7xRnCk2K0VGcUeLaTn8mAH7KKW JHpSSrZCF6bDDAeLLU9QJWwOsrsBH0VKjQ== X-Received: by 2002:a24:7014:: with SMTP id f20mr1286036itc.44.1554152141676; Mon, 01 Apr 2019 13:55:41 -0700 (PDT) Received: from fletcherw.bld.corp.google.com ([2620:15c:183:200:70a8:812a:cdeb:6e0]) by smtp.gmail.com with ESMTPSA id v133sm6688570ita.19.2019.04.01.13.55.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Apr 2019 13:55:41 -0700 (PDT) From: Fletcher Woodruff To: linux-kernel@vger.kernel.org Cc: Fletcher Woodruff , Bard Liao , Jaroslav Kysela , Liam Girdwood , Mark Brown , Oder Chiou , Takashi Iwai , Curtis Malainey , Ross Zwisler , alsa-devel@alsa-project.org Subject: [PATCH 2/2] ASoC: rt5677: make ACPI property names match _DSD Date: Mon, 1 Apr 2019 14:55:19 -0600 Message-Id: <20190401205519.34023-2-fletcherw@chromium.org> X-Mailer: git-send-email 2.21.0.392.gf8f6787159e-goog In-Reply-To: <20190401205519.34023-1-fletcherw@chromium.org> References: <20190401205519.34023-1-fletcherw@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The rt5677 driver is using the wrong property names to read from ACPI. Update the property names to match those from _DSD, so that the correct GPIO pin numbers are read and that plug-detection works. With this patch, plugging and unplugging the headphone jack switches between headphones and speakers automatically. Signed-off-by: Fletcher Woodruff --- sound/soc/codecs/rt5677.c | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/sound/soc/codecs/rt5677.c b/sound/soc/codecs/rt5677.c index 33380f82b7008f..1f725086cee39c 100644 --- a/sound/soc/codecs/rt5677.c +++ b/sound/soc/codecs/rt5677.c @@ -4998,25 +4998,6 @@ static const struct acpi_device_id rt5677_acpi_match[] = { }; MODULE_DEVICE_TABLE(acpi, rt5677_acpi_match); -static void rt5677_read_acpi_properties(struct rt5677_priv *rt5677, - struct device *dev) -{ - u32 val; - - if (!device_property_read_u32(dev, "DCLK", &val)) - rt5677->pdata.dmic2_clk_pin = val; - - rt5677->pdata.in1_diff = device_property_read_bool(dev, "IN1"); - rt5677->pdata.in2_diff = device_property_read_bool(dev, "IN2"); - rt5677->pdata.lout1_diff = device_property_read_bool(dev, "OUT1"); - rt5677->pdata.lout2_diff = device_property_read_bool(dev, "OUT2"); - rt5677->pdata.lout3_diff = device_property_read_bool(dev, "OUT3"); - - device_property_read_u32(dev, "JD1", &rt5677->pdata.jd1_gpio); - device_property_read_u32(dev, "JD2", &rt5677->pdata.jd2_gpio); - device_property_read_u32(dev, "JD3", &rt5677->pdata.jd3_gpio); -} - static void rt5677_read_device_properties(struct rt5677_priv *rt5677, struct device *dev) { @@ -5273,19 +5254,23 @@ static int rt5677_i2c_probe(struct i2c_client *i2c) if (match_id) rt5677->type = (enum rt5677_type)match_id->data; - rt5677_read_device_properties(rt5677, &i2c->dev); } else if (ACPI_HANDLE(&i2c->dev)) { const struct acpi_device_id *acpi_id; + u32 val; acpi_id = acpi_match_device(rt5677_acpi_match, &i2c->dev); if (acpi_id) rt5677->type = (enum rt5677_type)acpi_id->driver_data; - rt5677_read_acpi_properties(rt5677, &i2c->dev); + if (!device_property_read_u32(&i2c->dev, + "realtek,dmic2_clk_pin", &val)) + rt5677->pdata.dmic2_clk_pin = val; } else { return -EINVAL; } + rt5677_read_device_properties(rt5677, &i2c->dev); + /* pow-ldo2 and reset are optional. The codec pins may be statically * connected on the board without gpios. If the gpio device property * isn't specified, devm_gpiod_get_optional returns NULL. -- 2.21.0.392.gf8f6787159e-goog