aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorAntti Palosaari <crope@iki.fi>2013-08-11 18:07:02 -0400
committerMauro Carvalho Chehab <m.chehab@samsung.com>2013-08-20 15:08:47 -0400
commit0046079812cfcf6c725e067edb683e472d388552 (patch)
tree86176f2cab282169837cce23f54dd3afc83a21ec /drivers/staging
parent61198dfd08969a662767072aafeebcb493909338 (diff)
[media] msi3101: change stream format 384
After feeding different signal levels using RF generator and looking GNU Radio FFT sink I made decision to change bit shift 3 to bit shift 2 as there was very (too) huge visible leap in FFT sink GUI. Now it looks more natural. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/media/msi3101/sdr-msi3101.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/staging/media/msi3101/sdr-msi3101.c b/drivers/staging/media/msi3101/sdr-msi3101.c
index bf735f9b5db9..839e601bd7c4 100644
--- a/drivers/staging/media/msi3101/sdr-msi3101.c
+++ b/drivers/staging/media/msi3101/sdr-msi3101.c
@@ -589,7 +589,7 @@ static int msi3101_convert_stream_504(struct msi3101_state *s, u32 *dst,
589} 589}
590 590
591/* 591/*
592 * Converts signed ~10+3-bit integer into 32-bit IEEE floating point 592 * Converts signed ~10+2-bit integer into 32-bit IEEE floating point
593 * representation. 593 * representation.
594 */ 594 */
595static u32 msi3101_convert_sample_384(struct msi3101_state *s, u16 x, int shift) 595static u32 msi3101_convert_sample_384(struct msi3101_state *s, u16 x, int shift)
@@ -601,12 +601,15 @@ static u32 msi3101_convert_sample_384(struct msi3101_state *s, u16 x, int shift)
601 if (!x) 601 if (!x)
602 return 0; 602 return 0;
603 603
604 /* Convert 10-bit two's complement to 13-bit */ 604 if (shift == 3)
605 shift = 2;
606
607 /* Convert 10-bit two's complement to 12-bit */
605 if (x & (1 << 9)) { 608 if (x & (1 << 9)) {
606 x |= ~0U << 10; /* set all the rest bits to one */ 609 x |= ~0U << 10; /* set all the rest bits to one */
607 x <<= shift; 610 x <<= shift;
608 x = -x; 611 x = -x;
609 x &= 0xfff; /* result is 12 bit ... + sign */ 612 x &= 0x7ff; /* result is 11 bit ... + sign */
610 sign = 1 << 31; 613 sign = 1 << 31;
611 } else { 614 } else {
612 x <<= shift; 615 x <<= shift;