/*
 * Copyright (C) 2004 Wolfgang Grandegger (wg@denx.de)
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
 */

#ifndef _PP01_AD64_H_
#define _PP01_AD64_H_

#ifdef __KERNEL__
#include <linux/ioctl.h>
#else
#include <stdint.h>
#endif

#define AD64_NOOP			0x0000
#define AD64_INTENSITY10		0x0100
#define AD64_INTENSITY32		0x0200
#define AD64_SCAN_LIMIT			0x0300
#define AD64_CONFIG			0x0400
#define AD64_USER_FONTS			0x0500
#define AD64_DISPLAY_TEST		0x0700
#define AD64_DIGIT_P0(i) 		((0x20 + i) << 8)
#define AD64_DIGIT_P1(i) 		((0x40 + i) << 8)
#define AD64_DIGIT_P01(i) 		((0x60 + i) << 8)

#define AD64_CONFIG_SHUTDOWN		0x00
#define AD64_CONFIG_NORMAL		0x01
#define AD64_CONFIG_BLINK_FAST		0x04
#define AD64_CONFIG_BLINK_ENABLE	0x08
#define AD64_CONFIG_BLINK_SYNC		0x10
#define AD64_CONFIG_CLEAR_DIGITS	0x20
#define AD64_CONFIG_BLINK_READBACK	0x80

#define AD64_CONFIG_DEFAULT             AD64_CONFIG_NORMAL


/*
 * Structures and IOCTL definitions
 */

typedef struct {
	int plane;
	char digit[4];
} ad64_write_t;

#define AD64_MAGIC 'M'

#define AD64_RAW_WRITE  _IOW (AD64_MAGIC, 0, unsigned short)
#define AD64_WRITE	_IOW (AD64_MAGIC, 1, ad64_write_t)
#define AD64_CONFIGURE  _IOW (AD64_MAGIC, 2, unsigned char)
#define AD64_BRIGHTNESS _IOW (AD64_MAGIC, 3, unsigned char)
#define AD64_RESET      _IO  (AD64_MAGIC, 4)

#define AD64_SET_LED    _IOW (AD64_MAGIC, 5, unsigned int)

#endif /* _PP01_AD64_H_ */
