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: 9264633 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 592A360754 for ; Fri, 5 Aug 2016 00:24:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 49A8228415 for ; Fri, 5 Aug 2016 00:24:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3E5B428425; Fri, 5 Aug 2016 00:24:25 +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=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DD53128415 for ; Fri, 5 Aug 2016 00:24:23 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id A9794266E10; Fri, 5 Aug 2016 02:24:21 +0200 (CEST) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id BCE9C266B72; Fri, 5 Aug 2016 01:13:45 +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 1DF29266B40; Fri, 5 Aug 2016 01:13:41 +0200 (CEST) Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) by alsa0.perex.cz (Postfix) with ESMTP id D86C32674CB for ; Thu, 4 Aug 2016 15:39:27 +0200 (CEST) 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 alsa-devel@alsa-project.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 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 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 Subject: [alsa-devel] [PATCH 3/8] ASoC: uda134x: Optionally initialize L3 ops to default GPIO ops 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.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))