Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp768515pxy; Wed, 5 May 2021 13:27:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzPWj5lnvD+t/Lv/6Wxcc4yKwkhZgB7sj1evz0RHdQJafz0agwQmIdjx7Q0KBvuD/f/QnSX X-Received: by 2002:a05:6402:254c:: with SMTP id l12mr893594edb.278.1620246469158; Wed, 05 May 2021 13:27:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620246469; cv=none; d=google.com; s=arc-20160816; b=Ubo5KDsAbz1tTjwm6STquvvRPP/4TAD2LOiK/HzxhPu5cyij3v/StryR7CpPvQiYTa OzdIvT9aJfC2EV/aF1Hrwkp+PzQZnKHSz8uCBc/bRqUAmNYegdlGk6MIBvb8nGV2t3eL WIN5h6Fjj871Sm/r9seyCW3zF7A6ijFOIz+l7+qMbBAH09mRaVJ6iQ6Yfw9EjQx4ihUN xt/+6lHrulWMoQFwGjpxUHjUZfqDOnj38KityM/nBraxVQZjdKty06wjgVzBcuFK31fz P3ken7v59ID71IfLw8epm8yxd+66kFuAl8i8HXleuOFq2/EFrLHbLWWwkkM5Z+EtbPgg R4AA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=IK/9YhrI9qQcuYvnqtmxv3SKgmKt3KvtCMRtkmKuX7M=; b=hhnPPhnpCbAaHmvQ6jzMZMEpvvz6fAeiHyfWrChmn8J9azL0kLvl49O4ecEF4RCmg5 InWSTSVm1W8DUOLgD/L2bVjavZo34X0P9f+Wdz681pAG+WeCzVbdBFP8UuoK21IV3z9I 1oMANzDYiyD8YKZrJW/AyIgexLzl9yJeENc9B/p2O0WOpZ5gXRSsSVfwwgrpGsrlws4V NEcsgD7PsyhzgpaUw3qcGZJIpjliZjFTuKHZRjP7M0neqFbYFMdBcP3KUny+chFpVqvD eyz9QuKJb949uMLBumEZkvWBZEVeZnL/5M6EcF8eyBJPr2oOQIRLdSO22hOHZAmW9dqT MkEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WuwFt7qz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dk14si372230edb.280.2021.05.05.13.27.25; Wed, 05 May 2021 13:27:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WuwFt7qz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234655AbhEEQkR (ORCPT + 99 others); Wed, 5 May 2021 12:40:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:53474 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234261AbhEEQhq (ORCPT ); Wed, 5 May 2021 12:37:46 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C30BD6143E; Wed, 5 May 2021 16:33:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1620232412; bh=vgaLfULb+ZpcBqs/sfcsqHJT2jKL0I8vOFjfBTuoZig=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WuwFt7qzGaFkjJlMXLxygjdSEwNfhyJZ96Zk7LYlVq+7alaf68GsNRb6KCZpRFLmj ynKFGAfeQwdSKbaf5m7a0JrvOwuf6XZLm/S6YFPRpeKmXvIwdYSWhawrjniQQ+nIbf Hohuej/ISQdbrzaxOcQ0GmB+tRt11RL5uoJr9znhXHNeeeoprtp06dBKRO9MEl/NMD SGaR34pfzi0LBnHleIy2dqji4U07z2UPizaakHnE7qu+yn+RGXqfJ6vxWF6aDp7ddC AXaY7NaAKZAwPJCgjzblwP6K0elr3WAoGDsFFnhD9POVnJjjP0hztxWnc0RYS9agt6 LWZlUS1emltRg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: David Ward , Pierre-Louis Bossart , Mark Brown , Sasha Levin , alsa-devel@alsa-project.org Subject: [PATCH AUTOSEL 5.12 090/116] ASoC: rt286: Generalize support for ALC3263 codec Date: Wed, 5 May 2021 12:30:58 -0400 Message-Id: <20210505163125.3460440-90-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210505163125.3460440-1-sashal@kernel.org> References: <20210505163125.3460440-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: David Ward [ Upstream commit aa2f9c12821e6a4ba1df4fb34a3dbc6a2a1ee7fe ] The ALC3263 codec on the XPS 13 9343 is also found on the Latitude 13 7350 and Venue 11 Pro 7140. They require the same handling for the combo jack to work with a headset: GPIO pin 6 must be set. The HDA driver always sets this pin on the ALC3263, which it distinguishes by the codec vendor/device ID 0x10ec0288 and PCI subsystem vendor ID 0x1028 (Dell). The ASoC driver does not use PCI, so adapt this check to use DMI to determine if Dell is the system vendor. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=150601 BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=205961 Signed-off-by: David Ward Reviewed-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20210418134658.4333-6-david.ward@gatech.edu Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/codecs/rt286.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/sound/soc/codecs/rt286.c b/sound/soc/codecs/rt286.c index 8abe232ca4a4..2f18f5114f7e 100644 --- a/sound/soc/codecs/rt286.c +++ b/sound/soc/codecs/rt286.c @@ -1117,12 +1117,11 @@ static const struct dmi_system_id force_combo_jack_table[] = { { } }; -static const struct dmi_system_id dmi_dell_dino[] = { +static const struct dmi_system_id dmi_dell[] = { { - .ident = "Dell Dino", + .ident = "Dell", .matches = { DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), - DMI_MATCH(DMI_PRODUCT_NAME, "XPS 13 9343") } }, { } @@ -1133,7 +1132,7 @@ static int rt286_i2c_probe(struct i2c_client *i2c, { struct rt286_platform_data *pdata = dev_get_platdata(&i2c->dev); struct rt286_priv *rt286; - int i, ret, val; + int i, ret, vendor_id; rt286 = devm_kzalloc(&i2c->dev, sizeof(*rt286), GFP_KERNEL); @@ -1149,14 +1148,15 @@ static int rt286_i2c_probe(struct i2c_client *i2c, } ret = regmap_read(rt286->regmap, - RT286_GET_PARAM(AC_NODE_ROOT, AC_PAR_VENDOR_ID), &val); + RT286_GET_PARAM(AC_NODE_ROOT, AC_PAR_VENDOR_ID), &vendor_id); if (ret != 0) { dev_err(&i2c->dev, "I2C error %d\n", ret); return ret; } - if (val != RT286_VENDOR_ID && val != RT288_VENDOR_ID) { + if (vendor_id != RT286_VENDOR_ID && vendor_id != RT288_VENDOR_ID) { dev_err(&i2c->dev, - "Device with ID register %#x is not rt286\n", val); + "Device with ID register %#x is not rt286\n", + vendor_id); return -ENODEV; } @@ -1180,8 +1180,8 @@ static int rt286_i2c_probe(struct i2c_client *i2c, if (pdata) rt286->pdata = *pdata; - if (dmi_check_system(force_combo_jack_table) || - dmi_check_system(dmi_dell_dino)) + if ((vendor_id == RT288_VENDOR_ID && dmi_check_system(dmi_dell)) || + dmi_check_system(force_combo_jack_table)) rt286->pdata.cbj_en = true; regmap_write(rt286->regmap, RT286_SET_AUDIO_POWER, AC_PWRST_D3); @@ -1220,7 +1220,7 @@ static int rt286_i2c_probe(struct i2c_client *i2c, regmap_update_bits(rt286->regmap, RT286_DEPOP_CTRL3, 0xf777, 0x4737); regmap_update_bits(rt286->regmap, RT286_DEPOP_CTRL4, 0x00ff, 0x003f); - if (dmi_check_system(dmi_dell_dino)) { + if (vendor_id == RT288_VENDOR_ID && dmi_check_system(dmi_dell)) { regmap_update_bits(rt286->regmap, RT286_SET_GPIO_MASK, 0x40, 0x40); regmap_update_bits(rt286->regmap, -- 2.30.2