/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* FCI FC2580 silicon tuner driver
*
* Copyright (C) 2012 Antti Palosaari <crope@iki.fi>
*/
#ifndef FC2580_PRIV_H
#define FC2580_PRIV_H
#include "fc2580.h"
#include <media/v4l2-ctrls.h>
#include <media/v4l2-subdev.h>
#include <linux/regmap.h>
#include <linux/math64.h>
struct fc2580_reg_val {
u8 reg;
u8 val;
};
static const struct fc2580_reg_val fc2580_init_reg_vals[] = {
{0 x00, 0 x00},
{0 x12, 0 x86},
{0 x14, 0 x5c},
{0 x16, 0 x3c},
{0 x1f, 0 xd2},
{0 x09, 0 xd7},
{0 x0b, 0 xd5},
{0 x0c, 0 x32},
{0 x0e, 0 x43},
{0 x21, 0 x0a},
{0 x22, 0 x82},
{0 x45, 0 x10},
{0 x4c, 0 x00},
{0 x3f, 0 x88},
{0 x02, 0 x0e},
{0 x58, 0 x14},
};
struct fc2580_pll {
u32 freq;
u8 div_out;
u8 band;
};
static const struct fc2580_pll fc2580_pll_lut[] = {
/* VCO min VCO max */
{ 400000000 , 12 , 0 x80}, /* .......... 4800000000 */
{1000000000 , 4 , 0 x00}, /* 1600000000 4000000000 */
{0 xffffffff, 2 , 0 x40}, /* 2000000000 .......... */
};
struct fc2580_if_filter {
u32 freq;
u8 r36_val;
u8 r39_val;
};
static const struct fc2580_if_filter fc2580_if_filter_lut[] = {
{ 6000000 , 0 x18, 0 x00},
{ 7000000 , 0 x18, 0 x80},
{ 8000000 , 0 x18, 0 x80},
{0 xffffffff, 0 x18, 0 x80},
};
struct fc2580_freq_regs {
u32 freq;
u8 r25_val;
u8 r27_val;
u8 r28_val;
u8 r29_val;
u8 r2b_val;
u8 r2c_val;
u8 r2d_val;
u8 r30_val;
u8 r44_val;
u8 r50_val;
u8 r53_val;
u8 r5f_val;
u8 r61_val;
u8 r62_val;
u8 r63_val;
u8 r67_val;
u8 r68_val;
u8 r69_val;
u8 r6a_val;
u8 r6b_val;
u8 r6c_val;
u8 r6d_val;
u8 r6e_val;
u8 r6f_val;
};
/* XXX: 0xff is used for don't-care! */
static const struct fc2580_freq_regs fc2580_freq_regs_lut[] = {
{ 400000000 ,
0 xff, 0 x77, 0 x33, 0 x40, 0 xff, 0 xff, 0 xff, 0 x09, 0 xff, 0 x8c,
0 x50, 0 x0f, 0 x07, 0 x00, 0 x15, 0 x03, 0 x05, 0 x10, 0 x12, 0 x08,
0 x0a, 0 x78, 0 x32, 0 x54},
{ 538000000 ,
0 xf0, 0 x77, 0 x53, 0 x60, 0 xff, 0 xff, 0 x9f, 0 x09, 0 xff, 0 x8c,
0 x50, 0 x13, 0 x07, 0 x06, 0 x15, 0 x06, 0 x08, 0 x10, 0 x12, 0 x0b,
0 x0c, 0 x78, 0 x32, 0 x14},
{ 794000000 ,
0 xf0, 0 x77, 0 x53, 0 x60, 0 xff, 0 xff, 0 x9f, 0 x09, 0 xff, 0 x8c,
0 x50, 0 x15, 0 x03, 0 x03, 0 x15, 0 x03, 0 x05, 0 x0c, 0 x0e, 0 x0b,
0 x0c, 0 x78, 0 x32, 0 x14},
{1000000000 ,
0 xf0, 0 x77, 0 x53, 0 x60, 0 xff, 0 xff, 0 x8f, 0 x09, 0 xff, 0 x8c,
0 x50, 0 x15, 0 x07, 0 x06, 0 x15, 0 x07, 0 x09, 0 x10, 0 x12, 0 x0b,
0 x0c, 0 x78, 0 x32, 0 x14},
{0 xffffffff,
0 xff, 0 xff, 0 xff, 0 xff, 0 x70, 0 x37, 0 xe7, 0 x09, 0 x20, 0 x8c,
0 x50, 0 x0f, 0 x0f, 0 x00, 0 x13, 0 x00, 0 x02, 0 x0c, 0 x0e, 0 x08,
0 x0a, 0 xa0, 0 x50, 0 x14},
};
struct fc2580_dev {
u32 clk;
struct i2c_client *client;
struct regmap *regmap;
struct v4l2_subdev subdev;
bool active;
unsigned int f_frequency;
unsigned int f_bandwidth;
/* Controls */
struct v4l2_ctrl_handler hdl;
struct v4l2_ctrl *bandwidth_auto;
struct v4l2_ctrl *bandwidth;
};
#endif
Messung V0.5 in Prozent C=96 H=89 G=92
¤ Dauer der Verarbeitung: 0.11 Sekunden
(vorverarbeitet am 2026-06-08)
¤
*© Formatika GbR, Deutschland