From patchwork Mon Feb 19 12:18:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 128806 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp3436737ljc; Mon, 19 Feb 2018 04:18:38 -0800 (PST) X-Google-Smtp-Source: AH8x226HQT6eCXrIHERp/vxztISsetA3Kz3s0GiaCQAMDSU+IxVGBYoIzD5fcD6AjR/U4Ez4tNLT X-Received: by 10.28.15.131 with SMTP id 125mr11927025wmp.24.1519042718319; Mon, 19 Feb 2018 04:18:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519042718; cv=none; d=google.com; s=arc-20160816; b=ueMGnTV4pjZDF8c7li9tyfpMP4qd1SKYEf7xIHbH3kvsgOMJH68oAWWjuXFzDWGkvY u6Wsk5H/OXLW10e2TZ2jWH0blWVNVpsh+VSEOUU+eaL2V4KO73nyIsyU6wvjePbN3xZt Ne/ITS5Bg1xLL5jBZsLeaYyv+Q+kBcV0bUibiuHMlYNea5UzGGZhMKoVYxCS3DmFc5aY x4S8p9K3nwJgv4Kt+MEjNq6Gf3cIxlCoXdBS8rjBRiLbOew6jOZY1Erp3lcyMmdWF6QD 8eeuH/hcBpXy7Z1SHK2yIxsGaTYQUOAdmWft7yt8YJAjIbcDIXmD2cITO7FofufEhJQA +s+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:date:message-id:in-reply-to:to:from :dkim-signature:delivered-to:arc-authentication-results; bh=MjjAD2C9FbLCAxGQarnjqo5eA9pvpprIES8vgenNkxQ=; b=VCfB6+iUvpqqAlc94t3LOu+ZQk0qZd5JrLKHWVHJRTIr7gI+eyF7njhN900IHYLY6I QRq4mehXVXdtldJGyUGAHgR+1fhqBp0/UU6p/Q2xUc7RgV07dG0vT8jhyavH1P1y351l naeBTEyCDW2YJh/Iu8SeLqRW1LRrjqK/x3c5xRXsaOvXoLT2ArJI698vAMfoYbPVlsG9 CyJp1TrGe1MNYMpcZ668qoFzx9GLbHa9w2RvjfL45rLFCUf+6DRCnpXdA8D5qFOIAKcC N7JgN1wnx1EQGBZahHyboYsJSNWWEgMUV1kjMgY/0kKUJChGNsx1gN9Lf1I1naLEsV5Y B/Jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=KXTyGRo1; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id j21si13616332wmh.146.2018.02.19.04.18.37; Mon, 19 Feb 2018 04:18:38 -0800 (PST) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=KXTyGRo1; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 7A74A2673F0; Mon, 19 Feb 2018 13:18:25 +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 0C7522673F0; Mon, 19 Feb 2018 13:18:23 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, SPF_PASS, T_RP_MATCHES_RCVD autolearn=disabled version=3.4.0 Received: from heliosphere.sirena.org.uk (heliosphere.sirena.org.uk [172.104.155.198]) by alsa0.perex.cz (Postfix) with ESMTP id 5E32C2673D6 for ; Mon, 19 Feb 2018 13:18:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=/h2rFRcwc794Fq93ays/3YeDG63J/UUkw20E+vbLwf8=; b=KXTyGRo1NanI ymrEVKnq9IY/xUHboJyb2IScGnKRmyAt3ioiv+I2xS8raZYPuWp/Rfk2GgPlwXRzc+in7gjbFiaKv YtgWWAp78KIcThsJL9qluoHIeU14gCO4pH/689ptC9pmIG2epPne8yFkzESNx0iBiZ9qczosi++p6 O4BxE=; Received: from debutante.sirena.org.uk ([2001:470:1f1d:6b5::3] helo=debutante) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1enkOj-0003TL-RP; Mon, 19 Feb 2018 12:18:21 +0000 Received: from broonie by debutante with local (Exim 4.90_1) (envelope-from ) id 1enkOj-0002j9-Cl; Mon, 19 Feb 2018 12:18:21 +0000 From: Mark Brown To: Michal Oleszczyk In-Reply-To: Message-Id: Date: Mon, 19 Feb 2018 12:18:21 +0000 Cc: alsa-devel@alsa-project.org, Mark Brown Subject: [alsa-devel] Applied "ASoC: sgtl5000: add 5 band graphic equalizer" to the asoc tree 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 The patch ASoC: sgtl5000: add 5 band graphic equalizer has been applied to the asoc tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark >From 92a2742f9813ef65da19145a77e8067d6abbc822 Mon Sep 17 00:00:00 2001 From: Michal Oleszczyk Date: Mon, 19 Feb 2018 10:03:46 +0100 Subject: [PATCH] ASoC: sgtl5000: add 5 band graphic equalizer Enable 5-band graphic equalizer which allows manipulation of gain in range -11.75dB to 12dB for 5 specific sound bands: 115Hz, 330Hz, 990Hz, 3000Hz, 9900Hz. Signed-off-by: Michal Oleszczyk Signed-off-by: Mark Brown --- sound/soc/codecs/sgtl5000.c | 24 +++++++++++++++++++++--- sound/soc/codecs/sgtl5000.h | 7 +++++++ 2 files changed, 28 insertions(+), 3 deletions(-) -- 2.16.1 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c index 1724c4622052..7c1d65830c05 100644 --- a/sound/soc/codecs/sgtl5000.c +++ b/sound/soc/codecs/sgtl5000.c @@ -520,6 +520,9 @@ static const DECLARE_TLV_DB_RANGE(mic_gain_tlv, /* tlv for DAP channels, 0% - 100% - 200% */ static const DECLARE_TLV_DB_SCALE(dap_volume, 0, 1, 0); +/* tlv for bass bands, -11.75db to 12.0db, step .25db */ +static const DECLARE_TLV_DB_SCALE(bass_band, -1175, 25, 0); + /* tlv for hp volume, -51.5db to 12.0db, step .5db */ static const DECLARE_TLV_DB_SCALE(headphone_volume, -5150, 50, 0); @@ -585,6 +588,21 @@ static const struct snd_kcontrol_new sgtl5000_snd_controls[] = { SOC_SINGLE_EXT_TLV("AVC Threshold Volume", SGTL5000_DAP_AVC_THRESHOLD, 0, 96, 0, avc_get_threshold, avc_put_threshold, avc_threshold), + + SOC_SINGLE_TLV("BASS 0", SGTL5000_DAP_EQ_BASS_BAND0, + 0, 0x5F, 0, bass_band), + + SOC_SINGLE_TLV("BASS 1", SGTL5000_DAP_EQ_BASS_BAND1, + 0, 0x5F, 0, bass_band), + + SOC_SINGLE_TLV("BASS 2", SGTL5000_DAP_EQ_BASS_BAND2, + 0, 0x5F, 0, bass_band), + + SOC_SINGLE_TLV("BASS 3", SGTL5000_DAP_EQ_BASS_BAND3, + 0, 0x5F, 0, bass_band), + + SOC_SINGLE_TLV("BASS 4", SGTL5000_DAP_EQ_BASS_BAND4, + 0, 0x5F, 0, bass_band), }; /* mute the codec used by alsa core */ @@ -1303,11 +1321,11 @@ static int sgtl5000_probe(struct snd_soc_component *component) SGTL5000_BIAS_VOLT_MASK, sgtl5000->micbias_voltage << SGTL5000_BIAS_VOLT_SHIFT); /* - * disable DAP + * enable DAP Graphic EQ * TODO: - * Enable DAP in kcontrol and dapm. + * Add control for changing between PEQ/Tone Control/GEQ */ - snd_soc_component_write(component, SGTL5000_DAP_CTRL, 0); + snd_soc_component_write(component, SGTL5000_DAP_AUDIO_EQ, SGTL5000_DAP_SEL_GEQ); /* Unmute DAC after start */ snd_soc_component_update_bits(component, SGTL5000_CHIP_ADCDAC_CTRL, diff --git a/sound/soc/codecs/sgtl5000.h b/sound/soc/codecs/sgtl5000.h index 22f3442af982..28cf637155bb 100644 --- a/sound/soc/codecs/sgtl5000.h +++ b/sound/soc/codecs/sgtl5000.h @@ -399,4 +399,11 @@ #define SGTL5000_SYSCLK 0x00 #define SGTL5000_LRCLK 0x01 +/* + * SGTL5000_DAP_AUDIO_EQ + */ +#define SGTL5000_DAP_SEL_PEQ 1 +#define SGTL5000_DAP_SEL_TONE_CTRL 2 +#define SGTL5000_DAP_SEL_GEQ 3 + #endif