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

Commit a0550c97 authored by Rama Krishna Phani A's avatar Rama Krishna Phani A Committed by Jishnu Prakash
Browse files

msm: sps: Add support to perform BAM reset with pipes connected



Few clients require to reset BAM forcefully with pipes still
connected. Add support to perform BAM reset with pipes connected.

Change-Id: I19264d78a06f7e324bb6aa75c13774c404586480
Signed-off-by: default avatarRama Krishna Phani A <rphani@codeaurora.org>
parent 11a18c0d
Loading
Loading
Loading
Loading
+12 −5
Original line number Diff line number Diff line
/* Copyright (c) 2011-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2011-2018, 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
@@ -646,12 +646,19 @@ int sps_bam_reset(struct sps_bam *dev)
		      pipe_index++) {
			pipe = dev->pipes[pipe_index];
			if (BAM_PIPE_IS_ASSIGNED(pipe)) {
				if (!(dev->props.options &
							SPS_BAM_FORCE_RESET)) {
					SPS_ERR(dev,
						"sps:BAM device %pa RESET failed: pipe %d in use\n",
						BAM_ID(dev), pipe_index);
					result = SPS_ERROR;
					break;
				}

				SPS_DBG2(dev,
					"sps: BAM %pa is force reset with pipe %d in use\n",
					BAM_ID(dev), pipe_index);
			}
		}

		if (result == 0)
+3 −1
Original line number Diff line number Diff line
/* Copyright (c) 2011-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2011-2018, 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
@@ -120,6 +120,8 @@
#define SPS_BAM_HOLD_MEM            (1UL << 8)
/* Use cached write pointer */
#define SPS_BAM_CACHED_WP           (1UL << 10)
/* Reset BAM with pipes connected */
#define SPS_BAM_FORCE_RESET         (1UL << 11)

/* BAM device management flags */