Merge tag 'rproc-v6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc...
[linux-block.git] / drivers / media / dvb-frontends / lgdt330x.h
CommitLineData
c942fddf 1/* SPDX-License-Identifier: GPL-2.0-or-later */
d8667cbb 2/*
1963c907 3 * Support for LGDT3302 and LGDT3303 - VSB/QAM
d8667cbb
MM
4 *
5 * Copyright (C) 2005 Wilson Michaels <wilsonmichaels@earthlink.net>
d8667cbb
MM
6 */
7
6ddcc919
MK
8#ifndef LGDT330X_H
9#define LGDT330X_H
d8667cbb
MM
10
11#include <linux/dvb/frontend.h>
12
1963c907
MK
13typedef enum lg_chip_t {
14 UNDEFINED,
15 LGDT3302,
16 LGDT3303
17}lg_chip_type;
18
7129d314
MCC
19/**
20 * struct lgdt330x_config - contains lgdt330x configuration
21 *
7129d314
MCC
22 * @demod_chip: LG demodulator chip LGDT3302 or LGDT3303
23 * @serial_mpeg: MPEG hardware interface - 0:parallel 1:serial
24 * @pll_rf_set: Callback function to set PLL interface
25 * @set_ts_params: Callback function to set device param for start_dma
26 * @clock_polarity_flip:
27 * Flip the polarity of the mpeg data transfer clock using alternate
28 * init data.
29 * This option applies ONLY to LGDT3303 - 0:disabled (default) 1:enabled
23ba635d
MCC
30 * @get_dvb_frontend:
31 * returns the frontend associated with this I2C client.
32 * Filled by the driver.
7129d314 33 */
6ddcc919 34struct lgdt330x_config
d8667cbb 35{
1963c907 36 lg_chip_type demod_chip;
1963c907 37 int serial_mpeg;
0ccef6db 38 int (*pll_rf_set) (struct dvb_frontend* fe, int index);
d8667cbb 39 int (*set_ts_params)(struct dvb_frontend* fe, int is_punctured);
c0b11b91 40 int clock_polarity_flip;
23ba635d
MCC
41
42 struct dvb_frontend* (*get_dvb_frontend)(struct i2c_client *);
d8667cbb
MM
43};
44
9b174527 45#if IS_REACHABLE(CONFIG_DVB_LGDT330X)
23ba635d
MCC
46struct dvb_frontend *lgdt330x_attach(const struct lgdt330x_config *config,
47 u8 demod_address,
48 struct i2c_adapter *i2c);
102a342b 49#else
2a5f2705 50static inline
23ba635d
MCC
51struct dvb_frontend *lgdt330x_attach(const struct lgdt330x_config *config,
52 u8 demod_address,
53 struct i2c_adapter *i2c)
102a342b 54{
271ddbf7 55 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
102a342b
AQ
56 return NULL;
57}
58#endif // CONFIG_DVB_LGDT330X
d8667cbb 59
6ddcc919 60#endif /* LGDT330X_H */