From: Rajendra Nayak Date: Fri, 18 Nov 2011 11:17:20 +0000 (+0530) Subject: regulator: map consumer regulator based on device tree X-Git-Tag: v3.3-rc1~126^2~28^2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=69511a452e6dc6b74fe4f3671a51b1b44b9c57e3;p=pandora-kernel.git regulator: map consumer regulator based on device tree Device nodes in DT can associate themselves with one or more regulators/supply by providing a list of phandles (to regulator nodes) and corresponding supply names. For Example: devicenode: node@0x0 { ... ... vmmc-supply = <®ulator1>; vpll-supply = <®ulator2>; }; The driver would then do a regulator_get(dev, "vmmc"); to get regulator1 and do a regulator_get(dev, "vpll"); to get regulator2. of_get_regulator() extracts the regulator node for a given device, based on the supply name. Use it to look up the regulator for a given consumer from device tree, during a regulator_get(). If not found fallback and lookup through the regulator_map_list instead. Also, since the regulator dt nodes can use the same binding to associate with a parent regulator/supply, allow the drivers to specify a supply_name, which can then be used to lookup dt to find the parent phandle. Signed-off-by: Rajendra Nayak Acked-by: Grant Likely Signed-off-by: Mark Brown --- Reading git-diff-tree failed