Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp495137pxb; Sat, 20 Feb 2021 10:32:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJxiywPdkAv/+mDhnQ+oYZICAt4PHJ5dPidG+SSRKGomuePBB0JnKUG6IMull1qBP84igxpM X-Received: by 2002:a05:6402:270d:: with SMTP id y13mr14980559edd.149.1613845924820; Sat, 20 Feb 2021 10:32:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613845924; cv=none; d=google.com; s=arc-20160816; b=j7zjQXsEN8f+v0By1k8TUQgKc0YZIoLhs7kcV6m2wzWc9zccon6Ts3Qg2hJY/iUtJ8 HN2aYlMOthQ6ZGvJO13btzSdKxxvYAO66dJMLWwxNlJxm5uiUPfjqdxEqp9MSENdvPmG XlZRP7v0sFtv36/BQ1bfoHJlzJkEHt8zDGqRPx/7jHHa1smvgBAne15zXbqX2DzDiiPf vCSe2xZvceRNoV8CirVE/Va0QBq7p0EKfYkEK3hjy62lJApNisKNVUbA/mUb/kgJD+Ii m60f1XCY8Opu9EnasaCKbaeWBSWrflyUjrjzzb7nI9ha6eKOfy27v9qSGdZpA+oYwiH8 c8FA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=RjkOkIQ4H50D5nfZE/7c1OGqspZr6SZ/5yZfAB+3COw=; b=I01CITg15VEjkp5r+vdlv/3evzK8ZskznqwWc27AJo/tHKG1ezY9phuH5qUk8w3Kgj Wb79Ejah0f0gO5FpLg6R3gtZ8d+lm8nl2k13PSS9W8qtJ8pIBDqpW5y9CkvhRUvPN93r tPIMAmwMgW8LdZlhI+zwm+Z4uNg2vjD8A6Qt/1PFKHPvOeCZwE6EGE3oo49Zb5uWCpq1 fk+wkB/8/0qZHunwRwhD5p9Ur7bXwnE8nR+83ZAsafO4+tZTt4Brj6Mf607A0NLq4W+v h1RoPi99334kpqkp75Y3qPbcvvCpE5wzppDEZ07LQkmhoNsMTqnW8b4S9KLk6/RCAf5Z GY0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@beagleboard-org.20150623.gappssmtp.com header.s=20150623 header.b=b4fh1A59; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k10si8255204ejg.374.2021.02.20.10.31.41; Sat, 20 Feb 2021 10:32:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@beagleboard-org.20150623.gappssmtp.com header.s=20150623 header.b=b4fh1A59; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229867AbhBTS3O (ORCPT + 99 others); Sat, 20 Feb 2021 13:29:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229784AbhBTS3L (ORCPT ); Sat, 20 Feb 2021 13:29:11 -0500 Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45CE1C061786 for ; Sat, 20 Feb 2021 10:28:31 -0800 (PST) Received: by mail-pg1-x535.google.com with SMTP id z68so7501090pgz.0 for ; Sat, 20 Feb 2021 10:28:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=beagleboard-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=RjkOkIQ4H50D5nfZE/7c1OGqspZr6SZ/5yZfAB+3COw=; b=b4fh1A59ioeDsmCACwiyS9ttlR06kwwPf1pF/gF7JJbOVTVSxqrqevai2LxhBujys2 9MjT5vBsqrD3aDlDyNajoRDAlrnaE+r2gMwLd/qX1Ti4fLX5VfbM7miSgtYYew8b49kk VSf1oIS8dNcPzN9GeZV6lfIvLkrg751k17JwRwVW1zBhwluTAyVZxm3uhMoToqe/83MF bq7B3lsI36QhZj40FSMMvZpPAiDuTutcGMEz+NCQZ8j9lJNCKJCffce7mQk3NbexwXxk dbGrFqJ/Il8Bi9ahjiWtMrOQPD+2f/TMuhtuTRWXaHEmm76Yuue30ygvmNwBmHYa4NBN AJcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=RjkOkIQ4H50D5nfZE/7c1OGqspZr6SZ/5yZfAB+3COw=; b=d/JP5iZbc4vrrZWzz+CXjKggE23R308unNX1uQVHKEX6nwvxkQHi6hKfC0Z3n4tq+w xBr52eKSpaCu0yaJphSoCh5A+Naca5OlwQz48oBNchEWPCOxQlzLitQ2WQMmMnJJBbb0 0gvpFUmpYT1C1q/A6vgHz/cPRmHV+vS34L+9O9Q9ghvbtjNUiHJU4GQpTtpZ5/xJPL6b D8rL/nxx6ciLVbXddjtGhJlFQoj7NwTpWSi6zQvqUIvt0aReOg8kRIG3AwfbXXLRVaoM TfMqKV0xoqRMlezjCpKpSSttCf45ddpNbalpK00kGwvi76zE0A5OMklOuwKGrIEM5Hb6 1dzw== X-Gm-Message-State: AOAM533EVAyFS43ABlbsFrppbtrIDq2vbOrCi2r7Jxk+wRYweyvNtv5z 1abBDMhXJnayfrrdXi4TzOyHpw== X-Received: by 2002:a62:3805:0:b029:1ec:f57c:8189 with SMTP id f5-20020a6238050000b02901ecf57c8189mr14757805pfa.37.1613845710491; Sat, 20 Feb 2021 10:28:30 -0800 (PST) Received: from x1 ([2601:1c0:4701:ae70:3902:ca9d:7b75:1d0c]) by smtp.gmail.com with ESMTPSA id n1sm13998596pfd.212.2021.02.20.10.28.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 Feb 2021 10:28:29 -0800 (PST) Date: Sat, 20 Feb 2021 10:28:27 -0800 From: Drew Fustini To: Geert Uytterhoeven Cc: Linus Walleij , "open list:GPIO SUBSYSTEM" , Linux Kernel Mailing List , Tony Lindgren , Andy Shevchenko , Alexandre Belloni , Pantelis Antoniou , Jason Kridner , Robert Nelson , Joe Perches , Dan Carpenter , Jonathan Corbet , "open list:DOCUMENTATION" Subject: Re: [PATCH v7 2/3] pinctrl: pinmux: Add pinmux-select debugfs file Message-ID: <20210220182827.GA70861@x1> References: <20210217221457.1827266-1-drew@beagleboard.org> <20210217221457.1827266-3-drew@beagleboard.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 19, 2021 at 10:06:51AM +0100, Geert Uytterhoeven wrote: > Hi Drew, > > On Wed, Feb 17, 2021 at 11:15 PM Drew Fustini wrote: > > Add "pinmux-select" to debugfs which will activate a function and group: > > > > echo "" > pinmux-select > > > > The write operation pinmux_select() handles this by checking that the > > names map to valid selectors and then calling ops->set_mux(). > > > > The existing "pinmux-functions" debugfs file lists the pin functions > > registered for the pin controller. For example: > > > > function: pinmux-uart0, groups = [ pinmux-uart0-pins ] > > function: pinmux-mmc0, groups = [ pinmux-mmc0-pins ] > > function: pinmux-mmc1, groups = [ pinmux-mmc1-pins ] > > function: pinmux-i2c0, groups = [ pinmux-i2c0-pins ] > > function: pinmux-i2c1, groups = [ pinmux-i2c1-pins ] > > function: pinmux-spi1, groups = [ pinmux-spi1-pins ] > > > > To activate function pinmux-i2c1 and group pinmux-i2c1-pins: > > > > echo "pinmux-i2c1 pinmux-i2c1-pins" > pinmux-select > > > > Reviewed-by: Andy Shevchenko > > Reviewed-by: Tony Lindgren > > Signed-off-by: Drew Fustini > > Thanks for your patch! > > On R-Car M2-W, which does not use pinctrl-single, I have: > > # cat pinmux-functions > ... > function 14: i2c2, groups = [ i2c2 i2c2_b i2c2_c i2c2_d ] > ... > function 51: ssi, groups = [ ssi0_data ssi0_data_b ssi0129_ctrl > ssi0129_ctrl_b ssi1_data ssi1_data_b ssi1_ctrl ssi1_ctrl_b ssi2_data > ssi2_ctrl ssi3_data ssi34_ctrl ssi4_data ssi4_ctrl ssi5_data ssi5_ctrl > ssi6_data ssi6_ctrl ssi7_data ssi7_data_b ssi78_ctrl ssi78_ctrl_b > ssi8_data ssi8_data_b ssi9_data ssi9_data_b ssi9_ctrl ssi9_ctrl_b ] > ... > > On the Koelsch board: > > # cd /sys/kernel/debug/pinctrl/e6060000.pinctrl-sh-pfc/ > # echo ssi ssi2_ctrl > pinmux-select # Configure i2c2 pins for ssi > # i2cdetect -y -a 2 # Fails > # echo i2c2 i2c2 > pinmux-select # Restore i2c2 > # i2cdetect -y -a 2 # Works again > > The order of the 2 parameters looks a bit odd to me, as the operation > configures the pins from "group" to be used for "function". > See also arch/arm/boot/dts/r8a7791-koelsch.dts > For the i2c2 example it's not that obvious, but for ssi it is. > Might feel different for pinctrl-single, and perhaps I just need to get > used to it ;-) Thank you for comments and testing. Regarding the order of " ", I can change it to "" if that seems more natural. pinctrl-single does not actually use the group selector in pcs_set_mux() so it essentially does not matter for pinctrl-single. -Drew > > Anyway: > Reviewed-by: Geert Uytterhoeven > Tested-by: Geert Uytterhoeven > > 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