^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) * lnbh25.c
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * Driver for LNB supply and control IC LNBH25
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) * Copyright (C) 2014 NetUP Inc.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) * Copyright (C) 2014 Sergey Kozlov <serjk@netup.ru>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) * Copyright (C) 2014 Abylay Ospan <aospan@netup.ru>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #ifndef LNBH25_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #define LNBH25_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #include <linux/i2c.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) #include <linux/dvb/frontend.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) /* 22 kHz tone enabled. Tone output controlled by DSQIN pin */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) #define LNBH25_TEN 0x01
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) /* Low power mode activated (used only with 22 kHz tone output disabled) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) #define LNBH25_LPM 0x02
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) /* DSQIN input pin is set to receive external 22 kHz TTL signal source */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) #define LNBH25_EXTM 0x04
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) struct lnbh25_config {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) u8 i2c_address;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) u8 data2_config;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) #if IS_REACHABLE(CONFIG_DVB_LNBH25)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) struct dvb_frontend *lnbh25_attach(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) struct dvb_frontend *fe,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) struct lnbh25_config *cfg,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) struct i2c_adapter *i2c);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) static inline struct dvb_frontend *lnbh25_attach(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) struct dvb_frontend *fe,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) struct lnbh25_config *cfg,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) struct i2c_adapter *i2c)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) return NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) #endif