Skip to content

Commit 48dde94

Browse files
robert-scmchehab
authored andcommitted
media: si2157: Add optional firmware download
The Si2157 (A30) is functional with the ROM firmware 3.0.5, but can also be patched at runtime, e.g. to firmware 3.1.3. However, although a firmware filename for its firmware patch exists, that has only been used for the Si2177 (A30) so far (which indeed takes the binary identical firmware patch). Add support for downloading firmware patches into the Si2157 (A30), but make it optional, so that initialization can succeed with and without a firmware patch being available. Keep the use of request_firmware() for this purpose rather than firmware_request_nowarn(), so that the warning in the log makes users aware that it is possible to provide a firmware for this tuner. The firmware patch is probably also optional for other (if not all) tuners supported by the driver, but since I do not have the others available to test, they are kept mandatory for now to avoid regressions. Signed-off-by: Robert Schlabbach <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent 2ae5d7e commit 48dde94

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

drivers/media/tuners/si2157.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ static int si2157_init(struct dvb_frontend *fe)
130130
struct i2c_client *client = fe->tuner_priv;
131131
struct si2157_dev *dev = i2c_get_clientdata(client);
132132
unsigned int chip_id, xtal_trim;
133+
unsigned int fw_required;
133134
struct si2157_cmd cmd;
134135
const char *fw_name;
135136
int ret;
@@ -198,6 +199,10 @@ static int si2157_init(struct dvb_frontend *fe)
198199
#define SI2146_A10 ('A' << 24 | 46 << 16 | '1' << 8 | '0' << 0)
199200
#define SI2141_A10 ('A' << 24 | 41 << 16 | '1' << 8 | '0' << 0)
200201

202+
/* assume firmware is required, unless verified not to be */
203+
/* only the SI2157_A30 has been verified not to yet */
204+
fw_required = true;
205+
201206
switch (chip_id) {
202207
case SI2158_A20:
203208
case SI2148_A20:
@@ -206,10 +211,13 @@ static int si2157_init(struct dvb_frontend *fe)
206211
case SI2141_A10:
207212
fw_name = SI2141_A10_FIRMWARE;
208213
break;
214+
case SI2157_A30:
215+
fw_name = SI2157_A30_FIRMWARE;
216+
fw_required = false;
217+
break;
209218
case SI2177_A30:
210219
fw_name = SI2157_A30_FIRMWARE;
211220
break;
212-
case SI2157_A30:
213221
case SI2147_A30:
214222
case SI2146_A10:
215223
fw_name = NULL;
@@ -230,6 +238,9 @@ static int si2157_init(struct dvb_frontend *fe)
230238

231239
ret = si2157_load_firmware(fe, fw_name);
232240
if (ret) {
241+
if (!fw_required)
242+
goto skip_fw_download;
243+
233244
dev_err(&client->dev, "firmware file '%s' not found\n",
234245
fw_name);
235246
goto err;

0 commit comments

Comments
 (0)