Commit 4faba767 authored by Hans de Goede's avatar Hans de Goede Committed by Mauro Carvalho Chehab

[media] shark2: New driver for the Griffin radioSHARK v2 USB radio receiver

This driver consists of 2 parts, a generic tea5777 driver and a driver
for the Griffin radioSHARK v2 USB radio receiver, which is the only driver
using the generic tea5777 for now.

This first version only implements FM support, once the the new
VIDIOC_ENUM_FREQ_BANDS API is upstream I'll also add AM support.
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 7a3ed2d9
......@@ -74,6 +74,23 @@ config RADIO_SHARK
To compile this driver as a module, choose M here: the
module will be called radio-shark.
config RADIO_SHARK2
tristate "Griffin radioSHARK2 USB radio receiver"
depends on USB
---help---
Choose Y here if you have this radio receiver.
There are 2 versions of this device, this driver is for version 2,
which is black.
In order to control your radio card, you will need to use programs
that are compatible with the Video For Linux API. Information on
this API and pointers to "v4l" programs may be found at
<file:Documentation/video4linux/API.html>.
To compile this driver as a module, choose M here: the
module will be called radio-shark2.
config I2C_SI4713
tristate "I2C driver for Silicon Labs Si4713 device"
depends on I2C && VIDEO_V4L2
......
......@@ -12,6 +12,7 @@ obj-$(CONFIG_RADIO_TYPHOON) += radio-typhoon.o
obj-$(CONFIG_RADIO_TERRATEC) += radio-terratec.o
obj-$(CONFIG_RADIO_MAXIRADIO) += radio-maxiradio.o
obj-$(CONFIG_RADIO_SHARK) += radio-shark.o
obj-$(CONFIG_RADIO_SHARK2) += shark2.o
obj-$(CONFIG_RADIO_RTRACK) += radio-aimslab.o
obj-$(CONFIG_RADIO_ZOLTRIX) += radio-zoltrix.o
obj-$(CONFIG_RADIO_GEMTEK) += radio-gemtek.o
......@@ -30,4 +31,6 @@ obj-$(CONFIG_RADIO_TIMBERDALE) += radio-timb.o
obj-$(CONFIG_RADIO_WL1273) += radio-wl1273.o
obj-$(CONFIG_RADIO_WL128X) += wl128x/
shark2-objs := radio-shark2.o radio-tea5777.o
ccflags-y += -Isound
This diff is collapsed.
This diff is collapsed.
#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>
*
* 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.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#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 freq; /* current frequency */
u32 seek_rangelow; /* current hwseek limits */
u32 seek_rangehigh;
u32 read_reg;
u64 write_reg;
struct mutex mutex;
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);
#endif /* __RADIO_TEA5777_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment