From patchwork Fri Feb 28 06:35:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dylan Reid X-Patchwork-Id: 3738901 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 5ED959F2ED for ; Fri, 28 Feb 2014 06:41:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 85C1920265 for ; Fri, 28 Feb 2014 06:41:36 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 34BE720148 for ; Fri, 28 Feb 2014 06:41:35 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 4B02A265A1E; Fri, 28 Feb 2014 07:41:34 +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 C4B512654BA; Fri, 28 Feb 2014 07:38:08 +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 3181A26524F; Fri, 28 Feb 2014 07:38:06 +0100 (CET) Received: from mail-qa0-f74.google.com (mail-qa0-f74.google.com [209.85.216.74]) by alsa0.perex.cz (Postfix) with ESMTP id 792F826509A for ; Fri, 28 Feb 2014 07:37:13 +0100 (CET) Received: by mail-qa0-f74.google.com with SMTP id cm18so34193qab.3 for ; Thu, 27 Feb 2014 22:37:12 -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=Y3BASbSFeKIXPimbrB6gdoe3xYuUrrMDvycAkMsvvHA=; b=hgedwjzFXD3H1pUqByVZF2rGs5G9FzJmCwsCA405cZ1f/7FvxOCQNZsVcch6dMI6/L Gv5jqBedFMuACtGqNPL2MsnTrq7e7gSPxSOjVkbqdILU9Y3SzptdQ0VZ3Vys1ugt758R Oyb+cb9hwctNu6dPzU/aX2+H2hdcG/LYCg/v5g6+6J6EtDZ9w84MMLcfbGguutQlJo9L E6nBED+s3EziXtlY39eZWbumolBGGfqhEEVnhXRnTuRH6ymvJJLAwPoRB2NW5uy5ND2f q27tANExlwXNUUsZmIxFczURv/Y1kA+t8t3hXd1LZ67cx/JE7eJ95sIEUQs1xxtQJPR4 EwMg== X-Gm-Message-State: ALoCoQlsD0oRTLRIA6AWQ9ZRZAjMc8FQWY+Gx/GOG84yHNFFYrOrRP1OysZ55Fx7gdgUnT+gOCvb7PVIpsV+I64kP2Qk2FJuRFCpI/TBUTo0saxjyS9WJYKU3oAAzoxqf9EBTm+5DEpUROa5f8NsKTDILWoHQx3AfeCa1gT3Rl79ViplFCxMiuHvwnZlf9dFHMNWrXH7ymUVNyQatqYD3LizJSoxm2QQDNE06T+h1S0SKpwjakRMzxk= X-Received: by 10.58.111.202 with SMTP id ik10mr504553veb.4.1393569432714; Thu, 27 Feb 2014 22:37:12 -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 u4si113622yhb.5.2014.02.27.22.37.12 for (version=TLSv1.1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 27 Feb 2014 22:37:12 -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 86DDB5A42C0; Thu, 27 Feb 2014 22:37:12 -0800 (PST) Received: by hojo20.mtv.corp.google.com (Postfix, from userid 123195) id 4563F1815C6; Thu, 27 Feb 2014 22:37:12 -0800 (PST) From: Dylan Reid To: alsa-devel@alsa-project.org Date: Thu, 27 Feb 2014 22:35:57 -0800 Message-Id: <1393569362-27285-15-git-send-email-dgreid@chromium.org> X-Mailer: git-send-email 1.8.1.3.605.g02339dd In-Reply-To: <1393569362-27285-1-git-send-email-dgreid@chromium.org> References: <1393569362-27285-1-git-send-email-dgreid@chromium.org> Cc: tiwai@suse.de, Dylan Reid , swarren@wwwdotorg.org Subject: [alsa-devel] [RFC 14/19] 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 da5c7d2..4fa4da1 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c @@ -435,8 +435,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) @@ -1305,6 +1310,7 @@ static int azx_create(struct snd_card *card, struct pci_dev *pci, check_msi(chip); chip->dev_index = dev; chip->disable_msi_reset_irq = disable_msi_reset_irq; + 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 f1fa6f4..6d32367 100644 --- a/sound/pci/hda/hda_priv.h +++ b/sound/pci/hda/hda_priv.h @@ -316,6 +316,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 azx_reg_ops *reg_ops;