commit f67a44d14a847e3fcc4fd74d1660666535c26905 Author: Markus Rechberger Date: Wed Oct 22 22:14:17 2008 +0200 adding common used headers tunerchip.h: just contains an internal used struct which can be used for setting up a tuner frontend. Signed-off-by: Markus Rechberger diff --git a/drivers/media/video/empia/include/tunerchip.h b/drivers/media/video/empia/include/tunerchip.h new file mode 100644 index 0000000..75ba8e6 --- /dev/null +++ b/drivers/media/video/empia/include/tunerchip.h @@ -0,0 +1,32 @@ +#ifndef _TUNER_CHIP_H +#define _TUNER_CHIP_H + +struct tuner_module { + void *priv; + int (*tuner_cmd)(struct tuner_module *client, unsigned int cmd, void *data); + int (*shutdown)(struct tuner_module *client); + int (*set_frequency)(struct tuner_module *client, unsigned long frequency_in_hz); + int (*get_frequency_error)(struct tuner_module *client, long *frequency_error_mhz); + int (*get_lock_status)(struct tuner_module *client, unsigned short int *lock_status); + int (*get_version)(struct tuner_module *client, unsigned char* hw_majorversion, unsigned char* hw_minorversion, unsigned char* fw_majorversion, unsigned char* fw_minorversion); + int (*full_scan)(struct tuner_module *client, unsigned int freq_min, unsigned int freq_max, int freq_list_size, unsigned int *freq_list, int *nb_freq_found ); + void (*release)(struct tuner_module *client); +}; + +#define tuner_chip_detach(MOD) if(MOD) { \ + MOD->release(MOD); \ + symbol_put_addr(MOD->release); \ + } + +#define tuner_chip_attach(FUNCTION, ARGS...) ({ \ + struct tuner_module *mod = NULL; \ + typeof(&FUNCTION) __a = symbol_request(FUNCTION); \ + if (__a) { \ + mod=__a(ARGS); \ + if (mod == 0) \ + symbol_put(__a); \ + } \ + mod; \ +}) + +#endif