[media] go7007: set up the saa7115 audio clock correctly
authorHans Verkuil <hans.verkuil@cisco.com>
Mon, 11 Mar 2013 09:12:10 +0000 (06:12 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sun, 24 Mar 2013 15:49:07 +0000 (12:49 -0300)
The s_crystal_freq operation has to be called for the saa7115 to
set up the audio clock correctly.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/staging/media/go7007/go7007-priv.h
drivers/staging/media/go7007/go7007-usb.c
drivers/staging/media/go7007/go7007-v4l2.c

index a6ef67b438169972727db7dffa1c95e770c68666..7f79cc11017c6aaec602befbd2c357e8bc9db483 100644 (file)
@@ -60,6 +60,7 @@ struct go7007;
 #define GO7007_SENSOR_TV               (1<<7)
 #define GO7007_SENSOR_VBI              (1<<8)
 #define GO7007_SENSOR_SCALING          (1<<9)
+#define GO7007_SENSOR_SAA7115          (1<<10)
 
 /* Characteristics of audio sensor devices */
 #define GO7007_AUDIO_I2S_MODE_1                (1)
index 53c5b16c9629152714bf8b22d059df60236703c1..5c7a19e6fb68bc0d8d728eab8e90399d6be8ea71 100644 (file)
@@ -88,6 +88,7 @@ static struct go7007_usb_board board_matrix_ii = {
                .sensor_flags    = GO7007_SENSOR_656 |
                                        GO7007_SENSOR_VALID_ENABLE |
                                        GO7007_SENSOR_TV |
+                                       GO7007_SENSOR_SAA7115 |
                                        GO7007_SENSOR_VBI |
                                        GO7007_SENSOR_SCALING,
                .num_i2c_devs    = 1,
@@ -131,7 +132,7 @@ static struct go7007_usb_board board_matrix_reload = {
                .num_i2c_devs    = 1,
                .i2c_devs        = {
                        {
-                               .type   = "saa7115",
+                               .type   = "saa7113",
                                .addr   = 0x25,
                                .is_video = 1,
                        },
@@ -160,6 +161,7 @@ static struct go7007_usb_board board_star_trek = {
                .sensor_flags    = GO7007_SENSOR_656 |
                                        GO7007_SENSOR_VALID_ENABLE |
                                        GO7007_SENSOR_TV |
+                                       GO7007_SENSOR_SAA7115 |
                                        GO7007_SENSOR_VBI |
                                        GO7007_SENSOR_SCALING,
                .audio_flags     = GO7007_AUDIO_I2S_MODE_1 |
@@ -207,6 +209,7 @@ static struct go7007_usb_board board_px_tv402u = {
                .sensor_flags    = GO7007_SENSOR_656 |
                                        GO7007_SENSOR_VALID_ENABLE |
                                        GO7007_SENSOR_TV |
+                                       GO7007_SENSOR_SAA7115 |
                                        GO7007_SENSOR_VBI |
                                        GO7007_SENSOR_SCALING,
                .audio_flags     = GO7007_AUDIO_I2S_MODE_1 |
index 4d9a99832d7e755723cfed158f88c8ef9e85c320..824b7e5018e1776f58e8c9f9e9a3a2fa717c0876 100644 (file)
@@ -35,6 +35,7 @@
 #include <media/v4l2-ioctl.h>
 #include <media/v4l2-subdev.h>
 #include <media/v4l2-event.h>
+#include <media/saa7115.h>
 
 #include "go7007.h"
 #include "go7007-priv.h"
@@ -1461,6 +1462,12 @@ int go7007_v4l2_init(struct go7007 *go)
                v4l2_disable_ioctl(go->video_dev, VIDIOC_S_AUDIO);
                v4l2_disable_ioctl(go->video_dev, VIDIOC_ENUMAUDIO);
        }
+       /* Setup correct crystal frequency on this board */
+       if (go->board_info->sensor_flags & GO7007_SENSOR_SAA7115)
+               v4l2_subdev_call(go->sd_video, video, s_crystal_freq,
+                               SAA7115_FREQ_24_576_MHZ,
+                               SAA7115_FREQ_FL_APLL | SAA7115_FREQ_FL_UCGC |
+                               SAA7115_FREQ_FL_DOUBLE_ASCLK);
        go7007_s_input(go);
        if (go->board_info->sensor_flags & GO7007_SENSOR_TV)
                go7007_s_std(go);