From patchwork Thu Jul 27 03:14:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chancel Liu X-Patchwork-Id: 13328698 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id F2C55C0015E for ; Thu, 27 Jul 2023 03:17:17 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 7354083E; Thu, 27 Jul 2023 05:16:25 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 7354083E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1690427835; bh=piF1mhf+J/2geDFwhaC60KdDeeVMASCA93weVxdnJVc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=vAuClVepGdlN4fIG+jmaAmI6FgQ1MII61fj1gnEWXHkTgmk61hpq43MPtydNMOZrW k596P3/lGyzgIBk4pcKJzRboObEoTNeYErOEzDMf6u0i3nm8+JZfLTwDWFszLhcD3+ S64l9Gi4qjciCxTw7meeCldG9ZIeH7rtUsrwJ8BU= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 623A8F8019B; Thu, 27 Jul 2023 05:15:57 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id EF829F801F5; Thu, 27 Jul 2023 05:15:55 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id B42CDF801F5; Thu, 27 Jul 2023 05:15:41 +0200 (CEST) Received: from EUR02-DB5-obe.outbound.protection.outlook.com (mail-db5eur02on2062d.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe12::62d]) (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 C32D4F80153 for ; Thu, 27 Jul 2023 05:15:37 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz C32D4F80153 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=nxp.com header.i=@nxp.com header.a=rsa-sha256 header.s=selector2 header.b=EKG/Wxjp ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Gj2slRJP8+5bAGyk69Jlj45DCvaJhdQ4UiG4b8Z5ZQzl3USFzyUoj8FvdNSo95YMT9Y5/A/q7fbCKrL41h3qqc6uViVSYJxixdTK/6o4RX4xh/u9/Oiwp45pe0dtxMue+eWNjcXcV4mGBBWsFl4oSeTzRp8pxb7VflAlRZy9fTl0zJl+p5w3a7jKOWgKJYIGu8pbtfb+1HKqf7mD6eAyDE7br9sXAPHOw33tDu6FwH/FMLGBifgvAQ32NcQHNPYg4qy2vZNzDB5WS+W0lhoA0e7R4fdz/ntFll4EJtmMTDNAOsVNWixmPXRrlNA8fVzHBWhzS5ntHwb8rOtg/T1GbQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=7Rusdyh1WKkrdaep8m2fBU7OV+3d1BgCX3Rmavs7o8A=; b=QxqGjGs/YRKrlHfamZfj1NWRBDlq0dn7tEHqnPMbg5QIDrHQQe83bfyJ9/qdBtDrwommwukfcL0vit/PSo8l+3PnjJNK+IoyWm0aKMsKWn/6jYu+qeiTqYCJbYsmp7U8y/+KWLpoeaRx9QMF2IUKpu1pcsS8CPkQQ3OYmk7umAsxKIDxkaxsLENpuW7V+6Jtcb9edvKuLcr7f/8PvZWz6meFkujJ7o139wF3W4Mrm7PNa2f+wSp3tiQeAG8BMj1rrZS1Kb+1yhLQb3B6xfnWfN7qsClOj11kE1y3KRynjLok2TUKDPYnK/UsF+2n0hS8rFCqeQhh9Xn06bp03s9Xig== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7Rusdyh1WKkrdaep8m2fBU7OV+3d1BgCX3Rmavs7o8A=; b=EKG/Wxjpsuh0kMntopAdiM/Ew2BrbTEiwe4T+b/oSDeMCOtglwBiOGqDoYaD6mfNukswOLSnWMVvBBpcgfC1dTv1DTyXbV7246X2XtVcw8JkYMyJPJuNn4lZFZNmULfYCTqVTnbO2mrbtHpL5BV+AZQTA13EXfm49MMWs7TTyyI= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from DB9PR04MB9498.eurprd04.prod.outlook.com (2603:10a6:10:360::21) by AS4PR04MB9411.eurprd04.prod.outlook.com (2603:10a6:20b:4ea::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Thu, 27 Jul 2023 03:15:35 +0000 Received: from DB9PR04MB9498.eurprd04.prod.outlook.com ([fe80::cda8:5cad:29b6:3c96]) by DB9PR04MB9498.eurprd04.prod.outlook.com ([fe80::cda8:5cad:29b6:3c96%7]) with mapi id 15.20.6631.026; Thu, 27 Jul 2023 03:15:34 +0000 From: Chancel Liu To: shengjiu.wang@gmail.com, Xiubo.Lee@gmail.com, festevam@gmail.com, nicoleotsuka@gmail.com, lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Cc: Chancel Liu Subject: [PATCH 1/3] ASoC: fsl_micfil: Add new registers and new bit definition Date: Thu, 27 Jul 2023 11:14:57 +0800 Message-Id: <20230727031459.571559-2-chancel.liu@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230727031459.571559-1-chancel.liu@nxp.com> References: <20230727031459.571559-1-chancel.liu@nxp.com> X-ClientProxiedBy: SG2PR03CA0126.apcprd03.prod.outlook.com (2603:1096:4:91::30) To DB9PR04MB9498.eurprd04.prod.outlook.com (2603:10a6:10:360::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB9PR04MB9498:EE_|AS4PR04MB9411:EE_ X-MS-Office365-Filtering-Correlation-Id: bb834e58-4e68-4bae-5cad-08db8e4fbe35 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 8pQKMOrkYWdMiYsz2lpl9Kf3STdz5F1tufNRgbeubLZYTRcrdpDbEeDZstYyj0+yS3yVYPqzh2MlGNJI8qAsnAtI1dNhfyBuYW1pp3cJqHq3tWCsulTbHstaXaqua92Msb+GDPBKiw05ybzik5SP5GSbI2v5k8ZMCozYTAf+wk/9Cs9fXwW87B9eKKv+cOUDWRD9sgg+jClSthqTqoOYIaYb3jldPuelfaurpZ/Ob9kUc276/SEhqKv4AMLdCeeWZPwf9P0gZjqeVjDc4OwYusuaiN2M3hCuyYHtvxLu0J/WSbQoisW2gp3QWZOjY11/fs3UDDGHTqjYZsvs/KWWig5SPSQEjJaOLgUtoIqpwjhV4TZKO03hymyXfnNBpUfpMi/JqiguQdTuPkzqdptVhrKLAsmrfF8yJOuOClR2yQJjinywuML4Hs3MpmsHU1cokoux3vbw+6VvwXMzorgdIzeSAfqqNzB/QGf/iPG1wkgMvUk9eHTKZZA2FydBiAWIsKyjoDGp947/885E5qmgskXItRjLV2b26ktaY09Dwl+o6POGrYDwXQoXV8OqJLDQ/4Lg1a9mwfuzonIVZYlr0X00TvBNOfMxe4OjGn9uU4VcCOIb0NSSD4kLYJ1mKt3is9tu+yKqKT/sJw7kbIFSDg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB9PR04MB9498.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(39860400002)(136003)(376002)(346002)(366004)(451199021)(36756003)(86362001)(921005)(52116002)(2906002)(478600001)(38100700002)(38350700002)(186003)(26005)(1076003)(2616005)(6506007)(41300700001)(7416002)(44832011)(8676002)(6666004)(6512007)(5660300002)(6486002)(66556008)(66946007)(83380400001)(66476007)(4326008)(8936002)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: gkvwpMrx5WEq/Cu7uElJMY6iHdxyCbpR5ffJRjqmgjwrpWGwl8xbAUyE1lNFna0qLWZSoBXcqjHFKKW1sajRja90FxYxKBNpe327MqPmAHTuRv5udMoVzIeiit4zhkbYrOSdUIW3FTSOG4PPOiWyZfzEAEs2FpMKSKYTu9iM0RS14WJi/zN4FMThbFI4JNdknc5f9j6SxnQgaIUsjTK7F0h5KV/Hd1Cn05bkQU/UqojUgSsEE57heqMeB23ZHjbpsALXxOzNlV8yJleJ7Z8NFo7MEJZ4paYkpbrHPgXWeRszKuiyOFGX2bE2RdGMSpjpJ72E3V+SDvYO/WctVA6PfVmus05eVqinaXdbfuKbiUVP4pxKVJ31AvewzvBfHpXJERntaTWO0j88ZCrLY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oIomF1iKduSBCxzK0feG5ay9kOV1ZzuWPKkkQiXQZwtPWsWR0rZC3C0hzMcTVlhBPMzdfFjPN9ZTBMCChYVorUHjnPjWNtusXpsZ+lBKj4oENm62HAr0vGIqt6Rg71QBoXh X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: bb834e58-4e68-4bae-5cad-08db8e4fbe35 X-MS-Exchange-CrossTenant-AuthSource: DB9PR04MB9498.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2023 03:15:34.9340 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 9WGervjfsW1N0MxHCwr2hjK6XpKzQCu0e8B5WQ1sR4symR+SxdrULZzcs9Er/lilIcCeLVWPcqccyxb6E4RNEQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR04MB9411 Message-ID-Hash: 6RMR7ZRVY5V2H5N2PA22JPOG6UPP34WH X-Message-ID-Hash: 6RMR7ZRVY5V2H5N2PA22JPOG6UPP34WH X-MailFrom: chancel.liu@nxp.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: MICFIL IP is upgraded on i.MX93 platform. These new registers and new bit definition are added to complete the register list. Signed-off-by: Chancel Liu --- sound/soc/fsl/fsl_micfil.c | 6 ++++++ sound/soc/fsl/fsl_micfil.h | 28 ++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/sound/soc/fsl/fsl_micfil.c b/sound/soc/fsl/fsl_micfil.c index 3f08082a55be..b15febf19c02 100644 --- a/sound/soc/fsl/fsl_micfil.c +++ b/sound/soc/fsl/fsl_micfil.c @@ -825,6 +825,9 @@ static bool fsl_micfil_readable_reg(struct device *dev, unsigned int reg) case REG_MICFIL_DC_CTRL: case REG_MICFIL_OUT_CTRL: case REG_MICFIL_OUT_STAT: + case REG_MICFIL_FSYNC_CTRL: + case REG_MICFIL_VERID: + case REG_MICFIL_PARAM: case REG_MICFIL_VAD0_CTRL1: case REG_MICFIL_VAD0_CTRL2: case REG_MICFIL_VAD0_STAT: @@ -849,6 +852,7 @@ static bool fsl_micfil_writeable_reg(struct device *dev, unsigned int reg) case REG_MICFIL_DC_CTRL: case REG_MICFIL_OUT_CTRL: case REG_MICFIL_OUT_STAT: /* Write 1 to Clear */ + case REG_MICFIL_FSYNC_CTRL: case REG_MICFIL_VAD0_CTRL1: case REG_MICFIL_VAD0_CTRL2: case REG_MICFIL_VAD0_STAT: /* Write 1 to Clear */ @@ -873,6 +877,8 @@ static bool fsl_micfil_volatile_reg(struct device *dev, unsigned int reg) case REG_MICFIL_DATACH5: case REG_MICFIL_DATACH6: case REG_MICFIL_DATACH7: + case REG_MICFIL_VERID: + case REG_MICFIL_PARAM: case REG_MICFIL_VAD0_STAT: case REG_MICFIL_VAD0_NDATA: return true; diff --git a/sound/soc/fsl/fsl_micfil.h b/sound/soc/fsl/fsl_micfil.h index 9237a1c4cb8f..b3c392ef5daf 100644 --- a/sound/soc/fsl/fsl_micfil.h +++ b/sound/soc/fsl/fsl_micfil.h @@ -24,6 +24,9 @@ #define REG_MICFIL_DC_CTRL 0x64 #define REG_MICFIL_OUT_CTRL 0x74 #define REG_MICFIL_OUT_STAT 0x7C +#define REG_MICFIL_FSYNC_CTRL 0x80 +#define REG_MICFIL_VERID 0x84 +#define REG_MICFIL_PARAM 0x88 #define REG_MICFIL_VAD0_CTRL1 0x90 #define REG_MICFIL_VAD0_CTRL2 0x94 #define REG_MICFIL_VAD0_STAT 0x98 @@ -39,6 +42,8 @@ #define MICFIL_CTRL1_DBG BIT(28) #define MICFIL_CTRL1_SRES BIT(27) #define MICFIL_CTRL1_DBGE BIT(26) +#define MICFIL_CTRL1_DECFILS BIT(20) +#define MICFIL_CTRL1_FSYNCEN BIT(16) #define MICFIL_CTRL1_DISEL_DISABLE 0 #define MICFIL_CTRL1_DISEL_DMA 1 @@ -82,6 +87,29 @@ #define MICFIL_DC_CUTOFF_152Hz 2 #define MICFIL_DC_BYPASS 3 +/* MICFIL VERID Register -- REG_MICFIL_VERID */ +#define MICFIL_VERID_MAJOR_SHIFT 24 +#define MICFIL_VERID_MAJOR_MASK GENMASK(31, 24) +#define MICFIL_VERID_MINOR_SHIFT 16 +#define MICFIL_VERID_MINOR_MASK GENMASK(23, 16) +#define MICFIL_VERID_FEATURE_SHIFT 0 +#define MICFIL_VERID_FEATURE_MASK GENMASK(15, 0) + +/* MICFIL PARAM Register -- REG_MICFIL_PARAM */ +#define MICFIL_PARAM_NUM_HWVAD_SHIFT 24 +#define MICFIL_PARAM_NUM_HWVAD_MASK GENMASK(27, 24) +#define MICFIL_PARAM_HWVAD_ZCD BIT(19) +#define MICFIL_PARAM_HWVAD_ENERGY_MODE BIT(17) +#define MICFIL_PARAM_HWVAD BIT(16) +#define MICFIL_PARAM_DC_OUT_BYPASS BIT(11) +#define MICFIL_PARAM_DC_IN_BYPASS BIT(10) +#define MICFIL_PARAM_LOW_POWER BIT(9) +#define MICFIL_PARAM_FIL_OUT_WIDTH BIT(8) +#define MICFIL_PARAM_FIFO_PTRWID_SHIFT 4 +#define MICFIL_PARAM_FIFO_PTRWID_MASK GENMASK(7, 4) +#define MICFIL_PARAM_NPAIR_SHIFT 0 +#define MICFIL_PARAM_NPAIR_MASK GENMASK(3, 0) + /* MICFIL HWVAD0 Control 1 Register -- REG_MICFIL_VAD0_CTRL1*/ #define MICFIL_VAD0_CTRL1_CHSEL GENMASK(26, 24) #define MICFIL_VAD0_CTRL1_CICOSR GENMASK(19, 16) From patchwork Thu Jul 27 03:14:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chancel Liu X-Patchwork-Id: 13328701 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id D348FC001DF for ; Thu, 27 Jul 2023 03:18:03 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id D5ABCAE9; Thu, 27 Jul 2023 05:17:11 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D5ABCAE9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1690427881; bh=Dw3mIPFlz9+QKeRlaD8gvltMy5XTrQzqq/xy+HYqGxc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=iQWi3T6X2lAnXr2rzJSBMPiYIJ03fLb/IPFBOZ6n67nQacQZUbf4gFQo0l6Vz+G4D Brl464RzoO7fSe0nK3g2uE2VPR1f1y/SwjiKlF/ydK4o1jX/rWj4DzeGUiQ+ppckmr 0KP3aUTI1Q3EgD1+1bOBRg5elO+9mrTGtv8vNCMw= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 768A8F80153; Thu, 27 Jul 2023 05:16:22 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 5307DF80153; Thu, 27 Jul 2023 05:16:21 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id C154AF8057D; Thu, 27 Jul 2023 05:16:13 +0200 (CEST) Received: from EUR02-DB5-obe.outbound.protection.outlook.com (mail-db5eur02on20621.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe12::621]) (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 0C0DAF80153 for ; Thu, 27 Jul 2023 05:15:40 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 0C0DAF80153 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=nxp.com header.i=@nxp.com header.a=rsa-sha256 header.s=selector2 header.b=FLJ1rYMc ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MPh/UvLHvfZ/4m2dZKUsPWykvY/mPV/tfV/mz0YvWGWhdduMiB6yhGXwVUp/ViTZ0QcYIDVQRowPBJ2WSON9IkjHs1KoFDS69Sp0JP5TsBmTITxzvAQkNwPa5pDwkWz9KrwwM2e73/7on/ksUPbQDowqr2OpKkyQa0rD3ZTzJ5+MDIqQNXBnJ7lVtJ2M6AbeIpJ8VhU/FYTV9Pd/jAz2r38pRuVK6ha4jo8setlqwGsS0c1YVZZJKmNOQhotpIduwr4KeI3p8I6yZ5vc2ClNNYpMjpr+PTOzEjpD/QvpoFoPNP57kzMDrDom6Q1Ph6D6lIuiXxhFZlfflAD/Aa5+6Q== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=8W2fRhJKUeHxwsuTEJ7fKxOuuZm3h+8SgzxirAYYaeE=; b=IjY/HODy8DSypzTbYGjCnFA9vr1ZNrIGs60C9/F4ru82CPhQmb5wozEqLyzprTqeEYlAL5G2u4s45dSe0q8jbsSAH+yed75AofOkrui9ALT6MwEEC0fNIyEBdkTeQq9WgpWyI8238arNM4TPvACyW5GmgkGBgHa7lN4Fagl/2mpn+qkEEr2wF507TbHlG1QYoCi09OfrX1Ov8h+k6Q4I5prllKhUDtUUNjyoL0VPyrb2A+J7V3pxB29axE3VNy/ok43zlNGM5Y9NUrj7PGCJCk25UC0g6fLMYEhvk7Xvki5zsbVLAC/mY77kYswVOCXqIbO2PVPDV9IQH2iA5Oie0g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8W2fRhJKUeHxwsuTEJ7fKxOuuZm3h+8SgzxirAYYaeE=; b=FLJ1rYMcWo7JFx4G1oLC4VGPa/2EJ74eODdEUk2s/vDwtJ971515QcrINN7toxoakqB583rBLwa6YW1T3TmsosIt52pGto+HFnZUvvfB80Rg0ILEUh/kpZfJFcltOSsPsy2SPYYMYS8gcmMo2oo0kMWJMTWN6lw/cC8/1sinCS8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from DB9PR04MB9498.eurprd04.prod.outlook.com (2603:10a6:10:360::21) by AS4PR04MB9411.eurprd04.prod.outlook.com (2603:10a6:20b:4ea::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Thu, 27 Jul 2023 03:15:38 +0000 Received: from DB9PR04MB9498.eurprd04.prod.outlook.com ([fe80::cda8:5cad:29b6:3c96]) by DB9PR04MB9498.eurprd04.prod.outlook.com ([fe80::cda8:5cad:29b6:3c96%7]) with mapi id 15.20.6631.026; Thu, 27 Jul 2023 03:15:38 +0000 From: Chancel Liu To: shengjiu.wang@gmail.com, Xiubo.Lee@gmail.com, festevam@gmail.com, nicoleotsuka@gmail.com, lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Cc: Chancel Liu Subject: [PATCH 2/3] ASoC: fsl_micfil: Add fsl_micfil_check_version function Date: Thu, 27 Jul 2023 11:14:58 +0800 Message-Id: <20230727031459.571559-3-chancel.liu@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230727031459.571559-1-chancel.liu@nxp.com> References: <20230727031459.571559-1-chancel.liu@nxp.com> X-ClientProxiedBy: SG2PR03CA0126.apcprd03.prod.outlook.com (2603:1096:4:91::30) To DB9PR04MB9498.eurprd04.prod.outlook.com (2603:10a6:10:360::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB9PR04MB9498:EE_|AS4PR04MB9411:EE_ X-MS-Office365-Filtering-Correlation-Id: 6d590b6c-de7f-4742-1abe-08db8e4fc06f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: P6tUzRktDYl2YX2j35czfnEWCAP0P/y4byhdwKOqgu0LGVnKXLWMzvad2xE62jQpMqtd5shdLmjq7bt2o9RKhlJSTabTV5Gl2Ld+3d68wQopFsh/6O26rWX9Yz631XN+5IYITFnth3nvIyyrZGRl+HSaYlfa6zlsuOnoZu4AYzR32WIU4NdcANZOClM6wgZRTSM+ulktSir8z2f/kKVpZsTnnIO3Xm1jiM4AO5Dn7gQAihwQ44DK5gPgFDMxNnnKNz8pIOsyHE49ygHg02hb7BuXjDB33X4xTDiGY7fZDw6GUcwOlbQJNH4mxV9I64py7oasL3hK05YuTgbqE9s2OjLj7F5sILr/L6bcjutF/s3H+WFvTb5UjKdp14R+5kOj8nGcwvyCt6/1flkev2d3k7LWa6O0LEBZ6TO2S/+BVUlHA3+dbczr2pYjYWxwwXbnXclDJW/tOzThEnR0E2/jYUO7V3U2Ei+YLgICswRvCzs0zaokTrPAkJMATStBAVTXQoKPjpCZjcC0PlkG3RG9Pu5M1bkJSQaDSClB0G/GEgyFMt4hlcwZIjtxI9sHFU8BFKVwtRwBUSq5eb4WAAn11T2o3ildONrSoGSQwxybvGdmvEJ575So4wnEDOnCZgA7uiGwztR0ZIIHDc6qACuDJQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB9PR04MB9498.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(39860400002)(136003)(376002)(346002)(366004)(451199021)(36756003)(86362001)(921005)(52116002)(2906002)(478600001)(38100700002)(38350700002)(186003)(26005)(1076003)(2616005)(6506007)(41300700001)(7416002)(44832011)(8676002)(6666004)(6512007)(5660300002)(6486002)(66556008)(66946007)(83380400001)(66476007)(4326008)(8936002)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: tGA0IZHwuS7L2TxZqggeMqJOPtb8OsuWW8BUJe1lkHxqghjMBSsS9+Y2vDnAvOR2hqNPwZUczKnOEaWa1BxbU6aA9G4uGgj0lWPUWdMgOGsR7Niihk3OrkOU/nH4WYy0SqB/D2tzyCToTFR3nOVsOBY/9q4aEnT1SvE69yhM1QDdobwP+WWsGwpA+QHdYikNvsV533szhcpDSni9wP5BOhz8Pt6xDqFjusEdK4oCgU/lAmIfn6fe5JTzCR4L8NPwcFeN52AaSyCVC3HQ0oTnfw7BnPAzEM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IYC6lHUCJDFNdSV+/WooylG1XElPuOCsKY1nqiQIR+5Y/cO1OiXLXsVm6iDeDT6FRh5P8jDFHwQwYhWP5NlF0ahpYJ0mIVm1ZD4j+TVwZmtATK+5z0A7X76cI/LFNFDPaPFMfeE/XWoezZj6UY9WrwFmbizWztHEr2FGgzqfaFSfWjMAPt7frRFT7toafa5N+in19EoBDej6YbZOfKDcNZ/tje0BGSMN6Nuck3dQInrMtJdXw+20lg X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6d590b6c-de7f-4742-1abe-08db8e4fc06f X-MS-Exchange-CrossTenant-AuthSource: DB9PR04MB9498.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2023 03:15:38.6723 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ESkXOgNgv1l1Hxoa5ZX/pKLgjoVi/v9Ap6Lwq6aqPBqzaakE4VOqwzFwk6UDTUrNhSEBAL4O57Ab+pb6ReeHKg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR04MB9411 Message-ID-Hash: SMYG742NWWFB6E2FVVHOD3632HOQZSGW X-Message-ID-Hash: SMYG742NWWFB6E2FVVHOD3632HOQZSGW X-MailFrom: chancel.liu@nxp.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: fsl_micfil_check_version can help to parse the version info in VERID and PARAM registers. Since the two registers are added only on i.MX93 platform, a member flag called check_version is introduced to soc data structure which indicates need to check version. Signed-off-by: Chancel Liu --- sound/soc/fsl/fsl_micfil.c | 76 +++++++++++++++++++++++++++++++++++++- sound/soc/fsl/fsl_micfil.h | 36 ++++++++++++++++++ 2 files changed, 110 insertions(+), 2 deletions(-) diff --git a/sound/soc/fsl/fsl_micfil.c b/sound/soc/fsl/fsl_micfil.c index b15febf19c02..46eda6e8c4b6 100644 --- a/sound/soc/fsl/fsl_micfil.c +++ b/sound/soc/fsl/fsl_micfil.c @@ -56,6 +56,8 @@ struct fsl_micfil { int vad_init_mode; int vad_enabled; int vad_detected; + struct fsl_micfil_verid verid; + struct fsl_micfil_param param; }; struct fsl_micfil_soc_data { @@ -64,6 +66,7 @@ struct fsl_micfil_soc_data { unsigned int dataline; bool imx; bool use_edma; + bool check_version; u64 formats; }; @@ -90,6 +93,7 @@ static struct fsl_micfil_soc_data fsl_micfil_imx93 = { .dataline = 0xf, .formats = SNDRV_PCM_FMTBIT_S32_LE, .use_edma = true, + .check_version = true, }; static const struct of_device_id fsl_micfil_dt_ids[] = { @@ -356,6 +360,49 @@ static const struct snd_kcontrol_new fsl_micfil_snd_controls[] = { SOC_SINGLE_BOOL_EXT("VAD Detected", 0, hwvad_detected, NULL), }; +static int fsl_micfil_check_version(struct device *dev) +{ + struct fsl_micfil *micfil = dev_get_drvdata(dev); + unsigned int val; + int ret; + + if (!micfil->soc->check_version) + return 0; + + ret = regmap_read(micfil->regmap, REG_MICFIL_VERID, &val); + if (ret < 0) + return ret; + + dev_dbg(dev, "VERID: 0x%016X\n", val); + + micfil->verid.version = val & + (MICFIL_VERID_MAJOR_MASK | MICFIL_VERID_MINOR_MASK); + micfil->verid.version >>= MICFIL_VERID_MINOR_SHIFT; + micfil->verid.feature = val & MICFIL_VERID_FEATURE_MASK; + + ret = regmap_read(micfil->regmap, REG_MICFIL_PARAM, &val); + if (ret < 0) + return ret; + + dev_dbg(dev, "PARAM: 0x%016X\n", val); + + micfil->param.hwvad_num = (val & MICFIL_PARAM_NUM_HWVAD_MASK) >> + MICFIL_PARAM_NUM_HWVAD_SHIFT; + micfil->param.hwvad_zcd = val & MICFIL_PARAM_HWVAD_ZCD; + micfil->param.hwvad_energy_mode = val & MICFIL_PARAM_HWVAD_ENERGY_MODE; + micfil->param.hwvad = val & MICFIL_PARAM_HWVAD; + micfil->param.dc_out_bypass = val & MICFIL_PARAM_DC_OUT_BYPASS; + micfil->param.dc_in_bypass = val & MICFIL_PARAM_DC_IN_BYPASS; + micfil->param.low_power = val & MICFIL_PARAM_LOW_POWER; + micfil->param.fil_out_width = val & MICFIL_PARAM_FIL_OUT_WIDTH; + micfil->param.fifo_ptrwid = (val & MICFIL_PARAM_FIFO_PTRWID_MASK) >> + MICFIL_PARAM_FIFO_PTRWID_SHIFT; + micfil->param.npair = (val & MICFIL_PARAM_NPAIR_MASK) >> + MICFIL_PARAM_NPAIR_SHIFT; + + return 0; +} + /* The SRES is a self-negated bit which provides the CPU with the * capability to initialize the PDM Interface module through the * slave-bus interface. This bit always reads as zero, and this @@ -1037,6 +1084,9 @@ static irqreturn_t hwvad_err_isr(int irq, void *devid) return IRQ_HANDLED; } +static int fsl_micfil_runtime_suspend(struct device *dev); +static int fsl_micfil_runtime_resume(struct device *dev); + static int fsl_micfil_probe(struct platform_device *pdev) { struct device_node *np = pdev->dev.of_node; @@ -1156,6 +1206,25 @@ static int fsl_micfil_probe(struct platform_device *pdev) platform_set_drvdata(pdev, micfil); pm_runtime_enable(&pdev->dev); + if (!pm_runtime_enabled(&pdev->dev)) { + ret = fsl_micfil_runtime_resume(&pdev->dev); + if (ret) + goto err_pm_disable; + } + + ret = pm_runtime_resume_and_get(&pdev->dev); + if (ret < 0) + goto err_pm_get_sync; + + /* Get micfil version */ + ret = fsl_micfil_check_version(&pdev->dev); + if (ret < 0) + dev_warn(&pdev->dev, "Error reading MICFIL version: %d\n", ret); + + ret = pm_runtime_put_sync(&pdev->dev); + if (ret < 0 && ret != -ENOSYS) + goto err_pm_get_sync; + regcache_cache_only(micfil->regmap, true); /* @@ -1180,6 +1249,9 @@ static int fsl_micfil_probe(struct platform_device *pdev) return ret; +err_pm_get_sync: + if (!pm_runtime_status_suspended(&pdev->dev)) + fsl_micfil_runtime_suspend(&pdev->dev); err_pm_disable: pm_runtime_disable(&pdev->dev); @@ -1191,7 +1263,7 @@ static void fsl_micfil_remove(struct platform_device *pdev) pm_runtime_disable(&pdev->dev); } -static int __maybe_unused fsl_micfil_runtime_suspend(struct device *dev) +static int fsl_micfil_runtime_suspend(struct device *dev) { struct fsl_micfil *micfil = dev_get_drvdata(dev); @@ -1203,7 +1275,7 @@ static int __maybe_unused fsl_micfil_runtime_suspend(struct device *dev) return 0; } -static int __maybe_unused fsl_micfil_runtime_resume(struct device *dev) +static int fsl_micfil_runtime_resume(struct device *dev) { struct fsl_micfil *micfil = dev_get_drvdata(dev); int ret; diff --git a/sound/soc/fsl/fsl_micfil.h b/sound/soc/fsl/fsl_micfil.h index b3c392ef5daf..231a52aff024 100644 --- a/sound/soc/fsl/fsl_micfil.h +++ b/sound/soc/fsl/fsl_micfil.h @@ -174,4 +174,40 @@ #define MICFIL_HWVAD_ENVELOPE_MODE 0 #define MICFIL_HWVAD_ENERGY_MODE 1 +/** + * struct fsl_micfil_verid - version id data + * @version: version number + * @feature: feature specification number + */ +struct fsl_micfil_verid { + u32 version; + u32 feature; +}; + +/** + * struct fsl_micfil_param - parameter data + * @hwvad_num: the number of HWVADs + * @hwvad_zcd: HWVAD zero-cross detector is active + * @hwvad_energy_mode: HWVAD energy mode is active + * @hwvad: HWVAD is active + * @dc_out_bypass: points out if the output DC remover is disabled + * @dc_in_bypass: points out if the input DC remover is disabled + * @low_power: low power decimation filter + * @fil_out_width: filter output width + * @fifo_ptrwid: FIFO pointer width + * @npair: number of microphone pairs + */ +struct fsl_micfil_param { + u32 hwvad_num; + bool hwvad_zcd; + bool hwvad_energy_mode; + bool hwvad; + bool dc_out_bypass; + bool dc_in_bypass; + bool low_power; + bool fil_out_width; + u32 fifo_ptrwid; + u32 npair; +}; + #endif /* _FSL_MICFIL_H */ From patchwork Thu Jul 27 03:14:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chancel Liu X-Patchwork-Id: 13328700 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id CDCDDC0015E for ; Thu, 27 Jul 2023 03:17:46 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id EF6F5868; Thu, 27 Jul 2023 05:16:54 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz EF6F5868 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1690427865; bh=kaCCGuWZQC5WOdb/c3GiQKQARmKIsdehUO2liuEu6yM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=WU7ZI0aP3TA/cEoZocWBUA9tf2SasNtcwgOh0x/pegRAeWKH5Ms3c68S5SUq7O6rt wFX72mUuq6MuIr/aZPQ374NU1xto0vnVIlv9/UuB0PsBdAX+FxQJORyhGMkK2QKlNx 2qNl1RUY3C06N9N5MH2ENFbbf7z107FJYP6AkdHA= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 14EFAF8057B; Thu, 27 Jul 2023 05:16:04 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 41017F80564; Thu, 27 Jul 2023 05:16:02 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 84BCEF801F5; Thu, 27 Jul 2023 05:15:51 +0200 (CEST) Received: from EUR02-DB5-obe.outbound.protection.outlook.com (mail-db5eur02on20609.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe12::609]) (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 6F4DFF8019B for ; Thu, 27 Jul 2023 05:15:44 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 6F4DFF8019B Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=nxp.com header.i=@nxp.com header.a=rsa-sha256 header.s=selector2 header.b=ILE2MPqO ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TTj23D+4jE81gU53wIj71Zccy3ygWsEFOpzjMmETcQ/MCnFwdny5TnZB6mMn0JD4fUPKnYz8hLsDPhnVDeRSwS6qfajxbRMirD6+OerOZ6R9bVbQMXCsAwg3QBPkDez/JiQapV5A6oRfrdoCxjBRqyaSfJGLjDzCP/1if4bEutZ84unWHHgxPqLzTg5TsLXNr9eJYognWvef6kzhjySmSbA/2rSbO6aM70/NBf56xaE7uM5g34hpX3ZAfukLPvPZyyw7wd+Va7n90obhCrVR98x8X0egpoDdC0EOxqtQkDuY11YFpxEMDGeeBl1VARdJ9cWl0+cm5K/K4QkW6ncR8Q== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=/u7z16T/fN4Bk2hM/Am7krksx/eT0ABj8vAbSv508XE=; b=MaXSBwu0SaAVOT2St+a/wFRTYZI7yRAemdlff7IPTbeB4kHduzEjaegkJvyXJUXfVqGH2sC8r9jxwhjpm0T7qjk7CHiwFcfOOVHsLFKH0vIUh5CmUBNQHh1tAjbJb6fxOSGzkxwzEHZV0A3YGmSS8wbB4ZcHuIVTYAWNngZXskFXQnpvhsH5AmTgU1a6pibSadZizLNUC2klawzyjF5Jm/OLRt6hjErYjC5CE+7CB5Md8bJMp2cCPa5Xq8K/j1fX8D6jDYTaCSB9tC2yget9dSifQwZ+ICA79xEdyTToXKTylba3RzCVGEhFaBsqj+0MYswiyVajR6aHYQnsDH8GSQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/u7z16T/fN4Bk2hM/Am7krksx/eT0ABj8vAbSv508XE=; b=ILE2MPqOqm5/Wvt5lx34k3V7InaZZKIh7RAwLZKn6PAwcOW/e3T3Q/CaWZb//Y3iWHn8y9GEDpUKlvEdtxYTuhdCbxPRffaKLzoJ9KIiHJKekLHwzb3O588Fa478j+EkN2XBFgRUFdGsvxFiUpu8spgtJYb1eHVgkiQ/lNT5+qg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from DB9PR04MB9498.eurprd04.prod.outlook.com (2603:10a6:10:360::21) by AS4PR04MB9411.eurprd04.prod.outlook.com (2603:10a6:20b:4ea::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.29; Thu, 27 Jul 2023 03:15:42 +0000 Received: from DB9PR04MB9498.eurprd04.prod.outlook.com ([fe80::cda8:5cad:29b6:3c96]) by DB9PR04MB9498.eurprd04.prod.outlook.com ([fe80::cda8:5cad:29b6:3c96%7]) with mapi id 15.20.6631.026; Thu, 27 Jul 2023 03:15:42 +0000 From: Chancel Liu To: shengjiu.wang@gmail.com, Xiubo.Lee@gmail.com, festevam@gmail.com, nicoleotsuka@gmail.com, lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Cc: Chancel Liu Subject: [PATCH 3/3] ASoC: fsl_micfil: Use SET_SYSTEM_SLEEP_PM_OPS to simplify PM Date: Thu, 27 Jul 2023 11:14:59 +0800 Message-Id: <20230727031459.571559-4-chancel.liu@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230727031459.571559-1-chancel.liu@nxp.com> References: <20230727031459.571559-1-chancel.liu@nxp.com> X-ClientProxiedBy: SG2PR03CA0126.apcprd03.prod.outlook.com (2603:1096:4:91::30) To DB9PR04MB9498.eurprd04.prod.outlook.com (2603:10a6:10:360::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB9PR04MB9498:EE_|AS4PR04MB9411:EE_ X-MS-Office365-Filtering-Correlation-Id: 4c75c314-84d6-4894-d8ee-08db8e4fc2a8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OxkcIknpUkSkHLs8bEPRGKn5zwrJ+WhPCmPYJnhwILIJ3j+kDV0gxAPtzTgWe7ry7vq+modBOKlcEbD8c2hkYvoOoXM7E8GnAx7vXHsrpOSTyC3p+Ab/AKNyJ748ABQeNnaDuw66GGGg3SWwFWjOJ3/jE1nBfRnytIA50/gl+wqbHx3qKuG94xeDMf0XUPGyRH2okpKuqGa3rQuTIk++w8a8O1g5sDJwDEKbuM7i19gljsPA96rBmrvuYlVRcnuX6MWOw9cIaunbGJwK91KgacLS+MRrNXKaiWErjMludI52bb5tl2fag97aSy9jftJSVvBgy3ZpcM2X21VngXSi5Gzvv34wgUICPruse/uPmb9rFAS/LV+zHeS8/hyDToOXLyxeNGgkvrRaMfMmHaku1+AxchI1ACWVbI3bL5F9mFyl+JVS/aThRkX+rpk0U+s8v9cPVv7EAtwxKRHHhbLjr01flvb5tvA/W0mdyii5FMH2W4P9fqAAbq/y7bEazmXSF/qr5xBTOLypW+HwzdL4qPGnkICLZIXWRjcPLPm67zJ6Qv8JkDhs8jhq3uscclzlmczrOuGuoI1i/3qZ/V9LASHTbwz27k9OJ0oss9SrKQEdAebCpdZJDjtoTv6/c/t+Ske65jcPxcj2rtvcxHykiQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB9PR04MB9498.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(39860400002)(136003)(376002)(346002)(366004)(451199021)(36756003)(86362001)(921005)(52116002)(2906002)(478600001)(38100700002)(38350700002)(186003)(26005)(1076003)(2616005)(6506007)(41300700001)(7416002)(44832011)(8676002)(6666004)(6512007)(5660300002)(6486002)(66556008)(66946007)(83380400001)(66476007)(4326008)(8936002)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: iNbWqEIPRZKNxX+VtLK7F3fPKg6iqNriIsctzneYRCs5VSmhXw8ynk3hED6ggha6S36Vx2gOWsSO1oJjlLXfFwhmMhXPJt91eL6dvFhK2sTwHmRxeTyVa7T5DgoTADzoIhY0VaE4sTweabfnWouPkTpS5pDduENdPwGDuVxqGdkDmgsWsQnI44QCC/ce0MDxnvfCJd5SVFbIsjeAr0n6xflXo5BYnG6A/eW1+J/pAcyUq/3EGys6m7avp2TfBQcqSVOZowtdSX0jJmiy9XW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RgdHe8sotTufA+QGYwStFAiD5GiG9bgh4JKz+qFyNdNjYR3ygu3GQKXqokZp2f546K9828VznpUVV9x3kPMigd/NyR23K4rYgmKYeCcXyJ1CB6JxyX7xJGIQqxHszvr8nD0TUYBybbBHpM82UVVMzcy1z6WDsTKGSrsyv+wfIZC+yuthjlkHn7lqVgmoszBzQyXY29+pQQqxr8Pi9+ucUxymjMac5j3i/8U1sY/ZjY2HMW X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4c75c314-84d6-4894-d8ee-08db8e4fc2a8 X-MS-Exchange-CrossTenant-AuthSource: DB9PR04MB9498.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jul 2023 03:15:42.5418 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: CdrtevroYJPhgaKAFEVFRT/YpCs6QNjqEKiEyllnZVW4knh4qW16EDsu1i+Iu0+K0TMu2584htOp9aoJ9G8rMg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR04MB9411 Message-ID-Hash: OGY5VCY3KU2DO64P75LNSCX7GOHBN7YG X-Message-ID-Hash: OGY5VCY3KU2DO64P75LNSCX7GOHBN7YG X-MailFrom: chancel.liu@nxp.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Use SET_SYSTEM_SLEEP_PM_OPS to simplify suspend and resume function. fsl_micfil_suspend() and fsl_micfil_resume() can be deleted. Signed-off-by: Chancel Liu --- sound/soc/fsl/fsl_micfil.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/sound/soc/fsl/fsl_micfil.c b/sound/soc/fsl/fsl_micfil.c index 46eda6e8c4b6..6f5f8a886764 100644 --- a/sound/soc/fsl/fsl_micfil.c +++ b/sound/soc/fsl/fsl_micfil.c @@ -1297,26 +1297,12 @@ static int fsl_micfil_runtime_resume(struct device *dev) return 0; } -static int __maybe_unused fsl_micfil_suspend(struct device *dev) -{ - pm_runtime_force_suspend(dev); - - return 0; -} - -static int __maybe_unused fsl_micfil_resume(struct device *dev) -{ - pm_runtime_force_resume(dev); - - return 0; -} - static const struct dev_pm_ops fsl_micfil_pm_ops = { SET_RUNTIME_PM_OPS(fsl_micfil_runtime_suspend, fsl_micfil_runtime_resume, NULL) - SET_SYSTEM_SLEEP_PM_OPS(fsl_micfil_suspend, - fsl_micfil_resume) + SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, + pm_runtime_force_resume) }; static struct platform_driver fsl_micfil_driver = {