aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb-frontends
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2013-04-05 11:18:54 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-04-08 05:56:47 -0400
commit48a8a03b5806179f12dd6994a6957f797c13675f (patch)
tree63c7bf1f777bfa446859228375e37a14975eb33a /drivers/media/dvb-frontends
parenta9bd87c232b87014b20fdf52416f80c5c1e869fc (diff)
[media] cx88: kernel bz#9476: Fix tone setting for Nova-S+ model 92001
Hauppauge Nova-S-Plus DVB-S model 92001 does not lock on horizontal polarisation. According with the info provided at the BZ, model 92002 does. The difference is that, on model 92001, the tone select is done via isl6421, while, on other devices, this is done via cx24123 code. This patch adds a way to override the demod's set_tone at isl6421 driver. In order to avoid regressions, the override is enabled only for cx88 Nova S plus model 92001. For all other models and devices, the set_tone is provided by the demod driver. Patch originally proposed at bz@9476[1] by Michel Meyers and John Donoghue but applying the original patch would break support for all other devices based on isl6421. [1] https://bugzilla.kernel.org/show_bug.cgi?id=9476 Tested-by: Adam Sampson <ats@offog.org> Tested-by: Hans-Peter Jansen <hpj@urpla.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb-frontends')
-rw-r--r--drivers/media/dvb-frontends/isl6421.c28
-rw-r--r--drivers/media/dvb-frontends/isl6421.h4
2 files changed, 29 insertions, 3 deletions
diff --git a/drivers/media/dvb-frontends/isl6421.c b/drivers/media/dvb-frontends/isl6421.c
index 0cb3f0f74c9c..c77002fcc8e2 100644
--- a/drivers/media/dvb-frontends/isl6421.c
+++ b/drivers/media/dvb-frontends/isl6421.c
@@ -89,6 +89,30 @@ static int isl6421_enable_high_lnb_voltage(struct dvb_frontend *fe, long arg)
89 return (i2c_transfer(isl6421->i2c, &msg, 1) == 1) ? 0 : -EIO; 89 return (i2c_transfer(isl6421->i2c, &msg, 1) == 1) ? 0 : -EIO;
90} 90}
91 91
92static int isl6421_set_tone(struct dvb_frontend* fe, fe_sec_tone_mode_t tone)
93{
94 struct isl6421 *isl6421 = (struct isl6421 *) fe->sec_priv;
95 struct i2c_msg msg = { .addr = isl6421->i2c_addr, .flags = 0,
96 .buf = &isl6421->config,
97 .len = sizeof(isl6421->config) };
98
99 switch (tone) {
100 case SEC_TONE_ON:
101 isl6421->config |= ISL6421_ENT1;
102 break;
103 case SEC_TONE_OFF:
104 isl6421->config &= ~ISL6421_ENT1;
105 break;
106 default:
107 return -EINVAL;
108 }
109
110 isl6421->config |= isl6421->override_or;
111 isl6421->config &= isl6421->override_and;
112
113 return (i2c_transfer(isl6421->i2c, &msg, 1) == 1) ? 0 : -EIO;
114}
115
92static void isl6421_release(struct dvb_frontend *fe) 116static void isl6421_release(struct dvb_frontend *fe)
93{ 117{
94 /* power off */ 118 /* power off */
@@ -100,7 +124,7 @@ static void isl6421_release(struct dvb_frontend *fe)
100} 124}
101 125
102struct dvb_frontend *isl6421_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, u8 i2c_addr, 126struct dvb_frontend *isl6421_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, u8 i2c_addr,
103 u8 override_set, u8 override_clear) 127 u8 override_set, u8 override_clear, bool override_tone)
104{ 128{
105 struct isl6421 *isl6421 = kmalloc(sizeof(struct isl6421), GFP_KERNEL); 129 struct isl6421 *isl6421 = kmalloc(sizeof(struct isl6421), GFP_KERNEL);
106 if (!isl6421) 130 if (!isl6421)
@@ -131,6 +155,8 @@ struct dvb_frontend *isl6421_attach(struct dvb_frontend *fe, struct i2c_adapter
131 /* override frontend ops */ 155 /* override frontend ops */
132 fe->ops.set_voltage = isl6421_set_voltage; 156 fe->ops.set_voltage = isl6421_set_voltage;
133 fe->ops.enable_high_lnb_voltage = isl6421_enable_high_lnb_voltage; 157 fe->ops.enable_high_lnb_voltage = isl6421_enable_high_lnb_voltage;
158 if (override_tone)
159 fe->ops.set_tone = isl6421_set_tone;
134 160
135 return fe; 161 return fe;
136} 162}
diff --git a/drivers/media/dvb-frontends/isl6421.h b/drivers/media/dvb-frontends/isl6421.h
index e7ca7d12b50a..630e7f8a150e 100644
--- a/drivers/media/dvb-frontends/isl6421.h
+++ b/drivers/media/dvb-frontends/isl6421.h
@@ -42,10 +42,10 @@
42#if IS_ENABLED(CONFIG_DVB_ISL6421) 42#if IS_ENABLED(CONFIG_DVB_ISL6421)
43/* override_set and override_clear control which system register bits (above) to always set & clear */ 43/* override_set and override_clear control which system register bits (above) to always set & clear */
44extern struct dvb_frontend *isl6421_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, u8 i2c_addr, 44extern struct dvb_frontend *isl6421_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, u8 i2c_addr,
45 u8 override_set, u8 override_clear); 45 u8 override_set, u8 override_clear, bool override_tone);
46#else 46#else
47static inline struct dvb_frontend *isl6421_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, u8 i2c_addr, 47static inline struct dvb_frontend *isl6421_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, u8 i2c_addr,
48 u8 override_set, u8 override_clear) 48 u8 override_set, u8 override_clear, bool override_tone)
49{ 49{
50 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); 50 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
51 return NULL; 51 return NULL;