Kozlov Sergey | a6dc60ff | 2015-07-28 11:33:03 -0300 | [diff] [blame] | 1 | /* |
| 2 | * cxd2841er.h |
| 3 | * |
| 4 | * Sony CXD2441ER digital demodulator driver public definitions |
| 5 | * |
| 6 | * Copyright 2012 Sony Corporation |
| 7 | * Copyright (C) 2014 NetUP Inc. |
| 8 | * Copyright (C) 2014 Sergey Kozlov <serjk@netup.ru> |
| 9 | * Copyright (C) 2014 Abylay Ospan <aospan@netup.ru> |
| 10 | * |
| 11 | * This program is free software; you can redistribute it and/or modify |
| 12 | * it under the terms of the GNU General Public License as published by |
| 13 | * the Free Software Foundation; either version 2 of the License, or |
| 14 | * (at your option) any later version. |
| 15 | * |
| 16 | * This program is distributed in the hope that it will be useful, |
| 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 19 | * GNU General Public License for more details. |
| 20 | */ |
| 21 | |
| 22 | #ifndef CXD2841ER_H |
| 23 | #define CXD2841ER_H |
| 24 | |
| 25 | #include <linux/kconfig.h> |
| 26 | #include <linux/dvb/frontend.h> |
| 27 | |
Abylay Ospan | 83808c2 | 2016-03-22 19:20:34 -0300 | [diff] [blame] | 28 | enum cxd2841er_xtal { |
| 29 | SONY_XTAL_20500, /* 20.5 MHz */ |
| 30 | SONY_XTAL_24000, /* 24 MHz */ |
| 31 | SONY_XTAL_41000 /* 41 MHz */ |
| 32 | }; |
| 33 | |
Kozlov Sergey | a6dc60ff | 2015-07-28 11:33:03 -0300 | [diff] [blame] | 34 | struct cxd2841er_config { |
| 35 | u8 i2c_addr; |
Abylay Ospan | 83808c2 | 2016-03-22 19:20:34 -0300 | [diff] [blame] | 36 | enum cxd2841er_xtal xtal; |
Kozlov Sergey | a6dc60ff | 2015-07-28 11:33:03 -0300 | [diff] [blame] | 37 | }; |
| 38 | |
| 39 | #if IS_REACHABLE(CONFIG_DVB_CXD2841ER) |
| 40 | extern struct dvb_frontend *cxd2841er_attach_s(struct cxd2841er_config *cfg, |
| 41 | struct i2c_adapter *i2c); |
| 42 | |
| 43 | extern struct dvb_frontend *cxd2841er_attach_t(struct cxd2841er_config *cfg, |
| 44 | struct i2c_adapter *i2c); |
| 45 | |
| 46 | extern struct dvb_frontend *cxd2841er_attach_c(struct cxd2841er_config *cfg, |
| 47 | struct i2c_adapter *i2c); |
Abylay Ospan | 83808c2 | 2016-03-22 19:20:34 -0300 | [diff] [blame] | 48 | extern struct dvb_frontend *cxd2841er_attach_i(struct cxd2841er_config *cfg, |
| 49 | struct i2c_adapter *i2c); |
Kozlov Sergey | a6dc60ff | 2015-07-28 11:33:03 -0300 | [diff] [blame] | 50 | #else |
| 51 | static inline struct dvb_frontend *cxd2841er_attach_s( |
| 52 | struct cxd2841er_config *cfg, |
| 53 | struct i2c_adapter *i2c) |
| 54 | { |
Abylay Ospan | 83808c2 | 2016-03-22 19:20:34 -0300 | [diff] [blame] | 55 | pr_warn("%s: driver disabled by Kconfig\n", __func__); |
Kozlov Sergey | a6dc60ff | 2015-07-28 11:33:03 -0300 | [diff] [blame] | 56 | return NULL; |
| 57 | } |
| 58 | |
| 59 | static inline struct dvb_frontend *cxd2841er_attach_t( |
| 60 | struct cxd2841er_config *cfg, struct i2c_adapter *i2c) |
| 61 | { |
Abylay Ospan | 83808c2 | 2016-03-22 19:20:34 -0300 | [diff] [blame] | 62 | pr_warn("%s: driver disabled by Kconfig\n", __func__); |
Kozlov Sergey | a6dc60ff | 2015-07-28 11:33:03 -0300 | [diff] [blame] | 63 | return NULL; |
| 64 | } |
| 65 | |
| 66 | static inline struct dvb_frontend *cxd2841er_attach_c( |
| 67 | struct cxd2841er_config *cfg, struct i2c_adapter *i2c) |
| 68 | { |
Abylay Ospan | 83808c2 | 2016-03-22 19:20:34 -0300 | [diff] [blame] | 69 | pr_warn("%s: driver disabled by Kconfig\n", __func__); |
Kozlov Sergey | a6dc60ff | 2015-07-28 11:33:03 -0300 | [diff] [blame] | 70 | return NULL; |
| 71 | } |
Abylay Ospan | 83808c2 | 2016-03-22 19:20:34 -0300 | [diff] [blame] | 72 | |
| 73 | static inline struct dvb_frontend *cxd2841er_attach_i( |
| 74 | struct cxd2841er_config *cfg, struct i2c_adapter *i2c) |
| 75 | { |
| 76 | pr_warn("%s: driver disabled by Kconfig\n", __func__); |
| 77 | return NULL; |
| 78 | } |
| 79 | |
Kozlov Sergey | a6dc60ff | 2015-07-28 11:33:03 -0300 | [diff] [blame] | 80 | #endif |
| 81 | |
| 82 | #endif |