media: dvb: Fix support for maximum TSPP buffer size

The maximum allowed buffer size depends on maximum allowed
number of BAM descriptors. The maximum allowed number of
descriptors was changed to meet HW capabilities. A check
whether user buffer size requires number of descriptors
larger than what is allowed was added.

CRs-Fixed: 490749
Change-Id: Ic60414af156ee8d969263b7636393693277c8f61
Signed-off-by: Hamad Kadmany <hkadmany@codeaurora.org>
diff --git a/drivers/misc/tspp.c b/drivers/misc/tspp.c
index eaf795b..1135c37 100644
--- a/drivers/misc/tspp.c
+++ b/drivers/misc/tspp.c
@@ -60,9 +60,8 @@
 /*
  * BAM descriptor FIFO size (in number of descriptors).
  * Max number of descriptors allowed by SPS which is 8K-1.
- * Restrict it to half of this to save DMA memory.
  */
-#define TSPP_SPS_DESCRIPTOR_COUNT      (4 * 1024 - 1)
+#define TSPP_SPS_DESCRIPTOR_COUNT      (8 * 1024 - 1)
 #define TSPP_PACKET_LENGTH             188
 #define TSPP_MIN_BUFFER_SIZE           (TSPP_PACKET_LENGTH)
 
@@ -2199,6 +2198,12 @@
 		return -EINVAL;
 	}
 
+	if (count > TSPP_NUM_BUFFERS) {
+		pr_err("%s: tspp requires a maximum of %i buffers\n",
+			__func__, TSPP_NUM_BUFFERS);
+		return -EINVAL;
+	}
+
 	channel = &pdev->channels[channel_id];
 
 	/* allow buffer allocation only if there was no previous buffer