^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0-or-later */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * lnbp21.h - driver for lnb supply and control ic lnbp21
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * Copyright (C) 2006 Oliver Endriss
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) * the project's page is at https://linuxtv.org
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #ifndef _LNBP21_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #define _LNBP21_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) /* system register bits */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) /* [RO] 0=OK; 1=over current limit flag */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #define LNBP21_OLF 0x01
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) /* [RO] 0=OK; 1=over temperature flag (150 C) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) #define LNBP21_OTF 0x02
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) /* [RW] 0=disable LNB power, enable loopthrough
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) 1=enable LNB power, disable loopthrough */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) #define LNBP21_EN 0x04
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) /* [RW] 0=low voltage (13/14V, vert pol)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) 1=high voltage (18/19V,horiz pol) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) #define LNBP21_VSEL 0x08
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) /* [RW] increase LNB voltage by 1V:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) 0=13/18V; 1=14/19V */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) #define LNBP21_LLC 0x10
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) /* [RW] 0=tone controlled by DSQIN pin
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) 1=tone enable, disable DSQIN */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) #define LNBP21_TEN 0x20
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) /* [RW] current limit select:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) 0:Iout=500-650mA Isc=300mA
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) 1:Iout=400-550mA Isc=200mA */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) #define LNBP21_ISEL 0x40
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) /* [RW] short-circuit protect:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) 0=pulsed (dynamic) curr limiting
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) 1=static curr limiting */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) #define LNBP21_PCL 0x80
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) #include <linux/dvb/frontend.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) #if IS_REACHABLE(CONFIG_DVB_LNBP21)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) /* override_set and override_clear control which
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) system register bits (above) to always set & clear */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) extern struct dvb_frontend *lnbp21_attach(struct dvb_frontend *fe,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) struct i2c_adapter *i2c, u8 override_set,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) u8 override_clear);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) static inline struct dvb_frontend *lnbp21_attach(struct dvb_frontend *fe,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) struct i2c_adapter *i2c, u8 override_set,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) u8 override_clear)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) return NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) #endif