1c942fddfSThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-or-later */ 2711615dfSAntti Palosaari /* 3711615dfSAntti Palosaari * Silicon Labs Si2168 DVB-T/T2/C demodulator driver 4711615dfSAntti Palosaari * 5711615dfSAntti Palosaari * Copyright (C) 2014 Antti Palosaari <crope@iki.fi> 6711615dfSAntti Palosaari */ 7711615dfSAntti Palosaari 8845f3505SAntti Palosaari #ifndef SI2168_PRIV_H 9845f3505SAntti Palosaari #define SI2168_PRIV_H 10845f3505SAntti Palosaari 11845f3505SAntti Palosaari #include "si2168.h" 12fada1935SMauro Carvalho Chehab #include <media/dvb_frontend.h> 13845f3505SAntti Palosaari #include <linux/firmware.h> 14845f3505SAntti Palosaari #include <linux/i2c-mux.h> 158393c003SAntti Palosaari #include <linux/kernel.h> 16845f3505SAntti Palosaari 17635a90cfSLuis Alves #define SI2168_A20_FIRMWARE "dvb-demod-si2168-a20-01.fw" 18c9cb0820SOlli Salonen #define SI2168_A30_FIRMWARE "dvb-demod-si2168-a30-01.fw" 19c9cb0820SOlli Salonen #define SI2168_B40_FIRMWARE "dvb-demod-si2168-b40-01.fw" 2050d64462SEvgeny Plehov #define SI2168_D60_FIRMWARE "dvb-demod-si2168-d60-01.fw" 21845f3505SAntti Palosaari 22845f3505SAntti Palosaari /* state struct */ 23bd01c766SAntti Palosaari struct si2168_dev { 24e6d7ffcdSAntti Palosaari struct mutex i2c_mutex; 2558d7b541SPeter Rosin struct i2c_mux_core *muxc; 26845f3505SAntti Palosaari struct dvb_frontend fe; 270df289a2SMauro Carvalho Chehab enum fe_delivery_system delivery_system; 280df289a2SMauro Carvalho Chehab enum fe_status fe_status; 296ab1e943SAntti Palosaari #define SI2168_CHIP_ID_A20 ('A' << 24 | 68 << 16 | '2' << 8 | '0' << 0) 306ab1e943SAntti Palosaari #define SI2168_CHIP_ID_A30 ('A' << 24 | 68 << 16 | '3' << 8 | '0' << 0) 316ab1e943SAntti Palosaari #define SI2168_CHIP_ID_B40 ('B' << 24 | 68 << 16 | '4' << 8 | '0' << 0) 3250d64462SEvgeny Plehov #define SI2168_CHIP_ID_D60 ('D' << 24 | 68 << 16 | '6' << 8 | '0' << 0) 336ab1e943SAntti Palosaari unsigned int chip_id; 346ab1e943SAntti Palosaari unsigned int version; 356ab1e943SAntti Palosaari const char *firmware_name; 36389ce398SOlli Salonen u8 ts_mode; 371c9b943cSMauro Carvalho Chehab unsigned int active:1; 381c9b943cSMauro Carvalho Chehab unsigned int warm:1; 39*51c2664aSLukas Middendorf unsigned int initialized:1; 401c9b943cSMauro Carvalho Chehab unsigned int ts_clock_inv:1; 411c9b943cSMauro Carvalho Chehab unsigned int ts_clock_gapped:1; 421c9b943cSMauro Carvalho Chehab unsigned int spectral_inversion:1; 43845f3505SAntti Palosaari }; 44845f3505SAntti Palosaari 45a87a4d34SYannick Guerrini /* firmware command struct */ 46b02db9e1SOlli Salonen #define SI2168_ARGLEN 30 47845f3505SAntti Palosaari struct si2168_cmd { 48b02db9e1SOlli Salonen u8 args[SI2168_ARGLEN]; 49845f3505SAntti Palosaari unsigned wlen; 50845f3505SAntti Palosaari unsigned rlen; 51845f3505SAntti Palosaari }; 52845f3505SAntti Palosaari 53845f3505SAntti Palosaari #endif 54