summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/ipu-v3/ipu-common.c
diff options
context:
space:
mode:
authorSteve Longerbeam <slongerbeam@gmail.com>2016-07-19 18:11:02 -0700
committerPhilipp Zabel <p.zabel@pengutronix.de>2016-08-08 11:44:20 +0200
commit572a7615aeddc881057a4653658731c8bfac7d86 (patch)
treea5d35f48966dbb8a2ed73c1a283ec9e9a76ac104 /drivers/gpu/ipu-v3/ipu-common.c
parent03085911d7bbe1132977302fe45ec4efea29cd3d (diff)
downloadlinux-stable-572a7615aeddc881057a4653658731c8bfac7d86.tar.gz
linux-stable-572a7615aeddc881057a4653658731c8bfac7d86.tar.bz2
linux-stable-572a7615aeddc881057a4653658731c8bfac7d86.zip
gpu: ipu-v3: Add ipu_get_num()
Adds of-alias id to ipu_soc and retrieve with ipu_get_num(). Signed-off-by: Steve Longerbeam <steve_longerbeam@mentor.com> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Diffstat (limited to 'drivers/gpu/ipu-v3/ipu-common.c')
-rw-r--r--drivers/gpu/ipu-v3/ipu-common.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/gpu/ipu-v3/ipu-common.c b/drivers/gpu/ipu-v3/ipu-common.c
index 99dcacf05b99..d697cd505289 100644
--- a/drivers/gpu/ipu-v3/ipu-common.c
+++ b/drivers/gpu/ipu-v3/ipu-common.c
@@ -45,6 +45,12 @@ static inline void ipu_cm_write(struct ipu_soc *ipu, u32 value, unsigned offset)
writel(value, ipu->cm_reg + offset);
}
+int ipu_get_num(struct ipu_soc *ipu)
+{
+ return ipu->id;
+}
+EXPORT_SYMBOL_GPL(ipu_get_num);
+
void ipu_srm_dp_sync_update(struct ipu_soc *ipu)
{
u32 val;
@@ -1209,6 +1215,7 @@ static int ipu_probe(struct platform_device *pdev)
{
const struct of_device_id *of_id =
of_match_device(imx_ipu_dt_ids, &pdev->dev);
+ struct device_node *np = pdev->dev.of_node;
struct ipu_soc *ipu;
struct resource *res;
unsigned long ipu_base;
@@ -1237,6 +1244,7 @@ static int ipu_probe(struct platform_device *pdev)
ipu->channel[i].ipu = ipu;
ipu->devtype = devtype;
ipu->ipu_type = devtype->type;
+ ipu->id = of_alias_get_id(np, "ipu");
spin_lock_init(&ipu->lock);
mutex_init(&ipu->channel_lock);