From patchwork Mon May 26 08:22:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hui Wang X-Patchwork-Id: 4240431 X-Patchwork-Delegate: tiwai@suse.de Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id EF6E89F1E7 for ; Mon, 26 May 2014 08:23:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F106C201CE for ; Mon, 26 May 2014 08:23:35 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 1C5152017E for ; Mon, 26 May 2014 08:23:34 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id AAD5A2650AE; Mon, 26 May 2014 10:23:32 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 325D22619F3; Mon, 26 May 2014 10:23: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 E15AF2619F3; Mon, 26 May 2014 10:23:22 +0200 (CEST) Received: from mail-pb0-f47.google.com (mail-pb0-f47.google.com [209.85.160.47]) by alsa0.perex.cz (Postfix) with ESMTP id 7E9E426087B for ; Mon, 26 May 2014 10:23:14 +0200 (CEST) Received: by mail-pb0-f47.google.com with SMTP id rp16so7324486pbb.6 for ; Mon, 26 May 2014 01:23:13 -0700 (PDT) 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; bh=m75VLiQ+eurtQ0/t7UCqZ1KLEItq/tqwm7Fw6z9nszw=; b=fINME0nASih1kVB9TGItJTJoqoxsD6k5Ld6ac034Guz5UVzKiilfxOA66TTGAhyJ9A 8Iz7b97/XaoKdZZMCblxTDmqzw944AyynF+K/zqrt66b+bMqMPXbNaRC/C569/bgA8/k +NS+WORl+WAC2kZTSPgvNJupkzv2Kn4zNzlk8YIYzPczVl8ffMXPyEparng5a1BOHljM OnChVdLt4JluwYa5XunovkBVml0053Wv3Px1NVESXYcRXBiZnxf5XdiJS02SVdVfVNQW pEtSbhldFQUBCpB0jy+VU/blxTlvyj8aphqEoECwYMpxYp5BXfmwTBSxYaXxQEnqOgf1 gxtg== X-Gm-Message-State: ALoCoQmYK5jjpJQXthTLlG2jo+Dhku3SWItO1i2Q2uwrqPKT7YtdlCewj4pzqgIUn7hpffvdb0jq X-Received: by 10.66.246.138 with SMTP id xw10mr25548138pac.142.1401092593014; Mon, 26 May 2014 01:23:13 -0700 (PDT) Received: from localhost.localdomain ([116.213.97.190]) by mx.google.com with ESMTPSA id ov4sm16964840pbc.46.2014.05.26.01.23.09 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 26 May 2014 01:23:11 -0700 (PDT) From: Hui Wang To: tiwai@suse.de, alsa-devel@alsa-project.org Date: Mon, 26 May 2014 16:22:40 +0800 Message-Id: <1401092564-14293-1-git-send-email-hui.wang@canonical.com> X-Mailer: git-send-email 1.8.1.2 Cc: hui.wang@canonical.com, david.henningsson@canonical.com Subject: [alsa-devel] [PATCH 1/5] ALSA: hda - Add fixup_forced flag 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 X-Virus-Scanned: ClamAV using ClamSMTP From: David Henningsson The "fixup_forced" flag will indicate whether a specific fixup (or nofixup) has been set by the user, to override the driver's default. This flag will help future patches. Signed-off-by: David Henningsson --- sound/pci/hda/hda_auto_parser.c | 9 ++++++--- sound/pci/hda/hda_codec.h | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/sound/pci/hda/hda_auto_parser.c b/sound/pci/hda/hda_auto_parser.c index 90d2fda..36961ab 100644 --- a/sound/pci/hda/hda_auto_parser.c +++ b/sound/pci/hda/hda_auto_parser.c @@ -852,15 +852,17 @@ void snd_hda_pick_fixup(struct hda_codec *codec, if (codec->modelname && !strcmp(codec->modelname, "nofixup")) { codec->fixup_list = NULL; codec->fixup_id = -1; + codec->fixup_forced = 1; return; } if (codec->modelname && models) { while (models->name) { if (!strcmp(codec->modelname, models->name)) { - id = models->id; - name = models->name; - break; + codec->fixup_id = models->id; + codec->fixup_name = models->name; + codec->fixup_forced = 1; + return; } models++; } @@ -889,6 +891,7 @@ void snd_hda_pick_fixup(struct hda_codec *codec, } } + codec->fixup_forced = 0; codec->fixup_id = id; if (id >= 0) { codec->fixup_list = fixlist; diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h index a423313..5825aa1 100644 --- a/sound/pci/hda/hda_codec.h +++ b/sound/pci/hda/hda_codec.h @@ -402,6 +402,7 @@ struct hda_codec { /* fix-up list */ int fixup_id; + unsigned int fixup_forced:1; /* fixup explicitly set by user */ const struct hda_fixup *fixup_list; const char *fixup_name;