Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp52296pxf; Wed, 24 Mar 2021 20:44:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzyxVYa9S9tnbxWGjYi7wKsPGFIVFrvtk67pZr+EBNVyok8+RZLkd+qtXyk2Fgb+eS6gdDE X-Received: by 2002:a17:907:7651:: with SMTP id kj17mr7124907ejc.127.1616643852262; Wed, 24 Mar 2021 20:44:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1616643852; cv=pass; d=google.com; s=arc-20160816; b=Fk+Ki5VzWBzUGp7ga9u14MIBMeReHb4VcxwxYXL246j6M9KXE4rcprapoKM0ibJlSI 1gEN2SYK5ITSec4bNa1+yXWGyWkn2nvOJ35+OA9eEfNX1lA9B46xwxxWt5vvZBmr0paW AAFIWpvtZDnPAkFZImbcqWzHXZ+/N3NBO7q/fAj1buyrZ4hJqGPG/0mc3wS1aRAnofxy 5+yx+DUASeI9bghd3H55vzE6+41jyyIyHktQ6Zd79HC3ArzwZOdEE9p3uZamJRL20Eyi Z0HFaw246GSsZtmKRvgBMG16QXZ6uncE73PO+vy9T5CszfZJ2fsORhnY8ehx3xmYJHgc 5d5A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=+wDd7n5cgXIcltEj8IDCLemSRUOR5/Ppb2B5PRam3yo=; b=qHqS79FvpV4csIh34QRrj/kSLnX530pD6T9iJVvuI27zunGmcoLuEWQAF54OkCBVLK Z3ti5wfl60Qyby3sizWimt2To9S1DlgedrRht39QaZcpBt6EgJTYI9X8x3MzwhRs1XZe KDzIQAK/hBJ5zzF0gieJ8IxNPfTK6IvEwfxQg1Hg+mMyVk8YQ7AZ0eZCYl6tUxFQdWaw SQZHoW22NCvOtvIEsvRKZvKF1HGZG3Cw0sBOTnAOT/xZLVSn4IrNn16TOhG4B25CFw+B V7MDfwETPqTnGEeROyXyIh5QdFbHqX5esvhYJRpKmmEBkPjAMKu1f4NjoIJrMCHwWWdn BJ6w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@maximintegrated.onmicrosoft.com header.s=selector2-maximintegrated-onmicrosoft-com header.b=J2APmxxY; arc=pass (i=1 spf=pass spfdomain=maximintegrated.com dkim=pass dkdomain=maximintegrated.com dmarc=pass fromdomain=maximintegrated.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n16si3185510edo.395.2021.03.24.20.43.50; Wed, 24 Mar 2021 20:44:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@maximintegrated.onmicrosoft.com header.s=selector2-maximintegrated-onmicrosoft-com header.b=J2APmxxY; arc=pass (i=1 spf=pass spfdomain=maximintegrated.com dkim=pass dkdomain=maximintegrated.com dmarc=pass fromdomain=maximintegrated.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230300AbhCYDhU (ORCPT + 99 others); Wed, 24 Mar 2021 23:37:20 -0400 Received: from mail-eopbgr690116.outbound.protection.outlook.com ([40.107.69.116]:21223 "EHLO NAM04-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229670AbhCYDgk (ORCPT ); Wed, 24 Mar 2021 23:36:40 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=czrIyGroAzIqfMwJWLekKe4ysVHmU3W2Zvn0sHgyF230l9jaSgcw73XEmDOhBKfN8bN+5H0+hRNL5RUzThugMKl83x2RWIxTftif2Q1zvv7AkBrUyn4plcJdabhh7wELmxqr8qf8N2dwTM1uzZqFDVAzWL9N68tGT5O36n02xLH28wXib43XouoN38fLPSqd1oeDtsM4uZrwpRveSnqHV+xz/GnFx5EyT1vlSfjl7LGUcMF1oQ13Bi51bhcfpYEv4TiIQNKQDbqljT3YrzamR3l0b6O6I6V13O5dHi6nADJINecxhi+pC1drCvQZ87VNbK/8jPhqCx1Jdrxhbgo9SQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+wDd7n5cgXIcltEj8IDCLemSRUOR5/Ppb2B5PRam3yo=; b=PA7JeROCSKPimThY/o0QUkJs9h70b/JLhQOUZ1ytq8Ii501sqYxzlT723r5vnjtxL2NR+7QaJNqG60FrxPxSX53xdfNkP3XJcALwa9rhd7ay5MC/up9mcG/siao1ghFb7xadS+fAqAGvX5dWrFpKFNbllmw6JabGMz8nc39KBiR9VdA7Yx3Va0ECmsIgeZtFr474c0GxroBuiV36PxUwKlwkkh2H+XAk1MhBFVqkYFJ0sJihV5ZF13OgZ2RjyvzdPbXFjt+sVTqlgp2peuMgbD/ODzI1af6aRP0Xgob8Cz5mW/wT7S31yA7oYjeGSIeZqax/vclZHihTM1GNfymfoQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=maximintegrated.com; dmarc=pass action=none header.from=maximintegrated.com; dkim=pass header.d=maximintegrated.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=maximintegrated.onmicrosoft.com; s=selector2-maximintegrated-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+wDd7n5cgXIcltEj8IDCLemSRUOR5/Ppb2B5PRam3yo=; b=J2APmxxYal1Jn8Lhem0RGi0eclC328mZbfD+XzIXdmbIL4oZ/K3QjqtxdxuouOKj61fVWRgixnEAVttFO2LftsLUb/aNpbmCCSwxKctiMSIPc/LAPLM2ZYKTxN8IACKB9n/YA6byVMJ9ShaXPUES0x0q44vT4nsSLTsCNHh1BpA= Authentication-Results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=maximintegrated.com; Received: from BYAPR11MB3382.namprd11.prod.outlook.com (2603:10b6:a03:7f::15) by SJ0PR11MB4798.namprd11.prod.outlook.com (2603:10b6:a03:2d5::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.25; Thu, 25 Mar 2021 03:36:39 +0000 Received: from BYAPR11MB3382.namprd11.prod.outlook.com ([fe80::cce5:1aa1:302f:a956]) by BYAPR11MB3382.namprd11.prod.outlook.com ([fe80::cce5:1aa1:302f:a956%5]) with mapi id 15.20.3977.025; Thu, 25 Mar 2021 03:36:39 +0000 From: Ryan Lee To: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, pierre-louis.bossart@linux.intel.com, kai.vehmanen@linux.intel.com, yung-chuan.liao@linux.intel.com, rander.wang@linux.intel.com, ryans.lee@maximintegrated.com, guennadi.liakhovetski@linux.intel.com, vkoul@kernel.org, yong.zhi@intel.com, judyhsiao@google.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Cc: ryan.lee.maxim@gmail.com Subject: [PATCH 3/3] ASoC:codec:max98373: Added controls for autorestart config Date: Wed, 24 Mar 2021 20:35:55 -0700 Message-Id: <20210325033555.29377-3-ryans.lee@maximintegrated.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210325033555.29377-1-ryans.lee@maximintegrated.com> References: <20210325033555.29377-1-ryans.lee@maximintegrated.com> Content-Type: text/plain X-Originating-IP: [73.189.52.211] X-ClientProxiedBy: BY5PR04CA0001.namprd04.prod.outlook.com (2603:10b6:a03:1d0::11) To BYAPR11MB3382.namprd11.prod.outlook.com (2603:10b6:a03:7f::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (73.189.52.211) by BY5PR04CA0001.namprd04.prod.outlook.com (2603:10b6:a03:1d0::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.24 via Frontend Transport; Thu, 25 Mar 2021 03:36:37 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 075c2253-ac2e-41b1-1d13-08d8ef3f321a X-MS-TrafficTypeDiagnostic: SJ0PR11MB4798: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:327; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DGaaZwVfZxeMRqYrqJjyYbWEE2NdYWRIdhR38zJw+7tD4Gu5b76hfGiRYO5o5dW+zjcxh+dd8fU4VxLmIWAbfOkvfrZoXiDhozTIACIDlhlcdvX/ffEFqoSUgv/B/v58YsT2OqBPbWkEN+eMrXQ4+nZbav7c0RRQjbL8iznu9WZxiacW+V1ibCMo8B8fkWjz0VOr1O3hBWeWg3Qm46V39C1xsN1q/jbIV9uif0UufTm+W1pEWICLdSX4M7MwQPZDZQWWcDIVyoM3itKd03niAz5kuP6ClPYjsxeDLGuT5Qw0ONbsSdBmfVSkit18iyH70LkpmoG1GufyyM9Xk0I3v/cl6QqGa85vj/6uHqQiOJiETXlekJIAebsXUN37fT17H8J5DaT7znB4fbutuvCMyxgV2wxsMSX6K4IMD1d5k8PLS2aKN7CDUPOvbcLbB3zn19gOBo670ga9b2g/ZuOsmW/viGM9PJDw2XnBdN2hLS60y4tQ+GQPvF++ucsrA92tVo4YFWA8fNQuXUW/p9SmmtX7H1cboaOTjidA5pW6uE1UOvadeobBami1emKUo1FI6zAkIg4iEKTn2TI7V/ppw/oNWNva3zsg7mXhWQOfq1rC9R8k7Qe5a41qPV6qs+FPJTu38aU5uOJQof8lMdac8qFgdilstWRC1SJKSf2yVWkANouhceEQwjOksPoR0qrpEMnieAJztbmU7pw5lzQtkg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR11MB3382.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(39860400002)(376002)(136003)(396003)(346002)(921005)(478600001)(52116002)(6486002)(4326008)(6666004)(7416002)(186003)(69590400012)(26005)(2906002)(6506007)(16526019)(6512007)(316002)(8676002)(2616005)(83380400001)(66476007)(1076003)(36756003)(66556008)(5660300002)(66946007)(86362001)(38100700001)(956004)(8936002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?taFvgZS9P2jsiijG4g+f4TpAM0iUuY/xAbWv33f0opHlXk8RkGuP0zD2vQMe?= =?us-ascii?Q?pAjSm83PWk+ygFUaDkUvGwXGOMZp/7VkuLGsXQF6Lyf736LKkpf4CLcrri51?= =?us-ascii?Q?OupE35JU1PAKwmQf0abcHcWdbJ6jWAGGj7Z8q20CgJetnaFOZePzVGh7qowD?= =?us-ascii?Q?LKgBo6UmPmtWV0frp9cTRF7QpKcfH/6tbV4ETGGh/HkN98B1pu1yW9S/g1Kx?= =?us-ascii?Q?GbOgLr53ADqhRz6ZEWe1vjr9t0HiU496UPYkSJSfxJLTubMsSmiDydC6v4y8?= =?us-ascii?Q?u2G66y6k9+sH2Lm2M9whbvrk7MPjHN8HqYqOYwl+Plm4zyOcR5+I5feg6hD3?= =?us-ascii?Q?waT5pBhohJzVP0RR+HyX/I5QQbvEhHL0gG2qOaRpztmc2RuTPzGLr3Wf70HU?= =?us-ascii?Q?HRR0LTAl9+TD5ghSnzujFz2g3HiOZ7x1whOvVH/8Lb4I2E8+mONTPJBJbGyi?= =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: maximintegrated.com X-MS-Exchange-CrossTenant-Network-Message-Id: 075c2253-ac2e-41b1-1d13-08d8ef3f321a X-MS-Exchange-CrossTenant-AuthSource: BYAPR11MB3382.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Mar 2021 03:36:38.7168 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fbd909df-ea69-4788-a554-f24b7854ad03 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 0BoOj3FFX98oUJjoYulgb3ocflQI8y9hR2mDS0ZkV5lW5xH1C6nFOvG4u8zEI7f8pzC5TFNb5/lEltNqX8g8/3tOZJ0Q1MC/vIPPNHFOu6Q= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB4798 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3 new controls are added. "OVC Autorestart Switch" : controls whether or not the speaker amplifier automatically re-enables after an overcurrent fault condition. "THERM Autorestart Switch" : controls whether or not the device automatically resumes playback when the die temperature recovers from thermal shutdown. "CMON Autorestart Switch" : controls whether or not the device automatically resumes playback when the clock returns after stopping. Above Auto Restart functions are enabled by default. Signed-off-by: Ryan Lee --- sound/soc/codecs/max98373.c | 14 ++++++++++++++ sound/soc/codecs/max98373.h | 3 +++ 2 files changed, 17 insertions(+) diff --git a/sound/soc/codecs/max98373.c b/sound/soc/codecs/max98373.c index 1346a98ce8a1..e14fe98349a5 100644 --- a/sound/soc/codecs/max98373.c +++ b/sound/soc/codecs/max98373.c @@ -204,6 +204,15 @@ SOC_SINGLE("Ramp Up Switch", MAX98373_R203F_AMP_DSP_CFG, MAX98373_AMP_DSP_CFG_RMP_UP_SHIFT, 1, 0), SOC_SINGLE("Ramp Down Switch", MAX98373_R203F_AMP_DSP_CFG, MAX98373_AMP_DSP_CFG_RMP_DN_SHIFT, 1, 0), +/* Speaker Amplifier Overcurrent Automatic Restart Enable */ +SOC_SINGLE("OVC Autorestart Switch", MAX98373_R20FE_DEVICE_AUTO_RESTART_CFG, + MAX98373_OVC_AUTORESTART_SHIFT, 1, 0), +/* Thermal Shutdown Automatic Restart Enable */ +SOC_SINGLE("THERM Autorestart Switch", MAX98373_R20FE_DEVICE_AUTO_RESTART_CFG, + MAX98373_THERM_AUTORESTART_SHIFT, 1, 0), +/* Clock Monitor Automatic Restart Enable */ +SOC_SINGLE("CMON Autorestart Switch", MAX98373_R20FE_DEVICE_AUTO_RESTART_CFG, + MAX98373_CMON_AUTORESTART_SHIFT, 1, 0), SOC_SINGLE("CLK Monitor Switch", MAX98373_R20FE_DEVICE_AUTO_RESTART_CFG, MAX98373_CLOCK_MON_SHIFT, 1, 0), SOC_SINGLE("Dither Switch", MAX98373_R203F_AMP_DSP_CFG, @@ -392,6 +401,11 @@ static int max98373_probe(struct snd_soc_component *component) MAX98373_R2021_PCM_TX_HIZ_EN_2, 1 << (max98373->i_slot - 8), 0); + /* enable auto restart function by default */ + regmap_write(max98373->regmap, + MAX98373_R20FE_DEVICE_AUTO_RESTART_CFG, + 0xF); + /* speaker feedback slot configuration */ regmap_write(max98373->regmap, MAX98373_R2023_PCM_TX_SRC_2, diff --git a/sound/soc/codecs/max98373.h b/sound/soc/codecs/max98373.h index 71f5a5228f34..73a2cf69d84a 100644 --- a/sound/soc/codecs/max98373.h +++ b/sound/soc/codecs/max98373.h @@ -195,6 +195,9 @@ #define MAX98373_LIMITER_EN_SHIFT (0) /* MAX98373_R20FE_DEVICE_AUTO_RESTART_CFG */ +#define MAX98373_OVC_AUTORESTART_SHIFT (3) +#define MAX98373_THERM_AUTORESTART_SHIFT (2) +#define MAX98373_CMON_AUTORESTART_SHIFT (1) #define MAX98373_CLOCK_MON_SHIFT (0) /* MAX98373_R20FF_GLOBAL_SHDN */ -- 2.17.1