From patchwork Fri Jun 9 00:43:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 9776871 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C3C1260237 for ; Fri, 9 Jun 2017 00:43:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B2FDA283D9 for ; Fri, 9 Jun 2017 00:43:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A503E28575; Fri, 9 Jun 2017 00:43:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F1451283D9 for ; Fri, 9 Jun 2017 00:43:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751442AbdFIAn0 (ORCPT ); Thu, 8 Jun 2017 20:43:26 -0400 Received: from relmlor4.renesas.com ([210.160.252.174]:28731 "EHLO relmlie3.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751428AbdFIAnZ (ORCPT ); Thu, 8 Jun 2017 20:43:25 -0400 Received: from unknown (HELO relmlir2.idc.renesas.com) ([10.200.68.152]) by relmlie3.idc.renesas.com with ESMTP; 09 Jun 2017 09:43:21 +0900 Received: from relmlii2.idc.renesas.com (relmlii2.idc.renesas.com [10.200.68.66]) by relmlir2.idc.renesas.com (Postfix) with ESMTP id 5F9BE63CE7; Fri, 9 Jun 2017 09:43:21 +0900 (JST) X-IronPort-AV: E=Sophos;i="5.39,316,1493650800"; d="scan'208";a="246877814" Received: from mail-hk2apc01lp0208.outbound.protection.outlook.com (HELO APC01-HK2-obe.outbound.protection.outlook.com) ([65.55.88.208]) by relmlii2.idc.renesas.com with ESMTP/TLS/AES256-SHA256; 09 Jun 2017 09:43:20 +0900 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesasgroup.onmicrosoft.com; s=selector1-renesas-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=dw+zfxXGTZCKha+2YKMth4bJGMkgeGuyd9YNrB0Lvh0=; b=Q/iQpjQS4NfBFl6VauntSNZyVpqjoznOwfXddpUt+inj0oJ+ACke+t+HFEIYT4TnCdPcSfurWK71yB0fW9D8wMV/ldg1lmQYxANtlqvhFEs6zMpqqE0LCeWk06Eq3EcHFYAogbehUfAhnH+CT43OtKEbOJi4c86bgEMkoJzI8Mw= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; kernel.org; dmarc=none action=none header.from=renesas.com; Received: from morimoto-PC.renesas.com (211.11.155.144) by KL1PR0601MB1879.apcprd06.prod.outlook.com (2603:1096:802:8::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1157.12; Fri, 9 Jun 2017 00:43:18 +0000 Message-ID: <87a85iov10.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto Subject: [PATCH 1/5 v2] ASoC: simple_card_utils: add asoc_simple_card_clk_xxx() User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 To: Mark Brown CC: Linux-ALSA , Simon , In-Reply-To: <87bmpyov3z.wl%kuninori.morimoto.gx@renesas.com> References: <87bmpyov3z.wl%kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Date: Fri, 9 Jun 2017 00:43:18 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: SG2PR04CA0052.apcprd04.prod.outlook.com (2a01:111:e400:7803::20) To KL1PR0601MB1879.apcprd06.prod.outlook.com (2603:1096:802:8::15) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: KL1PR0601MB1879: X-MS-Office365-Filtering-Correlation-Id: 08557b39-997f-43fe-2d85-08d4aed08623 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081)(201703131423075)(201703031133081); SRVR:KL1PR0601MB1879; X-Microsoft-Exchange-Diagnostics: 1; KL1PR0601MB1879; 3:DSNG29FYZZhin+U4eYis1DugQ0Y+9d0ztfTJPVYPKP+ChFJ60FBzsj2V8Dn4N9wI2zn80DuOGylJ8Ak2uic43hwJcvDilbnshbG9BgrVLPxcvG0XxHLavHlc+tLpChST8bkaq1jkbdRNSrIozvuACERoT+M33scGTdrCYTtFHAs6fsUkh+/+pIRdRngCy+7S4L19p9Ffqu4pTOiUuN/qMaf5LRZgpY+swgpOSLPosfCauvch4yVyF6TCb0c4pZaQbcPlxUEdKhf0zMnSjnXaKZP+nhPgCdgIloy2o/DTDle76kIOGu0kEsl2A95MBzuATVBMsRZzj8Kcz8i2C1t7caLKSz16NEFwdQMeomtgOMg=; 25:vVuJ2XPiL/G3/5SidIPVS842y8WcklbZt9f/IvoXINvtueT2vyR6G+wSQ3FeNJrnPANK8l3vDw2dRXU/67WjuFE1MAZfW5gc9FiumOC1FdY1ZNB4R4W8Z6FVsit8GR8ZOwbPm3uGTD/TckX6/YtaXSQPoL5oPfJVKkpyaS2ELZeymu1CXxZGzGvLUOFIM2yOxeuRJ3RNV2qGQp/5uK578d528p1LbOsjGsqcMt1sbvGaRyuSZGF+ENuAaE/kkSTpvGBFGYgdOFkS8rYuaRtHH+KNdIDDgSjeGQCJzvPbQOZxrcBLcGwD9r/VjPV3Ypc+XGF5Kg7yUAfJwZJGR2UxCfGKc5J3PRXkJVq2wSQZUcadxp9uWORCnSMXmYumBF9fB1RoRu28ukAxUzzcRScR5uqHSK9YwAYnqJrW4kI2RwsPG3zt5fUA8NPMbm2XV4GhUG3KNgmwoNn2WDsGQDsSzik2veiyMoyDvdjV/WUW7vc= X-Microsoft-Exchange-Diagnostics: 1; KL1PR0601MB1879; 31:B6AOZfH7U3LKI6afN5UYweHulhIPStYTiy8Zpke/2WVtghUGOhpFkWmgH0QoyMTlQC1tYypMPBIdCEyb1kpde2YuTCe4pn8vMwSs7SlTvQRJrMwKm9Se0S9mj9UK4h+ZUMTWmZACp5qNXpFl9YQv0liuehEHuTT0tnkElwqxPohYrDyOMcbIUSvFgHy+9hw8pWb7yhYVWXwIOuDeJ4qo0OE1tvhDTt1HnJdTrxAuqmp9GuiI2ENMbh5i3zPwhFphvAqo0GsjY6dhmjn6ULPxSg==; 20:4ovB50TnyS2LtGYdLciioGMQQ31FnYn+RqKbMWvkiBuEu/bNhyVl1pleWn/cRc/3kcX1F3rfBCocYJf6XhhvIigVjCGe9b7mX8qFkQym6qhCPBHUpAQLUFO+t4/BqVvHsDxzjz7zo2AzfojDxcjjdt93ztDXcpt3JLaoythVoKcau4Ij5GNmoLn/nIrNLrvhuY6WM7gSdkOeWW+zen4Fu1d5Nn0IU//gleA4dpMkc9gbIXVP0EYgn/BvlaiapaCcFTWD0w0DBZlV9qDONAgnfLh32zdlPuHdrfofTIjNU540Hm2GJpuadJB3m1SumicU/kNgmMz/SFSTBvzgq3QlMBdrwIJhbmKMjNIADN3XWw1X3CPBOqCAqVVtYwajbVKkKfc5kxHc3wa65sFLJHK4LJ7Sl+SMOVMaCJSLgMfm5ehKsLEI1TCSiBNOJHbZIgV6NmJ6xMBTlB5yU9gayUMr+OijfT/KANuiq+p2LF4s5GNYdEPnJ+R/AEs5Tn8O90yo X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(100000703101)(100105400095)(3002001)(6055026)(6041248)(20161123555025)(20161123558100)(20161123560025)(20161123562025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:KL1PR0601MB1879; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:KL1PR0601MB1879; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; KL1PR0601MB1879; 4:J4nFDKY82YOa8glOOu0iSgPqBLPbBmEkRiJR/lun?= =?us-ascii?Q?disR4rSZWxeSHX9GhsJA/DEH8NShSmIOm+MVU0JjP/SvOXpbgV1fwvaP5taL?= =?us-ascii?Q?QF99sjRrWoZ6rpvkSC9HOhGwjLnG0aBydpc4CTzKCj9hx1qzISchL7jGHgYM?= =?us-ascii?Q?fGahl6Y5i8Z2w9YZBZ9WtkdUc/IDeRy8cswNim9tCjn4gtXXRJWpXe7cKD4l?= =?us-ascii?Q?QclsMvv+jqIq4R0FV3Md/QGjCgO6CUSAiQxX72qx7qFzqibSBXp44wsH0qHS?= =?us-ascii?Q?YRC98uU/0xjJnDqAyBOxaSBPUXS0o8BD9rtq308wUC001Cojjj6qr2iWChbH?= =?us-ascii?Q?Xfy/vcQwGTHimJCyJ8dvBVodh+0iVfDj9n8I8ZQcfqhcawqy3I/2VgzC2X7y?= =?us-ascii?Q?419rbVlKbe+PAQJZdm+aYhYwQ8bb6KSYVhz1qP4IhxwdPRcqX0xmGpPwIIpB?= =?us-ascii?Q?QuIzn1etzou9a8396CRWpLcBzHyb9ij0tzT8ET538w1rEwGxarZFZXawf6TV?= =?us-ascii?Q?Qp2Jocb5uYRHV090kSu/UiOmQXCmK57yuDpi7X7R6M0siDg73/JhMwnQXa0k?= =?us-ascii?Q?8pJbnI7koQwQregaaA2esBo3YL29P4+FvWWsp1UK8OB8DNnBVly4MLHTmIT/?= =?us-ascii?Q?Z48ipT/x3Evk+F37zVouwdBe6kDEk/BUXMLYD/cPql1bp6lk6gNy1M1kX2n/?= =?us-ascii?Q?5vN9Vn2u34hG58rz/JQfIzAaFNA3eI1gCQNqFn2KQglAVeABKvt+noqJhDZI?= =?us-ascii?Q?cvFJgIeBRHrtBBzxBzaGDRM2gf+MLwYeI6Jze5qf66HekURyuofIn7DtYzLs?= =?us-ascii?Q?1cQacSAHobPYzpFXwwaX7WRI5r2HSLVxyWgYPVrB5xHytytjXmoMBWpGWsoQ?= =?us-ascii?Q?zNPVNUkU1bvRPqjzfRJj0OkYhiCv9kUSSS0dnaXSlSGI2HChmgyN8kY0XRJd?= =?us-ascii?Q?yVpxqESoV6TJ6VQNLM+NFBB0OcARXk5BXuvn4VAEc7eHOi09uQh2lEwbdXEp?= =?us-ascii?Q?ilkMnT5/nIgXaaPvIxVqPKgA9GioQI1H/rvIhwlazDixnVdHB+5PubIL9I0T?= =?us-ascii?Q?mn/FXuc74oHuyHfS4fNd0WCo5LmzN72DuWPLAfdRZ53gyv3FL9N1JcSyXcZR?= =?us-ascii?Q?XFhr4ecYky+qsZZAjpxd0akdayhY54VsUA89JoqBhAvbBT5m5RNIOA=3D=3D?= X-Forefront-PRVS: 03333C607F X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(39450400003)(39850400002)(39410400002)(39400400002)(39840400002)(39860400002)(36756003)(25786009)(5660300001)(23726003)(3846002)(478600001)(86362001)(54356999)(2906002)(189998001)(66066001)(47776003)(76176999)(305945005)(7736002)(50986999)(33646002)(81166006)(6486002)(2950100002)(6916009)(8676002)(38730400002)(110136004)(53936002)(46406003)(42186005)(4326008)(53416004)(54906002)(21314002)(16060500001); DIR:OUT; SFP:1102; SCL:1; SRVR:KL1PR0601MB1879; H:morimoto-PC.renesas.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; KL1PR0601MB1879; 23:Xzs1PpK+ydpiQRZZ3Nz7xYPYHUTN9GvuxhzeqBw?= =?us-ascii?Q?hw14fVlrp3+GhzJdUeg3ya8lov/je97apwRjyss1GIew4xhJoP0Dws45kRs5?= =?us-ascii?Q?zG0qDYkaH/JSF1SVPxhR79R3CbY/x/U1impFLHS+DZJuBV3Wh4RqRj2qaeo7?= =?us-ascii?Q?s3MzHGVBjPt6/cci9Lwzsxa0vxlwDI8lOAp/HYGmhT3sbx2cjwxC2AupL+GG?= =?us-ascii?Q?h0e6UPQHLV3ZyI3/CSUJ+uhlYEYHyAnw/A9uTjWJ++8X1uq1a9SKDGBnF+SW?= =?us-ascii?Q?oVNZEtxck1f3inkwYel/BR722pU127JLWN9PWCzlLGNONKvTSAmtCoDVa3/i?= =?us-ascii?Q?g61MY6/56kiQsvIomzADL/BVSQKx4ffN3qLpLxRj/5wDblXihbkrKNiT2i6h?= =?us-ascii?Q?mHH4rr7Xnz9J49E169M6D+dzDaJiC7y3xwjmCOiAkPHYEkdupP6spW4Zj5ow?= =?us-ascii?Q?K2t1WnCUtPM3PgrQvRnKzZARtd9au1f56MltHgCfkI7+Z057gNHJQJR1b4y0?= =?us-ascii?Q?dihYZIc+T4VmIpfQlXYxawCh7fsaxiNqcI851NY8wIKEJHONbpBnt9FPzcdL?= =?us-ascii?Q?YEbf/50kWdwLhQ5t6L36AYmpA8AXzaXxyzqOvXZ5je/ZNQ3k1bHoB30QdmAz?= =?us-ascii?Q?Lte8/tL9vfBrK/QKDo88K4IPONLjoyI4Bb1ZkmVflZHGLmBKHkBB5L+9g3eC?= =?us-ascii?Q?fN6yYtqiUGqsyGGEoPgFlczkFM8DqhZAUqDsNM/pt65zNucuZP9kBSqCGClt?= =?us-ascii?Q?EVTN8voBTfbq2dF63m7K1ulAK6603WOVKw71VhMYTezG9U2uxZUYZrlvr13k?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ZMBS2yDo= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2017 00:43:18.7010 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1PR0601MB1879 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Kuninori Morimoto Current simple-card-utils sets asoc_simple_dai::clk via asoc_simple_card_parse_clk(). Current simple card drivers are using it directly for clk_enable/disable. Encapsulation is one of simple card util's purpose. Let's encapsulate it. Signed-off-by: Kuninori Morimoto --- v1 -> v2 - asoc_simple_card_clk_xxx #define -> function - add new asoc_simple_card_clk_register include/sound/simple_card_utils.h | 2 ++ sound/soc/generic/simple-card-utils.c | 19 ++++++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/include/sound/simple_card_utils.h b/include/sound/simple_card_utils.h index 108cae4..840d624 100644 --- a/include/sound/simple_card_utils.h +++ b/include/sound/simple_card_utils.h @@ -45,6 +45,8 @@ int asoc_simple_card_parse_clk(struct device *dev, struct device_node *dai_of_node, struct asoc_simple_dai *simple_dai, const char *name); +int asoc_simple_card_clk_enable(struct asoc_simple_dai *dai); +void asoc_simple_card_clk_disable(struct asoc_simple_dai *dai); #define asoc_simple_card_parse_cpu(node, dai_link, \ list_name, cells_name, is_single_link) \ diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c index d9d8b8a..beb4e38 100644 --- a/sound/soc/generic/simple-card-utils.c +++ b/sound/soc/generic/simple-card-utils.c @@ -110,6 +110,22 @@ int asoc_simple_card_parse_card_name(struct snd_soc_card *card, } EXPORT_SYMBOL_GPL(asoc_simple_card_parse_card_name); +static void asoc_simple_card_clk_register(struct asoc_simple_dai *dai, + struct clk *clk) +{ + dai->clk = clk; +} + +int asoc_simple_card_clk_enable(struct asoc_simple_dai *dai) +{ + return clk_prepare_enable(dai->clk); +} + +void asoc_simple_card_clk_disable(struct asoc_simple_dai *dai) +{ + clk_disable_unprepare(dai->clk); +} + int asoc_simple_card_parse_clk(struct device *dev, struct device_node *node, struct device_node *dai_of_node, @@ -128,7 +144,8 @@ int asoc_simple_card_parse_clk(struct device *dev, clk = devm_get_clk_from_child(dev, node, NULL); if (!IS_ERR(clk)) { simple_dai->sysclk = clk_get_rate(clk); - simple_dai->clk = clk; + + asoc_simple_card_clk_register(simple_dai, clk); } else if (!of_property_read_u32(node, "system-clock-frequency", &val)) { simple_dai->sysclk = val; } else {