From patchwork Tue May 19 07:48:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= X-Patchwork-Id: 6434721 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 50313C0433 for ; Tue, 19 May 2015 07:48:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 77EAD20377 for ; Tue, 19 May 2015 07:48:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8776D20364 for ; Tue, 19 May 2015 07:48:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754276AbbESHsU (ORCPT ); Tue, 19 May 2015 03:48:20 -0400 Received: from metis.ext.pengutronix.de ([92.198.50.35]:38969 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753281AbbESHsU (ORCPT ); Tue, 19 May 2015 03:48:20 -0400 Received: from dude.hi.pengutronix.de ([2001:67c:670:100:1d::7]) by metis.ext.pengutronix.de with esmtps (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1YucG5-0001ZV-7a; Tue, 19 May 2015 09:48:13 +0200 Received: from ukl by dude.hi.pengutronix.de with local (Exim 4.84) (envelope-from ) id 1YucG4-0006jH-5s; Tue, 19 May 2015 09:48:12 +0200 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Peter Ujfalusi , Jarkko Nikula , Liam Girdwood , Mark Brown Cc: Sebastian Reichel , linux-omap@vger.kernel.org, alsa-devel@alsa-project.org, kernel@pengutronix.de, Linus Walleij , Alexandre Courbot Subject: [PATCH] ASoC: rx51: use flags argument of devm_gpiod_get to set direction Date: Tue, 19 May 2015 09:48:08 +0200 Message-Id: <1432021688-25830-1-git-send-email-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.1.4 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::7 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-omap@vger.kernel.org Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Since 39b2bbe3d715 (gpio: add flags argument to gpiod_get*() functions) which appeared in v3.17-rc1, the gpiod_get* functions take an additional parameter that allows to specify direction and initial value for output. Use this to simplify the driver. Furthermore this is one caller less that stops us making the flags argument to gpiod_get*() mandatory. Fixes: 386e81ab3b4d ("ASoC: omap: rx51: get GPIO numbers via gpiod API") Signed-off-by: Uwe Kleine-König Acked-by: Jarkko Nikula tvout_selection_gpio = devm_gpiod_get(card->dev, - "tvout-selection"); + "tvout-selection", + GPIOD_OUT_LOW); if (IS_ERR(pdata->tvout_selection_gpio)) { dev_err(card->dev, "could not get tvout selection gpio\n"); return PTR_ERR(pdata->tvout_selection_gpio); } - err = gpiod_direction_output(pdata->tvout_selection_gpio, 0); - if (err) { - dev_err(card->dev, "could not setup tvout selection gpio\n"); - return err; - } - pdata->jack_detection_gpio = devm_gpiod_get(card->dev, - "jack-detection"); + "jack-detection", + GPIOD_ASIS); if (IS_ERR(pdata->jack_detection_gpio)) { dev_err(card->dev, "could not get jack detection gpio\n"); return PTR_ERR(pdata->jack_detection_gpio); } - pdata->eci_sw_gpio = devm_gpiod_get(card->dev, "eci-switch"); + pdata->eci_sw_gpio = devm_gpiod_get(card->dev, "eci-switch", + GPIOD_OUT_HIGH); if (IS_ERR(pdata->eci_sw_gpio)) { dev_err(card->dev, "could not get eci switch gpio\n"); return PTR_ERR(pdata->eci_sw_gpio); } - err = gpiod_direction_output(pdata->eci_sw_gpio, 1); - if (err) { - dev_err(card->dev, "could not setup eci switch gpio\n"); - return err; - } - pdata->speaker_amp_gpio = devm_gpiod_get(card->dev, - "speaker-amplifier"); + "speaker-amplifier", + GPIOD_OUT_LOW); if (IS_ERR(pdata->speaker_amp_gpio)) { dev_err(card->dev, "could not get speaker enable gpio\n"); return PTR_ERR(pdata->speaker_amp_gpio); } - err = gpiod_direction_output(pdata->speaker_amp_gpio, 0); - if (err) { - dev_err(card->dev, "could not setup speaker enable gpio\n"); - return err; - } - err = devm_snd_soc_register_card(card->dev, card); if (err) { dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", err);