From patchwork Fri May 23 13:58:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Henningsson X-Patchwork-Id: 4232841 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 AA7739F32B for ; Fri, 23 May 2014 13:58:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C91E420295 for ; Fri, 23 May 2014 13:58:50 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 49D8120272 for ; Fri, 23 May 2014 13:58:49 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 9AC1F26513A; Fri, 23 May 2014 15:58:47 +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,NO_DNS_FOR_FROM, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id A693E264FF6; Fri, 23 May 2014 15:58:36 +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 D3A65265099; Fri, 23 May 2014 15:58:35 +0200 (CEST) Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by alsa0.perex.cz (Postfix) with ESMTP id DD046264F28 for ; Fri, 23 May 2014 15:58:27 +0200 (CEST) Received: from hd9483857.selulk5.dyn.perspektivbredband.net ([217.72.56.87] helo=localhost.localdomain) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1WnpzO-0004eU-O7; Fri, 23 May 2014 13:58:26 +0000 From: David Henningsson To: tiwai@suse.de, alsa-devel@alsa-project.org Date: Fri, 23 May 2014 15:58:24 +0200 Message-Id: <1400853504-17405-1-git-send-email-david.henningsson@canonical.com> X-Mailer: git-send-email 1.9.1 Cc: David Henningsson Subject: [alsa-devel] [PATCH] hda-emu: Add new HDMI commands 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 Some new HDMI commands were added recently to the HDA driver. This patch makes hda-emu support these new commands (or at least, not output errors). Signed-off-by: David Henningsson --- hda-int.c | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ include/hda-types.h | 2 ++ 2 files changed, 55 insertions(+) diff --git a/hda-int.c b/hda-int.c index ef90fe8..6dd862d 100644 --- a/hda-int.c +++ b/hda-int.c @@ -823,6 +823,52 @@ static int get_cvt_channel_count(struct xhda_codec *codec, return node->cvt_channel_count; } +static int get_asp_channel_slot(struct xhda_codec *codec, + struct xhda_node *node, unsigned int cmd) +{ + return (node->asp_channel_slot[cmd & 0xf] << 4) + (cmd & 0xf); +} + +static int set_asp_channel_slot(struct xhda_codec *codec, + struct xhda_node *node, unsigned int cmd) +{ + node->asp_channel_slot[cmd & 0xf] = (cmd & 0xf0) >> 4; + return 0; +} + +static int set_dip_index(struct xhda_codec *codec, + struct xhda_node *node, unsigned int cmd) +{ + return 0; /* FIXME */ +} + +static int set_dip_data(struct xhda_codec *codec, + struct xhda_node *node, unsigned int cmd) +{ + return 0; /* FIXME */ +} + +static int get_dip_size(struct xhda_codec *codec, + struct xhda_node *node, unsigned int cmd) +{ + if (cmd & 0x8) + return 128; /* ELD buffer size */ + return 32; /* DIP buffer size */ +} + +static int set_dip_xmitctrl(struct xhda_codec *codec, + struct xhda_node *node, unsigned int cmd) +{ + node->dip_xmitctrl = cmd & 0xc0; + return 0; +} + +static int get_dip_xmitctrl(struct xhda_codec *codec, + struct xhda_node *node, unsigned int cmd) +{ + return node->dip_xmitctrl; +} + /* * parameters @@ -1063,6 +1109,10 @@ static struct xhda_verb_table verb_tbl[] = { { 0x71e, set_config_def_2, "set_config_def_2" }, { 0x71f, set_config_def_3, "set_config_def_3" }, { 0x72d, set_cvt_channel_count, "set_cvt_channel_count" }, + { 0x730, set_dip_index, "set_dip_index" }, + { 0x731, set_dip_data, "set_dip_data" }, + { 0x732, set_dip_xmitctrl, "set_dip_xmitctrl" }, + { 0x734, set_asp_channel_slot, "set_asp_channel_slot" }, { 0x7ff, set_codec_reset, "set_codec_reset" }, { 0xf00, get_parameters, "get_parameters" }, { 0xf01, get_connect_sel, "get_connect_sel" }, @@ -1087,6 +1137,9 @@ static struct xhda_verb_table verb_tbl[] = { { 0xf1c, get_config_default, "get_config_default" }, { 0xf20, get_ssid, "get_ssid" }, { 0xf2d, get_cvt_channel_count, "get_cvt_channel_count" }, + { 0xf2e, get_dip_size, "get_dip_size" }, + { 0xf32, get_dip_xmitctrl, "get_dip_xmitctrl" }, + { 0xf34, get_asp_channel_slot, "get_asp_channel_slot" }, {} }; diff --git a/include/hda-types.h b/include/hda-types.h index fe6b31f..46bfc67 100644 --- a/include/hda-types.h +++ b/include/hda-types.h @@ -58,6 +58,8 @@ struct xhda_node { unsigned char gpio_wake, gpio_unsol, gpio_sticky; unsigned int coef_idx; unsigned char cvt_channel_count; + unsigned char asp_channel_slot[16]; + unsigned char dip_xmitctrl; struct xhda_coef_table *coef_tbl; struct xhda_node *next; };