18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * descriptions + helper functions for simple dvb plls.
48c2ecf20Sopenharmony_ci */
58c2ecf20Sopenharmony_ci
68c2ecf20Sopenharmony_ci#ifndef __DVB_PLL_H__
78c2ecf20Sopenharmony_ci#define __DVB_PLL_H__
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ci#include <linux/i2c.h>
108c2ecf20Sopenharmony_ci#include <media/dvb_frontend.h>
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ci#define DVB_PLL_UNDEFINED               0
138c2ecf20Sopenharmony_ci#define DVB_PLL_THOMSON_DTT7579         1
148c2ecf20Sopenharmony_ci#define DVB_PLL_THOMSON_DTT759X         2
158c2ecf20Sopenharmony_ci#define DVB_PLL_LG_Z201                 3
168c2ecf20Sopenharmony_ci#define DVB_PLL_UNKNOWN_1               4
178c2ecf20Sopenharmony_ci#define DVB_PLL_TUA6010XS               5
188c2ecf20Sopenharmony_ci#define DVB_PLL_ENV57H1XD5              6
198c2ecf20Sopenharmony_ci#define DVB_PLL_TUA6034                 7
208c2ecf20Sopenharmony_ci#define DVB_PLL_TDA665X                 8
218c2ecf20Sopenharmony_ci#define DVB_PLL_TDED4                   9
228c2ecf20Sopenharmony_ci#define DVB_PLL_TDHU2                  10
238c2ecf20Sopenharmony_ci#define DVB_PLL_SAMSUNG_TBMV           11
248c2ecf20Sopenharmony_ci#define DVB_PLL_PHILIPS_SD1878_TDA8261 12
258c2ecf20Sopenharmony_ci#define DVB_PLL_OPERA1                 13
268c2ecf20Sopenharmony_ci#define DVB_PLL_SAMSUNG_DTOS403IH102A  14
278c2ecf20Sopenharmony_ci#define DVB_PLL_SAMSUNG_TDTC9251DH0    15
288c2ecf20Sopenharmony_ci#define DVB_PLL_SAMSUNG_TBDU18132      16
298c2ecf20Sopenharmony_ci#define DVB_PLL_SAMSUNG_TBMU24112      17
308c2ecf20Sopenharmony_ci#define DVB_PLL_TDEE4		       18
318c2ecf20Sopenharmony_ci#define DVB_PLL_THOMSON_DTT7520X       19
328c2ecf20Sopenharmony_ci#define DVB_PLL_TUA6034_FRIIO          20
338c2ecf20Sopenharmony_ci#define DVB_PLL_TDA665X_EARTH_PT1      21
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_cistruct dvb_pll_config {
368c2ecf20Sopenharmony_ci	struct dvb_frontend *fe;
378c2ecf20Sopenharmony_ci};
388c2ecf20Sopenharmony_ci
398c2ecf20Sopenharmony_ci#if IS_REACHABLE(CONFIG_DVB_PLL)
408c2ecf20Sopenharmony_ci/**
418c2ecf20Sopenharmony_ci * Attach a dvb-pll to the supplied frontend structure.
428c2ecf20Sopenharmony_ci *
438c2ecf20Sopenharmony_ci * @fe: Frontend to attach to.
448c2ecf20Sopenharmony_ci * @pll_addr: i2c address of the PLL (if used).
458c2ecf20Sopenharmony_ci * @i2c: i2c adapter to use (set to NULL if not used).
468c2ecf20Sopenharmony_ci * @pll_desc_id: dvb_pll_desc to use.
478c2ecf20Sopenharmony_ci *
488c2ecf20Sopenharmony_ci * return: Frontend pointer on success, NULL on failure
498c2ecf20Sopenharmony_ci */
508c2ecf20Sopenharmony_ciextern struct dvb_frontend *dvb_pll_attach(struct dvb_frontend *fe,
518c2ecf20Sopenharmony_ci					   int pll_addr,
528c2ecf20Sopenharmony_ci					   struct i2c_adapter *i2c,
538c2ecf20Sopenharmony_ci					   unsigned int pll_desc_id);
548c2ecf20Sopenharmony_ci#else
558c2ecf20Sopenharmony_cistatic inline struct dvb_frontend *dvb_pll_attach(struct dvb_frontend *fe,
568c2ecf20Sopenharmony_ci					   int pll_addr,
578c2ecf20Sopenharmony_ci					   struct i2c_adapter *i2c,
588c2ecf20Sopenharmony_ci					   unsigned int pll_desc_id)
598c2ecf20Sopenharmony_ci{
608c2ecf20Sopenharmony_ci	printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
618c2ecf20Sopenharmony_ci	return NULL;
628c2ecf20Sopenharmony_ci}
638c2ecf20Sopenharmony_ci#endif
648c2ecf20Sopenharmony_ci
658c2ecf20Sopenharmony_ci#endif
66