18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * isl6421.h - driver for lnb supply and control ic ISL6421
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Copyright (C) 2006 Andrew de Quincey
68c2ecf20Sopenharmony_ci * Copyright (C) 2006 Oliver Endriss
78c2ecf20Sopenharmony_ci *
88c2ecf20Sopenharmony_ci * the project's page is at https://linuxtv.org
98c2ecf20Sopenharmony_ci */
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci#ifndef _ISL6421_H
128c2ecf20Sopenharmony_ci#define _ISL6421_H
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ci#include <linux/dvb/frontend.h>
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ci/* system register bits */
178c2ecf20Sopenharmony_ci#define ISL6421_OLF1	0x01
188c2ecf20Sopenharmony_ci#define ISL6421_EN1	0x02
198c2ecf20Sopenharmony_ci#define ISL6421_VSEL1	0x04
208c2ecf20Sopenharmony_ci#define ISL6421_LLC1	0x08
218c2ecf20Sopenharmony_ci#define ISL6421_ENT1	0x10
228c2ecf20Sopenharmony_ci#define ISL6421_ISEL1	0x20
238c2ecf20Sopenharmony_ci#define ISL6421_DCL	0x40
248c2ecf20Sopenharmony_ci
258c2ecf20Sopenharmony_ci#if IS_REACHABLE(CONFIG_DVB_ISL6421)
268c2ecf20Sopenharmony_ci/* override_set and override_clear control which system register bits (above) to always set & clear */
278c2ecf20Sopenharmony_ciextern struct dvb_frontend *isl6421_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, u8 i2c_addr,
288c2ecf20Sopenharmony_ci			  u8 override_set, u8 override_clear, bool override_tone);
298c2ecf20Sopenharmony_ci#else
308c2ecf20Sopenharmony_cistatic inline struct dvb_frontend *isl6421_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, u8 i2c_addr,
318c2ecf20Sopenharmony_ci						  u8 override_set, u8 override_clear, bool override_tone)
328c2ecf20Sopenharmony_ci{
338c2ecf20Sopenharmony_ci	printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
348c2ecf20Sopenharmony_ci	return NULL;
358c2ecf20Sopenharmony_ci}
368c2ecf20Sopenharmony_ci#endif // CONFIG_DVB_ISL6421
378c2ecf20Sopenharmony_ci
388c2ecf20Sopenharmony_ci#endif
39