Skip to content

Commit 071da69

Browse files
mvduinRobertCNelson
authored andcommitted
ARM: omap2: support deasserting reset from dts
1 parent 06cf6d1 commit 071da69

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

Documentation/devicetree/bindings/arm/omap/omap.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ Optional properties:
2424
- ti,no-reset-on-init: When present, the module should not be reset at init
2525
- ti,no-idle-on-init: When present, the module should not be idled at init
2626
- ti,no-idle: When present, the module is never allowed to idle.
27+
- ti,deassert-hard-reset: list of hwmod and hardware reset line name pairs
28+
(ascii strings) to be deasserted upon device instantiation.
2729

2830
Example:
2931

arch/arm/mach-omap2/omap_device.c

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ static int omap_device_build_from_dt(struct platform_device *pdev)
141141
struct omap_hwmod *oh;
142142
struct device_node *node = pdev->dev.of_node;
143143
struct resource res;
144-
const char *oh_name;
145-
int oh_cnt, i, ret = 0;
144+
const char *oh_name, *rst_name;
145+
int oh_cnt, dstr_cnt, i, ret = 0;
146146
bool device_active = false, skip_pm_domain = false;
147147

148148
oh_cnt = of_property_count_strings(node, "ti,hwmods");
@@ -189,6 +189,26 @@ static int omap_device_build_from_dt(struct platform_device *pdev)
189189
ret = PTR_ERR(od);
190190
goto odbfd_exit1;
191191
}
192+
dstr_cnt =
193+
of_property_count_strings(node, "ti,deassert-hard-reset");
194+
if (dstr_cnt > 0) {
195+
for (i = 0; i < dstr_cnt; i += 2) {
196+
of_property_read_string_index(
197+
node, "ti,deassert-hard-reset", i,
198+
&oh_name);
199+
of_property_read_string_index(
200+
node, "ti,deassert-hard-reset", i+1,
201+
&rst_name);
202+
oh = omap_hwmod_lookup(oh_name);
203+
if (!oh) {
204+
dev_warn(&pdev->dev,
205+
"Cannot parse deassert property for '%s'\n",
206+
oh_name);
207+
break;
208+
}
209+
omap_hwmod_deassert_hardreset(oh, rst_name);
210+
}
211+
}
192212

193213
/* Fix up missing resource names */
194214
for (i = 0; i < pdev->num_resources; i++) {

0 commit comments

Comments
 (0)