18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
28c2ecf20Sopenharmony_ci/**
38c2ecf20Sopenharmony_ci * Driver for Sharp IX2505V (marked B0017) DVB-S silicon tuner
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Copyright (C) 2010 Malcolm Priestley
68c2ecf20Sopenharmony_ci */
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_ci#ifndef DVB_IX2505V_H
98c2ecf20Sopenharmony_ci#define DVB_IX2505V_H
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci#include <linux/i2c.h>
128c2ecf20Sopenharmony_ci#include <media/dvb_frontend.h>
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ci/**
158c2ecf20Sopenharmony_ci * struct ix2505v_config - ix2505 attachment configuration
168c2ecf20Sopenharmony_ci *
178c2ecf20Sopenharmony_ci * @tuner_address: tuner address
188c2ecf20Sopenharmony_ci * @tuner_gain: Baseband AMP gain control 0/1=0dB(default) 2=-2bB 3=-4dB
198c2ecf20Sopenharmony_ci * @tuner_chargepump: Charge pump output +/- 0=120 1=260 2=555 3=1200(default)
208c2ecf20Sopenharmony_ci * @min_delay_ms: delay after tune
218c2ecf20Sopenharmony_ci * @tuner_write_only: disables reads
228c2ecf20Sopenharmony_ci */
238c2ecf20Sopenharmony_cistruct ix2505v_config {
248c2ecf20Sopenharmony_ci	u8 tuner_address;
258c2ecf20Sopenharmony_ci	u8 tuner_gain;
268c2ecf20Sopenharmony_ci	u8 tuner_chargepump;
278c2ecf20Sopenharmony_ci	int min_delay_ms;
288c2ecf20Sopenharmony_ci	u8 tuner_write_only;
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ci};
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ci#if IS_REACHABLE(CONFIG_DVB_IX2505V)
338c2ecf20Sopenharmony_ci/**
348c2ecf20Sopenharmony_ci * Attach a ix2505v tuner to the supplied frontend structure.
358c2ecf20Sopenharmony_ci *
368c2ecf20Sopenharmony_ci * @fe: Frontend to attach to.
378c2ecf20Sopenharmony_ci * @config: pointer to &struct ix2505v_config
388c2ecf20Sopenharmony_ci * @i2c: pointer to &struct i2c_adapter.
398c2ecf20Sopenharmony_ci *
408c2ecf20Sopenharmony_ci * return: FE pointer on success, NULL on failure.
418c2ecf20Sopenharmony_ci */
428c2ecf20Sopenharmony_ciextern struct dvb_frontend *ix2505v_attach(struct dvb_frontend *fe,
438c2ecf20Sopenharmony_ci	const struct ix2505v_config *config, struct i2c_adapter *i2c);
448c2ecf20Sopenharmony_ci#else
458c2ecf20Sopenharmony_cistatic inline struct dvb_frontend *ix2505v_attach(struct dvb_frontend *fe,
468c2ecf20Sopenharmony_ci	const struct ix2505v_config *config, struct i2c_adapter *i2c)
478c2ecf20Sopenharmony_ci{
488c2ecf20Sopenharmony_ci	printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
498c2ecf20Sopenharmony_ci	return NULL;
508c2ecf20Sopenharmony_ci}
518c2ecf20Sopenharmony_ci#endif
528c2ecf20Sopenharmony_ci
538c2ecf20Sopenharmony_ci#endif /* DVB_IX2505V_H */
54