From patchwork Thu May 23 07:51:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 164943 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp1851975ili; Thu, 23 May 2019 00:51:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqwSE1nnTSBryCbsgv/uPly3KXVmyxu/88vnE8LRdiS8isXUeus/IHGfm4n1iKk8cVyMzwnn X-Received: by 2002:a17:902:284a:: with SMTP id e68mr71548679plb.258.1558597872287; Thu, 23 May 2019 00:51:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558597872; cv=none; d=google.com; s=arc-20160816; b=NhF9rBmldvkY5sEHLPWlLhHZGR+aSzP9WumxdFLQduaA68kyUTh3FYwqTNOYAktGW7 40V+mxu+Zj3MJ+7Gm9B1TzjJumcFMSgG+hsX0lGIojwtzHNFyjHRvbD4vJnhjWHS29YR dlHBYrCXUh1iWY9xE8g1QTGBHdMsyiu5qXFRHvoHN51UIIsUpychLtiD2BZeOyYGs8G/ 92ddx4C3YI0Sam1FUnYFrL8UGcidrbgnPSwacN+FQpVxqfy/KIajlijvpYnxZGWnihD+ kV2ENRIEqN3eVRaGuDa/x8axzSXgZweKN7csk/c4Twb7i7Ox1p8KrGqcjwhMQHkYuvCd 93wQ== 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=6x7UGpKJgQKDZHgVNjoxC5p2gPOS4T78zzyffMk/8h4=; b=pBPeKccSbdu19ekbV5ctIabEi5C7hB1YKorgDZkrKE+iYvJbrgNOcfHTDDvwwAXCKM nI9uCMw5wru+8KV9UuYd670EXHr80xQhZ/iPGDZg1rTg91Xak6c/P4zu7sWufqRLG48G 6Fehn3TR6X9BaFsKXF0Clj+dhzrp2+clKYpZeB8QweSlNyXhEdoPnubmfkgskTBCta36 ROe35dTXVBCBcl8uB1WLPdwmFmYBNEISZ+wTvc7QLgSBAUwAcQkZrnr8kG62vH2H79M9 oitYRUoxsG1CEjRc7OcMWdvwHjMWSJevWqgZybkJUji/dzOC1g32IQ+liOrpMnDmol/+ hTLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aFgwXRW+; 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 d191si26818514pga.454.2019.05.23.00.51.12; Thu, 23 May 2019 00:51:12 -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=aFgwXRW+; 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 S1726385AbfEWHvL (ORCPT + 5 others); Thu, 23 May 2019 03:51:11 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:37401 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726309AbfEWHvL (ORCPT ); Thu, 23 May 2019 03:51:11 -0400 Received: by mail-lj1-f193.google.com with SMTP id h19so4524983ljj.4 for ; Thu, 23 May 2019 00:51:10 -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=6x7UGpKJgQKDZHgVNjoxC5p2gPOS4T78zzyffMk/8h4=; b=aFgwXRW+4uUt0lfDSoB12+0Z7Ec2fOYPyFT6nesGKMeTj3IMO+2302jVVaHFb3BiKA eCMd4wHRiUMPKF2JorMchNo+Nl2DozudDA50BZU+cmUWnP5Dq2Rz5h8lcZO7g6Odob7T pWxK8WBKc3qY996glKW9R9S/kRfdMTsEydvuRozT+7Nl9P8mfuPuxsD0DGIrQuBrurNG YDOeNM3oz153pufgp/7IJyqXYmwc1fIsCfq7XqVcJOq78/kyBoDuSD5QOvtGGr8inyWe FHuTEG1rgib5OI6pInlHVMb6g41G0cIro6tOi1KpK14jdrtAEmdnM5ZInoiFY/IL1kwl xaIw== 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=6x7UGpKJgQKDZHgVNjoxC5p2gPOS4T78zzyffMk/8h4=; b=Yl8BmvHUjsr/Uvvu3289K8Xb+VT4hTM4nc85UBGwu/m0IUk4wC5yyCPhYuE9s6giaU m7u0aXTzNCGXWUK1bc8u7Xe5nVVuZrq2GAToW8yN+YI/el8R7rSGjfE50RvYymWC8lwL 3dC0CP7DEolQnXtl7ZA6MdiXoxBVYtzYS+IWdgk3FzaeDgmWPjXj97puFRip0aYG5K+b Fme0AiH+bJ1K5Tbk1R/ggjGX6BqVW1jetPZtGcX0nWwWxI93s9wR5x7IO8+nEY3H9QhV S3Q1P9G3iUyMA4mQfD2SCZ2vAwDErBdjwR1MQ8jL6rh3id68cNRXbao0/O4Rw6Qt4UUc mDPQ== X-Gm-Message-State: APjAAAUpaUohDbN/MFtStGczcza5Jt/+rn0YxIzq9B4EsMxRMb4mSd0A Hkv0031TmIs9t2B4YoBoTWGHSfnEPT0= X-Received: by 2002:a2e:5c08:: with SMTP id q8mr27595773ljb.113.1558597868547; Thu, 23 May 2019 00:51:08 -0700 (PDT) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id u19sm5631441lfu.63.2019.05.23.00.51.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 May 2019 00:51:06 -0700 (PDT) From: Linus Walleij To: linux-gpio@vger.kernel.org Cc: Linus Walleij , Peter Rosin , Neil Armstrong , Andrey Smirnov , Benjamin Gaignard Subject: [PATCH] pinctrl: sx150x: Enable device links to consumers Date: Thu, 23 May 2019 09:51:02 +0200 Message-Id: <20190523075102.16094-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 SX150X consumers are suspended before the SX150X is suspended. The SX150X does not implement suspend/resume callbacks, but the device links are hierarchical, and this also makes sure that the I2C master where the SX150X is in turn connected will not suspend before any clients of the pin control settings are suspended (and conversely for resume). Cc: Peter Rosin Cc: Neil Armstrong Cc: Andrey Smirnov Cc: Benjamin Gaignard Signed-off-by: Linus Walleij --- drivers/pinctrl/pinctrl-sx150x.c | 1 + 1 file changed, 1 insertion(+) -- 2.20.1 diff --git a/drivers/pinctrl/pinctrl-sx150x.c b/drivers/pinctrl/pinctrl-sx150x.c index 4d87d75b9c6e..8b954f74a63a 100644 --- a/drivers/pinctrl/pinctrl-sx150x.c +++ b/drivers/pinctrl/pinctrl-sx150x.c @@ -1151,6 +1151,7 @@ static int sx150x_probe(struct i2c_client *client, pctl->pinctrl_desc.pins = pctl->data->pins; pctl->pinctrl_desc.npins = pctl->data->npins; pctl->pinctrl_desc.owner = THIS_MODULE; + pctl->pinctrl_desc.link_consumers = true; ret = devm_pinctrl_register_and_init(dev, &pctl->pinctrl_desc, pctl, &pctl->pctldev);