Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp14185794ybl; Mon, 30 Dec 2019 05:40:18 -0800 (PST) X-Google-Smtp-Source: APXvYqw29WSLdTdOaYD8cd725fLCRimUPiLKc11M6QKqoSkrYvJNSrPQkgJbzmI8o8rcN2WOdkWg X-Received: by 2002:a05:6830:4ca:: with SMTP id s10mr35336649otd.268.1577713218633; Mon, 30 Dec 2019 05:40:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577713218; cv=none; d=google.com; s=arc-20160816; b=XgLdDHmw1AqnuZOf3VWPuX8B42uKxHw4F8XxdgITDH1E2R0kGuwd0F+eITXrnwTd0J S1ZvksSmSN+xjqubwSlpV9P9HDcQybx2ha0ogB3We77EcBvNDmeDRyNHu0w9vR2Yplbq TVnHqgqzGx2y2cGJlXeUkdFnuj29+lCGuKBrT8NSHkgfOVjy81VaQnYITKESMK/1HRkZ UpBa3aH28kwzJXG9P+6WShikWj8/VsqXPUj17B99e5X3m/nAOIJlmfZvN2JD9cMHbCSX LiYkAAhZpOzqm99SW1x+HKRPS9f+wkzNTN66atI/xKVtSAoEo1ewP5JrqUPmw86vKIVM Rn/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=f9qO8fKrfWzfAdTJK9a4NreeGQyvAX6gHNfWB1HhAdU=; b=uriKZUUfvaU2+Hc2MQr/PJLd94hdvVr83KWL+WWU9WclMCLdVRVFcg9li2szEGbVzh Kpr9qDTDNAqPEFykt8z9+uIvtmVP8LXto+AoJjCriMUGEEd8xv2tEdDqpMGx53IBu1VU IqeJmiMi7FxHBtQz35OL6x5qiCyYBfGV+fA4G7lWbMSOhC478ckTFAOBrKH5tfcyM9IN 9OSfwsqw7cvSer/FWvELLAES5swcxH7KTi7+zzLb4Q2nymUDfFFly/Vzxvwxtfga9lVA 43ZmZelFbn+7+vhFuexgdhnJrqoIOjIniTjq2Sa/hT7lDuvEv4537qfQbSydbfSvaIpM /EuA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r22si23369188otn.192.2019.12.30.05.40.06; Mon, 30 Dec 2019 05:40:18 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727494AbfL3Ni6 (ORCPT + 99 others); Mon, 30 Dec 2019 08:38:58 -0500 Received: from andre.telenet-ops.be ([195.130.132.53]:36650 "EHLO andre.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727460AbfL3Ni6 (ORCPT ); Mon, 30 Dec 2019 08:38:58 -0500 Received: from ramsan ([84.195.182.253]) by andre.telenet-ops.be with bizsmtp id kDeu210095USYZQ01Deuat; Mon, 30 Dec 2019 14:38:57 +0100 Received: from rox.of.borg ([192.168.97.57]) by ramsan with esmtp (Exim 4.90_1) (envelope-from ) id 1ilvG2-0001h2-IO; Mon, 30 Dec 2019 14:38:54 +0100 Received: from geert by rox.of.borg with local (Exim 4.90_1) (envelope-from ) id 1ilvG2-0001Xo-Fu; Mon, 30 Dec 2019 14:38:54 +0100 From: Geert Uytterhoeven To: Linus Walleij , Bartosz Golaszewski , Pantelis Antoniou , Frank Rowand , Rob Herring Cc: Peter Ujfalusi , Chris Brandt , linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH/RFC 0/2] gpio: of: Add DT overlay support for GPIO hogs Date: Mon, 30 Dec 2019 14:38:50 +0100 Message-Id: <20191230133852.5890-1-geert+renesas@glider.be> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi all, As GPIO hogs are configured at GPIO controller initialization time, adding/removing GPIO hogs in Device Tree overlays currently does not work. Hence this patch series adds support for that, by registering an of_reconfig notifier, as is already done for platform, i2c, and SPI devices. Perhaps this would be better served through a pinctrl-gpio driver? Pinctrl is already working fine with DT overlays, as the pinctrl-* properties are part of the slave device node, and thus looked up at slave device node attachment time, not at pin controller initialization time. In my particular use case (talking to SPI devices connected to a PMOD connector on the RSK+RZA1 development board), the GPIO performs board level muxing of a.o. the SPI MOSI/MISO/SCK signals. Hence the hog really needs to be active only while talking to the SPI device, so the muxing could (in theory) be done upon demand. But how to describe that in DT, and implement it (using Runtime PM?)? Thanks for your comments! Geert Uytterhoeven (2): gpio: of: Extract of_gpiochip_add_hog() gpio: of: Add DT overlay support for GPIO hogs drivers/gpio/gpiolib-of.c | 133 +++++++++++++++++++++++++++++++++----- drivers/gpio/gpiolib-of.h | 2 + drivers/gpio/gpiolib.c | 14 +++- drivers/gpio/gpiolib.h | 3 + 4 files changed, 133 insertions(+), 19 deletions(-) -- 2.17.1 Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds