1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * FCI FC2580 silicon tuner driver
5 * Copyright (C) 2012 Antti Palosaari <crope@iki.fi>
12 #include <media/v4l2-ctrls.h>
13 #include <media/v4l2-subdev.h>
14 #include <linux/regmap.h>
15 #include <linux/math64.h>
17 struct fc2580_reg_val
{
22 static const struct fc2580_reg_val fc2580_init_reg_vals
[] = {
47 static const struct fc2580_pll fc2580_pll_lut
[] = {
49 { 400000000, 12, 0x80}, /* .......... 4800000000 */
50 {1000000000, 4, 0x00}, /* 1600000000 4000000000 */
51 {0xffffffff, 2, 0x40}, /* 2000000000 .......... */
54 struct fc2580_if_filter
{
60 static const struct fc2580_if_filter fc2580_if_filter_lut
[] = {
61 { 6000000, 0x18, 0x00},
62 { 7000000, 0x18, 0x80},
63 { 8000000, 0x18, 0x80},
64 {0xffffffff, 0x18, 0x80},
67 struct fc2580_freq_regs
{
95 /* XXX: 0xff is used for don't-care! */
96 static const struct fc2580_freq_regs fc2580_freq_regs_lut
[] = {
98 0xff, 0x77, 0x33, 0x40, 0xff, 0xff, 0xff, 0x09, 0xff, 0x8c,
99 0x50, 0x0f, 0x07, 0x00, 0x15, 0x03, 0x05, 0x10, 0x12, 0x08,
100 0x0a, 0x78, 0x32, 0x54},
102 0xf0, 0x77, 0x53, 0x60, 0xff, 0xff, 0x9f, 0x09, 0xff, 0x8c,
103 0x50, 0x13, 0x07, 0x06, 0x15, 0x06, 0x08, 0x10, 0x12, 0x0b,
104 0x0c, 0x78, 0x32, 0x14},
106 0xf0, 0x77, 0x53, 0x60, 0xff, 0xff, 0x9f, 0x09, 0xff, 0x8c,
107 0x50, 0x15, 0x03, 0x03, 0x15, 0x03, 0x05, 0x0c, 0x0e, 0x0b,
108 0x0c, 0x78, 0x32, 0x14},
110 0xf0, 0x77, 0x53, 0x60, 0xff, 0xff, 0x8f, 0x09, 0xff, 0x8c,
111 0x50, 0x15, 0x07, 0x06, 0x15, 0x07, 0x09, 0x10, 0x12, 0x0b,
112 0x0c, 0x78, 0x32, 0x14},
114 0xff, 0xff, 0xff, 0xff, 0x70, 0x37, 0xe7, 0x09, 0x20, 0x8c,
115 0x50, 0x0f, 0x0f, 0x00, 0x13, 0x00, 0x02, 0x0c, 0x0e, 0x08,
116 0x0a, 0xa0, 0x50, 0x14},
121 struct i2c_client
*client
;
122 struct regmap
*regmap
;
123 struct v4l2_subdev subdev
;
125 unsigned int f_frequency
;
126 unsigned int f_bandwidth
;
129 struct v4l2_ctrl_handler hdl
;
130 struct v4l2_ctrl
*bandwidth_auto
;
131 struct v4l2_ctrl
*bandwidth
;