18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci#ifndef LINUX_FC0011_H_
38c2ecf20Sopenharmony_ci#define LINUX_FC0011_H_
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ci#include <media/dvb_frontend.h>
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_ci/** struct fc0011_config - fc0011 hardware config
98c2ecf20Sopenharmony_ci *
108c2ecf20Sopenharmony_ci * @i2c_address: I2C bus address.
118c2ecf20Sopenharmony_ci */
128c2ecf20Sopenharmony_cistruct fc0011_config {
138c2ecf20Sopenharmony_ci	u8 i2c_address;
148c2ecf20Sopenharmony_ci};
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ci/** enum fc0011_fe_callback_commands - Frontend callbacks
178c2ecf20Sopenharmony_ci *
188c2ecf20Sopenharmony_ci * @FC0011_FE_CALLBACK_POWER: Power on tuner hardware.
198c2ecf20Sopenharmony_ci * @FC0011_FE_CALLBACK_RESET: Request a tuner reset.
208c2ecf20Sopenharmony_ci */
218c2ecf20Sopenharmony_cienum fc0011_fe_callback_commands {
228c2ecf20Sopenharmony_ci	FC0011_FE_CALLBACK_POWER,
238c2ecf20Sopenharmony_ci	FC0011_FE_CALLBACK_RESET,
248c2ecf20Sopenharmony_ci};
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ci#if IS_REACHABLE(CONFIG_MEDIA_TUNER_FC0011)
278c2ecf20Sopenharmony_cistruct dvb_frontend *fc0011_attach(struct dvb_frontend *fe,
288c2ecf20Sopenharmony_ci				   struct i2c_adapter *i2c,
298c2ecf20Sopenharmony_ci				   const struct fc0011_config *config);
308c2ecf20Sopenharmony_ci#else
318c2ecf20Sopenharmony_cistatic inline
328c2ecf20Sopenharmony_cistruct dvb_frontend *fc0011_attach(struct dvb_frontend *fe,
338c2ecf20Sopenharmony_ci				   struct i2c_adapter *i2c,
348c2ecf20Sopenharmony_ci				   const struct fc0011_config *config)
358c2ecf20Sopenharmony_ci{
368c2ecf20Sopenharmony_ci	dev_err(&i2c->dev, "fc0011 driver disabled in Kconfig\n");
378c2ecf20Sopenharmony_ci	return NULL;
388c2ecf20Sopenharmony_ci}
398c2ecf20Sopenharmony_ci#endif
408c2ecf20Sopenharmony_ci
418c2ecf20Sopenharmony_ci#endif /* LINUX_FC0011_H_ */
42