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: 9263667 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 E24BE6048F for ; Thu, 4 Aug 2016 13:40:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D44CF28406 for ; Thu, 4 Aug 2016 13:40:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C8CDA28409; Thu, 4 Aug 2016 13:40:29 +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,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 7C8D128406 for ; Thu, 4 Aug 2016 13:40:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933724AbcHDNk2 (ORCPT ); Thu, 4 Aug 2016 09:40:28 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:54269 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757186AbcHDNkR (ORCPT ); Thu, 4 Aug 2016 09:40:17 -0400 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-samsung-soc@vger.kernel.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 Cc: krzk@kernel.org, alsa-devel@alsa-project.org, b.zolnierkie@samsung.com, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Sylwester Nawrocki 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 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.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))