From patchwork Sun Nov 1 13:32:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ondrej Zary X-Patchwork-Id: 7532101 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 36DC0BEEA4 for ; Sun, 1 Nov 2015 13:32:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5C4D1206AF for ; Sun, 1 Nov 2015 13:32:35 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 3AD8F206AA for ; Sun, 1 Nov 2015 13:32:33 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 9E7A12604E4; Sun, 1 Nov 2015 14:32:31 +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=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 4CA57260438; Sun, 1 Nov 2015 14:32: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 AC942260452; Sun, 1 Nov 2015 14:32:22 +0100 (CET) Received: from gsystem.sk (ns.gsystem.sk [62.176.172.50]) by alsa0.perex.cz (Postfix) with ESMTP id 8DEFC260435 for ; Sun, 1 Nov 2015 14:32:15 +0100 (CET) Received: from stip-static-68.213-81-217.telecom.sk ([213.81.217.68] helo=gsql.ggedos.sk) by gsystem.sk with esmtpsa (TLS1.1:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1Zssk1-0000di-JB; Sun, 01 Nov 2015 14:32:13 +0100 From: Ondrej Zary To: alsa-devel@alsa-project.org Date: Sun, 1 Nov 2015 14:32:03 +0100 Message-Id: <1446384723-29765-1-git-send-email-linux@rainbow-software.org> X-Mailer: git-send-email 1.7.10.4 Cc: Takashi Iwai , Kernel development list Subject: [alsa-devel] [PATCH] snd-maestro3: Enable docking support for Dell Latitude C810 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 Enable I2S docking for Dell Latitude C810. This allows the audio output on C/Port II to work (and probably also the audio inputs on C/Dock II). The volume can't be adjusted - none of the mixer controls currently supported affects the I2S output (they belong to the STAC9721/23 AC'97 codec responsible for the laptop internal connectors & speakers). Signed-off-by: Ondrej Zary --- sound/pci/maestro3.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/sound/pci/maestro3.c b/sound/pci/maestro3.c index 72e89ce..965d5c6 100644 --- a/sound/pci/maestro3.c +++ b/sound/pci/maestro3.c @@ -1932,12 +1932,19 @@ snd_m3_ac97_write(struct snd_ac97 *ac97, unsigned short reg, unsigned short val) } -static void snd_m3_remote_codec_config(int io, int isremote) +static void snd_m3_remote_codec_config(struct snd_m3 *chip, int isremote) { + int io = chip->iobase; + u16 tmp; + isremote = isremote ? 1 : 0; - outw((inw(io + RING_BUS_CTRL_B) & ~SECOND_CODEC_ID_MASK) | isremote, - io + RING_BUS_CTRL_B); + tmp = inw(io + RING_BUS_CTRL_B) & ~SECOND_CODEC_ID_MASK; + /* enable dock on Dell Latitude C810 */ + if (chip->pci->subsystem_vendor == 0x1028 && + chip->pci->subsystem_device == 0x00e5) + tmp |= M3I_DOCK_ENABLE; + outw(tmp | isremote, io + RING_BUS_CTRL_B); outw((inw(io + SDO_OUT_DEST_CTRL) & ~COMMAND_ADDR_OUT) | isremote, io + SDO_OUT_DEST_CTRL); outw((inw(io + SDO_IN_DEST_CTRL) & ~STATUS_ADDR_IN) | isremote, @@ -1989,7 +1996,7 @@ static void snd_m3_ac97_reset(struct snd_m3 *chip) if (!chip->irda_workaround) dir |= 0x10; /* assuming pci bus master? */ - snd_m3_remote_codec_config(io, 0); + snd_m3_remote_codec_config(chip, 0); outw(IO_SRAM_ENABLE, io + RING_BUS_CTRL_A); udelay(20);