From patchwork Sat Mar 12 22:32:35 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Green X-Patchwork-Id: 528 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:43:22 -0000 Delivered-To: patches@linaro.org Received: by 10.224.45.75 with SMTP id d11cs13469qaf; Sat, 12 Mar 2011 14:32:39 -0800 (PST) Received: by 10.216.143.134 with SMTP id l6mr892180wej.2.1299969159138; Sat, 12 Mar 2011 14:32:39 -0800 (PST) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx.google.com with ESMTPS id z57si10951980weq.79.2011.03.12.14.32.37 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 12 Mar 2011 14:32:37 -0800 (PST) Received-SPF: pass (google.com: domain of andy.warmcat.com@googlemail.com designates 74.125.82.50 as permitted sender) client-ip=74.125.82.50; Authentication-Results: mx.google.com; spf=pass (google.com: domain of andy.warmcat.com@googlemail.com designates 74.125.82.50 as permitted sender) smtp.mail=andy.warmcat.com@googlemail.com; dkim=pass (test mode) header.i=@googlemail.com Received: by wwc33 with SMTP id 33so4661214wwc.31 for ; Sat, 12 Mar 2011 14:32:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:sender:from:subject:to:cc:date:message-id :in-reply-to:references:user-agent:mime-version:content-type :content-transfer-encoding; bh=w95DiQfh00zqPMMrkgslP7rUsIMkMswqjfHx5Wj1lPM=; b=oN0N8LP4agDNySxeZE0027m/JETxo88N98/s6Ea1/o7fse72BGulUcVCe3bRWguWCB o2+TQoQj/NTmXSyigYYI31hPB/jnXek5zpLQuaVaxrD+bX4AbGVtCi9DIZbbsEEXtYop lRSYqgOOFPTXUOjK7XmyNVqKs0u7Ec3ENtoqo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=sender:from:subject:to:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding; b=ZyUSWQQ6Ld7TRMNJr/Zgy0YQRVURqOUYSBH7+iTM1H/T1BY/GObKpk3Nqf6DnFQd25 ECBEmnTU581FReQaTRzVq7WYQLgecdXf9HHLYz7iWPNMEWk/6CdAeb6zL3zT5O+fHOny K/2wwGcpjtsKRtYd/Xg8Ir9UaHsPO7oJLQumM= Received: by 10.216.145.145 with SMTP id p17mr982072wej.37.1299969157121; Sat, 12 Mar 2011 14:32:37 -0800 (PST) Received: from otae.warmcat.com (s15404224.onlinehome-server.info [87.106.134.80]) by mx.google.com with ESMTPS id g32sm1657215wej.3.2011.03.12.14.32.36 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 12 Mar 2011 14:32:36 -0800 (PST) Sender: Andy Green From: Andy Green Subject: [RFC PATCH 4/4] PLATFORM: Add some documentation to platform docs about async platform_data To: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Cc: patches@linaro.org, Andy Green Date: Sat, 12 Mar 2011 22:32:35 +0000 Message-ID: <20110312223234.27020.3911.stgit@otae.warmcat.com> In-Reply-To: <20110312222633.27020.19543.stgit@otae.warmcat.com> References: <20110312222633.27020.19543.stgit@otae.warmcat.com> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 Signed-off-by: Andy Green --- Documentation/driver-model/platform.txt | 25 +++++++++++++++++++++++++ 1 files changed, 25 insertions(+), 0 deletions(-) diff --git a/Documentation/driver-model/platform.txt b/Documentation/driver-model/platform.txt index 41f4163..0c34156 100644 --- a/Documentation/driver-model/platform.txt +++ b/Documentation/driver-model/platform.txt @@ -96,6 +96,31 @@ System setup also associates those clocks with the device, so that that calls to clk_get(&pdev->dev, clock_name) return them as needed. +Providing platform_data to onboard devices on asynchronously probed buses +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Some boards have fixed onboard assets that would normally be dealt with +by using plaform_data set in the usual way in the board definition file, +but cannot directly do so because they are on a bus that is probed +asynchronously. For emebedded devices, often the broard definition +file is adding platform devices for the buses involved, like USB host +and gadget, in a fixed order using platform_add_devices(), so the device +path of these fixed soldered-on-the-board assets is deterministic. + +For buses and devices that are named deterministically at boot-time, +you can define platform_data that binds to these devices when they are +probed by declaring a map of device paths to platform_data in your +board definition file before adding the bus platform devices, using + + void platform_register_async_platform_data( + struct platform_async_platform_data *map, int count); + +Buses that participate in this scheme will then check this mapping list +for corresponding platform_data as they are probed and apply it +automatically. An example device path mapping is + + "usb1/1-1/1-1.1" + + Legacy Drivers: Device Probing ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Some drivers are not fully converted to the driver model, because they take