Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/i2c add a flags argument to lg3303, and use it for t...



details:   https://anonhg.NetBSD.org/src/rev/58e37ce0db8a
branches:  trunk
changeset: 767301:58e37ce0db8a
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Thu Jul 14 23:46:52 2011 +0000

description:
add a flags argument to lg3303, and use it for the caller to request
serial mpeg mode

diffstat:

 sys/dev/i2c/lg3303.c    |  12 ++++++------
 sys/dev/i2c/lg3303var.h |   8 ++++++--
 2 files changed, 12 insertions(+), 8 deletions(-)

diffs (78 lines):

diff -r 9e38f353451a -r 58e37ce0db8a sys/dev/i2c/lg3303.c
--- a/sys/dev/i2c/lg3303.c      Thu Jul 14 23:45:43 2011 +0000
+++ b/sys/dev/i2c/lg3303.c      Thu Jul 14 23:46:52 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lg3303.c,v 1.1 2011/07/11 18:00:06 jmcneill Exp $ */
+/* $NetBSD: lg3303.c,v 1.2 2011/07/14 23:46:52 jmcneill Exp $ */
 
 /*-
  * Copyright 2007 Jason Harmening
@@ -28,7 +28,7 @@
  */
 
 #include <sys/param.h>
-__KERNEL_RCSID(0, "$NetBSD: lg3303.c,v 1.1 2011/07/11 18:00:06 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lg3303.c,v 1.2 2011/07/14 23:46:52 jmcneill Exp $");
 
 #include <sys/types.h>
 #include <sys/kmem.h>
@@ -80,7 +80,7 @@
 static int     lg3303_init(struct lg3303 *);
 
 struct lg3303 *
-lg3303_open(device_t parent, i2c_tag_t i2c, i2c_addr_t addr)
+lg3303_open(device_t parent, i2c_tag_t i2c, i2c_addr_t addr, int flags)
 {
        struct lg3303 *lg;
 
@@ -91,6 +91,7 @@
        lg->i2c = i2c;
        lg->i2c_addr = addr;
        lg->current_modulation = -1;
+       lg->flags = flags;
 
        if (lg3303_init(lg) != 0) {
                kmem_free(lg, sizeof(*lg));
@@ -205,10 +206,9 @@
 
        if (lg->current_modulation != modulation) {
                uint8_t top_ctrl[] = {REG_TOP_CONTROL, 0x00};
-#if 0
-               if (m_input == DVB_INPUT_SERIAL)
+
+               if (lg->flags & LG3303_CFG_SERIAL_INPUT)
                        top_ctrl[1] = 0x40;  
-#endif
 
                switch (modulation) {
                case VSB_8:
diff -r 9e38f353451a -r 58e37ce0db8a sys/dev/i2c/lg3303var.h
--- a/sys/dev/i2c/lg3303var.h   Thu Jul 14 23:45:43 2011 +0000
+++ b/sys/dev/i2c/lg3303var.h   Thu Jul 14 23:46:52 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lg3303var.h,v 1.1 2011/07/11 18:00:06 jmcneill Exp $ */
+/* $NetBSD: lg3303var.h,v 1.2 2011/07/14 23:46:52 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2011 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -32,15 +32,19 @@
 #include <dev/i2c/i2cvar.h>
 #include <dev/dtv/dtvio.h>
 
+#define        LG3303_CFG_SERIAL_INPUT 0x01
+
 struct lg3303 {
        device_t        parent;
        i2c_tag_t       i2c;
        i2c_addr_t      i2c_addr;
 
        fe_modulation_t current_modulation;
+
+       int             flags;
 };
 
-struct lg3303 *        lg3303_open(device_t, i2c_tag_t, i2c_addr_t);
+struct lg3303 *        lg3303_open(device_t, i2c_tag_t, i2c_addr_t, int);
 void           lg3303_close(struct lg3303 *);
 int            lg3303_set_modulation(struct lg3303 *, fe_modulation_t);
 fe_status_t    lg3303_get_dtv_status(struct lg3303 *);



Home | Main Index | Thread Index | Old Index