mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 20:07:46 +09:00
media: rockchip: isp and ispp try to ioremap
try to ioremap when ioremap resource busy that device reg range include device's iommu reg range. Change-Id: Ie701d0a70f443404f49d658916c0dbb4f6cbe06d Signed-off-by: Cai YiWei <cyw@rock-chips.com>
This commit is contained in:
@@ -34,6 +34,7 @@
|
||||
|
||||
#include <linux/clk.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/mfd/syscon.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/of.h>
|
||||
@@ -992,9 +993,21 @@ static int rkisp_plat_probe(struct platform_device *pdev)
|
||||
dev_warn(dev, "Missing rockchip,grf property\n");
|
||||
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
if (!res) {
|
||||
dev_err(dev, "get resource failed\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
isp_dev->base_addr = devm_ioremap_resource(dev, res);
|
||||
if (IS_ERR(isp_dev->base_addr))
|
||||
if (PTR_ERR(isp_dev->base_addr) == -EBUSY) {
|
||||
resource_size_t offset = res->start;
|
||||
resource_size_t size = resource_size(res);
|
||||
|
||||
isp_dev->base_addr = devm_ioremap(dev, offset, size);
|
||||
}
|
||||
if (IS_ERR(isp_dev->base_addr)) {
|
||||
dev_err(dev, "ioremap failed\n");
|
||||
return PTR_ERR(isp_dev->base_addr);
|
||||
}
|
||||
|
||||
match_data = match->data;
|
||||
isp_dev->mipi_irq = -1;
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include <linux/clk.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/of_graph.h>
|
||||
@@ -324,9 +325,19 @@ static int rkispp_plat_probe(struct platform_device *pdev)
|
||||
match_data = match->data;
|
||||
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
ispp_dev->base_addr = devm_ioremap_resource(dev, res);
|
||||
if (IS_ERR(ispp_dev->base_addr)) {
|
||||
if (!res) {
|
||||
dev_err(dev, "get resource failed\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
ispp_dev->base_addr = devm_ioremap_resource(dev, res);
|
||||
if (PTR_ERR(ispp_dev->base_addr) == -EBUSY) {
|
||||
resource_size_t offset = res->start;
|
||||
resource_size_t size = resource_size(res);
|
||||
|
||||
ispp_dev->base_addr = devm_ioremap(dev, offset, size);
|
||||
}
|
||||
if (IS_ERR(ispp_dev->base_addr)) {
|
||||
dev_err(dev, "ioremap failed\n");
|
||||
return PTR_ERR(ispp_dev->base_addr);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user