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

Commit 9da9e4fc authored by Ghanim Fodi's avatar Ghanim Fodi
Browse files

msm: gsi: Update GSI driver to support 24 event ring channels



GSI 2.5 supports 24 event ring channels as opposed to 22
at previous versions. Update driver to support it.

CRs-Fixed: 2264249
Change-Id: I4b80a5b24c3dad8950ccc2b0a6839fb86879399d
Signed-off-by: default avatarGhanim Fodi <gfodi@codeaurora.org>
parent 6401e390
Loading
Loading
Loading
Loading
+6 −1
Original line number Original line Diff line number Diff line
@@ -905,6 +905,11 @@ int gsi_register_device(struct gsi_per_props *props, unsigned long *dev_hdl)
		return -GSI_STATUS_ERROR;
		return -GSI_STATUS_ERROR;
	}
	}


	if (gsi_ctx->max_ev > GSI_EVT_RING_MAX) {
		GSIERR("max event rings are beyond absolute maximum\n");
		return -GSI_STATUS_ERROR;
	}

	if (props->mhi_er_id_limits_valid &&
	if (props->mhi_er_id_limits_valid &&
	    props->mhi_er_id_limits[0] > (gsi_ctx->max_ev - 1)) {
	    props->mhi_er_id_limits[0] > (gsi_ctx->max_ev - 1)) {
		devm_iounmap(gsi_ctx->dev, gsi_ctx->base);
		devm_iounmap(gsi_ctx->dev, gsi_ctx->base);
@@ -1847,7 +1852,7 @@ int gsi_alloc_channel(struct gsi_chan_props *props, unsigned long dev_hdl,
	}
	}


	if (props->evt_ring_hdl != ~0) {
	if (props->evt_ring_hdl != ~0) {
		if (props->evt_ring_hdl >= GSI_EVT_RING_MAX) {
		if (props->evt_ring_hdl >= gsi_ctx->max_ev) {
			GSIERR("invalid evt ring=%lu\n", props->evt_ring_hdl);
			GSIERR("invalid evt ring=%lu\n", props->evt_ring_hdl);
			return -GSI_STATUS_INVALID_PARAMS;
			return -GSI_STATUS_INVALID_PARAMS;
		}
		}
+1 −1
Original line number Original line Diff line number Diff line
@@ -21,7 +21,7 @@
#include <linux/ipc_logging.h>
#include <linux/ipc_logging.h>


#define GSI_CHAN_MAX      31
#define GSI_CHAN_MAX      31
#define GSI_EVT_RING_MAX  23
#define GSI_EVT_RING_MAX  24
#define GSI_NO_EVT_ERINDEX 31
#define GSI_NO_EVT_ERINDEX 31


#define gsi_readl(c)	({ u32 __v = readl_relaxed(c); __iormb(); __v; })
#define gsi_readl(c)	({ u32 __v = readl_relaxed(c); __iormb(); __v; })