Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9626d922 authored by Gjorgji Rosikopulos's avatar Gjorgji Rosikopulos Committed by Gerrit - the friendly Code Review server
Browse files

msm: jpeg: fix core reset on invalid state



On first open all clocks are disabled and engine is power
collapsed so we can put driver in init state.

This is fixing the issue when unexpected close
is issued leaving the driver to undefined state.

Change-Id: Ib53335980f978af298737b3652f9680de706833b
Signed-off-by: default avatarGjorgji Rosikopulos <grosik@codeaurora.org>
parent 07c7432a
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
/* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2015, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -719,6 +719,9 @@ int __msm_jpeg_open(struct msm_jpeg_device *pgmn_dev)
		return -EBUSY;
	}
	pgmn_dev->open_count++;
	if (pgmn_dev->open_count == 1)
		pgmn_dev->state = MSM_JPEG_INIT;

	mutex_unlock(&pgmn_dev->lock);

	msm_jpeg_core_irq_install(msm_jpeg_irq);