From patchwork Thu Aug 4 13:38:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sylwester Nawrocki/Kernel \\(PLT\\) /SRPOL/Staff Engineer/Samsung Electronics" X-Patchwork-Id: 9263681 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 ABDF56048F for ; Thu, 4 Aug 2016 13:43:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9A67A28406 for ; Thu, 4 Aug 2016 13:43:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8A42328409; Thu, 4 Aug 2016 13:43:03 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 175B728406 for ; Thu, 4 Aug 2016 13:43:03 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bVIu9-0007hi-1r; Thu, 04 Aug 2016 13:41:45 +0000 Received: from mailout4.samsung.com ([203.254.224.34]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bVIsG-0005ao-76 for linux-arm-kernel@lists.infradead.org; Thu, 04 Aug 2016 13:39:50 +0000 Received: from epcpsbgm2new.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OBE01A7G0LQGMF0@mailout4.samsung.com> for linux-arm-kernel@lists.infradead.org; Thu, 04 Aug 2016 22:39:26 +0900 (KST) X-AuditID: cbfee61b-f79466d000001e3c-ca-57a3458debb0 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id 15.F4.07740.D8543A75; Thu, 4 Aug 2016 06:39:26 -0700 (MST) Received: from AMDC1344.digital.local ([106.116.147.32]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OBE000Y20L4R530@mmp1.samsung.com>; Thu, 04 Aug 2016 22:39:25 +0900 (KST) From: Sylwester Nawrocki To: broonie@kernel.org Subject: [PATCH 3/8] ASoC: uda134x: Optionally initialize L3 ops to default GPIO ops Date: Thu, 04 Aug 2016 15:38:43 +0200 Message-id: <1470317928-25365-4-git-send-email-s.nawrocki@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1470317928-25365-1-git-send-email-s.nawrocki@samsung.com> References: <1470317928-25365-1-git-send-email-s.nawrocki@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprCLMWRmVeSWpSXmKPExsVy+t9jAd0+18XhBk3RFlcuHmKy2DhjPavF 1IdP2CzOn9/AbrHp8TVWixnn9zFZHH7TzurA7rHhcxObx6ZVnWwem5fUe/RtWcXo8XmTXABr FJdNSmpOZllqkb5dAldG0+FPTAVvuCva5vxhb2C8z9nFyMkhIWAiMeFePyOELSZx4d56ti5G Lg4hgaWMEksfnWeGcH4BOW/nsoNUsQkYSvQe7QPrEAHquD2nkxnEZhY4wiixdy1YjbBAmMSl K+dYQWwWAVWJ7+9/g9XwCrhJHOhazgaxTU7i5LHJQDUcHJwC7hIvtniAhIWASr6+OsY6gZF3 ASPDKkaJ1ILkguKk9FyjvNRyveLE3OLSvHS95PzcTYzgsHomvYPx8C73Q4wCHIxKPLwWExeF C7EmlhVX5h5ilOBgVhLh/e20OFyINyWxsiq1KD++qDQntfgQozQHi5I47+P/68KEBNITS1Kz U1MLUotgskwcnFINjGm2et3yPFqtjp5ORz/xVvpaViia7g+YrvzrCa9TRrRnZqJf1k/Pyx// Crctbp2ouf/cAqlFjQv0tFXq6kLkREu7Odgm+yd+VDnv5ZHUd7jp0sXj/b9jHrE84X5pv21q ycT7Fl3zc1dO+sB9RbiOYZVIy7IVh2M+LGpKYL8j8X/Jow9NJ39MUGIpzkg01GIuKk4EAOOV QBYnAgAA X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160804_063948_485855_B687CCBB X-CRM114-Status: GOOD ( 13.72 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alsa-devel@alsa-project.org, linux-samsung-soc@vger.kernel.org, b.zolnierkie@samsung.com, krzk@kernel.org, Sylwester Nawrocki , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The GPIO ops can be selected by platform_data which allows the codec platform device to probe without the sound card's driver intervention. The downside is that it will request GPIOs on behalf of the codec device and thus allow only one user on the bus, but it desn't seem to be a limitation with current code and usage of the GPIO ops is optional anyway. The proper approach would presumably be to create a proper Linux bus driver for L3, should this rather ancient bus specification suddenly gain more interest. Signed-off-by: Sylwester Nawrocki --- sound/soc/codecs/uda134x.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sound/soc/codecs/uda134x.c b/sound/soc/codecs/uda134x.c index e4c694c..b72c925 100644 --- a/sound/soc/codecs/uda134x.c +++ b/sound/soc/codecs/uda134x.c @@ -544,6 +544,7 @@ static int uda134x_codec_probe(struct platform_device *pdev) { struct uda134x_platform_data *pd = pdev->dev.platform_data; struct uda134x_priv *uda134x; + int ret; if (!pd) { dev_err(&pdev->dev, "Missing L3 bitbang function\n"); @@ -557,6 +558,12 @@ static int uda134x_codec_probe(struct platform_device *pdev) uda134x->pd = pd; platform_set_drvdata(pdev, uda134x); + if (pd->l3.use_gpios) { + ret = l3_set_gpio_ops(&pdev->dev, &uda134x->pd->l3); + if (ret < 0) + return ret; + } + uda134x->regmap = devm_regmap_init(&pdev->dev, NULL, pd, &uda134x_regmap_config); if (IS_ERR(uda134x->regmap))