1711615dfSAntti Palosaari /* 2711615dfSAntti Palosaari * Silicon Labs Si2168 DVB-T/T2/C demodulator driver 3711615dfSAntti Palosaari * 4711615dfSAntti Palosaari * Copyright (C) 2014 Antti Palosaari <crope@iki.fi> 5711615dfSAntti Palosaari * 6711615dfSAntti Palosaari * This program is free software; you can redistribute it and/or modify 7711615dfSAntti Palosaari * it under the terms of the GNU General Public License as published by 8711615dfSAntti Palosaari * the Free Software Foundation; either version 2 of the License, or 9711615dfSAntti Palosaari * (at your option) any later version. 10711615dfSAntti Palosaari * 11711615dfSAntti Palosaari * This program is distributed in the hope that it will be useful, 12711615dfSAntti Palosaari * but WITHOUT ANY WARRANTY; without even the implied warranty of 13711615dfSAntti Palosaari * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14711615dfSAntti Palosaari * GNU General Public License for more details. 15711615dfSAntti Palosaari */ 16711615dfSAntti Palosaari 17845f3505SAntti Palosaari #ifndef SI2168_PRIV_H 18845f3505SAntti Palosaari #define SI2168_PRIV_H 19845f3505SAntti Palosaari 20845f3505SAntti Palosaari #include "si2168.h" 21845f3505SAntti Palosaari #include "dvb_frontend.h" 22845f3505SAntti Palosaari #include <linux/firmware.h> 23845f3505SAntti Palosaari #include <linux/i2c-mux.h> 248393c003SAntti Palosaari #include <linux/kernel.h> 25845f3505SAntti Palosaari 26635a90cfSLuis Alves #define SI2168_A20_FIRMWARE "dvb-demod-si2168-a20-01.fw" 27c9cb0820SOlli Salonen #define SI2168_A30_FIRMWARE "dvb-demod-si2168-a30-01.fw" 28c9cb0820SOlli Salonen #define SI2168_B40_FIRMWARE "dvb-demod-si2168-b40-01.fw" 29*50d64462SEvgeny Plehov #define SI2168_D60_FIRMWARE "dvb-demod-si2168-d60-01.fw" 30a733291dSMauro Carvalho Chehab #define SI2168_B40_FIRMWARE_FALLBACK "dvb-demod-si2168-02.fw" 31845f3505SAntti Palosaari 32845f3505SAntti Palosaari /* state struct */ 33bd01c766SAntti Palosaari struct si2168_dev { 34e6d7ffcdSAntti Palosaari struct mutex i2c_mutex; 3558d7b541SPeter Rosin struct i2c_mux_core *muxc; 36845f3505SAntti Palosaari struct dvb_frontend fe; 370df289a2SMauro Carvalho Chehab enum fe_delivery_system delivery_system; 380df289a2SMauro Carvalho Chehab enum fe_status fe_status; 396ab1e943SAntti Palosaari #define SI2168_CHIP_ID_A20 ('A' << 24 | 68 << 16 | '2' << 8 | '0' << 0) 406ab1e943SAntti Palosaari #define SI2168_CHIP_ID_A30 ('A' << 24 | 68 << 16 | '3' << 8 | '0' << 0) 416ab1e943SAntti Palosaari #define SI2168_CHIP_ID_B40 ('B' << 24 | 68 << 16 | '4' << 8 | '0' << 0) 42*50d64462SEvgeny Plehov #define SI2168_CHIP_ID_D60 ('D' << 24 | 68 << 16 | '6' << 8 | '0' << 0) 436ab1e943SAntti Palosaari unsigned int chip_id; 446ab1e943SAntti Palosaari unsigned int version; 456ab1e943SAntti Palosaari const char *firmware_name; 46845f3505SAntti Palosaari bool active; 476ab1e943SAntti Palosaari bool warm; 48389ce398SOlli Salonen u8 ts_mode; 4952791979SCrazyCat bool ts_clock_inv; 508117a312SOlli Salonen bool ts_clock_gapped; 51845f3505SAntti Palosaari }; 52845f3505SAntti Palosaari 53a87a4d34SYannick Guerrini /* firmware command struct */ 54b02db9e1SOlli Salonen #define SI2168_ARGLEN 30 55845f3505SAntti Palosaari struct si2168_cmd { 56b02db9e1SOlli Salonen u8 args[SI2168_ARGLEN]; 57845f3505SAntti Palosaari unsigned wlen; 58845f3505SAntti Palosaari unsigned rlen; 59845f3505SAntti Palosaari }; 60845f3505SAntti Palosaari 61845f3505SAntti Palosaari #endif 62