Home | History | Annotate | Line # | Download | only in i2c
au8522var.h revision 1.1.6.3
      1 /* $NetBSD: au8522var.h,v 1.1.6.3 2011/05/31 03:04:36 rmind Exp $ */
      2 
      3 /*-
      4  * Copyright (c) 2010 Jared D. McNeill <jmcneill (at) invisible.ca>
      5  * All rights reserved.
      6  *
      7  * Redistribution and use in source and binary forms, with or without
      8  * modification, are permitted provided that the following conditions
      9  * are met:
     10  * 1. Redistributions of source code must retain the above copyright
     11  *    notice, this list of conditions and the following disclaimer.
     12  * 2. Redistributions in binary form must reproduce the above copyright
     13  *    notice, this list of conditions and the following disclaimer in the
     14  *    documentation and/or other materials provided with the distribution.
     15  *
     16  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     17  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     18  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     19  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     20  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     21  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     22  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     23  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     24  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     25  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     26  * POSSIBILITY OF SUCH DAMAGE.
     27  */
     28 
     29 #ifndef _AU8522VAR_H
     30 #define _AU8522VAR_H
     31 
     32 #include <dev/i2c/i2cvar.h>
     33 
     34 struct au8522 {
     35 	device_t	parent;
     36 	i2c_tag_t	i2c;
     37 	i2c_addr_t	i2c_addr;
     38 };
     39 
     40 typedef enum {
     41 	AU8522_VINPUT_UNCONF = -1,
     42 	AU8522_VINPUT_NONE = 0,
     43 	AU8522_VINPUT_CVBS,
     44 	AU8522_VINPUT_CVBS_TUNER,
     45 	AU8522_VINPUT_SVIDEO,
     46 } au8522_vinput_t;
     47 
     48 typedef enum {
     49 	AU8522_AINPUT_UNCONF = -1,
     50 	AU8522_AINPUT_NONE = 0,
     51 	AU8522_AINPUT_SIF,
     52 } au8522_ainput_t;
     53 
     54 struct au8522 *	au8522_open(device_t, i2c_tag_t, i2c_addr_t);
     55 void		au8522_close(struct au8522 *);
     56 
     57 void		au8522_enable(struct au8522 *, bool);
     58 void		au8522_set_input(struct au8522 *,
     59 				 au8522_vinput_t, au8522_ainput_t);
     60 int		au8522_get_signal(struct au8522 *);
     61 void		au8522_set_audio(struct au8522 *, bool);
     62 
     63 #endif /* !_AU8522VAR_H */
     64