Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp364985pxj; Thu, 20 May 2021 11:04:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzBHuZtGRa3GRbnZ0MEf1ygdWngOv7PbWDJaZuerNOKdZR++Ilzs8bGiAH5o6EmeFmqpTLh X-Received: by 2002:a5d:8d87:: with SMTP id b7mr5946032ioj.46.1621533895609; Thu, 20 May 2021 11:04:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621533895; cv=none; d=google.com; s=arc-20160816; b=RUahGLf3z3F+kRiQJ4dxxKLNbPKRHZ+AwZlYc+TBG1Y90Gvg/GP1RdQE9xbFypcNpn 8d9LVqCW1iK+7NwSS0UxPmoC7ZjdR3BNr6LbWoYI8KrQeIJjGr+VpYa4EzfQk/aQeuH7 meF3SCso9xvQxXYaoCiz0PJofuoV+xN/0hmC0YuNZor/c+1fhvORl27qkBB7Q92Mgf+n dOV6ExVXTsmcY+rbrcmbeN7cDfQtCrpKF/FfjPvFlnMDFNjaL5roDKdJ+C49ht94WfjW NtnvtyO/+cyTo4f55u0RM3kDTJFrJisS+VlX86Zb3qdRjccoB9eXxQS3sv3ZG/4/AQ34 4m5Q== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=RhOhjk8sQQYYsYKkPrSXdDSIaieeOuDe/HEAnyWgyPo=; b=JE0ua+4jhys/Bd+qwZVoswb8ovxoBQw5i7HU7U3b/RNz5DIURZQqd2UEo95Y2d6JQW cQFkUactTjoziX0mczjlPEKM/DE9B2bi6KEA7fVX6RzHcbMb6TikOvMYgThTlNhnZ6iw RCSCRlqrNQWl0xAwwxIXVOdYCXMp6uvuCyMH1oCiO+wkQDRzHGJGDI5O6oI4sgBeM3kf sLXz8tONXWGPnDjGia20q/jDcaeE8APs7V77FJF+IYtfxGH8yk1kZXXRW6Lo4INI+N93 mkKcSMJ0gm76AH28BXv/jhA1Pjn5h2b9xRt1NHELcWKmFq3Vyild9z5pAYJkW/McWUbf ms6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=gsafLND2; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x20si2676096iov.56.2021.05.20.11.04.41; Thu, 20 May 2021 11:04:55 -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=@linuxfoundation.org header.s=korg header.b=gsafLND2; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235861AbhETKNA (ORCPT + 99 others); Thu, 20 May 2021 06:13:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:37258 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235586AbhETKFY (ORCPT ); Thu, 20 May 2021 06:05:24 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9E6116193D; Thu, 20 May 2021 09:41:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621503668; bh=mBI01HSj9/sLxrNE+2BUmR1I+zuGIOKTuT40t1ZuGuE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gsafLND243wIdudscDd0gDfkwPSw5K/fa1biml3ETxa3I0dXW5XHPXeFAJ/Kr3Gmv 5e1dPenmdE+3Ma4Kz8j4YZbFYIOBOwxDyZIwAxrTfyT+3rGKC4VTvowbpGJldEM1aO qMpeUWttyT83Uk9bgdettxQzwRQA+Hg3RD/Cdc3Q= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, David Ward , Pierre-Louis Bossart , Mark Brown , Sasha Levin Subject: [PATCH 4.19 324/425] ASoC: rt286: Generalize support for ALC3263 codec Date: Thu, 20 May 2021 11:21:33 +0200 Message-Id: <20210520092142.068362574@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092131.308959589@linuxfoundation.org> References: <20210520092131.308959589@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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 0b0f748bffbe..7e44ccae3bc8 100644 --- a/sound/soc/codecs/rt286.c +++ b/sound/soc/codecs/rt286.c @@ -1118,12 +1118,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") } }, { } @@ -1134,7 +1133,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); @@ -1150,14 +1149,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; } @@ -1181,8 +1181,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); @@ -1221,7 +1221,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