mirror of
https://github.com/torvalds/linux.git
synced 2024-12-22 10:56:40 +00:00
c942fddf87
Based on 3 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version [author] [kishon] [vijay] [abraham] [i] [kishon]@[ti] [com] this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version [author] [graeme] [gregory] [gg]@[slimlogic] [co] [uk] [author] [kishon] [vijay] [abraham] [i] [kishon]@[ti] [com] [based] [on] [twl6030]_[usb] [c] [author] [hema] [hk] [hemahk]@[ti] [com] this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details extracted by the scancode license scanner the SPDX license identifier GPL-2.0-or-later has been chosen to replace the boilerplate/reference in 1105 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Richard Fontana <rfontana@redhat.com> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190527070033.202006027@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
77 lines
2.2 KiB
C
77 lines
2.2 KiB
C
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
#ifndef __RADIO_TEA5777_H
|
|
#define __RADIO_TEA5777_H
|
|
|
|
/*
|
|
* v4l2 driver for TEA5777 Philips AM/FM radio tuner chips
|
|
*
|
|
* Copyright (c) 2012 Hans de Goede <hdegoede@redhat.com>
|
|
*
|
|
* Based on the ALSA driver for TEA5757/5759 Philips AM/FM radio tuner chips:
|
|
*
|
|
* Copyright (c) 2004 Jaroslav Kysela <perex@perex.cz>
|
|
* Copyright (c) 2012 Hans de Goede <hdegoede@redhat.com>
|
|
*/
|
|
|
|
#include <linux/videodev2.h>
|
|
#include <media/v4l2-ctrls.h>
|
|
#include <media/v4l2-dev.h>
|
|
#include <media/v4l2-device.h>
|
|
|
|
#define TEA575X_FMIF 10700
|
|
#define TEA575X_AMIF 450
|
|
|
|
struct radio_tea5777;
|
|
|
|
struct radio_tea5777_ops {
|
|
/*
|
|
* Write the 6 bytes large write register of the tea5777
|
|
*
|
|
* val represents the 6 write registers, with byte 1 from the
|
|
* datasheet being the most significant byte (so byte 5 of the u64),
|
|
* and byte 6 from the datasheet being the least significant byte.
|
|
*
|
|
* returns 0 on success.
|
|
*/
|
|
int (*write_reg)(struct radio_tea5777 *tea, u64 val);
|
|
/*
|
|
* Read the 3 bytes large read register of the tea5777
|
|
*
|
|
* The read value gets returned in val, akin to write_reg, byte 1 from
|
|
* the datasheet is stored as the most significant byte (so byte 2 of
|
|
* the u32), and byte 3 from the datasheet gets stored as the least
|
|
* significant byte (iow byte 0 of the u32).
|
|
*
|
|
* returns 0 on success.
|
|
*/
|
|
int (*read_reg)(struct radio_tea5777 *tea, u32 *val);
|
|
};
|
|
|
|
struct radio_tea5777 {
|
|
struct v4l2_device *v4l2_dev;
|
|
struct v4l2_file_operations fops;
|
|
struct video_device vd; /* video device */
|
|
bool has_am; /* Device can tune to AM freqs */
|
|
bool write_before_read; /* must write before read quirk */
|
|
bool needs_write; /* for write before read quirk */
|
|
u32 band; /* current band */
|
|
u32 freq; /* current frequency */
|
|
u32 audmode; /* last set audmode */
|
|
u32 seek_rangelow; /* current hwseek limits */
|
|
u32 seek_rangehigh;
|
|
u32 read_reg;
|
|
u64 write_reg;
|
|
struct mutex mutex;
|
|
const struct radio_tea5777_ops *ops;
|
|
void *private_data;
|
|
u8 card[32];
|
|
u8 bus_info[32];
|
|
struct v4l2_ctrl_handler ctrl_handler;
|
|
};
|
|
|
|
int radio_tea5777_init(struct radio_tea5777 *tea, struct module *owner);
|
|
void radio_tea5777_exit(struct radio_tea5777 *tea);
|
|
int radio_tea5777_set_freq(struct radio_tea5777 *tea);
|
|
|
|
#endif /* __RADIO_TEA5777_H */
|