diff options
author | Antti Palosaari <crope@iki.fi> | 2012-07-24 20:21:04 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-08-04 06:56:40 -0400 |
commit | eb29fbeaed617f7a2cf53d276535f8fbdc28db09 (patch) | |
tree | 0744c7ebfbb4f806d1550b636ab21896c9d17aae /drivers/media/dvb | |
parent | ad6b9e517b39acec98862e7f9bddefe1b275445b (diff) |
[media] af9015: remote controller fixes
1)
AF9015 remote controller query will fail rarely due to register
access failures and dvb_usb_v2 will stop rc polling when error
returned. Add logic to allow errors until two consecutive errors
occurs.
2)
Remote controller key map was not loaded in case of key map was set as
a device property. Fix it.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb')
-rw-r--r-- | drivers/media/dvb/dvb-usb-v2/af9015.c | 15 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb-v2/af9015.h | 1 |
2 files changed, 13 insertions, 3 deletions
diff --git a/drivers/media/dvb/dvb-usb-v2/af9015.c b/drivers/media/dvb/dvb-usb-v2/af9015.c index bbe1d3382195..10363f6b5234 100644 --- a/drivers/media/dvb/dvb-usb-v2/af9015.c +++ b/drivers/media/dvb/dvb-usb-v2/af9015.c | |||
@@ -1232,11 +1232,19 @@ static int af9015_rc_query(struct dvb_usb_device *d) | |||
1232 | } | 1232 | } |
1233 | 1233 | ||
1234 | state->rc_repeat = buf[6]; | 1234 | state->rc_repeat = buf[6]; |
1235 | state->rc_failed = false; | ||
1235 | 1236 | ||
1236 | error: | 1237 | error: |
1237 | if (ret) | 1238 | if (ret) { |
1238 | err("%s: failed:%d", __func__, ret); | 1239 | err("%s: failed:%d", __func__, ret); |
1239 | 1240 | ||
1241 | /* allow random errors as dvb-usb will stop polling on error */ | ||
1242 | if (!state->rc_failed) | ||
1243 | ret = 0; | ||
1244 | |||
1245 | state->rc_failed = true; | ||
1246 | } | ||
1247 | |||
1240 | return ret; | 1248 | return ret; |
1241 | } | 1249 | } |
1242 | 1250 | ||
@@ -1249,8 +1257,9 @@ static int af9015_get_rc_config(struct dvb_usb_device *d, struct dvb_usb_rc *rc) | |||
1249 | return 0; | 1257 | return 0; |
1250 | 1258 | ||
1251 | /* try to load remote based module param */ | 1259 | /* try to load remote based module param */ |
1252 | rc->map_name = af9015_rc_setup_match(dvb_usb_af9015_remote, | 1260 | if (!rc->map_name) |
1253 | af9015_rc_setup_modparam); | 1261 | rc->map_name = af9015_rc_setup_match(dvb_usb_af9015_remote, |
1262 | af9015_rc_setup_modparam); | ||
1254 | 1263 | ||
1255 | /* try to load remote based eeprom hash */ | 1264 | /* try to load remote based eeprom hash */ |
1256 | if (!rc->map_name) | 1265 | if (!rc->map_name) |
diff --git a/drivers/media/dvb/dvb-usb-v2/af9015.h b/drivers/media/dvb/dvb-usb-v2/af9015.h index b41ee73b26dc..c6b304d962ad 100644 --- a/drivers/media/dvb/dvb-usb-v2/af9015.h +++ b/drivers/media/dvb/dvb-usb-v2/af9015.h | |||
@@ -139,6 +139,7 @@ struct af9015_state { | |||
139 | u8 rc_repeat; | 139 | u8 rc_repeat; |
140 | u32 rc_keycode; | 140 | u32 rc_keycode; |
141 | u8 rc_last[4]; | 141 | u8 rc_last[4]; |
142 | bool rc_failed; | ||
142 | u8 dual_mode; | 143 | u8 dual_mode; |
143 | u8 seq; /* packet sequence number */ | 144 | u8 seq; /* packet sequence number */ |
144 | u16 mt2060_if1[2]; | 145 | u16 mt2060_if1[2]; |