From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B70B6C76188 for ; Fri, 19 Jul 2019 11:19:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 87A802184E for ; Fri, 19 Jul 2019 11:19:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727962AbfGSLTk (ORCPT ); Fri, 19 Jul 2019 07:19:40 -0400 Received: from mga09.intel.com ([134.134.136.24]:9604 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726931AbfGSLTj (ORCPT ); Fri, 19 Jul 2019 07:19:39 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Jul 2019 04:19:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,282,1559545200"; d="scan'208";a="195918306" Received: from crojewsk-mobl1.ger.corp.intel.com (HELO [10.251.81.172]) ([10.251.81.172]) by fmsmga002.fm.intel.com with ESMTP; 19 Jul 2019 04:19:33 -0700 Subject: Re: [PATCH v6 2/6] ASoC: sgtl5000: Improve VAG power and mute control To: Oleksandr Suvorov Cc: Fabio Estevam , "linux-kernel@vger.kernel.org" , Igor Opaniuk , Marcel Ziswiler , "alsa-devel@alsa-project.org" , "stable@vger.kernel.org" , Jaroslav Kysela , Sasha Levin , Mark Brown , Takashi Iwai , Liam Girdwood References: <20190719100524.23300-1-oleksandr.suvorov@toradex.com> <20190719100524.23300-3-oleksandr.suvorov@toradex.com> From: Cezary Rojewski Message-ID: Date: Fri, 19 Jul 2019 13:19:31 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190719100524.23300-3-oleksandr.suvorov@toradex.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019-07-19 12:05, Oleksandr Suvorov wrote: > VAG power control is improved to fit the manual [1]. This patch fixes as > minimum one bug: if customer muxes Headphone to Line-In right after boot, > the VAG power remains off that leads to poor sound quality from line-in. > > I.e. after boot: > - Connect sound source to Line-In jack; > - Connect headphone to HP jack; > - Run following commands: > $ amixer set 'Headphone' 80% > $ amixer set 'Headphone Mux' LINE_IN > > Change VAG power on/off control according to the following algorithm: > - turn VAG power ON on the 1st incoming event. > - keep it ON if there is any active VAG consumer (ADC/DAC/HP/Line-In). > - turn VAG power OFF when there is the latest consumer's pre-down event > come. > - always delay after VAG power OFF to avoid pop. > - delay after VAG power ON if the initiative consumer is Line-In, this > prevents pop during line-in muxing. > > According to the data sheet [1], to avoid any pops/clicks, > the outputs should be muted during input/output > routing changes. > > [1] https://www.nxp.com/docs/en/data-sheet/SGTL5000.pdf > > Cc: stable@vger.kernel.org > Fixes: 9b34e6cc3bc2 ("ASoC: Add Freescale SGTL5000 codec support") > Signed-off-by: Oleksandr Suvorov > Reviewed-by: Marcel Ziswiler > Reviewed-by: Fabio Estevam > > --- > > Changes in v6: > - Code optimization You went crazy with that description (u16 mute_mask[]) :) Reviewed-by: Cezary Rojewski