summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSonic Zhang <sonic.zhang@analog.com>2014-07-23 06:57:14 -0300
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-07-26 17:12:30 -0300
commitf7d0e6d67fdc300c316dfb7ca1d4aaa234171053 (patch)
treeace4348aeb292408dbdde5ed0d2f79d2064c0533
parent3d3a41098e4b9580e7570026ab361cb5b0c7f037 (diff)
downloadop-kernel-dev-f7d0e6d67fdc300c316dfb7ca1d4aaa234171053.zip
op-kernel-dev-f7d0e6d67fdc300c316dfb7ca1d4aaa234171053.tar.gz
[media] media: blackfin: ppi: Pass device pointer to request peripheral pins
if the pinctrl driver is enabled. Signed-off-by: Sonic Zhang <sonic.zhang@analog.com> Acked-by: Scott Jiang <scott.jiang.linux@gmail.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
-rw-r--r--drivers/media/platform/blackfin/bfin_capture.c2
-rw-r--r--drivers/media/platform/blackfin/ppi.c8
-rw-r--r--include/media/blackfin/ppi.h3
3 files changed, 8 insertions, 5 deletions
diff --git a/drivers/media/platform/blackfin/bfin_capture.c b/drivers/media/platform/blackfin/bfin_capture.c
index 6ef9866..7c70d51 100644
--- a/drivers/media/platform/blackfin/bfin_capture.c
+++ b/drivers/media/platform/blackfin/bfin_capture.c
@@ -939,7 +939,7 @@ static int bcap_probe(struct platform_device *pdev)
bcap_dev->cfg = config;
- bcap_dev->ppi = ppi_create_instance(config->ppi_info);
+ bcap_dev->ppi = ppi_create_instance(pdev, config->ppi_info);
if (!bcap_dev->ppi) {
v4l2_err(pdev->dev.driver, "Unable to create ppi\n");
ret = -ENODEV;
diff --git a/drivers/media/platform/blackfin/ppi.c b/drivers/media/platform/blackfin/ppi.c
index 15e9c2b..90c4a93 100644
--- a/drivers/media/platform/blackfin/ppi.c
+++ b/drivers/media/platform/blackfin/ppi.c
@@ -19,6 +19,7 @@
#include <linux/module.h>
#include <linux/slab.h>
+#include <linux/platform_device.h>
#include <asm/bfin_ppi.h>
#include <asm/blackfin.h>
@@ -307,7 +308,8 @@ static void ppi_update_addr(struct ppi_if *ppi, unsigned long addr)
set_dma_start_addr(ppi->info->dma_ch, addr);
}
-struct ppi_if *ppi_create_instance(const struct ppi_info *info)
+struct ppi_if *ppi_create_instance(struct platform_device *pdev,
+ const struct ppi_info *info)
{
struct ppi_if *ppi;
@@ -315,14 +317,14 @@ struct ppi_if *ppi_create_instance(const struct ppi_info *info)
return NULL;
if (peripheral_request_list(info->pin_req, KBUILD_MODNAME)) {
- pr_err("request peripheral failed\n");
+ dev_err(&pdev->dev, "request peripheral failed\n");
return NULL;
}
ppi = kzalloc(sizeof(*ppi), GFP_KERNEL);
if (!ppi) {
peripheral_free_list(info->pin_req);
- pr_err("unable to allocate memory for ppi handle\n");
+ dev_err(&pdev->dev, "unable to allocate memory for ppi handle\n");
return NULL;
}
ppi->ops = &ppi_ops;
diff --git a/include/media/blackfin/ppi.h b/include/media/blackfin/ppi.h
index d0697f4..61a283f 100644
--- a/include/media/blackfin/ppi.h
+++ b/include/media/blackfin/ppi.h
@@ -91,6 +91,7 @@ struct ppi_if {
void *priv;
};
-struct ppi_if *ppi_create_instance(const struct ppi_info *info);
+struct ppi_if *ppi_create_instance(struct platform_device *pdev,
+ const struct ppi_info *info);
void ppi_delete_instance(struct ppi_if *ppi);
#endif
OpenPOWER on IntegriCloud