# HG changeset patch
# User Mauro Carvalho Chehab <mchehab@infradead.org>
# Node ID 4e3545e2299c2ef7f0b657240afda6fd09b6f5c4
# Parent  1abc18fdd0a3ffedca41f88e7be8c3b3427669aa
Added the capability of selecting fm gain by tuner

From: Mauro Carvalho Chehab <mchehab@infradead.org>

Some tuners require using cGainNormal instead of cGainLow for
high sensibility on FM reception.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>

diff -r 1abc18fdd0a3 -r 4e3545e2299c linux/drivers/media/video/tuner-simple.c
--- a/linux/drivers/media/video/tuner-simple.c	Wed Nov 22 04:40:05 2006 -0200
+++ b/linux/drivers/media/video/tuner-simple.c	Wed Nov 22 04:54:35 2006 -0200
@@ -501,6 +501,8 @@ static void default_set_radio_freq(struc
 			config |= TDA9887_INTERCARRIER;
 /*		if (params->port1_set_for_fm_mono)
 			config &= ~TDA9887_PORT1_ACTIVE;*/
+		if (params->fm_gain_normal)
+			config |= TDA9887_GAIN_NORMAL;
 		i2c_clients_command(c->adapter, TDA9887_SET_CONFIG, &config);
 	}
 	if (4 != (rc = i2c_master_send(c,buffer,4)))
diff -r 1abc18fdd0a3 -r 4e3545e2299c linux/include/media/tuner-types.h
--- a/linux/include/media/tuner-types.h	Wed Nov 22 04:40:05 2006 -0200
+++ b/linux/include/media/tuner-types.h	Wed Nov 22 04:54:35 2006 -0200
@@ -57,6 +57,10 @@ struct tuner_params {
 	   sensitivity. If this setting is 1, then set PORT2 to 1 to
 	   get proper FM reception. */
 	unsigned int port2_fm_high_sensitivity:1;
+	/* Some Philips tuners use tda9887 cGainNormal to select the FM radio
+	   sensitivity. If this setting is 1, e register will use cGainNormal
+	   instead of cGainLow. */
+	unsigned int fm_gain_normal:1;
 	/* Most tuners with a tda9887 use QSS mode. Some (cheaper) tuners
 	   use Intercarrier mode. If this setting is 1, then the tuner
 	   needs to be set to intercarrier mode. */
