From: Franklin Meng <fmeng2002@yahoo.com>
To: linux-media@vger.kernel.org
Cc: " Mauro Carvalho ChehabDevin Heitmueller
<dheitmueller@kernellabs.com>" <mchehab@infradead.org>,
Douglas Schilling Landgraf <dougsland@gmail.com>
Subject: [Patch 1/3] Kworld 315U
Date: Sun, 17 Jan 2010 23:03:29 -0800 (PST) [thread overview]
Message-ID: <647298.8638.qm@web32701.mail.mud.yahoo.com> (raw)
Patch to add the s_power function to the saa7115.c code.
Signed-off-by: Franklin Meng<fmeng2002@yahoo.com>
diff -r b6b82258cf5e linux/drivers/media/video/saa7115.c
--- a/linux/drivers/media/video/saa7115.c Thu Dec 31 19:14:54 2009 -0200
+++ b/linux/drivers/media/video/saa7115.c Sun Jan 17 22:54:21 2010 -0800
@@ -1338,6 +1338,59 @@
return 0;
}
+static int saa711x_s_power(struct v4l2_subdev *sd, int val)
+{
+ struct saa711x_state *state = to_state(sd);
+
+ if(val > 1 || val < 0)
+ return -EINVAL;
+
+ /* There really isn't a way to put the chip into power saving
+ other than by pulling CE to ground so all we do is return
+ out of this function
+ */
+ if(val == 0)
+ return 0;
+
+ /* When enabling the chip again we need to reinitialize the
+ all the values
+ */
+ state->input = -1;
+ state->output = SAA7115_IPORT_ON;
+ state->enable = 1;
+ state->radio = 0;
+ state->bright = 128;
+ state->contrast = 64;
+ state->hue = 0;
+ state->sat = 64;
+
+ state->audclk_freq = 48000;
+
+ v4l2_dbg(1, debug, sd, "writing init values s_power\n");
+
+ /* init to 60hz/48khz */
+ state->crystal_freq = SAA7115_FREQ_24_576_MHZ;
+ switch (state->ident) {
+ case V4L2_IDENT_SAA7111:
+ saa711x_writeregs(sd, saa7111_init);
+ break;
+ case V4L2_IDENT_SAA7113:
+ saa711x_writeregs(sd, saa7113_init);
+ break;
+ default:
+ state->crystal_freq = SAA7115_FREQ_32_11_MHZ;
+ saa711x_writeregs(sd, saa7115_init_auto_input);
+ }
+ if (state->ident != V4L2_IDENT_SAA7111)
+ saa711x_writeregs(sd, saa7115_init_misc);
+ saa711x_set_v4lstd(sd, V4L2_STD_NTSC);
+
+ v4l2_dbg(1, debug, sd, "status: (1E) 0x%02x, (1F) 0x%02x\n",
+ saa711x_read(sd, R_1E_STATUS_BYTE_1_VD_DEC),
+ saa711x_read(sd, R_1F_STATUS_BYTE_2_VD_DEC));
+ return 0;
+}
+
static int saa711x_reset(struct v4l2_subdev *sd, u32 val)
{
v4l2_dbg(1, debug, sd, "decoder RESET\n");
@@ -1513,6 +1566,7 @@
.s_std = saa711x_s_std,
.reset = saa711x_reset,
.s_gpio = saa711x_s_gpio,
+ .s_power = saa711x_s_power,
#ifdef CONFIG_VIDEO_ADV_DEBUG
.g_register = saa711x_g_register,
.s_register = saa711x_s_register,
next reply other threads:[~2010-01-18 7:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-18 7:03 Franklin Meng [this message]
2010-01-18 7:07 ` [Patch 2/3] Kworld 315U Franklin Meng
2010-01-25 14:15 ` Mauro Carvalho Chehab
2010-01-25 13:59 ` [Patch 1/3] " Mauro Carvalho Chehab
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=647298.8638.qm@web32701.mail.mud.yahoo.com \
--to=fmeng2002@yahoo.com \
--cc=dougsland@gmail.com \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox