Received: by 10.192.165.148 with SMTP id m20csp65952imm; Fri, 20 Apr 2018 03:08:01 -0700 (PDT) X-Google-Smtp-Source: AIpwx48ZCvOKrpKwFmt04LuZMe0iDdX22V+80qvsr2V6yCUyxUImrLpCChoiXtFvsvVRSvrLbP2M X-Received: by 2002:a17:902:d685:: with SMTP id v5-v6mr9487161ply.284.1524218881622; Fri, 20 Apr 2018 03:08:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524218881; cv=none; d=google.com; s=arc-20160816; b=WNzLjq3feAjmgUM4QEp9NLLDMxA6xfiYNqkHnQbq4ibcHQYSBQkDbqZPQmD2Mg65lc RVykZ8s4+6jQn4twy9LcqJWf3I36mSN/VYQoNb920+ebNi8CX579Pocm7EoU7zxIxqHN C6HL75qFug0qTgUY1QRrYjl2bGOdOkJ8SC20gPsm2WC8YeYuSVJfZonKhyUyLjQ7VS4P NIUM8bwlZQCH+b+cvBLWsz4pYtuR9tcZhKOASWDJ12V7qXfSHpjMvFFNwygXt6WvN5cQ KHGEmhha0rzbAF6Bja8eb4QRBjwzvwLR+ET4aXmLwPTf79g6hd8SfInUgxGiTKH1VlHK Eg/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=5ARK6c9ToyOMaC/E2PtC5Q9McXrcAl/X/7U9fhj85to=; b=XyU2MxMZWaU4jOY5WmqL7afVpwWrjJraaSNdrU8YtiTmH0zXq8fLrBHpkCDK8SLT1W bPzZ//kv4URjaI6JAFT2xmaaJR/6NRFRk2tIJhNvqFCvQrdMgCEmJ3Nmw4prBN0zwZRQ M+XT/uFf5RqfGp+ORAUEuLyH0fq334YOYcMLEjds746B6r966DJnHe9dlqMLgbf1cZTQ O7lH/nxg1yADKJlPqeHhHvrkf6DFpIwSX8HxjkAn9NdyPp3nEGEZd8S5kKCxOb44zIRM IeW0+/7iuaUPMtyBZievu6vPd2YheG3DgEdBdCvzQIRhh3rRlpVkpiehEA0lwGQzHbK7 TExw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=NgW1UKwR; 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 t25si4379262pge.26.2018.04.20.03.07.46; Fri, 20 Apr 2018 03:08:01 -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=NgW1UKwR; 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 S1754436AbeDTKFI (ORCPT + 99 others); Fri, 20 Apr 2018 06:05:08 -0400 Received: from lelnx193.ext.ti.com ([198.47.27.77]:28929 "EHLO lelnx193.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754273AbeDTKFG (ORCPT ); Fri, 20 Apr 2018 06:05:06 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by lelnx193.ext.ti.com (8.15.1/8.15.1) with ESMTP id w3KA4nvB025196; Fri, 20 Apr 2018 05:04:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1524218689; bh=buahoNgCRXgmtSEt+TddpefSlgr/fA3HkqjYaFVTBa4=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=NgW1UKwRb+PpaeX0FPWGr7WdddHipPqrWIVL/8gQvbkJeHowCJZvaQw8kQTB3r4Kj j4ApHQi0ZejFuOqCDK4b6tfIJNjkGAxEldjWuGV/yLINUaBuhtOWfjclancdatSmvk dtgIOZffDtGJJEXoZuT5VMBx3fPHTRD4QiIWVw6s= Received: from DLEE103.ent.ti.com (dlee103.ent.ti.com [157.170.170.33]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id w3KA4nSs007897; Fri, 20 Apr 2018 05:04:49 -0500 Received: from DLEE102.ent.ti.com (157.170.170.32) by DLEE103.ent.ti.com (157.170.170.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Fri, 20 Apr 2018 05:04:48 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE102.ent.ti.com (157.170.170.32) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Fri, 20 Apr 2018 05:04:48 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id w3KA4moH031435; Fri, 20 Apr 2018 05:04:48 -0500 From: Jean-Jacques Hiblot To: , , , , CC: , , , , , Jean-Jacques Hiblot Subject: [PATCH 1/3] ASoC: tas6424: Allow disabling auto diagnostics for faster power-on Date: Fri, 20 Apr 2018 12:04:42 +0200 Message-ID: <1524218684-19752-2-git-send-email-jjhiblot@ti.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1524218684-19752-1-git-send-email-jjhiblot@ti.com> References: <1524218684-19752-1-git-send-email-jjhiblot@ti.com> 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 DC diagnostics can be bypassed by adding the property "disable-auto-diagnostics". Signed-off-by: Jean-Jacques Hiblot --- .../devicetree/bindings/sound/ti,tas6424.txt | 2 ++ sound/soc/codecs/tas6424.c | 22 +++++++++++++++++++++- sound/soc/codecs/tas6424.h | 3 +++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/sound/ti,tas6424.txt b/Documentation/devicetree/bindings/sound/ti,tas6424.txt index 1c4ada0..bf2ff98 100644 --- a/Documentation/devicetree/bindings/sound/ti,tas6424.txt +++ b/Documentation/devicetree/bindings/sound/ti,tas6424.txt @@ -6,6 +6,8 @@ Required properties: - compatible: "ti,tas6424" - TAS6424 - reg: I2C slave address - sound-dai-cells: must be equal to 0 + - disable-auto-diagnostics: disable DC auto diagnostics (faster power + on, but less safe as shortage won't be detected) Example: diff --git a/sound/soc/codecs/tas6424.c b/sound/soc/codecs/tas6424.c index 4f3a16c..5cee400 100644 --- a/sound/soc/codecs/tas6424.c +++ b/sound/soc/codecs/tas6424.c @@ -43,6 +43,7 @@ struct tas6424_data { unsigned int last_fault1; unsigned int last_fault2; unsigned int last_warn; + bool no_auto_diags; }; /* @@ -308,7 +309,8 @@ static int tas6424_power_on(struct snd_soc_component *component) /* any time we come out of HIZ, the output channels automatically run DC * load diagnostics, wait here until this completes */ - msleep(230); + if (!tas6424->no_auto_diags) + msleep(230); return 0; } @@ -627,6 +629,9 @@ static int tas6424_i2c_probe(struct i2c_client *client, return ret; } + tas6424->no_auto_diags = of_property_read_bool(dev->of_node, + "disable-auto-diagnostics"); + for (i = 0; i < ARRAY_SIZE(tas6424->supplies); i++) tas6424->supplies[i].supply = tas6424_supply_names[i]; ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(tas6424->supplies), @@ -651,6 +656,21 @@ static int tas6424_i2c_probe(struct i2c_client *client, return ret; } + if (tas6424->no_auto_diags) { + /* + * Disable DC auto-diagnostics to save time when channel leave + * Hi-Z state + */ + ret = regmap_update_bits(tas6424->regmap, + TAS6424_DC_DIAG_CTRL1, + 0xff, TAS6424_LDGBYPASS); + if (ret) { + dev_err(dev, "failed to disable auto-diags: %d\n", + ret); + return ret; + } + } + INIT_DELAYED_WORK(&tas6424->fault_check_work, tas6424_fault_check_work); ret = devm_snd_soc_register_component(dev, &soc_codec_dev_tas6424, diff --git a/sound/soc/codecs/tas6424.h b/sound/soc/codecs/tas6424.h index 4305883..3aea0f7 100644 --- a/sound/soc/codecs/tas6424.h +++ b/sound/soc/codecs/tas6424.h @@ -111,6 +111,9 @@ TAS6424_CH3_STATE_DIAG | \ TAS6424_CH4_STATE_DIAG) +/* TAS6424_DC_DIAG_CTRL1 */ +#define TAS6424_LDGBYPASS BIT(0) + /* TAS6424_GLOB_FAULT1_REG */ #define TAS6424_FAULT_CLOCK BIT(4) #define TAS6424_FAULT_PVDD_OV BIT(3) -- 2.7.4