brintos

brintos / linux-shallow public Read only

0
0
Text · 2.2 KiB · 69fdca0 Raw
76 lines · c
1/* SPDX-License-Identifier: GPL-2.0 */2#ifndef _DRXK_H_3#define _DRXK_H_4 5#include <linux/types.h>6#include <linux/i2c.h>7 8/**9 * struct drxk_config - Configure the initial parameters for DRX-K10 *11 * @adr:		I2C address of the DRX-K12 * @parallel_ts:	True means that the device uses parallel TS,13 *			Serial otherwise.14 * @dynamic_clk:	True means that the clock will be dynamically15 *			adjusted. Static clock otherwise.16 * @enable_merr_cfg:	Enable SIO_PDR_PERR_CFG/SIO_PDR_MVAL_CFG.17 * @single_master:	Device is on the single master mode18 * @no_i2c_bridge:	Don't switch the I2C bridge to talk with tuner19 * @antenna_gpio:	GPIO bit used to control the antenna20 * @antenna_dvbt:	GPIO bit for changing antenna to DVB-C. A value of 121 *			means that 1=DVBC, 0 = DVBT. Zero means the opposite.22 * @mpeg_out_clk_strength: DRXK Mpeg output clock drive strength.23 * @chunk_size:		maximum size for I2C messages24 * @microcode_name:	Name of the firmware file with the microcode25 * @qam_demod_parameter_count:	The number of parameters used for the command26 *				to set the demodulator parameters. All27 *				firmwares are using the 2-parameter command.28 *				An exception is the ``drxk_a3.mc`` firmware,29 *				which uses the 4-parameter command.30 *				A value of 0 (default) or lower indicates that31 *				the correct number of parameters will be32 *				automatically detected.33 *34 * On the ``*_gpio`` vars, bit 0 is UIO-1, bit 1 is UIO-2 and bit 2 is35 * UIO-3.36 */37struct drxk_config {38	u8	adr;39	bool	single_master;40	bool	no_i2c_bridge;41	bool	parallel_ts;42	bool	dynamic_clk;43	bool	enable_merr_cfg;44 45	bool	antenna_dvbt;46	u16	antenna_gpio;47 48	u8	mpeg_out_clk_strength;49	int	chunk_size;50 51	const char	*microcode_name;52	int		 qam_demod_parameter_count;53};54 55#if IS_REACHABLE(CONFIG_DVB_DRXK)56/**57 * drxk_attach - Attach a drxk demod58 *59 * @config: pointer to &struct drxk_config with demod configuration.60 * @i2c: i2c adapter to use.61 *62 * return: FE pointer on success, NULL on failure.63 */64extern struct dvb_frontend *drxk_attach(const struct drxk_config *config,65					struct i2c_adapter *i2c);66#else67static inline struct dvb_frontend *drxk_attach(const struct drxk_config *config,68					struct i2c_adapter *i2c)69{70	printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);71	return NULL;72}73#endif74 75#endif76