Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752700AbdC2Oz5 (ORCPT ); Wed, 29 Mar 2017 10:55:57 -0400 Received: from relmlor1.renesas.com ([210.160.252.171]:39283 "EHLO relmlie4.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752336AbdC2Ozx (ORCPT ); Wed, 29 Mar 2017 10:55:53 -0400 X-IronPort-AV: E=Sophos;i="5.36,241,1486393200"; d="scan'208";a="238127306" From: Chris Brandt To: Linus Walleij , Jacopo Mondi , Bjorn Andersson CC: Geert Uytterhoeven , Laurent Pinchart , Rob Herring , "Mark Rutland" , Russell King , Linux-Renesas , "linux-gpio@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH v3 3/7] arm: dts: dt-bindings: Add Renesas RZ pinctrl header Thread-Topic: [PATCH v3 3/7] arm: dts: dt-bindings: Add Renesas RZ pinctrl header Thread-Index: AQHSpLJ6VNE1pFUaX0a1Hx3QR4RDhaGr1ZuAgAAPSIA= Date: Wed, 29 Mar 2017 14:55:46 +0000 Message-ID: References: <1490368934-12494-1-git-send-email-jacopo+renesas@jmondi.org> <1490368934-12494-4-git-send-email-jacopo+renesas@jmondi.org> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: linaro.org; dkim=none (message not signed) header.d=none;linaro.org; dmarc=none action=none header.from=renesas.com; x-originating-ip: [75.60.247.61] x-microsoft-exchange-diagnostics: 1;SG2PR06MB1167;7:k2Ch/mql0uueEA2qVcRZ/4i9hTGjbIgRnRktC3B/K++PmAwdkk9ZyYNHEpkXOaWbzR5UXyn7awNncRiJ9TWfcFd9H+VPlK0OyRybC5XGfJKFr8l5QkfVvmZxfa+6UvuwLjmaljySZZd4LYM3gROhz5eqIlxxYDRTCglj+fwAh9b5jL/hQhmd2mwgSk22lrbjoL0lbneAD9KkIJrKK6+66Zppr0Afk+1SP4Q3JEszdnJu5fW5kJnY49/6fZJg2gGvAN3ipvna92EH4/ocnf9eiWLlxqMZxI15HeM2vLDchKqFKQV8shklyknkgbx/EiseieSkql0p2CKdWiOtQXFZ/A==;20:1K/WY4voeyfIN0yfyWRgeiB6UczfQlddF2LyjrBoe6x6AhqXH9L94Q9zs2OubjdIcfLEGrWezJlw4sfE7sVjR+Ubzdn2+XkyTvi+1xy96xN277sH0S2AfOF7LVkSU+3FMbUuEMkn94JU+HLDx5Xh9r5ZN89viO57ykDLJPkN8GM= x-ms-office365-filtering-correlation-id: c0ff1df8-767b-420d-aea4-08d476b3aed1 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(2017030254075)(48565401081)(201703131423075)(201703031133081)(201702281549075);SRVR:SG2PR06MB1167; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040450)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6055026)(6041248)(20161123560025)(20161123558025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406075)(20161123562025)(20161123555025)(6072148);SRVR:SG2PR06MB1167;BCL:0;PCL:0;RULEID:;SRVR:SG2PR06MB1167; x-forefront-prvs: 0261CCEEDF x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(39450400003)(39840400002)(39850400002)(39860400002)(39410400002)(39400400002)(377454003)(24454002)(5660300001)(55016002)(102836003)(33656002)(8676002)(53546009)(54356999)(25786009)(7696004)(3846002)(77096006)(53936002)(81166006)(66066001)(74316002)(6506006)(54906002)(86362001)(6436002)(2950100002)(9686003)(99286003)(122556002)(38730400002)(4326008)(2906002)(229853002)(50986999)(2900100001)(6246003)(8936002)(305945005)(76176999)(189998001)(6116002)(3660700001)(7736002)(7416002)(3280700002);DIR:OUT;SFP:1102;SCL:1;SRVR:SG2PR06MB1167;H:SG2PR06MB1165.apcprd06.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Mar 2017 14:55:46.8051 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2PR06MB1167 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id v2TEwCHN023660 Content-Length: 3722 Lines: 102 On Wednesday, March 29, 2017, Linus Walleij wrote: > On Fri, Mar 24, 2017 at 4:22 PM, Jacopo Mondi > wrote: > > > Add dt-bindings for Renesas r7s72100 pin controller header file. > > > > Signed-off-by: Jacopo Mondi > > > +/* > > + * Pin is bi-directional. > > + * An alternate function that needs both input/output functionalities > > +shall > > + * be configured as bidirectional. > > + * Eg. SDA/SCL pins of an I2c interface. > > + */ > > +#define BI_DIR (1 << 3) > > Any specific reason why this should not simply be added to > include/linux/pinctrl/pinconf-generic.h > as PIN_CONFIG_BIDIRECTIONAL and parsed in drivers/pinctrl/pinconf- > generic.c from the (new) DT property "bidirectional" simply? I see your point. It would cut down from every driver out there inventing some new property or config instead of everyone just sharing a fixed set. Maybe someone else out there will end up having a need for a "bidirectional" option. > > +/* > > + * Flags used to ask software to drive the pin I/O direction > > +overriding the > > + * alternate function configuration. > > + * Some alternate functions require software to force I/O direction > > +of a pin, > > + * overriding the designated one. > > + * Refer to the HW manual to know when this flag shall be used. > > + */ > > +#define SWIO_IN (1 << 4) > > +#define SWIO_OUT (1 << 5) > > What is wrong in doing this with generic pin config using > PIN_CONFIG_INPUT_ENABLE and PIN_CONFIG_OUTPUT (ignoring the argument)? > > In the device tree use input-enable and add a new output-enable (with > unspecified value) with proper description and DT bindings? Again, that's probably fine. It seems we are still doing the same thing which is using the DT to pass extra config information to the driver. And, we can do whatever we want with that info. > And if you think these have no general applicability, by the end of the > day they are *still* pin config, not magic flags we can choose to toss in > with the muxing, so you can do what the Qualcomm driver does and add > custom pin configurations extending the generic pin config, see > drivers/pinctrl/qcom/pinctrl-spmi-gpio.c > qcom,pull-up-strength etc. But, it seems that when you set a config option, it applies to everything in "pins"? I2C Example: (seem OK) /* P1_6 = RIIC3SCL (bi dir) */ /* P1_7 = RIIC3SDA (bi dir) */ i2c3_pins: i2c3 { pins = , ; bidirectional; }; But, what do we do for Ethernet? All the pins are "normal" except just the MDIO pin needs to be bidirectional. That's the part I'm confused by. How do we flag that just the ET_MDIO needs "bidirectional"? /* Ethernet */ ether_pins: ether { /* Ethernet on Ports 1,2,3,5 */ pins = , /* P1_14 = ET_COL */ , /* P5_9 = ET_MDC */ , /* P3_3 = ET_MDIO !!!! (bi dir) !!!!!! */ , /* P3_4 = ET_RXCLK */ , /* P3_5 = ET_RXER */ , /* P3_6 = ET_RXDV */ , /* P2_0 = ET_TXCLK */ , /* P2_1 = ET_TXER */ , /* P2_2 = ET_TXEN */ , /* P2_3 = ET_CRS */ , /* P2_4 = ET_TXD0 */ , /* P2_5 = ET_TXD1 */ , /* P2_6 = ET_TXD2 */ , /* P2_7 = ET_TXD3 */ , /* P2_8 = ET_RXD0 */ , /* P2_9 = ET_RXD1 */ , /* P2_10 = ET_RXD2 */ ; /* P2_11 = ET_RXD3 */ }; Chris