From patchwork Mon Jul 26 09:15:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jack Yu X-Patchwork-Id: 485896 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=-13.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED 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 B3CE6C4338F for ; Mon, 26 Jul 2021 09:16:54 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F141360F02 for ; Mon, 26 Jul 2021 09:16:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org F141360F02 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=realtek.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 99F4A170D; Mon, 26 Jul 2021 11:16:00 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 99F4A170D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1627291010; bh=iwNdfYpFpkvRaFFrZkQunt4OMd2XbMdClKypMaDacA0=; h=From:To:Subject:Date:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=UISP62fZJ7AF5yPNLH7NN7r8+TcEzXZxcqS8uYuBeRTK7ZDmcQoBE+BhXajLnl4O5 d7p/kGntk+pt9WpRHTCJqsImYW89cAXhV2d2/gD0IjRsTcw13yA/e4E1jEG1lbmeI8 pemw7z7F1Oans9ciNyjI6Ho9v1wwI43h8+9jja/M= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 176F2F80253; Mon, 26 Jul 2021 11:16:00 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id C4DB1F8025A; Mon, 26 Jul 2021 11:15:57 +0200 (CEST) Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id E97B4F8020D for ; Mon, 26 Jul 2021 11:15:49 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz E97B4F8020D Authenticated-By: X-SpamFilter-By: ArmorX SpamTrap 5.73 with qID 16Q9Fg052009720, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtexh36502.realtek.com.tw[172.21.6.25]) by rtits2.realtek.com.tw (8.15.2/2.71/5.88) with ESMTPS id 16Q9Fg052009720 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Mon, 26 Jul 2021 17:15:42 +0800 Received: from RTEXMBS06.realtek.com.tw (172.21.6.99) by RTEXH36502.realtek.com.tw (172.21.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Mon, 26 Jul 2021 17:15:42 +0800 Received: from RTEXMBS01.realtek.com.tw (172.21.6.94) by RTEXMBS06.realtek.com.tw (172.21.6.99) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Mon, 26 Jul 2021 17:15:41 +0800 Received: from RTEXMBS01.realtek.com.tw ([fe80::50bb:7602:98b5:697f]) by RTEXMBS01.realtek.com.tw ([fe80::50bb:7602:98b5:697f%5]) with mapi id 15.01.2106.013; Mon, 26 Jul 2021 17:15:41 +0800 From: Jack Yu To: "broonie@kernel.org" , "lgirdwood@gmail.com" Subject: [PATCH] ASoC: rt1015: Remove unnecessary flush work on rt1015 driver Thread-Topic: [PATCH] ASoC: rt1015: Remove unnecessary flush work on rt1015 driver Thread-Index: AdeB/s2McXvWwgIaRsGlxX75SwRBlg== Date: Mon, 26 Jul 2021 09:15:41 +0000 Message-ID: <3ef458a6ad754589b96d6a94abda1e55@realtek.com> Accept-Language: zh-TW, en-US Content-Language: zh-TW X-MS-Has-Attach: X-MS-TNEF-Correlator: <3ef458a6ad754589b96d6a94abda1e55@realtek.com> x-originating-ip: [172.22.239.67] x-kse-serverinfo: RTEXMBS06.realtek.com.tw, 9 x-kse-attachmentfiltering-interceptor-info: no applicable attachment filtering rules found x-kse-antivirus-interceptor-info: scan successful x-kse-antivirus-info: =?big5?b?Q2xlYW4sIGJhc2VzOiAyMDIxLzcvMjYgpFekyCAw?= =?big5?b?ODoxMDowMA==?= x-kse-bulkmessagesfiltering-scan-result: protection disabled MIME-Version: 1.0 X-KSE-ServerInfo: RTEXH36502.realtek.com.tw, 9 X-KSE-Attachment-Filter-Triggered-Rules: Clean X-KSE-Attachment-Filter-Triggered-Filters: Clean X-KSE-BulkMessagesFiltering-Scan-Result: protection disabled X-KSE-AntiSpam-Outbound-Interceptor-Info: scan successful X-KSE-AntiSpam-Version: 5.9.20, Database issued on: 07/26/2021 08:58:13 X-KSE-AntiSpam-Status: KAS_STATUS_NOT_DETECTED X-KSE-AntiSpam-Method: none X-KSE-AntiSpam-Rate: 0 X-KSE-AntiSpam-Info: Lua profiles 165236 [Jul 26 2021] X-KSE-AntiSpam-Info: Version: 5.9.20.0 X-KSE-AntiSpam-Info: Envelope from: jack.yu@realtek.com X-KSE-AntiSpam-Info: LuaCore: 449 449 5db59deca4a4f5e6ea34a93b13bc730e229092f4 X-KSE-AntiSpam-Info: {tnef_exp} X-KSE-AntiSpam-Info: {Tracking_from_domain_doesnt_match_to} X-KSE-AntiSpam-Info: realtek.com:7.1.1; d41d8cd98f00b204e9800998ecf8427e.com:7.1.1; 127.0.0.199:7.1.2 X-KSE-AntiSpam-Info: {Track_Chinese_Simplified, headers_charset} X-KSE-AntiSpam-Info: Rate: 0 X-KSE-AntiSpam-Info: Status: not_detected X-KSE-AntiSpam-Info: Method: none X-KSE-AntiSpam-Info: Auth:dkim=none X-KSE-Antiphishing-Info: Clean X-KSE-Antiphishing-ScanningType: Heuristic X-KSE-Antiphishing-Method: None X-KSE-Antiphishing-Bases: 07/26/2021 09:01:00 Cc: Oder Chiou , "alsa-devel@alsa-project.org" , "lars@metafoo.de" , =?big5?b?a2VudF9jaGVuQHJlYWx0?= =?big5?b?ZWsuY29tIFuzr6vYp7td?= , "yuhsuan@google.com" , =?big5?b?RGVyZWsgW6TovHc=?= =?big5?b?uHFd?= , =?big5?b?U2h1bWluZyBbrVOu0bvKXQ==?= , "Flove\(HsinFu\)" X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Remove workqueue of flush work in rt1015 driver since we don't need it after internal discussion, and there is no impact on performance without this workqueue. Signed-off-by: Jack Yu --- sound/soc/codecs/rt1015.c | 39 +-------------------------------------- sound/soc/codecs/rt1015.h | 2 -- 2 files changed, 1 insertion(+), 40 deletions(-) -- 2.31.1 diff --git a/sound/soc/codecs/rt1015.c b/sound/soc/codecs/rt1015.c index 9238f12999aa..b3e69bf245dd 100644 --- a/sound/soc/codecs/rt1015.c +++ b/sound/soc/codecs/rt1015.c @@ -547,31 +547,6 @@ static int rt1015_bypass_boost_put(struct snd_kcontrol *kcontrol, return 0; } -static void rt1015_flush_work(struct work_struct *work) -{ - struct rt1015_priv *rt1015 = container_of(work, struct rt1015_priv, - flush_work.work); - struct snd_soc_component *component = rt1015->component; - unsigned int val, i; - - for (i = 0; i < 200; ++i) { - usleep_range(1000, 1500); - dev_dbg(component->dev, "Flush DAC (retry:%u)\n", i); - regmap_read(rt1015->regmap, RT1015_CLK_DET, &val); - if (val & 0x800) - break; - } - - regmap_write(rt1015->regmap, RT1015_SYS_RST1, 0x0597); - regmap_write(rt1015->regmap, RT1015_SYS_RST1, 0x05f7); - regmap_write(rt1015->regmap, RT1015_MAN_I2C, 0x0028); - - if (val & 0x800) - dev_dbg(component->dev, "Flush DAC completed.\n"); - else - dev_warn(component->dev, "Fail to flush DAC data.\n"); -} - static const struct snd_kcontrol_new rt1015_snd_controls[] = { SOC_SINGLE_TLV("DAC Playback Volume", RT1015_DAC1, RT1015_DAC_VOL_SFT, 127, 0, dac_vol_tlv), @@ -630,10 +605,6 @@ static int r1015_dac_event(struct snd_soc_dapm_widget *w, } break; - case SND_SOC_DAPM_POST_PMU: - regmap_write(rt1015->regmap, RT1015_MAN_I2C, 0x00a8); - break; - case SND_SOC_DAPM_POST_PMD: if (rt1015->bypass_boost == RT1015_Enable_Boost) { snd_soc_component_write(component, @@ -653,8 +624,6 @@ static int r1015_dac_event(struct snd_soc_dapm_widget *w, RT1015_SYS_RST2, 0x0b9a); } rt1015->dac_is_used = 0; - - cancel_delayed_work_sync(&rt1015->flush_work); break; default: @@ -687,8 +656,6 @@ static int rt1015_amp_drv_event(struct snd_soc_dapm_widget *w, } break; case SND_SOC_DAPM_POST_PMU: - if (rt1015->hw_config == RT1015_HW_28) - schedule_delayed_work(&rt1015->flush_work, msecs_to_jiffies(10)); msleep(rt1015->pdata.power_up_delay_ms); break; default: @@ -702,7 +669,7 @@ static const struct snd_soc_dapm_widget rt1015_dapm_widgets[] = { NULL, 0), SND_SOC_DAPM_AIF_IN("AIFRX", "AIF Playback", 0, SND_SOC_NOPM, 0, 0), SND_SOC_DAPM_DAC_E("DAC", NULL, SND_SOC_NOPM, 0, 0, - r1015_dac_event, SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU | + r1015_dac_event, SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD), SND_SOC_DAPM_OUT_DRV_E("Amp Drv", SND_SOC_NOPM, 0, 0, NULL, 0, rt1015_amp_drv_event, SND_SOC_DAPM_PRE_PMU | @@ -1028,7 +995,6 @@ static int rt1015_probe(struct snd_soc_component *component) snd_soc_component_get_drvdata(component); rt1015->component = component; - INIT_DELAYED_WORK(&rt1015->flush_work, rt1015_flush_work); return 0; } @@ -1037,7 +1003,6 @@ static void rt1015_remove(struct snd_soc_component *component) { struct rt1015_priv *rt1015 = snd_soc_component_get_drvdata(component); - cancel_delayed_work_sync(&rt1015->flush_work); regmap_write(rt1015->regmap, RT1015_RESET, 0); } @@ -1180,8 +1145,6 @@ static int rt1015_i2c_probe(struct i2c_client *i2c, return ret; } - rt1015->hw_config = (i2c->addr == 0x29) ? RT1015_HW_29 : RT1015_HW_28; - ret = regmap_read(rt1015->regmap, RT1015_DEVICE_ID, &val); if (ret) { dev_err(&i2c->dev, diff --git a/sound/soc/codecs/rt1015.h b/sound/soc/codecs/rt1015.h index 14344532048e..c9f636af7fd1 100644 --- a/sound/soc/codecs/rt1015.h +++ b/sound/soc/codecs/rt1015.h @@ -444,8 +444,6 @@ struct rt1015_priv { int bypass_boost; int dac_is_used; int cali_done; - int hw_config; - struct delayed_work flush_work; }; #endif /* __RT1015_H__ */