treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157
[sfrench/cifs-2.6.git] / drivers / media / tuners / si2157_priv.h
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3  * Silicon Labs Si2146/2147/2148/2157/2158 silicon tuner driver
4  *
5  * Copyright (C) 2014 Antti Palosaari <crope@iki.fi>
6  */
7
8 #ifndef SI2157_PRIV_H
9 #define SI2157_PRIV_H
10
11 #include <linux/firmware.h>
12 #include <media/v4l2-mc.h>
13 #include "si2157.h"
14
15 enum si2157_pads {
16         SI2157_PAD_RF_INPUT,
17         SI2157_PAD_VID_OUT,
18         SI2157_PAD_AUD_OUT,
19         SI2157_NUM_PADS
20 };
21
22 /* state struct */
23 struct si2157_dev {
24         struct mutex i2c_mutex;
25         struct dvb_frontend *fe;
26         bool active;
27         bool inversion;
28         u8 chiptype;
29         u8 if_port;
30         u32 if_frequency;
31         struct delayed_work stat_work;
32
33 #if defined(CONFIG_MEDIA_CONTROLLER)
34         struct media_device     *mdev;
35         struct media_entity     ent;
36         struct media_pad        pad[SI2157_NUM_PADS];
37 #endif
38
39 };
40
41 #define SI2157_CHIPTYPE_SI2157 0
42 #define SI2157_CHIPTYPE_SI2146 1
43 #define SI2157_CHIPTYPE_SI2141 2
44
45 /* firmware command struct */
46 #define SI2157_ARGLEN      30
47 struct si2157_cmd {
48         u8 args[SI2157_ARGLEN];
49         unsigned wlen;
50         unsigned rlen;
51 };
52
53 #define SI2158_A20_FIRMWARE "dvb-tuner-si2158-a20-01.fw"
54 #define SI2141_A10_FIRMWARE "dvb-tuner-si2141-a10-01.fw"
55
56 #endif