Module Name: src Committed By: jmcneill Date: Thu Jul 14 23:46:52 UTC 2011
Modified Files: src/sys/dev/i2c: lg3303.c lg3303var.h Log Message: add a flags argument to lg3303, and use it for the caller to request serial mpeg mode To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/dev/i2c/lg3303.c src/sys/dev/i2c/lg3303var.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/i2c/lg3303.c diff -u src/sys/dev/i2c/lg3303.c:1.1 src/sys/dev/i2c/lg3303.c:1.2 --- src/sys/dev/i2c/lg3303.c:1.1 Mon Jul 11 18:00:06 2011 +++ src/sys/dev/i2c/lg3303.c Thu Jul 14 23:46:52 2011 @@ -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: Index: src/sys/dev/i2c/lg3303var.h diff -u src/sys/dev/i2c/lg3303var.h:1.1 src/sys/dev/i2c/lg3303var.h:1.2 --- src/sys/dev/i2c/lg3303var.h:1.1 Mon Jul 11 18:00:06 2011 +++ src/sys/dev/i2c/lg3303var.h Thu Jul 14 23:46:52 2011 @@ -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 <jmcne...@invisible.ca> @@ -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 *);