From owner-svn-src-head@FreeBSD.ORG Tue Nov 4 23:10:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BC194890; Tue, 4 Nov 2014 23:10:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9E71FE99; Tue, 4 Nov 2014 23:10:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA4NAx6V067642; Tue, 4 Nov 2014 23:10:59 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA4NAxob067641; Tue, 4 Nov 2014 23:10:59 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201411042310.sA4NAxob067641@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 4 Nov 2014 23:10:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274105 - head/sys/dev/sound/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2014 23:10:59 -0000 Author: bapt Date: Tue Nov 4 23:10:58 2014 New Revision: 274105 URL: https://svnweb.freebsd.org/changeset/base/274105 Log: Partially fix indentation issues to improve readability helping cooperation with Dragonfly folks PR: 194785 Submitted by: François Tigeot (ftigeot@wolfpond.org) Modified: head/sys/dev/sound/pci/spicds.c Modified: head/sys/dev/sound/pci/spicds.c ============================================================================== --- head/sys/dev/sound/pci/spicds.c Tue Nov 4 23:03:59 2014 (r274104) +++ head/sys/dev/sound/pci/spicds.c Tue Nov 4 23:10:58 2014 (r274105) @@ -210,37 +210,40 @@ spicds_init(struct spicds_info *codec) snd_mtxlock(codec->lock); if (codec->type == SPICDS_TYPE_AK4524 ||\ codec->type == SPICDS_TYPE_AK4528) { - /* power off */ - spicds_wrcd(codec, AK4524_POWER, 0); - /* set parameter */ - spicds_wrcd(codec, AK4524_FORMAT, codec->format); - spicds_wrcd(codec, AK4524_DVC, codec->dvc); - /* power on */ - spicds_wrcd(codec, AK4524_POWER, AK452X_POWER_PWDA | AK452X_POWER_PWAD | AK452X_POWER_PWVR); - /* free reset register */ - spicds_wrcd(codec, AK4524_RESET, AK452X_RESET_RSDA | AK452X_RESET_RSAD); + /* power off */ + spicds_wrcd(codec, AK4524_POWER, 0); + /* set parameter */ + spicds_wrcd(codec, AK4524_FORMAT, codec->format); + spicds_wrcd(codec, AK4524_DVC, codec->dvc); + /* power on */ + spicds_wrcd(codec, AK4524_POWER, + AK452X_POWER_PWDA | AK452X_POWER_PWAD | AK452X_POWER_PWVR); + /* free reset register */ + spicds_wrcd(codec, AK4524_RESET, + AK452X_RESET_RSDA | AK452X_RESET_RSAD); } if (codec->type == SPICDS_TYPE_WM8770) { - /* WM8770 init values are taken from ALSA */ - /* These come first to reduce init pop noise */ - spicds_wrcd(codec, 0x1b, 0x044); /* ADC Mux (AC'97 source) */ - spicds_wrcd(codec, 0x1c, 0x00B); /* Out Mux1 (VOUT1 = DAC+AUX, VOUT2 = DAC) */ - spicds_wrcd(codec, 0x1d, 0x009); /* Out Mux2 (VOUT2 = DAC, VOUT3 = DAC) */ - - spicds_wrcd(codec, 0x18, 0x000); /* All power-up */ + /* WM8770 init values are taken from ALSA */ - spicds_wrcd(codec, 0x16, 0x122); /* I2S, normal polarity, 24bit */ - spicds_wrcd(codec, 0x17, 0x022); /* 256fs, slave mode */ + /* These come first to reduce init pop noise */ + spicds_wrcd(codec, 0x1b, 0x044); /* ADC Mux (AC'97 source) */ + spicds_wrcd(codec, 0x1c, 0x00B); /* Out Mux1 (VOUT1 = DAC+AUX, VOUT2 = DAC) */ + spicds_wrcd(codec, 0x1d, 0x009); /* Out Mux2 (VOUT2 = DAC, VOUT3 = DAC) */ - spicds_wrcd(codec, 0x19, 0x000); /* -12dB ADC/L */ - spicds_wrcd(codec, 0x1a, 0x000); /* -12dB ADC/R */ + spicds_wrcd(codec, 0x18, 0x000); /* All power-up */ + + spicds_wrcd(codec, 0x16, 0x122); /* I2S, normal polarity, 24bit */ + spicds_wrcd(codec, 0x17, 0x022); /* 256fs, slave mode */ + + spicds_wrcd(codec, 0x19, 0x000); /* -12dB ADC/L */ + spicds_wrcd(codec, 0x1a, 0x000); /* -12dB ADC/R */ } - if (codec->type == SPICDS_TYPE_AK4358) - spicds_wrcd(codec, 0x00, 0x07); /* I2S, 24bit, power-up */ + if (codec->type == SPICDS_TYPE_AK4358) + spicds_wrcd(codec, 0x00, 0x07); /* I2S, 24bit, power-up */ if (codec->type == SPICDS_TYPE_AK4381) - spicds_wrcd(codec, 0x00, 0x8f); /* I2S, 24bit, power-up */ + spicds_wrcd(codec, 0x00, 0x8f); /* I2S, 24bit, power-up */ if (codec->type == SPICDS_TYPE_AK4396) - spicds_wrcd(codec, 0x00, 0x07); /* I2S, 24bit, power-up */ + spicds_wrcd(codec, 0x00, 0x07); /* I2S, 24bit, power-up */ snd_mtxunlock(codec->lock); } @@ -249,18 +252,18 @@ spicds_reinit(struct spicds_info *codec) { snd_mtxlock(codec->lock); if (codec->type != SPICDS_TYPE_WM8770) { - /* reset */ - spicds_wrcd(codec, AK4524_RESET, 0); - /* set parameter */ - spicds_wrcd(codec, AK4524_FORMAT, codec->format); - spicds_wrcd(codec, AK4524_DVC, codec->dvc); - /* free reset register */ - spicds_wrcd(codec, AK4524_RESET, AK452X_RESET_RSDA | AK452X_RESET_RSAD); - } - else { - /* WM8770 reinit */ - /* AK4358 reinit */ - /* AK4381 reinit */ + /* reset */ + spicds_wrcd(codec, AK4524_RESET, 0); + /* set parameter */ + spicds_wrcd(codec, AK4524_FORMAT, codec->format); + spicds_wrcd(codec, AK4524_DVC, codec->dvc); + /* free reset register */ + spicds_wrcd(codec, AK4524_RESET, + AK452X_RESET_RSDA | AK452X_RESET_RSAD); + } else { + /* WM8770 reinit */ + /* AK4358 reinit */ + /* AK4381 reinit */ } snd_mtxunlock(codec->lock); } @@ -301,11 +304,11 @@ spicds_set(struct spicds_info *codec, in case SPICDS_TYPE_WM8770: right = right + 27; break; - case SPICDS_TYPE_AK4381: + case SPICDS_TYPE_AK4381: case SPICDS_TYPE_AK4396: right = right * 255 / 100; break; - default: + default: right = right * 127 / 100; } if (dir == PCMDIR_REC && codec->type == SPICDS_TYPE_AK4524) {