Skip to contentSkip to conversation

radio-bcm2048: Fix region selection

PATCH Jan Roemisch 3 participants 4 messages May 16, 2015 – May 18, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Oh sorry, the real name is Jan Roemisch.

Greetings
Jan

maintainer
#1 lore raw
Quoted 1 line · Jan Roemisch

Oh sorry, the real name is Jan Roemisch.

Ok, thanks, can someone please fix up the patches and resend them?

greg k-h

#2 lore raw

Removed "Japan wide band" region since this is impossible to do just like that. Additionally it's now possible to go back to non-Japanese regions without having to reload the module.

Greetings
Jan Roemisch

Quoted 7 lines · Greg KH
Quoted 1 line · Jan Roemisch

Oh sorry, the real name is Jan Roemisch.

Ok, thanks, can someone please fix up the patches and resend them?

greg k-h

drivers/staging/media/bcm2048/radio-bcm2048.c +12 -8
index 5382506..d2e7f1e 100644
@@ -342,14 +342,6 @@ static struct region_info region_configs[] = {
 		.deemphasis		= 50,
 		.region			= 3,
 	},
-	/* Japan wide band */
-	{
-		.channel_spacing	= 10,
-		.bottom_frequency	= 76000,
-		.top_frequency		= 108000,
-		.deemphasis		= 50,
-		.region			= 4,
-	},
 };
 
 /*
@@ -741,6 +733,18 @@ static int bcm2048_set_region(struct bcm2048_device *bdev, u8 region)
 
 	mutex_lock(&bdev->mutex);
 	bdev->region_info = region_configs[region];
+
+	if (region_configs[region].bottom_frequency < 87500)
+		bdev->cache_fm_ctrl |= BCM2048_BAND_SELECT;
+	else
+		bdev->cache_fm_ctrl &= ~BCM2048_BAND_SELECT;
+
+	err = bcm2048_send_command(bdev, BCM2048_I2C_FM_CTRL,
+					bdev->cache_fm_ctrl);
+	if (err) {
+		mutex_unlock(&bdev->mutex);
+		goto done;
+	}
 	mutex_unlock(&bdev->mutex);
 
 	if (bdev->frequency < region_configs[region].bottom_frequency ||
Acked-by
#3 lore raw
Quoted 3 lines · Jan Roemisch

Removed "Japan wide band" region since this is impossible to do just like that. Additionally it's now possible to go back to non-Japanese regions without having to reload the module.

But note that you'll probably need to do one more resend, with

Signed-off-by:

line.

Thanks and best regards,
Pavel

Quoted 50 lines

Greetings
Jan Roemisch

Quoted 7 lines · Greg KH
Quoted 1 line · Jan Roemisch

Oh sorry, the real name is Jan Roemisch.

Ok, thanks, can someone please fix up the patches and resend them?

greg k-h

drivers/staging/media/bcm2048/radio-bcm2048.c +12 -8
index 5382506..d2e7f1e 100644
@@ -342,14 +342,6 @@ static struct region_info region_configs[] = {
 		.deemphasis		= 50,
 		.region			= 3,
 	},
-	/* Japan wide band */
-	{
-		.channel_spacing	= 10,
-		.bottom_frequency	= 76000,
-		.top_frequency		= 108000,
-		.deemphasis		= 50,
-		.region			= 4,
-	},
 };
 
 /*
@@ -741,6 +733,18 @@ static int bcm2048_set_region(struct bcm2048_device *bdev, u8 region)
 
 	mutex_lock(&bdev->mutex);
 	bdev->region_info = region_configs[region];
+
+	if (region_configs[region].bottom_frequency < 87500)
+		bdev->cache_fm_ctrl |= BCM2048_BAND_SELECT;
+	else
+		bdev->cache_fm_ctrl &= ~BCM2048_BAND_SELECT;
+
+	err = bcm2048_send_command(bdev, BCM2048_I2C_FM_CTRL,
+					bdev->cache_fm_ctrl);
+	if (err) {
+		mutex_unlock(&bdev->mutex);
+		goto done;
+	}
 	mutex_unlock(&bdev->mutex);
 
 	if (bdev->frequency < region_configs[region].bottom_frequency ||
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html