From patchwork Sun Sep 24 14:56:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 114133 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp1646389qgf; Sun, 24 Sep 2017 08:02:51 -0700 (PDT) X-Received: by 10.84.240.4 with SMTP id y4mr4895697plk.22.1506265371709; Sun, 24 Sep 2017 08:02:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506265371; cv=none; d=google.com; s=arc-20160816; b=aM05sU5+ZA60Hm6oy7qa1VyuneJQxRc4YOctB+/BFihFai5g3h6FUzJmd9gh3Zm7BK IPoBcQSoxkw5B0BLsLCjLQghiYwIPaP+8xI9q1cJG5uhseAVN7TPEkMYXMUL2y/2BeAU m1JC3+OCvq+LndBbyXBbA0s53seeldKdwzUUnJtcda5jE617eyOrodE9SUMemEM2Y47Q Rr1qaoXwPiSeYdVx+c6xzzrrFbhG8DdDzj6FOtTn66FSGqYmjph5DC50vjZhhRRatasj vMP7V8R1dCv9IxLxcDZuOB7Cz0MgO0I+cX0PEijU+hgJ5fbaGxOKF6SfSPK25Ef8qrsS BXsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=PHU9GwQikBxttSN6CQscSmCAlSIe7qNrQaoy+I4aNN4=; b=lUvxyOXvyq5rS8dWMFHAjrhhVNqChMA2R56+MpjeWToTXQADlyJ3Y0LRvhC7sLUVVO pgfsMiOmKSNuv/YbBMWxWDq6d9t31jBi5SsnQaIniSeGMiNP2Q7TfRpB4EnQ7IMEmbAh iv/oRzjCDs0/fZh4gdjGZMkkQxHQT0MsadxIA2HtXA6+QkNYvGs1HV5aBJYlLyp/HAWQ lN8E3PFz1U8ugccMCv04V6mROV5kqlZbsm0Jp3ucFbR9Lb4WOvxfPrbLtp+Ycp95hvw5 dnUWUm5J/kk0EgJkWs60QiLoITLt0dyBrCNJgpMnBRzGu0xPYipOifGDXttMuoICulzZ +NKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=B/YBjcar; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p14si2753146pli.693.2017.09.24.08.02.51; Sun, 24 Sep 2017 08:02:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=B/YBjcar; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752683AbdIXPCs (ORCPT + 26 others); Sun, 24 Sep 2017 11:02:48 -0400 Received: from mail-pg0-f54.google.com ([74.125.83.54]:50797 "EHLO mail-pg0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752461AbdIXPCq (ORCPT ); Sun, 24 Sep 2017 11:02:46 -0400 Received: by mail-pg0-f54.google.com with SMTP id p5so2730598pgn.7 for ; Sun, 24 Sep 2017 08:02:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=PHU9GwQikBxttSN6CQscSmCAlSIe7qNrQaoy+I4aNN4=; b=B/YBjcarg4evTS4hONzQQav1IN0BRtTfnxijA8IWZMH3F4P53q8a4taiN7iGLMOw9j ol6UYmrzGXp7JdQB8LjWgNHH2rCu5to25GSE98/4EFRdkMAp1zpgd12UIM0rj1To1e7M WAn2wYWDy7l38Lb9+kydseVxsYkR2h9az218U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=PHU9GwQikBxttSN6CQscSmCAlSIe7qNrQaoy+I4aNN4=; b=KfXLiBX9cVnziQg9lk+aaO7kg3eGyeQ2q90RdH9m7Gtt+oEjFS7fniWJvyhhmHxo/p E5i0w8RnOX6D6vpXbTltEjsQ16TAjvR1x6JjV4qdFIWUp1pGvgMR6+VISxKkCcD/Qeoq F7eElvMkkSUcFylkHQ437lT6uSvsHG/vA0PbKJBsW76RcSosltf68Ot/nowF2mvCVEmZ xHTDDJO4OMaBnN/PLcDz/VvzmetfpK99cRSzb2H6e3iHM2U9t/eZTU1YMkOYCYZ6hT81 c23c3p9OwQ4eYMST8ZzWrRnO7LmEYR45L0SoGyEiZ8IlzbH6Qp2V+fROOiM+u2MzIORt divA== X-Gm-Message-State: AHPjjUjdP0bE2Gcy/N+kyBEGYqfGlu+taVagaGpSVj3UfYhpxH+woX0V scOHUlo5QUluG8BKNfM8Ce0FLmI9Q5Q= X-Google-Smtp-Source: AOwi7QBzN5AkklkkcDT97zcjcrWrF9Gjl24mR+QM3FZhreTMLwk/INeidPkdEjjfnXu3qUQSUGOdmw== X-Received: by 10.98.71.153 with SMTP id p25mr4846219pfi.84.1506265366320; Sun, 24 Sep 2017 08:02:46 -0700 (PDT) Received: from genomnajs.saswifi.com ([104.153.224.168]) by smtp.gmail.com with ESMTPSA id n83sm7386805pfi.163.2017.09.24.08.02.14 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 24 Sep 2017 08:02:45 -0700 (PDT) From: Linus Walleij To: MyungJoo Ham , Chanwoo Choi Cc: linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, John Stultz , Mike Lockwood , Guenter Roeck , Linus Walleij Subject: [PATCH 8/8] extcon: gpio: Always check state on resume Date: Sun, 24 Sep 2017 16:56:22 +0200 Message-Id: <20170924145622.4031-9-linus.walleij@linaro.org> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170924145622.4031-1-linus.walleij@linaro.org> References: <20170924145622.4031-1-linus.walleij@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It makes most sense to always check the state of the GPIO external connector at system resume so just do this by default. Add a TODO if people turn out to desire to parameterize this. Signed-off-by: Linus Walleij --- drivers/extcon/extcon-gpio.c | 9 +++++++++ 1 file changed, 9 insertions(+) -- 2.13.5 diff --git a/drivers/extcon/extcon-gpio.c b/drivers/extcon/extcon-gpio.c index b7353f5018b5..4f0ad5ad2722 100644 --- a/drivers/extcon/extcon-gpio.c +++ b/drivers/extcon/extcon-gpio.c @@ -83,6 +83,15 @@ static int gpio_extcon_probe(struct platform_device *pdev) if (!data) return -ENOMEM; + /* + * Always checking connector state on resume makes most sense so do this + * by default. + * + * TODO: if parameterization is needed, augment this to use proper device + * properties or set it up from PM core. + */ + data->check_on_resume = true; + data->gpiod = devm_gpiod_get(dev, "extcon", GPIOD_IN); if (IS_ERR(data->gpiod)) return PTR_ERR(data->gpiod);