/*
* Realtek RTL2832 DVB-T demodulator driver
*
* Copyright (C) 2012 Thomas Mair <thomas.mair86@gmail.com>
* Copyright (C) 2012-2014 Antti Palosaari <crope@iki.fi>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "rtl2832_priv.h"
#define REG_MASK(b) (BIT(b + 1) - 1)
static const struct rtl2832_reg_entry registers[] = {
[DVBT_SOFT_RST] = {0x101, 2, 2},
[DVBT_IIC_REPEAT] = {0x101, 3, 3},
[DVBT_TR_WAIT_MIN_8K] = {0x188, 11, 2},
[DVBT_RSD_BER_FAIL_VAL] = {0x18f, 15, 0},
[DVBT_EN_BK_TRK] = {0x1a6, 7, 7},
[DVBT_AD_EN_REG] = {0x008, 7, 7},
[DVBT_AD_EN_REG1] = {0x008, 6, 6},
[DVBT_EN_BBIN] = {0x1b1, 0, 0},
[DVBT_MGD_THD0] = {0x195, 7, 0},
[DVBT_MGD_THD1] = {0x196, 7, 0},
[DVBT_MGD_THD2] = {0x197, 7, 0},
[DVBT_MGD_THD3] = {0x198, 7, 0},
[DVBT_MGD_THD4] = {0x199, 7, 0},
[DVBT_MGD_THD5] = {0x19a, 7, 0},
[DVBT_MGD_THD6] = {0x19b, 7, 0},
[DVBT_MGD_THD7] = {0x19c, 7, 0},
[DVBT_EN_CACQ_NOTCH] = {0x161, 4, 4},
[DVBT_AD_AV_REF] = {0x009, 6, 0},
[DVBT_REG_PI] = {0x00a, 2, 0},
[DVBT_PIP_ON] = {0x021, 3, 3},
[DVBT_SCALE1_B92] = {0x292, 7, 0},
[DVBT_SCALE1_B93] = {<