Thomas Gleixner | c942fdd | 2019-05-27 08:55:06 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
Kozlov Sergey | dacf9ce | 2015-07-28 11:33:01 -0300 | [diff] [blame] | 2 | /* |
| 3 | * ascot2e.h |
| 4 | * |
| 5 | * Sony Ascot3E DVB-T/T2/C/C2 tuner driver |
| 6 | * |
| 7 | * Copyright 2012 Sony Corporation |
| 8 | * Copyright (C) 2014 NetUP Inc. |
| 9 | * Copyright (C) 2014 Sergey Kozlov <serjk@netup.ru> |
| 10 | * Copyright (C) 2014 Abylay Ospan <aospan@netup.ru> |
Kozlov Sergey | dacf9ce | 2015-07-28 11:33:01 -0300 | [diff] [blame] | 11 | */ |
| 12 | |
| 13 | #ifndef __DVB_ASCOT2E_H__ |
| 14 | #define __DVB_ASCOT2E_H__ |
| 15 | |
Kozlov Sergey | dacf9ce | 2015-07-28 11:33:01 -0300 | [diff] [blame] | 16 | #include <linux/dvb/frontend.h> |
| 17 | #include <linux/i2c.h> |
| 18 | |
| 19 | /** |
| 20 | * struct ascot2e_config - the configuration of Ascot2E tuner driver |
| 21 | * @i2c_address: I2C address of the tuner |
| 22 | * @xtal_freq_mhz: Oscillator frequency, MHz |
| 23 | * @set_tuner_priv: Callback function private context |
| 24 | * @set_tuner_callback: Callback function that notifies the parent driver |
| 25 | * which tuner is active now |
| 26 | */ |
| 27 | struct ascot2e_config { |
| 28 | u8 i2c_address; |
| 29 | u8 xtal_freq_mhz; |
| 30 | void *set_tuner_priv; |
| 31 | int (*set_tuner_callback)(void *, int); |
| 32 | }; |
| 33 | |
| 34 | #if IS_REACHABLE(CONFIG_DVB_ASCOT2E) |
Mauro Carvalho Chehab | be9b53c | 2017-11-29 14:02:22 -0500 | [diff] [blame] | 35 | /** |
Mauro Carvalho Chehab | b064945 | 2020-10-23 16:08:10 +0200 | [diff] [blame] | 36 | * ascot2e_attach - Attach an ascot2e tuner |
Mauro Carvalho Chehab | be9b53c | 2017-11-29 14:02:22 -0500 | [diff] [blame] | 37 | * |
| 38 | * @fe: frontend to be attached |
| 39 | * @config: pointer to &struct ascot2e_config with tuner configuration. |
| 40 | * @i2c: i2c adapter to use. |
| 41 | * |
| 42 | * return: FE pointer on success, NULL on failure. |
| 43 | */ |
Kozlov Sergey | dacf9ce | 2015-07-28 11:33:01 -0300 | [diff] [blame] | 44 | extern struct dvb_frontend *ascot2e_attach(struct dvb_frontend *fe, |
| 45 | const struct ascot2e_config *config, |
| 46 | struct i2c_adapter *i2c); |
| 47 | #else |
| 48 | static inline struct dvb_frontend *ascot2e_attach(struct dvb_frontend *fe, |
| 49 | const struct ascot2e_config *config, |
| 50 | struct i2c_adapter *i2c) |
| 51 | { |
| 52 | printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); |
| 53 | return NULL; |
| 54 | } |
| 55 | #endif |
| 56 | |
| 57 | #endif |