From patchwork Fri Feb 28 23:41:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dylan Reid X-Patchwork-Id: 3745491 X-Patchwork-Delegate: tiwai@suse.de Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id EB510BF13A for ; Fri, 28 Feb 2014 23:51:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2DDF2201BB for ; Fri, 28 Feb 2014 23:51:08 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id F355F2012E for ; Fri, 28 Feb 2014 23:51:06 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id F247C266068; Sat, 1 Mar 2014 00:51:05 +0100 (CET) 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 06E60265ABD; Sat, 1 Mar 2014 00:43:24 +0100 (CET) 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 5AEDE2659C9; Sat, 1 Mar 2014 00:43:20 +0100 (CET) Received: from mail-pa0-f74.google.com (mail-pa0-f74.google.com [209.85.220.74]) by alsa0.perex.cz (Postfix) with ESMTP id B7EBF2659CD for ; Sat, 1 Mar 2014 00:42:52 +0100 (CET) Received: by mail-pa0-f74.google.com with SMTP id fa1so173140pad.5 for ; Fri, 28 Feb 2014 15:42:51 -0800 (PST) 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=YJ77rAOEaHr2OttkL8tWBOhO1yrghDT7PZL9M3jlXfk=; b=gd24vr1aZoA9w5X2dqD+Wk6Tkl5/EZDpkTyUYfj7Njq4RN6hK294m1lfTQYrjrgF4A SCL6G9XQ74DQ/1l1sB+jFBFY52AZZvLANDNHfICAw/gpH6SzOywvJpRWaHD+SOLmSTBm vAYW5pn8GiEC0gpPrmlY8hkDYj7oZB5oGkkhhRd5RMSX8ETck5J8tlV3B75XClOEYoxQ Hc92McDHmvzXNaCzBlC0xR0ww+4ePYvWCqQqukFfkkEdrBSj7730jJREnBSDWd1nv2S+ nJJLu/MYFZ0WVX2VrbdubG/JsyyPp9FJl+7j7zeJJIAFLzGkmun+2bZvtukg68Y0OhVd /rbA== X-Gm-Message-State: ALoCoQm+23Wts/IYZ4mlfky7TWOnD7tcWvG8psqHXq0ftY0VoBujTErAUzf3Ay7xG+5tOIj44d564D6u2bJ2/ADac0pvxTDvGOqN1jVtsCoBvTcvJlIuHM3V2f5FRXMh7Huw3NPt4vtLrT80h0Q7oPb7e1HOItnNBsO9msNjWF4mD7qh/hQb/uJ0xddLqu2pH1wpi+KEIQIt7UkZpJWNYP8rdmYG1HEI2zgd1pxQp1W/uBoGeEp6TDQ= X-Received: by 10.67.2.101 with SMTP id bn5mr2431639pad.29.1393630971259; Fri, 28 Feb 2014 15:42:51 -0800 (PST) Received: from corp2gmr1-2.hot.corp.google.com (corp2gmr1-2.hot.corp.google.com [172.24.189.93]) by gmr-mx.google.com with ESMTPS id u63si542909yhm.6.2014.02.28.15.42.51 for (version=TLSv1.1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 28 Feb 2014 15:42:51 -0800 (PST) Received: from hojo20.mtv.corp.google.com (hojo20.mtv.corp.google.com [172.22.72.28]) by corp2gmr1-2.hot.corp.google.com (Postfix) with ESMTP id 15E3D5A425E; Fri, 28 Feb 2014 15:42:51 -0800 (PST) Received: by hojo20.mtv.corp.google.com (Postfix, from userid 123195) id C3017181DD6; Fri, 28 Feb 2014 15:42:50 -0800 (PST) From: Dylan Reid To: alsa-devel@alsa-project.org Date: Fri, 28 Feb 2014 15:41:18 -0800 Message-Id: <1393630893-29010-8-git-send-email-dgreid@chromium.org> X-Mailer: git-send-email 1.8.1.3.605.g02339dd In-Reply-To: <1393630893-29010-1-git-send-email-dgreid@chromium.org> References: <1393630893-29010-1-git-send-email-dgreid@chromium.org> Cc: tiwai@suse.de, Dylan Reid , swarren@wwwdotorg.org Subject: [alsa-devel] [RFCv2 07/22] ALSA: hda - Add jackpoll_ms to struct azx 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 Keeping a pointer to the jackpoll_ms array in the chip will allow azx_codec_create to be shared between hda_intel and hda_platform drivers. Also modify get_jackpoll_ms to make the jackpoll_ms member optional, this way a platform driver can leave it out if it's not needed. Signed-off-by: Dylan Reid --- sound/pci/hda/hda_intel.c | 8 +++++++- sound/pci/hda/hda_priv.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index 7cdb4dd..1e7d3f3 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -1324,8 +1324,13 @@ static void azx_bus_reset(struct hda_bus *bus) static int get_jackpoll_interval(struct azx *chip) { - int i = jackpoll_ms[chip->dev_index]; + int i; unsigned int j; + + if (!chip->jackpoll_ms) + return 0; + + i = chip->jackpoll_ms[chip->dev_index]; if (i == 0) return 0; if (i < 50 || i > 60000) @@ -3172,6 +3177,7 @@ static int azx_create(struct snd_card *card, struct pci_dev *pci, chip->driver_type = driver_caps & 0xff; check_msi(chip); chip->dev_index = dev; + chip->jackpoll_ms = jackpoll_ms; INIT_WORK(&chip->irq_pending_work, azx_irq_pending_work); INIT_LIST_HEAD(&chip->pcm_list); INIT_LIST_HEAD(&chip->list); diff --git a/sound/pci/hda/hda_priv.h b/sound/pci/hda/hda_priv.h index c231c11..0a56e8e 100644 --- a/sound/pci/hda/hda_priv.h +++ b/sound/pci/hda/hda_priv.h @@ -321,6 +321,7 @@ struct azx { int capture_streams; int capture_index_offset; int num_streams; + const int *jackpoll_ms; /* per-card jack poll interval */ /* Register interaction. */ const struct hda_controller_ops *ops;