Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp7873809pxb; Fri, 19 Feb 2021 01:16:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJx9XODJCUTWVXcrlI1W1BySKK3nUhmAia8MgkI3MOxKEox4sYAJ0xhcL0WleMrd9HknMS34 X-Received: by 2002:a17:907:e91:: with SMTP id ho17mr7974562ejc.93.1613726184604; Fri, 19 Feb 2021 01:16:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613726184; cv=none; d=google.com; s=arc-20160816; b=ROTCMxpDo8WwoP30tp9VYKYG4mfGCydc6YcIBuC8tl/mst8QParPGMHpjNN2RxGTDu GArPWnDsnaf7FIpwrSh0hLXcQ/bwt1lS+mQ6eM9XxQTnMEWnhCvghhT6m49qOqnxBH63 6egOtBLfqhTB5C2vp8lQaoL/UeIdwDRkgxh2owb06FJUKLsq2uVjRhqb1NvJcc4vJptP e7oHbo5L0ajmrH/ZUFq2L1X5QNUO585oxImSODeum0VoYxKYRKnJMQejlk0y76xX15tq /+k6CQ8q7B6/uIXB8VgLGCJocfdJw/9ksxUIK2d30vN1UKaoNWThFzHWwD+RVMnSl2pd gqLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=WMmV+pg/AZEmOZWqm+tCw4vrAAYkC3Vrjkj4xpthz5Q=; b=XNCCUSs6pZFINCKiFGmvLfjKYnC2JL61CCCu9aIzwAxKfgAcRVZZVrNmvWcNC45TSd v4KwRzucGB5fvkE4soKKtmolCW25JGejJJ+us7Td2Jdp3BzS1dMeRr4Ogzk/Pr5l3s9N hxHaoA3MW3LVPe6cFU4w97ZYLco/pVHsx9HYvTQ7PWeuEKzimqiWDScLHlXHAhoAa32+ EB4S6mo47KgTm6NyqNshP5XWcq6bz7URklY0S1HMLOeSrh/05rXJajVlYD+qm9ovdtMB 0aekT/U+Rkygx09CWxKBq8v49Vimi1xjJXk95c4C9ft1gBQG8TykxA+FzjRYNC2J9j69 fkxA== ARC-Authentication-Results: i=1; mx.google.com; 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 24si4268172ejw.535.2021.02.19.01.16.00; Fri, 19 Feb 2021 01:16:24 -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; 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 S229925AbhBSJN3 (ORCPT + 99 others); Fri, 19 Feb 2021 04:13:29 -0500 Received: from mail-oi1-f172.google.com ([209.85.167.172]:37638 "EHLO mail-oi1-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229958AbhBSJHo (ORCPT ); Fri, 19 Feb 2021 04:07:44 -0500 Received: by mail-oi1-f172.google.com with SMTP id y199so5163022oia.4; Fri, 19 Feb 2021 01:07:28 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=WMmV+pg/AZEmOZWqm+tCw4vrAAYkC3Vrjkj4xpthz5Q=; b=qBgKiSZjiy+AsAFN0BRkVX/1Gy66LIv9oVg43bXGptf9YINb+E7sgU0ToL2VYJ3dxc 0qV/aSF5W7UNUtpxSHLlmkS+3aYaboSAksG5lfQnxDtwSdFsJcw6brf4/9cUTYT17mUY 5T4EHvWPojdCgLThd42rOlV3H8qRXMLrw409zEDTbmScYOlaqI9M8CJcFcd1MofGyZ5j ArwzDuquJmA97UVRvVWPY4ecCiWWgEw8dVbWeeFxThvAU6O1M3kRia6glxTCCcYTdYcz QjPzzbpjmbzupL/egG/ShZHTCYbqMZVdvuY2geEjMORCLXq8tUqH25fRNS58pidM/ziL 7hNw== X-Gm-Message-State: AOAM530nNbtcIbOCFXE8B1KJ1u4mg0NyC5TSKwWTqDZDlBrOoNJ8oubT k3mtI/rQMLFocNPmukrDzPL18rU+FY49bcfGUdA= X-Received: by 2002:aca:744:: with SMTP id 65mr5682790oih.153.1613725622900; Fri, 19 Feb 2021 01:07:02 -0800 (PST) MIME-Version: 1.0 References: <20210217221457.1827266-1-drew@beagleboard.org> <20210217221457.1827266-3-drew@beagleboard.org> In-Reply-To: <20210217221457.1827266-3-drew@beagleboard.org> From: Geert Uytterhoeven Date: Fri, 19 Feb 2021 10:06:51 +0100 Message-ID: Subject: Re: [PATCH v7 2/3] pinctrl: pinmux: Add pinmux-select debugfs file To: Drew Fustini 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" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 ;-) 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