Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932294AbbFSKrR (ORCPT ); Fri, 19 Jun 2015 06:47:17 -0400 Received: from opensource.wolfsonmicro.com ([80.75.67.52]:56276 "EHLO opensource.wolfsonmicro.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932136AbbFSKrA (ORCPT ); Fri, 19 Jun 2015 06:47:00 -0400 From: Charles Keepax To: lee.jones@linaro.org, cw00.choi@samsung.com Cc: myungjoo.ham@samsung.com, sameo@linux.intel.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, patches@opensource.wolfsonmicro.com Subject: [PATCH v3 1/7] extcon: arizona: Factor out initial GPIO state Date: Fri, 19 Jun 2015 11:33:03 +0100 Message-Id: <1434709989-28300-2-git-send-email-ckeepax@opensource.wolfsonmicro.com> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1434709989-28300-1-git-send-email-ckeepax@opensource.wolfsonmicro.com> References: <1434709989-28300-1-git-send-email-ckeepax@opensource.wolfsonmicro.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1204 Lines: 34 Signed-off-by: Charles Keepax --- drivers/extcon/extcon-arizona.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/drivers/extcon/extcon-arizona.c b/drivers/extcon/extcon-arizona.c index 9262b45..e31613a 100644 --- a/drivers/extcon/extcon-arizona.c +++ b/drivers/extcon/extcon-arizona.c @@ -1135,6 +1135,7 @@ static int arizona_extcon_probe(struct platform_device *pdev) struct arizona *arizona = dev_get_drvdata(pdev->dev.parent); struct arizona_pdata *pdata = &arizona->pdata; struct arizona_extcon_info *info; + int gpio_initial_level; unsigned int val; unsigned int clamp_mode; int jack_irq_fall, jack_irq_rise; @@ -1226,8 +1227,9 @@ static int arizona_extcon_probe(struct platform_device *pdev) info->micd_num_modes = ARRAY_SIZE(micd_default_modes); } + gpio_initial_level = info->micd_modes[0].gpio; if (arizona->pdata.micd_pol_gpio > 0) { - if (info->micd_modes[0].gpio) + if (gpio_initial_level) mode = GPIOF_OUT_INIT_HIGH; else mode = GPIOF_OUT_INIT_LOW; -- 1.7.2.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in Please read the FAQ at http://www.tux.org/lkml/