From patchwork Wed Sep 17 05:28:59 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anatol Pomozov X-Patchwork-Id: 4922761 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 88BAA9F32F for ; Wed, 17 Sep 2014 05:28:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 187492015D for ; Wed, 17 Sep 2014 05:30:13 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id DBDC920155 for ; Wed, 17 Sep 2014 05:30:11 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id DB1C1265341; Wed, 17 Sep 2014 07:30:10 +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, DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id C7D3F26529F; Wed, 17 Sep 2014 07:29:23 +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 9CD7E26522D; Wed, 17 Sep 2014 07:29:20 +0200 (CEST) Received: from mail-ie0-f202.google.com (mail-ie0-f202.google.com [209.85.223.202]) by alsa0.perex.cz (Postfix) with ESMTP id 76ECC26520E for ; Wed, 17 Sep 2014 07:29:12 +0200 (CEST) Received: by mail-ie0-f202.google.com with SMTP id rd18so178870iec.3 for ; Tue, 16 Sep 2014 22:29:11 -0700 (PDT) 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=MvNsWHjMMh7Wk2X2RVQqDiJxq0PxQPklh3VjQwopK4A=; b=PvjaYmbx8rqzv+MFOZ/x8ZmcZv2KIp/a+XLm+Vt37vu2dTCtoWJja0EHnevZAA8l5i N6hZaDfe+1yZWdJDaTNSubSsoKPfJX5reaWMhhr/cETl5zDWjcr8rfgFrflJNw0KIv2b VIEgdMnqkbsozOAnzrGarBfc2jcK6rflEm+39oqTcb4WD7q9JTuZu5tGc9ycEalMvEP6 Crl6cXFUcNI7Uqw8lAV0TA1kCWk2ZKnUvEHYSY9dJVXFzHPeztm+VCL/CiYsZ/awP+47 IFGRnm/QxtuIzmP16CkfB3HVcrQ+zasPimQNUZvmwE09Yk5XfYy60nwa19mrtIkgIRrC tXbw== X-Gm-Message-State: ALoCoQl3fFB6Vimpw6DYPK6tteTUYQpEMhaQ0AzFVyvnZT533rq3deGxFdYNB20uHkFECe6hmhKHXpFQ6o+7OXH/sTp3aMhFmBYPMXlzsUYZp2UiCL+FFxKH/SGvUkRNpavktP9ba/L8umjgbbjZJ7MeKsMCV2wa+ewef0iz1DiqSiHiw0EFG88= X-Received: by 10.182.45.162 with SMTP id o2mr23706212obm.20.1410931751775; Tue, 16 Sep 2014 22:29:11 -0700 (PDT) Received: from corpmail-nozzle1-1.hot.corp.google.com ([100.108.1.104]) by gmr-mx.google.com with ESMTPS id j25si801278yhb.0.2014.09.16.22.29.11 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Sep 2014 22:29:11 -0700 (PDT) Received: from anatol.mtv.corp.google.com ([172.22.64.197]) by corpmail-nozzle1-1.hot.corp.google.com with ESMTP id mvvyDw8T.1; Tue, 16 Sep 2014 22:29:11 -0700 Received: by anatol.mtv.corp.google.com (Postfix, from userid 67983) id 145A11003A8; Tue, 16 Sep 2014 22:29:11 -0700 (PDT) From: Anatol Pomozov To: broonie@kernel.org, lgirdwood@gmail.com Date: Tue, 16 Sep 2014 22:28:59 -0700 Message-Id: <1410931739-6088-2-git-send-email-anatol.pomozov@gmail.com> X-Mailer: git-send-email 2.1.0.rc2.206.gedb03e5 In-Reply-To: <1410931739-6088-1-git-send-email-anatol.pomozov@gmail.com> References: <1410931739-6088-1-git-send-email-anatol.pomozov@gmail.com> Cc: oder_chiou@realtek.com, alsa-devel@alsa-project.org, Anatol Pomozov Subject: [alsa-devel] [PATCH 2/2] ASoC: rt5677: Add sidetone controls 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 Signed-off-by: Anatol Pomozov --- sound/soc/codecs/rt5677.c | 7 +++++++ sound/soc/codecs/rt5677.h | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/sound/soc/codecs/rt5677.c b/sound/soc/codecs/rt5677.c index fbaceb6..86cdf82 100644 --- a/sound/soc/codecs/rt5677.c +++ b/sound/soc/codecs/rt5677.c @@ -542,6 +542,7 @@ static const DECLARE_TLV_DB_SCALE(dac_vol_tlv, -65625, 375, 0); static const DECLARE_TLV_DB_SCALE(in_vol_tlv, -3450, 150, 0); static const DECLARE_TLV_DB_SCALE(adc_vol_tlv, -17625, 375, 0); static const DECLARE_TLV_DB_SCALE(adc_bst_tlv, 0, 1200, 0); +static const DECLARE_TLV_DB_SCALE(st_vol_tlv, -4650, 150, 0); /* {0, +20, +24, +30, +35, +40, +44, +50, +52} dB */ static unsigned int bst_tlv[] = { @@ -578,6 +579,12 @@ static const struct snd_kcontrol_new rt5677_snd_controls[] = { SOC_SINGLE_TLV("IN1 Boost", RT5677_IN1, RT5677_BST_SFT1, 8, 0, bst_tlv), SOC_SINGLE_TLV("IN2 Boost", RT5677_IN1, RT5677_BST_SFT2, 8, 0, bst_tlv), + /* Sidetone Control */ + SOC_SINGLE("Sidetone Switch", RT5677_SIDETONE_CTRL, + RT5677_ST_EN_SFT, 1, 0), + SOC_SINGLE_TLV("Sidetone Volume", RT5677_SIDETONE_CTRL, + RT5677_ST_VOL_SFT, 31, 0, st_vol_tlv), + /* ADC Digital Volume Control */ SOC_DOUBLE("ADC1 Capture Switch", RT5677_STO1_ADC_DIG_VOL, RT5677_L_MUTE_SFT, RT5677_R_MUTE_SFT, 1, 1), diff --git a/sound/soc/codecs/rt5677.h b/sound/soc/codecs/rt5677.h index 222a4137..d4eb6d5 100644 --- a/sound/soc/codecs/rt5677.h +++ b/sound/soc/codecs/rt5677.h @@ -382,6 +382,10 @@ #define RT5677_ST_SEL_SFT 9 #define RT5677_ST_EN (0x1 << 6) #define RT5677_ST_EN_SFT 6 +#define RT5677_ST_GAIN (0x1 << 5) +#define RT5677_ST_GAIN_SFT 5 +#define RT5677_ST_VOL_MASK (0x1f << 0) +#define RT5677_ST_VOL_SFT 0 /* Analog DAC1/2/3 Source Control (0x15) */ #define RT5677_ANA_DAC3_SRC_SEL_MASK (0x3 << 4)