Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3503779ybi; Fri, 19 Jul 2019 04:22:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqzbykDn0zxvjIrbJWGr3lkTTQfRbSJxdcu2OzsEmWcC2mMfBiu8NfBrvYGGTS+sHhfFUugT X-Received: by 2002:a63:b64:: with SMTP id a36mr43331790pgl.215.1563535342954; Fri, 19 Jul 2019 04:22:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563535342; cv=none; d=google.com; s=arc-20160816; b=K6oVM6H4Lg1Hih5NVS2ab3YJ2M6ZNWKteRt5ka/OCHFY/oo0Dx8TAPpK5JNvflEuIV GMkTrzQALCpPIB8QuktcColQ6KDRL7Zpr1xSGJVVLXC93kseG7U5rVzdT47cE+PuAuLa MAf32tCEqG0OhOJbnZMWT6dcmlDmZKzLa6xLm01RM0wWMoaSfoe+6mqxEVRvLnQgkQqK 8pto011bMXRJzcmBBnnidN2/z4eQNL1ruD6HLztHc1Km84GrYhbPYsv0qlVhCDa0WnVN iaplrNYDD7h+SXPguEfinTf0bnHPIsqNAQSxvTT1IIB62NyOBL5jW4uekK+r3du9v0ta cdHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=GRV/DcDuQZltqmlEfZ6XbQj/FGirb+UQUw5Y3APnJE8=; b=im++9FOR3khkycVUCmLP91x7k8ie29OXpafTBDDjtge+4L6AebtA9hObM/Juh6zffS QrDs+w1pI1E737ltBsSoKhwY78vUScDo7pEhzf7DeCYqXFHbwb9RUL505CfihRnW0okP /ie8elYcLqo0rqxrx1JdjdjUfNUVJFZEqEhe6TUNTitMMgD18rqDhGpcdYEiGyVXbYIh Rr2vAs/vIwnWcHIpteVkntCfjY2FPTVs1iIsmGdz85b9pWIJ+4JWuu65aux6w81dBrfg i/NnOvOFf4qFsy+gWggk1hudmR468ifvtnSCvibQqIvYdiMUhnWzBNZ22HJney0yW0/I Y0cA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 32si2522301pla.181.2019.07.19.04.22.06; Fri, 19 Jul 2019 04:22:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727953AbfGSLTk (ORCPT + 99 others); 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