From patchwork Thu May 23 07:46:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 164942 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp1848458ili; Thu, 23 May 2019 00:46:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqyxF70GRWBEYsbCqmGcYKV3/EWYCt2fJr/JDeLpmQ4qZdxS+9PAbno1iJJ6pV0UWZE6QqjF X-Received: by 2002:a17:90a:a0a:: with SMTP id o10mr221725pjo.105.1558597591856; Thu, 23 May 2019 00:46:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558597591; cv=none; d=google.com; s=arc-20160816; b=uyrzip4IvakjpZFjwO4kv3Dp66qdBgXcfUDGbyAmHE3b9qGZdHZDSoNqD5NH1+62Gt gRkzkCZC9GckxC3sQs305uiHhYec1/wKjoKLEelrMVknIZaCCGURa8cXH+5Fk0vCcCgi pC6wr4QcYbC2yUcWnQPvkNfuHwiGziyiv9q+Jvn9ozMlLy3Qv5ivOigpke5lKLflaubp FSXfTICv5XScz8kLnsZh4qBPUSjN8NtMuykKSig4eSBSWhtkl1TnyKxER8A+GftzarW3 Ka1/15IBCd0ZWbHX97AH8i/yq3fXrYhMrVvyfG8XsThNfDuXDINv8o0rynBcqD73B9hd v5mA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=SNNBJSnx3sXoOboWJiPonCGDAGxtUWB/VomEYANV8g0=; b=iREbsV8KHmjJ1SrdaADjlTT6R8AE4f1ZlT0g94RM2+I50QGdUc3r1ED4J+NeMvtZCM YBU2Q++U3KKzzwFLz689GbsmrIDVfTR3+/3pFh1oIueKTQ301X6n29GzO9MLUmZkVonX 2Aqd5Z4jJrvet6M+VP0VUevOBiiUSmkayPlmYO5MOevN6k9pD3SJOkxl7s3IvYeyq/bT EDnVlqrxjes0rKbSQKOD7hFVwNxnLmnPvDjXWLruAlVXj5XWNW38Qo1gIxByP4xcviUb wogqgnBWw8K4bh2kkzdYHP7u7PqXe7l/aPgbwTHT7cA7ALocUvdfm9XMhxsb2I+Ano5p TaCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=saIesGeF; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-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 n7si13518941plk.435.2019.05.23.00.46.31; Thu, 23 May 2019 00:46:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-gpio-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=saIesGeF; spf=pass (google.com: best guess record for domain of linux-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-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 S1726081AbfEWHqb (ORCPT + 5 others); Thu, 23 May 2019 03:46:31 -0400 Received: from mail-lf1-f65.google.com ([209.85.167.65]:34975 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725814AbfEWHqb (ORCPT ); Thu, 23 May 2019 03:46:31 -0400 Received: by mail-lf1-f65.google.com with SMTP id c17so3663609lfi.2 for ; Thu, 23 May 2019 00:46:29 -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:mime-version :content-transfer-encoding; bh=SNNBJSnx3sXoOboWJiPonCGDAGxtUWB/VomEYANV8g0=; b=saIesGeF5H5wuOLPc4qHpPhs01t+hLPYqfO0MdarfCANbniA8IPtXJdob3P1KB3grT lSgqF9KLEbSXd/WG8HiOSPeA/PdhL7l7aBv6VA0zU1doIQUxvDjAD1sSWI0ll0jvrvL8 eaT5R2UoaCMtghgHEdX9KNexU9aWmsRkVXIJuNgSyTKh14Z5D9ngSWBL+0iT/QM70PS0 CU/9bVXK5+uOI26hRFihQ2NHsfIQDGt/5UXr/bQ/bth9/mbxja8PgCXaIourB5QoHlf/ 9u/rxvUXU6GTJpqnaf4EU2U+J+S1ZhT5hNDojSkZri26Sjd1iB/kgD1FP+t/2lsT4o9y UULw== 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:mime-version :content-transfer-encoding; bh=SNNBJSnx3sXoOboWJiPonCGDAGxtUWB/VomEYANV8g0=; b=EoPhoPhzyIeNpmlmvEU7Dy6IKLP3CgyWbQXELvIjAtwRXgv8q5R+MXNY1Tdy3TJ5IM YYCOYSn4rpza6aHmQ01UMp09IDFSYqucLptmeiHUaOBxIM4kEJEhbIOpqQaMrEX8X8ZT HnD1MevAiaA/+T7B3BrRkNw/+rOM4GnZl/VeJ3JdynYxkkETGjDCp9+WQ1c01VDHG6xH gHisGLFMlDoMlpdLV+/CYSmnMZk4YMoKC4YwvKa1dZ4+CXI/OUj7pKb4LYOf1viQf58i 07f0lXIgyncKVZ8f4KcqVXVvyzOtnvvGvBU21wPM/il4oGRn7kk5sTQC5ayVs2Ce7ySM Kzsw== X-Gm-Message-State: APjAAAV0lvJ2WirM6q19W8UBDiwwJo9CMGSfD+3ENsYjhAOt4jZV4fa5 xU+Q4nPtI4tyNri6tPDXFpl3f7kkm2o= X-Received: by 2002:ac2:5612:: with SMTP id v18mr30620142lfd.15.1558597588740; Thu, 23 May 2019 00:46:28 -0700 (PDT) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id k18sm5628761ljk.70.2019.05.23.00.46.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 May 2019 00:46:27 -0700 (PDT) From: Linus Walleij To: linux-gpio@vger.kernel.org Cc: Linus Walleij , =?utf-8?q?Jan_Kundr=C3=A1t?= , Lars Poeschel , Jason Kridner , Marco Felsch , Phil Reid Subject: [PATCH] pinctrl: mcp23s08: Enable device links to consumers Date: Thu, 23 May 2019 09:46:25 +0200 Message-Id: <20190523074625.15294-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org A recent core change makes it possible to create device links between a pin controller and its consumers. This is necessary to ascertain the right suspend/resume order for the devices: if a device is using a certain pin control state and want to switch that before/after going to suspend, then the pin controller may not be suspended already, and conversely on the resume path. Make sure any MCP23s08 consumers are suspended before the MCP23s08 is suspended. The MCP23s08 does not implement suspend/resume callbacks, but the device links are hierarchical, and this also makes sure that the I2C master where the MCP23s08 is in turn connected will not suspend before any clients of the pin control settings are suspended (and conversely for resume). Cc: Jan Kundrát Cc: Lars Poeschel Cc: Jason Kridner Cc: Marco Felsch Cc: Phil Reid Signed-off-by: Linus Walleij --- drivers/pinctrl/pinctrl-mcp23s08.c | 1 + 1 file changed, 1 insertion(+) -- 2.20.1 diff --git a/drivers/pinctrl/pinctrl-mcp23s08.c b/drivers/pinctrl/pinctrl-mcp23s08.c index f0cdb5234e49..9025835c0ec4 100644 --- a/drivers/pinctrl/pinctrl-mcp23s08.c +++ b/drivers/pinctrl/pinctrl-mcp23s08.c @@ -831,6 +831,7 @@ static int mcp23s08_probe_one(struct mcp23s08 *mcp, struct device *dev, else if (mcp->pinctrl_desc.npins == 16) mcp->pinctrl_desc.pins = mcp23x17_pins; mcp->pinctrl_desc.owner = THIS_MODULE; + mcp->pinctrl_desc.link_consumers = true; mcp->pctldev = devm_pinctrl_register(dev, &mcp->pinctrl_desc, mcp); if (IS_ERR(mcp->pctldev)) {