diff options
author | Omar Ramirez Luna <omar.luna@linaro.org> | 2012-11-19 20:05:50 -0500 |
---|---|---|
committer | Joerg Roedel <joro@8bytes.org> | 2012-12-03 12:48:13 -0500 |
commit | 72b15b6ae97796c5fac687addde5dbfab872cf94 (patch) | |
tree | be849a67c3b00a4bb0f4651901e0c37323e74c94 /drivers/iommu/omap-iommu.c | |
parent | 87f8e57327bd8d85fb5b46cad29ac281430cc50d (diff) |
iommu/omap: Migrate to hwmod framework
Use hwmod data and device attributes to build and register an
omap device for iommu driver.
- Update the naming convention in isp module.
- Remove unneeded check for number of resources, as this is now
handled by omap_device and prevents driver from loading.
- Now unused, remove platform device and resource data, handling
of sysconfig register for softreset purposes, use default
latency structure.
- Use hwmod API for reset handling.
Signed-off-by: Omar Ramirez Luna <omar.luna@linaro.org>
Tested-by: Ohad Ben-Cohen <ohad@wizery.com>
Signed-off-by: Joerg Roedel <joro@8bytes.org>
Diffstat (limited to 'drivers/iommu/omap-iommu.c')
-rw-r--r-- | drivers/iommu/omap-iommu.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c index f8082da6179b..af9b4f31f594 100644 --- a/drivers/iommu/omap-iommu.c +++ b/drivers/iommu/omap-iommu.c | |||
@@ -143,13 +143,23 @@ EXPORT_SYMBOL_GPL(omap_iommu_arch_version); | |||
143 | static int iommu_enable(struct omap_iommu *obj) | 143 | static int iommu_enable(struct omap_iommu *obj) |
144 | { | 144 | { |
145 | int err; | 145 | int err; |
146 | struct platform_device *pdev = to_platform_device(obj->dev); | ||
147 | struct iommu_platform_data *pdata = pdev->dev.platform_data; | ||
146 | 148 | ||
147 | if (!obj) | 149 | if (!obj || !pdata) |
148 | return -EINVAL; | 150 | return -EINVAL; |
149 | 151 | ||
150 | if (!arch_iommu) | 152 | if (!arch_iommu) |
151 | return -ENODEV; | 153 | return -ENODEV; |
152 | 154 | ||
155 | if (pdata->deassert_reset) { | ||
156 | err = pdata->deassert_reset(pdev, pdata->reset_name); | ||
157 | if (err) { | ||
158 | dev_err(obj->dev, "deassert_reset failed: %d\n", err); | ||
159 | return err; | ||
160 | } | ||
161 | } | ||
162 | |||
153 | clk_enable(obj->clk); | 163 | clk_enable(obj->clk); |
154 | 164 | ||
155 | err = arch_iommu->enable(obj); | 165 | err = arch_iommu->enable(obj); |
@@ -159,12 +169,18 @@ static int iommu_enable(struct omap_iommu *obj) | |||
159 | 169 | ||
160 | static void iommu_disable(struct omap_iommu *obj) | 170 | static void iommu_disable(struct omap_iommu *obj) |
161 | { | 171 | { |
162 | if (!obj) | 172 | struct platform_device *pdev = to_platform_device(obj->dev); |
173 | struct iommu_platform_data *pdata = pdev->dev.platform_data; | ||
174 | |||
175 | if (!obj || !pdata) | ||
163 | return; | 176 | return; |
164 | 177 | ||
165 | arch_iommu->disable(obj); | 178 | arch_iommu->disable(obj); |
166 | 179 | ||
167 | clk_disable(obj->clk); | 180 | clk_disable(obj->clk); |
181 | |||
182 | if (pdata->assert_reset) | ||
183 | pdata->assert_reset(pdev, pdata->reset_name); | ||
168 | } | 184 | } |
169 | 185 | ||
170 | /* | 186 | /* |
@@ -926,9 +942,6 @@ static int __devinit omap_iommu_probe(struct platform_device *pdev) | |||
926 | struct resource *res; | 942 | struct resource *res; |
927 | struct iommu_platform_data *pdata = pdev->dev.platform_data; | 943 | struct iommu_platform_data *pdata = pdev->dev.platform_data; |
928 | 944 | ||
929 | if (pdev->num_resources != 2) | ||
930 | return -EINVAL; | ||
931 | |||
932 | obj = kzalloc(sizeof(*obj) + MMU_REG_SIZE, GFP_KERNEL); | 945 | obj = kzalloc(sizeof(*obj) + MMU_REG_SIZE, GFP_KERNEL); |
933 | if (!obj) | 946 | if (!obj) |
934 | return -ENOMEM; | 947 | return -ENOMEM; |