Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752771AbbGIK0M (ORCPT ); Thu, 9 Jul 2015 06:26:12 -0400 Received: from opensource.wolfsonmicro.com ([80.75.67.52]:55444 "EHLO opensource.wolfsonmicro.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750943AbbGIKZ3 (ORCPT ); Thu, 9 Jul 2015 06:25:29 -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 4/5] extcon: arizona: Add support for general purpose switch Date: Thu, 9 Jul 2015 11:09:15 +0100 Message-Id: <1436436556-15540-4-git-send-email-ckeepax@opensource.wolfsonmicro.com> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1436436556-15540-1-git-send-email-ckeepax@opensource.wolfsonmicro.com> References: <1436436556-15540-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: 1437 Lines: 40 The switch is typically used in conjunction with the MICDET clamp in order to suppress pops and clicks associated with jack insertion. Signed-off-by: Charles Keepax --- drivers/extcon/extcon-arizona.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/drivers/extcon/extcon-arizona.c b/drivers/extcon/extcon-arizona.c index f372156..b48fb29 100644 --- a/drivers/extcon/extcon-arizona.c +++ b/drivers/extcon/extcon-arizona.c @@ -1216,6 +1216,8 @@ static int arizona_extcon_device_get_pdata(struct arizona *arizona) pdata->micd_software_compare = device_property_read_bool(arizona->dev, "wlf,micd-software-compare"); + device_property_read_u32(arizona->dev, "wlf,gpsw", &pdata->gpsw); + return 0; } @@ -1313,6 +1315,10 @@ static int arizona_extcon_probe(struct platform_device *pdev) info->micd_num_modes = ARRAY_SIZE(micd_default_modes); } + if (arizona->pdata.gpsw > 0) + regmap_update_bits(arizona->regmap, ARIZONA_GP_SWITCH_1, + ARIZONA_SW1_MODE_MASK, arizona->pdata.gpsw); + if (arizona->pdata.micd_pol_gpio > 0) { if (info->micd_modes[0].gpio) mode = GPIOF_OUT_INIT_HIGH; -- 1.7.2.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/