summaryrefslogtreecommitdiff
path: root/drivers/media
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/platform/ti-vpe/cal-camerarx.c10
-rw-r--r--drivers/media/platform/ti-vpe/cal.h3
2 files changed, 13 insertions, 0 deletions
diff --git a/drivers/media/platform/ti-vpe/cal-camerarx.c b/drivers/media/platform/ti-vpe/cal-camerarx.c
index f799047c70f7..79ebad139289 100644
--- a/drivers/media/platform/ti-vpe/cal-camerarx.c
+++ b/drivers/media/platform/ti-vpe/cal-camerarx.c
@@ -285,6 +285,11 @@ static int cal_camerarx_start(struct cal_camerarx *phy)
u32 val;
int ret;
+ if (phy->enable_count > 0) {
+ phy->enable_count++;
+ return 0;
+ }
+
link_freq = cal_camerarx_get_ext_link_freq(phy);
if (link_freq < 0)
return link_freq;
@@ -409,6 +414,8 @@ static int cal_camerarx_start(struct cal_camerarx *phy)
/* Finally, enable the PHY Protocol Interface (PPI). */
cal_camerarx_ppi_enable(phy);
+ phy->enable_count++;
+
return 0;
}
@@ -416,6 +423,9 @@ static void cal_camerarx_stop(struct cal_camerarx *phy)
{
int ret;
+ if (--phy->enable_count > 0)
+ return;
+
cal_camerarx_ppi_disable(phy);
cal_camerarx_disable_irqs(phy);
diff --git a/drivers/media/platform/ti-vpe/cal.h b/drivers/media/platform/ti-vpe/cal.h
index cf0b8f5d4378..006374be3f9f 100644
--- a/drivers/media/platform/ti-vpe/cal.h
+++ b/drivers/media/platform/ti-vpe/cal.h
@@ -167,8 +167,11 @@ struct cal_camerarx {
/*
* Lock for camerarx ops. Protects:
* - formats
+ * - enable_count
*/
struct mutex mutex;
+
+ unsigned int enable_count;
};
struct cal_dev {