diff options
author | Tony Lindgren <tony@atomide.com> | 2018-04-16 13:24:14 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2018-04-30 15:04:51 -0400 |
commit | 71941002ad140cba0ee922a2bc9f5dcf9ac70b54 (patch) | |
tree | 31dd6f199d4ac5d91f43ecfdde3902e0db58ab34 /arch/arm/mach-omap2/omap_device.c | |
parent | 103fd8e7ac1f5f8e332970a95c79cd32c537798a (diff) |
ARM: OMAP2+: Only probe SDMA via ti-sysc if configured in dts
We still have some SDMA probing using omap_device_build() for the
arch/arm/plat-omap/dma.c part that the dmaengine driver then uses.
So we still need to ensure that omap_device_build() works even if we
probe and manage the dmaengine driver via ti-sysc. And we don't want
to call dev_pm_domain_set() as otherwise we'd also have omap_device
try to manage the hardware in addition to ti-sysc.
Cc: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2/omap_device.c')
-rw-r--r-- | arch/arm/mach-omap2/omap_device.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/arch/arm/mach-omap2/omap_device.c b/arch/arm/mach-omap2/omap_device.c index 3b829a50d1db..ac219b9e6a4c 100644 --- a/arch/arm/mach-omap2/omap_device.c +++ b/arch/arm/mach-omap2/omap_device.c | |||
@@ -143,7 +143,7 @@ static int omap_device_build_from_dt(struct platform_device *pdev) | |||
143 | struct resource res; | 143 | struct resource res; |
144 | const char *oh_name; | 144 | const char *oh_name; |
145 | int oh_cnt, i, ret = 0; | 145 | int oh_cnt, i, ret = 0; |
146 | bool device_active = false; | 146 | bool device_active = false, skip_pm_domain = false; |
147 | 147 | ||
148 | oh_cnt = of_property_count_strings(node, "ti,hwmods"); | 148 | oh_cnt = of_property_count_strings(node, "ti,hwmods"); |
149 | if (oh_cnt <= 0) { | 149 | if (oh_cnt <= 0) { |
@@ -151,8 +151,15 @@ static int omap_device_build_from_dt(struct platform_device *pdev) | |||
151 | return -ENODEV; | 151 | return -ENODEV; |
152 | } | 152 | } |
153 | 153 | ||
154 | /* SDMA still needs special handling for omap_device_build() */ | ||
155 | ret = of_property_read_string_index(node, "ti,hwmods", 0, &oh_name); | ||
156 | if (!ret && (!strncmp("dma_system", oh_name, 10) || | ||
157 | !strncmp("dma", oh_name, 3))) | ||
158 | skip_pm_domain = true; | ||
159 | |||
154 | /* Use ti-sysc driver instead of omap_device? */ | 160 | /* Use ti-sysc driver instead of omap_device? */ |
155 | if (!omap_hwmod_parse_module_range(NULL, node, &res)) | 161 | if (!skip_pm_domain && |
162 | !omap_hwmod_parse_module_range(NULL, node, &res)) | ||
156 | return -ENODEV; | 163 | return -ENODEV; |
157 | 164 | ||
158 | hwmods = kzalloc(sizeof(struct omap_hwmod *) * oh_cnt, GFP_KERNEL); | 165 | hwmods = kzalloc(sizeof(struct omap_hwmod *) * oh_cnt, GFP_KERNEL); |
@@ -191,11 +198,12 @@ static int omap_device_build_from_dt(struct platform_device *pdev) | |||
191 | r->name = dev_name(&pdev->dev); | 198 | r->name = dev_name(&pdev->dev); |
192 | } | 199 | } |
193 | 200 | ||
194 | dev_pm_domain_set(&pdev->dev, &omap_device_pm_domain); | 201 | if (!skip_pm_domain) { |
195 | 202 | dev_pm_domain_set(&pdev->dev, &omap_device_pm_domain); | |
196 | if (device_active) { | 203 | if (device_active) { |
197 | omap_device_enable(pdev); | 204 | omap_device_enable(pdev); |
198 | pm_runtime_set_active(&pdev->dev); | 205 | pm_runtime_set_active(&pdev->dev); |
206 | } | ||
199 | } | 207 | } |
200 | 208 | ||
201 | odbfd_exit1: | 209 | odbfd_exit1: |