Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752905Ab2KFTlL (ORCPT ); Tue, 6 Nov 2012 14:41:11 -0500 Received: from li42-95.members.linode.com ([209.123.162.95]:58207 "EHLO li42-95.members.linode.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752432Ab2KFTlH convert rfc822-to-8bit (ORCPT ); Tue, 6 Nov 2012 14:41:07 -0500 Subject: Re: [RFC] Device Tree Overlays Proposal (Was Re: capebus moving omap_devices to mach-omap2) Mime-Version: 1.0 (Apple Message framework v1085) Content-Type: text/plain; charset=iso-8859-1 From: Pantelis Antoniou In-Reply-To: Date: Tue, 6 Nov 2012 20:41:00 +0100 Cc: Tony Lindgren , Grant Likely , Rob Herring , Deepak Saxena , Benjamin Herrenschmidt , Scott Wood , Felipe Balbi , Benoit Cousson , linux-kernel , Koen Kooi , Matt Porter , linux-omap@vger.kernel.org, Kevin Hilman , Paul Walmsley , devicetree-discuss@lists.ozlabs.org Content-Transfer-Encoding: 8BIT Message-Id: <56051C08-3ECF-4C0A-9B88-64B4C1DDDF45@antoniou-consulting.com> References: <02FF5400-9F97-4B8A-AEF0-267B01C8099F@antoniou-consulting.com> <20121106183531.GH6801@atomide.com> To: Russ Dill X-Mailer: Apple Mail (2.1085) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3231 Lines: 96 Hi Russ, On Nov 6, 2012, at 8:29 PM, Russ Dill wrote: > On Tue, Nov 6, 2012 at 10:35 AM, Tony Lindgren wrote: >> * Grant Likely [121106 03:16]: >>> On Tue, Nov 6, 2012 at 10:30 AM, Pantelis Antoniou >>> wrote: >>>> >>>> Another can of worms is the pinctrl nodes. >>> >>> Yes... new pinctrl data would need to trigger adding new data to >>> pinctrl. I don't know if the pinctrl api supports that. >> >> The actual pins stay the same, just their configuration >> changes. AFAIK all that is already supported using the >> pinctrl framework. >> >> For example, considering hotplugging capes on the beaglebone: >> >> 1. You need to map all the sensible modes for the pins exposed >> to the capes in the board specific .dts file. This will >> add roughly 4 x nr_capbus_pins named modes in the .dts file >> so not too bad. >> >> 2. Claim all the capebus pins during the capbus driver probe >> and set them to some safe mode. >> >> 3. Try to detect the connected cape(s) over i2c. >> >> 4. Use pinctr_select_state to set the desired modes for >> the pins used by the cape(s). >> >> 5. Enable capebus regulators and clocks etc. >> >> 6. Load the driver modules for whatever omap internal >> devices the cape supports. >> >> You could also claim the pin for the omap internal >> devices instead of claiming them in the capebus, but then >> things can get messy with binding and unbinding the >> drivers. So just claiming all the pins in the capebus >> probably keeps things simpler. > > That assumes that for a particular external bus, certain pins aren't > already shared with functions already on the board, for instance if an > I?C bus brought out to the external bus already has a chip connected > to it. This is our case on the bone. We don't enable the peripheral until a cape that references it is enabled. I don't think that very big changes are going to be needed TBH. So now we use: am3358_pinmux: pinmux@44e10800 { .... bone_dvi_cape_led_pins: pinmux_bone_dvi_cape_led_pins { pinctrl-single,pins = < 0x48 0x07 /* gpmc_a2.gpio1_18, OUTPUT | MODE7 */ 0x4c 0x07 /* gpmc_a3.gpio1_19, OUTPUT | MODE7 */ >; }; .... }; And in the cape definition: pinctrl-0 = <&bone_geiger_cape_pins>; Ideally if we could do this in the cape definition: cape_pinmux { parent = <&am3358_pinmux>; bone_dvi_cape_led_pins: pinmux_bone_dvi_cape_led_pins { pinctrl-single,pins = < 0x48 0x07 /* gpmc_a2.gpio1_18, OUTPUT | MODE7 */ 0x4c 0x07 /* gpmc_a3.gpio1_19, OUTPUT | MODE7 */ >; }; pinctrl-0 = <&bone_geiger_cape_pins>; It would be just fine. Regards -- Pantelis -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/