From patchwork Fri Nov 13 05:12:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuninori Morimoto X-Patchwork-Id: 7608851 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 82E479F2F7 for ; Fri, 13 Nov 2015 05:12:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8B8A420672 for ; Fri, 13 Nov 2015 05:12:36 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 3D3DB20658 for ; Fri, 13 Nov 2015 05:12:35 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 95CEB265AF8; Fri, 13 Nov 2015 06:12:33 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Status: No, score=-2.6 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, NO_DNS_FOR_FROM, RCVD_IN_DNSWL_LOW, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id B1FE7265A1B; Fri, 13 Nov 2015 06:12:25 +0100 (CET) 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 74A07265AB8; Fri, 13 Nov 2015 06:12:24 +0100 (CET) Received: from relmlie3.idc.renesas.com (relmlor4.renesas.com [210.160.252.174]) by alsa0.perex.cz (Postfix) with ESMTP id E49CC265A13 for ; Fri, 13 Nov 2015 06:12:15 +0100 (CET) Received: from unknown (HELO relmlir3.idc.renesas.com) ([10.200.68.153]) by relmlie3.idc.renesas.com with ESMTP; 13 Nov 2015 14:12:12 +0900 Received: from relmlac4.idc.renesas.com (relmlac4.idc.renesas.com [10.200.69.24]) by relmlir3.idc.renesas.com (Postfix) with ESMTP id 94290420F7; Fri, 13 Nov 2015 14:12:12 +0900 (JST) Received: by relmlac4.idc.renesas.com (Postfix, from userid 0) id 92952480A4; Fri, 13 Nov 2015 14:12:12 +0900 (JST) Received: from relmlac4.idc.renesas.com (localhost [127.0.0.1]) by relmlac4.idc.renesas.com (Postfix) with ESMTP id 8E47548014; Fri, 13 Nov 2015 14:12:12 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac4.idc.renesas.com with ESMTP id QAD26928; Fri, 13 Nov 2015 14:12:12 +0900 X-IronPort-AV: E=Sophos;i="5.20,285,1444662000"; d="scan'";a="198459966" Received: from mail-sg2apc01lp0245.outbound.protection.outlook.com (HELO APC01-SG2-obe.outbound.protection.outlook.com) ([65.55.88.245]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 13 Nov 2015 14:12:11 +0900 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=kuninori.morimoto.gx@renesas.com; Received: from morimoto-PC.renesas.com (211.11.155.144) by HK2PR06MB1010.apcprd06.prod.outlook.com (10.161.187.27) with Microsoft SMTP Server (TLS) id 15.1.325.17; Fri, 13 Nov 2015 05:12:09 +0000 Message-ID: <87ziyiij30.wl%kuninori.morimoto.gx@renesas.com> From: Kuninori Morimoto User-Agent: Wanderlust/2.15.9 Emacs/24.3 Mule/6.0 To: Mark Brown MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Date: Fri, 13 Nov 2015 05:12:09 +0000 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: OS1PR01CA0020.jpnprd01.prod.outlook.com (25.161.225.158) To HK2PR06MB1010.apcprd06.prod.outlook.com (25.161.187.27) X-Microsoft-Exchange-Diagnostics: 1; HK2PR06MB1010; 2:yEktjnRQAtTXQbqwgOoDjeBmCLJzwN2zos+G9NFLtX70AoBDM+J9Tt7igPlJsUEVOTQk6SPwuUFgd/91YrSX4ttxbwG9sEI3ggrPJUPDQXjp3kvz20aeCls98FrZVwYd7QCT1rL2oDjqcYXyo1lZL3spN0mJv/+QThKVbW69shE=; 3:p39SMGb1gL7U63llHJ8m3w8YWInLd13Pfw7rFygGeLnUvoIWcilEq81gnRrD3GcFybgHXsverdjYP1qYImsy1//IWEQTiIFdAZe7iY5QB0PXh56KxxGC5skwDn/XczxqlqRRw2on1FBFeotzVa4ebQ==; 25:wVZZ6rx1S4BdMo8VYmqAEQAcyCB1A4hl4rEx7WFS9KGMoSTUSsq9vI205l4oPbUg6f4IfFFxC7tbsd0NBDLSUYPgKImJIsX14VymWGufTlqB5m6eUYrrzISWz90KyL3piLaMhhPqYdqp9qJCSJOR0HeGtpSN5cyerwEAHmdoZdzXRQS1NO+V7Jd1Rwz+yFjHDPPQiFE59K5svKanvy65wnhn7aHNTMzJ1yPBGN5BPYOMy+vsQdJw5Ik6nffLYPxOYbNzTe4jx6vdlQE1Axvc8Q== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:HK2PR06MB1010; X-Microsoft-Exchange-Diagnostics: 1; HK2PR06MB1010; 20:RqIjIA3ezFC9Opsh6OBW4G3Amh7iejio9WECE9QncjwcyOT9StnSFf8AkTyAdFEQGwR7Oz76ybikuHvuyEizU31/LeTNJmkIxkV0WC0EW3dBwfI3wuwAyXptRaKtWFj0duJIBBe7xojgAFttX7QlArcfrRTpkmN5VmnEhDz2yawqhgI5ebS+JSFSyZdrImgxu2j3LoRefgtQhgSv9Xscuni1RSY4vs9voAdnuCRq1qIbIw2bAa4yC7983yWYcWG6qaYkfH2vY59+/cwSAv3bnGnnavzmPifXkmgVS4C4k+7nUBJcyPBv2w8nqmdFRjHFUjFyiUFbSB5IqkSLuQMuHmOvDE4IzoY/ox4dyru0SIqdPYF0+110y10qn3LZMOr0R+346QZOSsbSNxjQxkUCi4vZf82uQp9Z83GuwVlhDyLwsKQKArUpc2UG/YY17K0oqw+4Ac206dz2LRG1kkigqNlvR4hQqlJuSH56m37XAYjbWv9Oh842l8wzrC+i/P4f; 4:18sz7Y0thTXEo4E+WTLly7/mNaNf6loWTJHwEnpKaoMGCBcMAxeZFtj2ct1ISwR1ogcwg/yeBTt5//UySeDj4iyYHHQPpzItjHVaz52/6NISERMNOuvvs4feH87gqaUM2CX3mXSQaM7d2y7FXFaTcyjpQQTlOMg9DfJfCsuSf0ymeJAercIhbMv5TjujyHv0fAP9GRpdTeN3dcVXYE5BVDSdMM7Unhs1zgWb4W4lsrhCTGqMn/r/BJsqxHJI5bPQwvjnA/zZ5WcvCqhQtI/xdMW6orMgqTp9A1F4j/hzEae+lz/n8G3bwqhF0jiwBwWFdz6WJ5R1z+knbHYaHbzWU9OTlvPNvP3+oSCU4VBGZ/jUN0rvmhv3C83Hxqpl5oge X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(85106069007906); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(520078)(10201501046)(3002001); SRVR:HK2PR06MB1010; BCL:0; PCL:0; RULEID:; SRVR:HK2PR06MB1010; X-Forefront-PRVS: 0759F7A50A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(189002)(199003)(97736004)(229853001)(86362001)(19580395003)(5008740100001)(19580405001)(92566002)(66066001)(50466002)(33646002)(36756003)(46406003)(54356999)(69596002)(5007970100001)(50986999)(81156007)(5004730100002)(101416001)(106356001)(77096005)(110136002)(5001960100002)(40100003)(5001920100001)(105586002)(4001350100001)(53416004)(23726002)(83506001)(122386002)(87976001)(47776003)(189998001)(42186005); DIR:OUT; SFP:1102; SCL:1; SRVR:HK2PR06MB1010; H:morimoto-PC.renesas.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HK2P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Qr78aX?= =?us-ascii?Q?RqZ6+u5998JC6AXZVJmGn7AJTB8Wjb7M8tM8suUV7q0OpzudIfCPX3gM6DE2?= =?us-ascii?Q?4Ao1LcFhP8+PUak5XzkNi5MusbVRLyR/7jlVmVMLge8scBKRA80d9XQSt3XW?= =?us-ascii?Q?Cbe6pGiPhTexZ/mKQ9N4UtcQ3vs9VPJ8CopZ28Y3/iJ0nLvTF9QDP33jzbpq?= =?us-ascii?Q?r7yrQM=3D?= X-Microsoft-Exchange-Diagnostics: 1; HK2PR06MB1010; 5:ETa+FQr+GtMZtGrGB+ySaVFXFLZofOEcVLSk3adsBcdt8oFTBbo5mfFHtZcPPbvpnDAOuEM9acnGaSvpTG+DExmSPSTDX/ygM4jtF9ZTMR7m3EuRhR1QCxdPXT7vOLNciX1jMq7A+nByAymRpOHhOg==; 24:W8KJ13XC3wGxafnq7XgPnNOMZxQyh3HhUJqfOz8hvZmhwElTbR445n39Mni40VI+7A74d/4aSSX4jaysPWwzwyaps4AfCx/OWUXFS0w4O1k=; 20:c/05tRwFY9rJ5WHJ2h3U7EA2UxTTgWC49/Vk1e1f62+hyTn/Og5JTJYu1S2RRT8uAQvVs9NDf+SmLPAUtOVUBWjUjbR/HXngANijqfJSjGaOgzQIgH5DqQMnf2c7km9GS4/+cZHDu1srRtM8EhjlVSGcFnahIgNmgotSfMXrmVY= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Nov 2015 05:12:09.9642 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HK2PR06MB1010 Cc: Linux-ALSA , Simon , Liam Girdwood Subject: [alsa-devel] [PATCH] ASoC: ak4613: add single-end optional property for IN/OUT pins 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 From: Kuninori Morimoto ak4613 IN/OUT pin can be selected as differential/single-end. Differential is default, because it is register default settings. Signed-off-by: Kuninori Morimoto --- Documentation/devicetree/bindings/sound/ak4613.txt | 10 ++++++++ sound/soc/codecs/ak4613.c | 29 ++++++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/Documentation/devicetree/bindings/sound/ak4613.txt b/Documentation/devicetree/bindings/sound/ak4613.txt index 15a9195..392b5b5 100644 --- a/Documentation/devicetree/bindings/sound/ak4613.txt +++ b/Documentation/devicetree/bindings/sound/ak4613.txt @@ -7,6 +7,16 @@ Required properties: - compatible : "asahi-kasei,ak4613" - reg : The chip select number on the I2C bus +Optional properties: +- in1-single-end : Boolean. Indicate input / output pins are single-ended. +- in2-single-end rather than differential. +- out1-single-end +- out2-single-end +- out3-single-end +- out4-single-end +- out5-single-end +- out6-single-end + Example: &i2c { diff --git a/sound/soc/codecs/ak4613.c b/sound/soc/codecs/ak4613.c index 07a2664..7dc01fe 100644 --- a/sound/soc/codecs/ak4613.c +++ b/sound/soc/codecs/ak4613.c @@ -79,6 +79,8 @@ struct ak4613_priv { unsigned int fmt; u8 fmt_ctrl; + u8 oc; + u8 ic; int cnt; }; @@ -343,6 +345,9 @@ static int ak4613_dai_hw_params(struct snd_pcm_substream *substream, snd_soc_update_bits(codec, CTRL1, FMT_MASK, fmt_ctrl); snd_soc_write(codec, CTRL2, ctrl2); + snd_soc_write(codec, ICTRL, priv->ic); + snd_soc_write(codec, OCTRL, priv->oc); + hw_params_end: if (ret < 0) dev_warn(dev, "unsupported data width/format combination\n"); @@ -431,6 +436,28 @@ static struct snd_soc_codec_driver soc_codec_dev_ak4613 = { .num_dapm_routes = ARRAY_SIZE(ak4613_intercon), }; +static void ak4613_parse_of(struct ak4613_priv *priv, + struct device *dev) +{ + struct device_node *np = dev->of_node; + char prop[32]; + int i; + + /* Input 1 - 2 */ + for (i = 0; i < 2; i++) { + snprintf(prop, sizeof(prop), "in%d-single-end", i + 1); + if (!of_get_property(np, prop, NULL)) + priv->ic |= 1 << i; + } + + /* Output 1 - 6 */ + for (i = 0; i < 6; i++) { + snprintf(prop, sizeof(prop), "out%d-single-end", i + 1); + if (!of_get_property(np, prop, NULL)) + priv->oc |= 1 << i; + } +} + static int ak4613_i2c_probe(struct i2c_client *i2c, const struct i2c_device_id *id) { @@ -458,6 +485,8 @@ static int ak4613_i2c_probe(struct i2c_client *i2c, if (!priv) return -ENOMEM; + ak4613_parse_of(priv, dev); + priv->fmt_ctrl = NO_FMT; priv->cnt = 0;