From patchwork Mon Aug 18 11:00:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inha Song X-Patchwork-Id: 4735841 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4BC66C0338 for ; Mon, 18 Aug 2014 11:01:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3BD9F200FE for ; Mon, 18 Aug 2014 11:01:02 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 204A22011D for ; Mon, 18 Aug 2014 11:01:00 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 32EDC26578A; Mon, 18 Aug 2014 13:00:59 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 06D50265523; Mon, 18 Aug 2014 13:00:21 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id DA3922654E0; Mon, 18 Aug 2014 13:00:18 +0200 (CEST) Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) by alsa0.perex.cz (Postfix) with ESMTP id A1B872654E0 for ; Mon, 18 Aug 2014 13:00:10 +0200 (CEST) Received: from epcpsbgr2.samsung.com (u142.gpu120.samsung.co.kr [203.254.230.142]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NAI007YJ183JXA0@mailout2.samsung.com> for alsa-devel@alsa-project.org; Mon, 18 Aug 2014 20:00:03 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.114]) by epcpsbgr2.samsung.com (EPCPMTA) with SMTP id DE.A0.19786.3BCD1F35; Mon, 18 Aug 2014 20:00:03 +0900 (KST) X-AuditID: cbfee68e-b7fab6d000004d4a-72-53f1dcb3b0d0 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 78.48.04943.3BCD1F35; Mon, 18 Aug 2014 20:00:03 +0900 (KST) Received: from songinha-Samsung-DeskTop-System ([10.252.81.136]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0NAI00FT91822W30@mmp1.samsung.com>; Mon, 18 Aug 2014 20:00:03 +0900 (KST) Date: Mon, 18 Aug 2014 20:00:03 +0900 From: Inha Song To: broonie@kernel.org Message-id: <20140818200003.2ab8aca0@songinha-Samsung-DeskTop-System> X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.10; i686-pc-linux-gnu) MIME-version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrNIsWRmVeSWpSXmKPExsWyRsSkSHfznY/BBr1TRS2uXDzEZDH14RM2 i39TbrBbXP/ynNVi/pFzrBb9bxayWpx7tZLR4v7Xo4wW3650MFlc3jWHzWLp9YtMFsvf/mez mDB9LYtF694j7Banu1kd+D02fG5i81gzbw2jx+W+XiaPnbPusnusXP6FzWPTqk42jzvX9rB5 zDsZ6PFy4m82j74tqxg9Pm+SC+CO4rJJSc3JLEst0rdL4MpYfnUya8E87oqNj5ezNTDO5uxi 5OSQEDCRmP1xJSOELSZx4d56ti5GLg4hgaWMEvOnLAVKcIAVLV7GChFfxCgxYcNcRginn0ni 2Po9LCDdLAKqEs/uHGcGsdkENCS+f94MZosATb09p5MZpIFZ4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seYnNa94yT2Dk m4WkbBaSsllIyhYwMq9iFE0tSC4oTkrPNdQrTswtLs1L10vOz93ECE4Xz6R2MK5ssDjEKMDB qMTD6/H6Q7AQa2JZcWXuIUYJDmYlEd7s8x+DhXhTEiurUovy44tKc1KLDzGaAr09kVlKNDkf mMrySuINjU3MjCyNzA0tjIzNlcR5D7RaBwoJpCeWpGanphakFsH0MXFwSjUwxk7q3141ecmj co9a15fBurG2J3hMp6QvMbPLuprBl7h+scqiCcv7Y4TnPsmQ+hx4cWpPjNb+OTL6X3SOrXzY t9xt8bsPJbMeRqldmhN2v8Uh8F0O25bjG4N0vMR8MibduL34wKyVywSkBW/6WOXY7LoewRCR w7S8hbn9TXd0V39wmEPv/HheJZbijERDLeai4kQAb9n35y0DAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Cc: mark.rutland@arm.com, devicetree@vger.kernel.org, alsa-devel@alsa-project.org, sameo@linux.intel.com, pawel.moll@arm.com, ijc+devicetree@hellion.org.uk, patches@opensource.wolfsonmicro.com, linux-kernel@vger.kernel.org, lgirdwood@gmail.com, cw00.choi@samsung.com, robh+dt@kernel.org, galak@codeaurora.org, ckeepax@opensource.wolfsonmicro.com, lee.jones@linaro.org Subject: [alsa-devel] [PATCH v3 1/2] mfd: arizona: Add support for INn_Modec register control X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 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-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Some boards need to set the INn_MODE[1:0] register to change the input signal patch. This wlf,inmode property is optional. If present, values must be specified less than or equal to the number of input singals. If values less than the number of input signals, elements that has not been specifed are set to 0 by default. Example: - wlf,inmode = <2 0 2>; /* IN1, IN3 use DMIC */ Signed-off-by: Inha Song Reviewed-by: Charles Keepax --- drivers/mfd/arizona-core.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/mfd/arizona-core.c b/drivers/mfd/arizona-core.c index 10a0cb9..81e6db8 100644 --- a/drivers/mfd/arizona-core.c +++ b/drivers/mfd/arizona-core.c @@ -534,7 +534,7 @@ EXPORT_SYMBOL_GPL(arizona_of_get_named_gpio); static int arizona_of_get_core_pdata(struct arizona *arizona) { struct arizona_pdata *pdata = &arizona->pdata; - int ret, i; + int ret, i, proplen; pdata->reset = arizona_of_get_named_gpio(arizona, "wlf,reset", true); @@ -560,6 +560,12 @@ static int arizona_of_get_core_pdata(struct arizona *arizona) ret); } + proplen = of_property_count_u32_elems(arizona->dev->of_node, + "wlf,inmode"); + if (proplen > 0 && proplen <= ARRAY_SIZE(arizona->pdata.inmode)) + of_property_read_u32_array(arizona->dev->of_node, "wlf,inmode", + arizona->pdata.inmode, proplen); + return 0; }