From patchwork Wed Sep 2 06:11:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yang, Libin" X-Patchwork-Id: 7108581 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B5D4B9F380 for ; Wed, 2 Sep 2015 06:22:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D224C20616 for ; Wed, 2 Sep 2015 06:22:22 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id D475A204E0 for ; Wed, 2 Sep 2015 06:22:21 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id F30942619D7; Wed, 2 Sep 2015 08:22:19 +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=-2.6 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, RCVD_IN_DNSWL_LOW, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 15710264ED3; Wed, 2 Sep 2015 08:22:17 +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 90942264F10; Wed, 2 Sep 2015 08:22:16 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by alsa0.perex.cz (Postfix) with ESMTP id 381D62619D7 for ; Wed, 2 Sep 2015 08:22:08 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 01 Sep 2015 23:22:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,451,1437462000"; d="scan'208";a="796441674" Received: from younglee-grantley.sh.intel.com ([10.239.159.137]) by fmsmga002.fm.intel.com with ESMTP; 01 Sep 2015 23:22:05 -0700 From: libin.yang@intel.com To: alsa-devel@alsa-project.org, tiwai@suse.de, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, jani.nikula@linux.intel.com, ville.syrjala@linux.intel.com Date: Wed, 2 Sep 2015 14:11:38 +0800 Message-Id: <1441174301-144177-1-git-send-email-libin.yang@intel.com> X-Mailer: git-send-email 1.9.1 Cc: Libin Yang Subject: [alsa-devel] [PATCH v6 1/4] drm/i915: Add audio sync_audio_rate callback 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: Libin Yang Add the sync_audio_rate callback. With the callback, audio driver can trigger i915 driver to set the proper N/CTS or N/M based on different sample rates. Signed-off-by: Libin Yang Reviewed-by: Jani Nikula --- include/drm/i915_component.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/drm/i915_component.h b/include/drm/i915_component.h index c9a8b64..8ad6f1b 100644 --- a/include/drm/i915_component.h +++ b/include/drm/i915_component.h @@ -33,6 +33,13 @@ struct i915_audio_component { void (*put_power)(struct device *); void (*codec_wake_override)(struct device *, bool enable); int (*get_cdclk_freq)(struct device *); + /** + * @sync_audio_rate: set n/cts based on the sample rate + * + * Called from audio driver. After audio driver sets the + * sample rate, it will call this function to set n/cts + */ + int (*sync_audio_rate)(struct device *, int port, int rate); } *ops; };