diff options
Diffstat (limited to 'drivers/media/dvb-frontends')
-rw-r--r-- | drivers/media/dvb-frontends/isl6421.c | 28 | ||||
-rw-r--r-- | drivers/media/dvb-frontends/isl6421.h | 4 |
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 | ||
92 | static 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 | |||
92 | static void isl6421_release(struct dvb_frontend *fe) | 116 | static 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 | ||
102 | struct dvb_frontend *isl6421_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, u8 i2c_addr, | 126 | struct 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 */ |
44 | extern struct dvb_frontend *isl6421_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, u8 i2c_addr, | 44 | extern 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 |
47 | static inline struct dvb_frontend *isl6421_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, u8 i2c_addr, | 47 | static 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; |