Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[media] si2165: Remove legacy attach

Now that all users of legacy attach are converted it can be removed.

Signed-off-by: Matthias Schwarzott <zzam@gentoo.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>

authored by

Matthias Schwarzott and committed by
Mauro Carvalho Chehab
81fd533a 773028fe

+17 -148
-117
drivers/media/dvb-frontends/si2165.c
··· 1011 1011 return 0; 1012 1012 } 1013 1013 1014 - static void si2165_release(struct dvb_frontend *fe) 1015 - { 1016 - struct si2165_state *state = fe->demodulator_priv; 1017 - 1018 - dprintk("%s: called\n", __func__); 1019 - kfree(state); 1020 - } 1021 - 1022 1014 static struct dvb_frontend_ops si2165_ops = { 1023 1015 .info = { 1024 1016 .name = "Silicon Labs ", ··· 1046 1054 1047 1055 .set_frontend = si2165_set_frontend, 1048 1056 .read_status = si2165_read_status, 1049 - 1050 - .release = si2165_release, 1051 1057 }; 1052 - 1053 - struct dvb_frontend *si2165_attach(const struct si2165_config *config, 1054 - struct i2c_adapter *i2c) 1055 - { 1056 - struct si2165_state *state = NULL; 1057 - int n; 1058 - int io_ret; 1059 - u8 val; 1060 - char rev_char; 1061 - const char *chip_name; 1062 - 1063 - if (config == NULL || i2c == NULL) 1064 - goto error; 1065 - 1066 - /* allocate memory for the internal state */ 1067 - state = kzalloc(sizeof(struct si2165_state), GFP_KERNEL); 1068 - if (state == NULL) 1069 - goto error; 1070 - 1071 - /* setup the state */ 1072 - state->i2c = i2c; 1073 - state->config = *config; 1074 - 1075 - if (state->config.ref_freq_Hz < 4000000 1076 - || state->config.ref_freq_Hz > 27000000) { 1077 - dev_err(&state->i2c->dev, "%s: ref_freq of %d Hz not supported by this driver\n", 1078 - KBUILD_MODNAME, state->config.ref_freq_Hz); 1079 - goto error; 1080 - } 1081 - 1082 - /* create dvb_frontend */ 1083 - memcpy(&state->fe.ops, &si2165_ops, 1084 - sizeof(struct dvb_frontend_ops)); 1085 - state->fe.demodulator_priv = state; 1086 - 1087 - /* powerup */ 1088 - io_ret = si2165_writereg8(state, 0x0000, state->config.chip_mode); 1089 - if (io_ret < 0) 1090 - goto error; 1091 - 1092 - io_ret = si2165_readreg8(state, 0x0000, &val); 1093 - if (io_ret < 0) 1094 - goto error; 1095 - if (val != state->config.chip_mode) 1096 - goto error; 1097 - 1098 - io_ret = si2165_readreg8(state, 0x0023, &state->chip_revcode); 1099 - if (io_ret < 0) 1100 - goto error; 1101 - 1102 - io_ret = si2165_readreg8(state, 0x0118, &state->chip_type); 1103 - if (io_ret < 0) 1104 - goto error; 1105 - 1106 - /* powerdown */ 1107 - io_ret = si2165_writereg8(state, 0x0000, SI2165_MODE_OFF); 1108 - if (io_ret < 0) 1109 - goto error; 1110 - 1111 - if (state->chip_revcode < 26) 1112 - rev_char = 'A' + state->chip_revcode; 1113 - else 1114 - rev_char = '?'; 1115 - 1116 - switch (state->chip_type) { 1117 - case 0x06: 1118 - chip_name = "Si2161"; 1119 - state->has_dvbt = true; 1120 - break; 1121 - case 0x07: 1122 - chip_name = "Si2165"; 1123 - state->has_dvbt = true; 1124 - state->has_dvbc = true; 1125 - break; 1126 - default: 1127 - dev_err(&state->i2c->dev, "%s: Unsupported Silicon Labs chip (type %d, rev %d)\n", 1128 - KBUILD_MODNAME, state->chip_type, state->chip_revcode); 1129 - goto error; 1130 - } 1131 - 1132 - dev_info(&state->i2c->dev, 1133 - "%s: Detected Silicon Labs %s-%c (type %d, rev %d)\n", 1134 - KBUILD_MODNAME, chip_name, rev_char, state->chip_type, 1135 - state->chip_revcode); 1136 - 1137 - strlcat(state->fe.ops.info.name, chip_name, 1138 - sizeof(state->fe.ops.info.name)); 1139 - 1140 - n = 0; 1141 - if (state->has_dvbt) { 1142 - state->fe.ops.delsys[n++] = SYS_DVBT; 1143 - strlcat(state->fe.ops.info.name, " DVB-T", 1144 - sizeof(state->fe.ops.info.name)); 1145 - } 1146 - if (state->has_dvbc) { 1147 - state->fe.ops.delsys[n++] = SYS_DVBC_ANNEX_A; 1148 - strlcat(state->fe.ops.info.name, " DVB-C", 1149 - sizeof(state->fe.ops.info.name)); 1150 - } 1151 - 1152 - return &state->fe; 1153 - 1154 - error: 1155 - kfree(state); 1156 - return NULL; 1157 - } 1158 - EXPORT_SYMBOL(si2165_attach); 1159 1058 1160 1059 static int si2165_probe(struct i2c_client *client, 1161 1060 const struct i2c_device_id *id)
-31
drivers/media/dvb-frontends/si2165.h
··· 50 50 bool inversion; 51 51 }; 52 52 53 - struct si2165_config { 54 - /* i2c addr 55 - * possible values: 0x64,0x65,0x66,0x67 */ 56 - u8 i2c_addr; 57 - 58 - /* external clock or XTAL */ 59 - u8 chip_mode; 60 - 61 - /* frequency of external clock or xtal in Hz 62 - * possible values: 4000000, 16000000, 20000000, 240000000, 27000000 63 - */ 64 - u32 ref_freq_Hz; 65 - 66 - /* invert the spectrum */ 67 - bool inversion; 68 - }; 69 - 70 - #if IS_REACHABLE(CONFIG_DVB_SI2165) 71 - struct dvb_frontend *si2165_attach( 72 - const struct si2165_config *config, 73 - struct i2c_adapter *i2c); 74 - #else 75 - static inline struct dvb_frontend *si2165_attach( 76 - const struct si2165_config *config, 77 - struct i2c_adapter *i2c) 78 - { 79 - pr_warn("%s: driver disabled by Kconfig\n", __func__); 80 - return NULL; 81 - } 82 - #endif /* CONFIG_DVB_SI2165 */ 83 - 84 53 #endif /* _DVB_SI2165_H */
+17
drivers/media/dvb-frontends/si2165_priv.h
··· 20 20 21 21 #define SI2165_FIRMWARE_REV_D "dvb-demod-si2165.fw" 22 22 23 + struct si2165_config { 24 + /* i2c addr 25 + * possible values: 0x64,0x65,0x66,0x67 */ 26 + u8 i2c_addr; 27 + 28 + /* external clock or XTAL */ 29 + u8 chip_mode; 30 + 31 + /* frequency of external clock or xtal in Hz 32 + * possible values: 4000000, 16000000, 20000000, 240000000, 27000000 33 + */ 34 + u32 ref_freq_Hz; 35 + 36 + /* invert the spectrum */ 37 + bool inversion; 38 + }; 39 + 23 40 #endif /* _DVB_SI2165_PRIV */