diff options
author | Matthias Schwarzott <zzam@gentoo.org> | 2014-08-31 07:35:07 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2014-09-23 15:13:33 -0400 |
commit | 119bd82e0e87903ef45fffe9c17b1fb6a99cc628 (patch) | |
tree | 04325cd9bb8a71819c07391acb129c3db071dee2 /drivers/media | |
parent | 55bea40070f33a6b52c605a74b4920bad645d0ea (diff) |
[media] si2165: enable Si2161 support
Additionally print chip name with revision symbolically.
This is a preparation for supporting new Hauppauge WinTV-HVR-900-H based
on cx231xx.
Signed-off-by: Matthias Schwarzott <zzam@gentoo.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/dvb-frontends/si2165.c | 39 |
1 files changed, 27 insertions, 12 deletions
diff --git a/drivers/media/dvb-frontends/si2165.c b/drivers/media/dvb-frontends/si2165.c index 7de0612be9fa..98ddb49ad52b 100644 --- a/drivers/media/dvb-frontends/si2165.c +++ b/drivers/media/dvb-frontends/si2165.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | Driver for Silicon Labs SI2165 DVB-C/-T Demodulator | 2 | Driver for Silicon Labs Si2161 DVB-T and Si2165 DVB-C/-T Demodulator |
3 | 3 | ||
4 | Copyright (C) 2013-2014 Matthias Schwarzott <zzam@gentoo.org> | 4 | Copyright (C) 2013-2014 Matthias Schwarzott <zzam@gentoo.org> |
5 | 5 | ||
@@ -916,7 +916,7 @@ static void si2165_release(struct dvb_frontend *fe) | |||
916 | 916 | ||
917 | static struct dvb_frontend_ops si2165_ops = { | 917 | static struct dvb_frontend_ops si2165_ops = { |
918 | .info = { | 918 | .info = { |
919 | .name = "Silicon Labs Si2165", | 919 | .name = "Silicon Labs ", |
920 | .caps = FE_CAN_FEC_1_2 | | 920 | .caps = FE_CAN_FEC_1_2 | |
921 | FE_CAN_FEC_2_3 | | 921 | FE_CAN_FEC_2_3 | |
922 | FE_CAN_FEC_3_4 | | 922 | FE_CAN_FEC_3_4 | |
@@ -956,6 +956,8 @@ struct dvb_frontend *si2165_attach(const struct si2165_config *config, | |||
956 | int n; | 956 | int n; |
957 | int io_ret; | 957 | int io_ret; |
958 | u8 val; | 958 | u8 val; |
959 | char rev_char; | ||
960 | const char *chip_name; | ||
959 | 961 | ||
960 | if (config == NULL || i2c == NULL) | 962 | if (config == NULL || i2c == NULL) |
961 | goto error; | 963 | goto error; |
@@ -1005,22 +1007,35 @@ struct dvb_frontend *si2165_attach(const struct si2165_config *config, | |||
1005 | if (io_ret < 0) | 1007 | if (io_ret < 0) |
1006 | goto error; | 1008 | goto error; |
1007 | 1009 | ||
1008 | dev_info(&state->i2c->dev, "%s: hardware revision 0x%02x, chip type 0x%02x\n", | 1010 | if (state->chip_revcode < 26) |
1009 | KBUILD_MODNAME, state->chip_revcode, state->chip_type); | 1011 | rev_char = 'A' + state->chip_revcode; |
1012 | else | ||
1013 | rev_char = '?'; | ||
1010 | 1014 | ||
1011 | /* It is a guess that register 0x0118 (chip type?) can be used to | 1015 | switch (state->chip_type) { |
1012 | * differ between si2161, si2163 and si2165 | 1016 | case 0x06: |
1013 | * Only si2165 has been tested. | 1017 | chip_name = "Si2161"; |
1014 | */ | 1018 | state->has_dvbt = true; |
1015 | if (state->chip_type == 0x07) { | 1019 | break; |
1020 | case 0x07: | ||
1021 | chip_name = "Si2165"; | ||
1016 | state->has_dvbt = true; | 1022 | state->has_dvbt = true; |
1017 | state->has_dvbc = true; | 1023 | state->has_dvbc = true; |
1018 | } else { | 1024 | break; |
1019 | dev_err(&state->i2c->dev, "%s: Unsupported chip.\n", | 1025 | default: |
1020 | KBUILD_MODNAME); | 1026 | dev_err(&state->i2c->dev, "%s: Unsupported Silicon Labs chip (type %d, rev %d)\n", |
1027 | KBUILD_MODNAME, state->chip_type, state->chip_revcode); | ||
1021 | goto error; | 1028 | goto error; |
1022 | } | 1029 | } |
1023 | 1030 | ||
1031 | dev_info(&state->i2c->dev, | ||
1032 | "%s: Detected Silicon Labs %s-%c (type %d, rev %d)\n", | ||
1033 | KBUILD_MODNAME, chip_name, rev_char, state->chip_type, | ||
1034 | state->chip_revcode); | ||
1035 | |||
1036 | strlcat(state->frontend.ops.info.name, chip_name, | ||
1037 | sizeof(state->frontend.ops.info.name)); | ||
1038 | |||
1024 | n = 0; | 1039 | n = 0; |
1025 | if (state->has_dvbt) { | 1040 | if (state->has_dvbt) { |
1026 | state->frontend.ops.delsys[n++] = SYS_DVBT; | 1041 | state->frontend.ops.delsys[n++] = SYS_DVBT; |