110099Sjkh/* $NetBSD: tvpllvar.h,v 1.1 2011/07/11 00:01:52 jakllsch Exp $ */
210099Sjkh
310099Sjkh/*
413832Sache * Copyright (c) 2008 Jonathan A. Kollasch
510099Sjkh * All rights reserved.
610099Sjkh *
710099Sjkh * Redistribution and use in source and binary forms, with or without
810099Sjkh * modification, are permitted provided that the following conditions
910099Sjkh * are met:
1010099Sjkh * 1. Redistributions of source code must retain the above copyright
1110099Sjkh *    notice, this list of conditions and the following disclaimer.
1210099Sjkh * 2. Redistributions in binary form must reproduce the above copyright
1310099Sjkh *    notice, this list of conditions and the following disclaimer in the
1410099Sjkh *    documentation and/or other materials provided with the distribution.
1513832Sache *
1610099Sjkh * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1710099Sjkh * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
1810099Sjkh * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
1910099Sjkh * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
2010099Sjkh * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
2110099Sjkh * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
2210099Sjkh * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
2310099Sjkh * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
2410099Sjkh * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
2510099Sjkh * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
2610099Sjkh * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2710099Sjkh */
2810099Sjkh
2910099Sjkh#ifndef _DEV_I2C_TVPLLVAR_H_
3010099Sjkh#define _DEV_I2C_TVPLLVAR_H_
3110099Sjkh
3210099Sjkh#include <sys/param.h>
3310099Sjkh#include <sys/types.h>
3410099Sjkh#include <dev/i2c/i2cvar.h>
3510099Sjkh#include <dev/dtv/dtvio.h>
3610099Sjkh
3710099Sjkh#define	TVPLL_IGNORE_AUX	0xff
3810099Sjkh
3910099Sjkhstruct tvpll_data {
4013865Sache	const char * name;
4113865Sache	uint32_t min;
4213865Sache	uint32_t max;
4313865Sache	uint32_t iffreq;
4410099Sjkh	uint8_t *initdata;
4513865Sache	uint8_t *sleepdata;
4613865Sache	int count;
4713865Sache	struct tvpll_entry{
4813865Sache		uint32_t limit;
4913865Sache		uint32_t stepsize;
5010099Sjkh		uint8_t config;
5113865Sache		uint8_t cb;
5210099Sjkh		uint8_t aux;
5313865Sache	} *entries;
5410099Sjkh};
5513865Sache
5610099Sjkhstruct tvpll * tvpll_open(device_t, i2c_tag_t, i2c_addr_t, struct tvpll_data *);
5710099Sjkhvoid tvpll_close(struct tvpll *);
5810099Sjkhint tvpll_tune_dtv(struct tvpll *, const struct dvb_frontend_parameters *);
5910099Sjkhint tvpll_get_status(struct tvpll *);
6010099Sjkh
6110099Sjkh#endif /* !_DEV_I2C_TVPLLVAR_H_ */
6210099Sjkh