Commit e281db58 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

V4L/DVB (8639): saa6752hs: cleanup and add AC-3 support

Cleaned up the saa6752hs i2c driver.
Add AC-3 support.
Add VIDIOC_CHIP_IDENT support.
Signed-off-by: default avatarHans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 1e551266
This diff is collapsed.
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include <media/saa6752hs.h> #include <media/saa6752hs.h>
#include <media/v4l2-common.h> #include <media/v4l2-common.h>
#include <media/v4l2-chip-ident.h>
/* ------------------------------------------------------------------ */ /* ------------------------------------------------------------------ */
...@@ -403,6 +404,25 @@ static int empress_querymenu(struct file *file, void *priv, ...@@ -403,6 +404,25 @@ static int empress_querymenu(struct file *file, void *priv,
return saa7134_i2c_call_saa6752(dev, VIDIOC_QUERYMENU, c); return saa7134_i2c_call_saa6752(dev, VIDIOC_QUERYMENU, c);
} }
static int empress_g_chip_ident(struct file *file, void *fh,
struct v4l2_chip_ident *chip)
{
struct saa7134_dev *dev = file->private_data;
chip->ident = V4L2_IDENT_NONE;
chip->revision = 0;
if (dev->mpeg_i2c_client == NULL)
return -EINVAL;
if (chip->match_type == V4L2_CHIP_MATCH_I2C_DRIVER &&
chip->match_chip == I2C_DRIVERID_SAA6752HS)
return saa7134_i2c_call_saa6752(dev, VIDIOC_G_CHIP_IDENT, chip);
if (chip->match_type == V4L2_CHIP_MATCH_I2C_ADDR &&
chip->match_chip == dev->mpeg_i2c_client->addr)
return saa7134_i2c_call_saa6752(dev, VIDIOC_G_CHIP_IDENT, chip);
return -EINVAL;
}
static const struct file_operations ts_fops = static const struct file_operations ts_fops =
{ {
.owner = THIS_MODULE, .owner = THIS_MODULE,
...@@ -431,11 +451,11 @@ static const struct v4l2_ioctl_ops ts_ioctl_ops = { ...@@ -431,11 +451,11 @@ static const struct v4l2_ioctl_ops ts_ioctl_ops = {
.vidioc_enum_input = empress_enum_input, .vidioc_enum_input = empress_enum_input,
.vidioc_g_input = empress_g_input, .vidioc_g_input = empress_g_input,
.vidioc_s_input = empress_s_input, .vidioc_s_input = empress_s_input,
.vidioc_queryctrl = empress_queryctrl, .vidioc_queryctrl = empress_queryctrl,
.vidioc_querymenu = empress_querymenu, .vidioc_querymenu = empress_querymenu,
.vidioc_g_ctrl = empress_g_ctrl, .vidioc_g_ctrl = empress_g_ctrl,
.vidioc_s_ctrl = empress_s_ctrl, .vidioc_s_ctrl = empress_s_ctrl,
.vidioc_g_chip_ident = empress_g_chip_ident,
}; };
/* ----------------------------------------------------------- */ /* ----------------------------------------------------------- */
......
...@@ -637,13 +637,17 @@ int v4l2_ctrl_query_fill_std(struct v4l2_queryctrl *qctrl) ...@@ -637,13 +637,17 @@ int v4l2_ctrl_query_fill_std(struct v4l2_queryctrl *qctrl)
EXPORT_SYMBOL(v4l2_ctrl_query_fill_std); EXPORT_SYMBOL(v4l2_ctrl_query_fill_std);
/* Fill in a struct v4l2_querymenu based on the struct v4l2_queryctrl and /* Fill in a struct v4l2_querymenu based on the struct v4l2_queryctrl and
the menu. The qctrl pointer may be NULL, in which case it is ignored. */ the menu. The qctrl pointer may be NULL, in which case it is ignored.
If menu_items is NULL, then the menu items are retrieved using
v4l2_ctrl_get_menu. */
int v4l2_ctrl_query_menu(struct v4l2_querymenu *qmenu, struct v4l2_queryctrl *qctrl, int v4l2_ctrl_query_menu(struct v4l2_querymenu *qmenu, struct v4l2_queryctrl *qctrl,
const char **menu_items) const char **menu_items)
{ {
int i; int i;
qmenu->reserved = 0; qmenu->reserved = 0;
if (menu_items == NULL)
menu_items = v4l2_ctrl_get_menu(qmenu->id);
if (menu_items == NULL || if (menu_items == NULL ||
(qctrl && (qmenu->index < qctrl->minimum || qmenu->index > qctrl->maximum))) (qctrl && (qmenu->index < qctrl->minimum || qmenu->index > qctrl->maximum)))
return -EINVAL; return -EINVAL;
......
...@@ -72,6 +72,10 @@ enum { ...@@ -72,6 +72,10 @@ enum {
/* module cs5345: just ident 5345 */ /* module cs5345: just ident 5345 */
V4L2_IDENT_CS5345 = 5345, V4L2_IDENT_CS5345 = 5345,
/* module saa6752hs: reserved range 6750-6759 */
V4L2_IDENT_SAA6752HS = 6752,
V4L2_IDENT_SAA6752HS_AC3 = 6753,
/* module wm8739: just ident 8739 */ /* module wm8739: just ident 8739 */
V4L2_IDENT_WM8739 = 8739, V4L2_IDENT_WM8739 = 8739,
......
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