Received: by 10.192.165.148 with SMTP id m20csp1531924imm; Thu, 3 May 2018 00:37:25 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrKde8avzw0btzhb6UWY0MFKrSgT6T2xJb62zkkdNk0H6nPMESeSxUAXzP3cp52CjKXaegk X-Received: by 2002:a65:488c:: with SMTP id n12-v6mr18514103pgs.155.1525333045908; Thu, 03 May 2018 00:37:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525333045; cv=none; d=google.com; s=arc-20160816; b=bJN50PmGOIXfsia1GLD0yLuIZ1V/yfwzw0CINFr0ICSBztdcBGePuGVQr5OHniZy8h djz8yNMVfdoRnpoowZuoZ4bS2v+QdohkhMcjoa4vKlKopMvDHVhQb7BisQqJl9SEl86e 1mBc6a3f6W80DNYa0c2HYQdxNVMgZUrF8vwAhBz7Lkbeu/62V/wQTrnfu6FzUK2v6CJT xaGdbFDb4pHqq5i3D46pOojC2axHD52X+QO+CbDlFjDg8aR4t/KJAuN9PFMdQyLmQ1Cr EO08OXpFoLr+2HYBVVpNQs91MUrZETo9erTQXeRbEMG1VUaOJ07VrmEUYIyLD6UILJLX QojQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:dkim-signature:arc-authentication-results; bh=FstPKeKMKRBMnOFnDk+YjXySFXGub3OelbOu2dZ83uk=; b=h2puSreaX2y4XutNen851Vj+U/d0VwVfL3DSHFrQi0Ym12Q3FGVxZNUlzVETVTmg6p xkIQcaLgBxS+Cvy5Uml73YVOcPuaL+7G9TR0P/XhskVlTzmLFpSmpsllEXeHyKr8PLpD LAkrKRLxSzmoSPLtiTINczGfrb1sQJOOdp+i70iSDTl3+95rs5ONFcSoFOg2qFejqjsM zdn77p02nDF5rH860hlywlsIFKFVywpDd0XI//JWVGEypQvW3AYcefo9prgo7R7KwPKy ELlsc4EZt6ufWbaZ9KEzxwLJ0WbDHHAw8nFqz75n4X85kdPKpJhCXLKd6+Xcn3xTqmRh i6dg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=SCnExLDY; 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=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n1-v6si4645650pga.543.2018.05.03.00.37.11; Thu, 03 May 2018 00:37:25 -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; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=SCnExLDY; 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=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751073AbeECHg7 (ORCPT + 99 others); Thu, 3 May 2018 03:36:59 -0400 Received: from lelnx194.ext.ti.com ([198.47.27.80]:51789 "EHLO lelnx194.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750781AbeECHg6 (ORCPT ); Thu, 3 May 2018 03:36:58 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by lelnx194.ext.ti.com (8.15.1/8.15.1) with ESMTP id w437agCx019781; Thu, 3 May 2018 02:36:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1525333002; bh=FstPKeKMKRBMnOFnDk+YjXySFXGub3OelbOu2dZ83uk=; h=From:To:CC:Subject:Date; b=SCnExLDYivwgpkXewjNJsWdaDUDr8j36tf6cTj0dQFdx7z069X9xOscD8yn8pAtgp jJ0Xxmo3eFgcsJuvgaeYpUixHkj1gBLOXnOkgszNucVGWqCta/bxYZcWNFDf69n5lv rSjDHr4+zXgs6VFeN8PyhscTDyc+tZaB2UTbpxm0= Received: from DFLE103.ent.ti.com (dfle103.ent.ti.com [10.64.6.24]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id w437agCv018195; Thu, 3 May 2018 02:36:42 -0500 Received: from DFLE103.ent.ti.com (10.64.6.24) by DFLE103.ent.ti.com (10.64.6.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Thu, 3 May 2018 02:36:42 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE103.ent.ti.com (10.64.6.24) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Thu, 3 May 2018 02:36:42 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w437afJI012819; Thu, 3 May 2018 02:36:42 -0500 From: Jean-Jacques Hiblot To: , , , , CC: , , , , , Jean-Jacques Hiblot Subject: [PATCH v4] ASoC: tas6424: Allow disabling auto diagnostics for faster power-on Date: Thu, 3 May 2018 09:36:27 +0200 Message-ID: <1525332987-5266-1-git-send-email-jjhiblot@ti.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The TAS6424 incorporates both DC-load and AC-load diagnostics which are used to determine the status of the load. The DC diagnostics runs when any channel is directed to leave the Hi-Z state and enter the MUTE or PLAY state. The DC diagnostics are turned on by default but, if a fast startup without diagnostics is required, the diagnostics can be disabled using a dedicated ALSA control. Signed-off-by: Jean-Jacques Hiblot --- changes in v4: - rename the control "Auto Diagnostics Swicth" with a capital S on the Switch sound/soc/codecs/tas6424.c | 13 +++++++++++-- sound/soc/codecs/tas6424.h | 4 ++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/tas6424.c b/sound/soc/codecs/tas6424.c index 89fd0c1..14999b9 100644 --- a/sound/soc/codecs/tas6424.c +++ b/sound/soc/codecs/tas6424.c @@ -64,6 +64,8 @@ static const struct snd_kcontrol_new tas6424_snd_controls[] = { TAS6424_CH3_VOL_CTRL, 0, 0xff, 0, dac_tlv), SOC_SINGLE_TLV("Speaker Driver CH4 Playback Volume", TAS6424_CH4_VOL_CTRL, 0, 0xff, 0, dac_tlv), + SOC_SINGLE_STROBE("Auto Diagnostics Switch", TAS6424_DC_DIAG_CTRL1, + TAS6424_LDGBYPASS_SHIFT, 1), }; static int tas6424_dac_event(struct snd_soc_dapm_widget *w, @@ -297,6 +299,11 @@ static int tas6424_power_on(struct snd_soc_component *component) struct tas6424_data *tas6424 = snd_soc_component_get_drvdata(component); int ret; u8 chan_states; + int no_auto_diags = 0; + unsigned int reg_val; + + if (!regmap_read(tas6424->regmap, TAS6424_DC_DIAG_CTRL1, ®_val)) + no_auto_diags = reg_val & TAS6424_LDGBYPASS_MASK; ret = regulator_bulk_enable(ARRAY_SIZE(tas6424->supplies), tas6424->supplies); @@ -327,9 +334,11 @@ static int tas6424_power_on(struct snd_soc_component *component) snd_soc_component_write(component, TAS6424_CH_STATE_CTRL, chan_states); /* any time we come out of HIZ, the output channels automatically run DC - * load diagnostics, wait here until this completes + * load diagnostics if autodiagnotics are enabled. wait here until this + * completes. */ - msleep(230); + if (!no_auto_diags) + msleep(230); return 0; } diff --git a/sound/soc/codecs/tas6424.h b/sound/soc/codecs/tas6424.h index 4305883..b5958c4 100644 --- a/sound/soc/codecs/tas6424.h +++ b/sound/soc/codecs/tas6424.h @@ -111,6 +111,10 @@ TAS6424_CH3_STATE_DIAG | \ TAS6424_CH4_STATE_DIAG) +/* TAS6424_DC_DIAG_CTRL1 */ +#define TAS6424_LDGBYPASS_SHIFT 0 +#define TAS6424_LDGBYPASS_MASK BIT(TAS6424_LDGBYPASS_SHIFT) + /* TAS6424_GLOB_FAULT1_REG */ #define TAS6424_FAULT_CLOCK BIT(4) #define TAS6424_FAULT_PVDD_OV BIT(3) -- 2.7.4