1 1.2 jmcneill /* $NetBSD: tvpllvar.h,v 1.2 2011/07/15 03:31:37 jmcneill Exp $ */ 2 1.1 jakllsch 3 1.1 jakllsch /* 4 1.1 jakllsch * Copyright (c) 2008 Jonathan A. Kollasch 5 1.1 jakllsch * All rights reserved. 6 1.1 jakllsch * 7 1.1 jakllsch * Redistribution and use in source and binary forms, with or without 8 1.1 jakllsch * modification, are permitted provided that the following conditions 9 1.1 jakllsch * are met: 10 1.1 jakllsch * 1. Redistributions of source code must retain the above copyright 11 1.1 jakllsch * notice, this list of conditions and the following disclaimer. 12 1.1 jakllsch * 2. Redistributions in binary form must reproduce the above copyright 13 1.1 jakllsch * notice, this list of conditions and the following disclaimer in the 14 1.1 jakllsch * documentation and/or other materials provided with the distribution. 15 1.1 jakllsch * 16 1.1 jakllsch * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17 1.1 jakllsch * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18 1.1 jakllsch * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 19 1.1 jakllsch * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 20 1.1 jakllsch * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 21 1.1 jakllsch * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 22 1.1 jakllsch * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 23 1.1 jakllsch * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 1.1 jakllsch * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 25 1.1 jakllsch * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 26 1.1 jakllsch * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 1.1 jakllsch */ 28 1.1 jakllsch 29 1.1 jakllsch #ifndef _DEV_I2C_TVPLLVAR_H_ 30 1.1 jakllsch #define _DEV_I2C_TVPLLVAR_H_ 31 1.1 jakllsch 32 1.1 jakllsch #include <sys/param.h> 33 1.1 jakllsch #include <sys/types.h> 34 1.1 jakllsch #include <dev/i2c/i2cvar.h> 35 1.1 jakllsch #include <dev/dtv/dtvio.h> 36 1.1 jakllsch 37 1.2 jmcneill #define TVPLL_IGNORE_AUX 0xff 38 1.2 jmcneill 39 1.1 jakllsch struct tvpll_data { 40 1.1 jakllsch const char * name; 41 1.1 jakllsch uint32_t min; 42 1.1 jakllsch uint32_t max; 43 1.1 jakllsch uint32_t iffreq; 44 1.1 jakllsch uint8_t *initdata; 45 1.1 jakllsch uint8_t *sleepdata; 46 1.1 jakllsch int count; 47 1.1 jakllsch struct tvpll_entry{ 48 1.1 jakllsch uint32_t limit; 49 1.1 jakllsch uint32_t stepsize; 50 1.1 jakllsch uint8_t config; 51 1.1 jakllsch uint8_t cb; 52 1.2 jmcneill uint8_t aux; 53 1.1 jakllsch } *entries; 54 1.1 jakllsch }; 55 1.1 jakllsch 56 1.1 jakllsch struct tvpll * tvpll_open(device_t, i2c_tag_t, i2c_addr_t, struct tvpll_data *); 57 1.1 jakllsch void tvpll_close(struct tvpll *); 58 1.1 jakllsch int tvpll_tune_dtv(struct tvpll *, const struct dvb_frontend_parameters *); 59 1.1 jakllsch int tvpll_get_status(struct tvpll *); 60 1.1 jakllsch 61 1.1 jakllsch #endif /* !_DEV_I2C_TVPLLVAR_H_ */ 62