On Tuesday 21 November 2006 08:13, Patrick Boettcher wrote: > Hi Andrew, > > On Mon, 20 Nov 2006, Andrew de Quincey wrote: > > dib3000.h > > dib3000-watch.h > > dib-i2c.h > > > > dib3000-watch.c has a GPL header. Patrick, I basically just wanted to > > check if it was ok to apply that same header to these other three files? > > Yes, I think so for dib3000-watch.h and dib3000.h . > > The dib-i2c.h is basically a collection of the user-space I2C-data. At the > time there was no .h from the kernel (I don't know if there is now) ... I > took things from lm-sensors and the kernel to create this file. How about this patch? I recreated dib-i2c.h from scratch by coping the relevant bits from 2.6.17.11, including the license/copyright headers. If this is ok, can you send an acked-by line so I can include it in the commit message so there is a record.
diff -r ad1dac37ed8d util/dib3000-watch/dib-i2c.h --- a/util/dib3000-watch/dib-i2c.h Mon Nov 20 20:55:12 2006 +0000 +++ b/util/dib3000-watch/dib-i2c.h Wed Nov 22 20:37:34 2006 +0000 @@ -1,43 +1,112 @@ /* * adapted from different kernel headers - * "this is the current way of doing things."-Greg K-H - * - * everything copied from linux kernel 2.6.10 source + * "this is the current way of doing things."-Greg K-H + * + * everything copied from linux kernel 2.6.17.11 source */ #ifndef _DIB_I2C_H #define _DIB_I2C_H +/* from <linux/i2c.h> */ +/* ------------------------------------------------------------------------- */ +/* */ +/* i2c.h - definitions for the i2c-bus interface */ +/* */ +/* ------------------------------------------------------------------------- */ +/* Copyright (C) 1995-2000 Simon G. Vogl -/* from <linux/i2c.h> */ -#define I2C_SLAVE 0x0703 -#define I2C_SLAVE_FORCE 0x0706 -#define I2C_TENBIT 0x0704 -#define I2C_PEC 0x0708 -#define I2C_RETRIES 0x0701 -#define I2C_TIMEOUT 0x0702 + 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. -#define I2C_FUNCS 0x0705 -#define I2C_RDWR 0x0707 -#define I2C_SMBUS 0x0720 + 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ +/* ------------------------------------------------------------------------- */ + +/* With some changes from Ky�ti M�kki <kmalkki@xxxxxxxxx> and + Frodo Looijaard <frodol@xxxxxx> */ + + + +/* ----- commands for the ioctl like i2c_command call: + * note that additional calls are defined in the algorithm and hw + * dependent layers - these can be listed here, or see the + * corresponding header files. + */ + /* -> bit-adapter specific ioctls */ +#define I2C_RETRIES 0x0701 /* number of times a device address */ + /* should be polled when not */ + /* acknowledging */ +#define I2C_TIMEOUT 0x0702 /* set timeout - call with int */ + + +/* this is for i2c-dev.c */ +#define I2C_SLAVE 0x0703 /* Change slave address */ + /* Attn.: Slave address is 7 or 10 bits */ +#define I2C_SLAVE_FORCE 0x0706 /* Change slave address */ + /* Attn.: Slave address is 7 or 10 bits */ + /* This changes the address, even if it */ + /* is already taken! */ +#define I2C_TENBIT 0x0704 /* 0 for 7 bit addrs, != 0 for 10 bit */ + +#define I2C_FUNCS 0x0705 /* Get the adapter functionality */ +#define I2C_RDWR 0x0707 /* Combined R/W transfer (one stop only)*/ +#define I2C_PEC 0x0708 /* != 0 for SMBus PEC */ + +#define I2C_SMBUS 0x0720 /* SMBus-level access */ + + +/* + * I2C Message - used for pure i2c transaction, also from /dev interface + */ struct i2c_msg { - __u16 addr; + __u16 addr; /* slave address */ __u16 flags; -#define I2C_M_RD 0x0001 -#define I2C_M_TEN 0x0010 -#define I2C_M_NOSTART 0x4000 +#define I2C_M_TEN 0x10 /* we have a ten bit chip address */ +#define I2C_M_RD 0x01 +#define I2C_M_NOSTART 0x4000 #define I2C_M_REV_DIR_ADDR 0x2000 -#define I2C_M_IGNORE_NAK 0x1000 -#define I2C_M_NO_RD_ACK 0x0800 - __u16 len; - __u8 *buf; +#define I2C_M_IGNORE_NAK 0x1000 +#define I2C_M_NO_RD_ACK 0x0800 + __u16 len; /* msg length */ + __u8 *buf; /* pointer to msg data */ }; + /* from <linux/i2c-dev.h> */ +/* + i2c-dev.h - i2c-bus driver, char device interface + + Copyright (C) 1995-97 Simon G. Vogl + Copyright (C) 1998-99 Frodo Looijaard <frodol@xxxxxx> + + 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., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +/* This is the structure as used in the I2C_RDWR ioctl call */ struct i2c_rdwr_ioctl_data { - struct i2c_msg *msgs; - __u32 nmsgs; + struct i2c_msg *msgs; /* pointers to i2c_msgs */ + __u32 nmsgs; /* number of i2c_msgs */ }; #endif diff -r ad1dac37ed8d util/dib3000-watch/dib3000-watch.h --- a/util/dib3000-watch/dib3000-watch.h Mon Nov 20 20:55:12 2006 +0000 +++ b/util/dib3000-watch/dib3000-watch.h Wed Nov 22 20:22:56 2006 +0000 @@ -1,3 +1,25 @@ +/* + * Tool for watching the dib3000*-demodulators, + * with an extended output. + * + * Copyright (C) 2005 by Patrick Boettcher <patrick.boettcher@xxxxxxx> + * + * 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. + * Or, point your browser to http://www.gnu.org/copyleft/gpl.html + */ #ifndef __DIB_DEMOD_WATCH__ #define __DIB_DEMOD_WATCH__ @@ -14,13 +36,13 @@ struct dib_demod { struct dib_demod { int fd; __u8 i2c_addr; - + dib_demod_t rev; }; struct dib3000mb_monitoring { int agc_lock; - int carrier_lock; + int carrier_lock; int tps_lock; int vit_lock; int ts_sync_lock; @@ -32,9 +54,9 @@ struct dib3000mb_monitoring { int unc; int fft_pos; - + int nfft; - + double carrier_offset; double ber; double snr; diff -r ad1dac37ed8d util/dib3000-watch/dib3000.h --- a/util/dib3000-watch/dib3000.h Mon Nov 20 20:55:12 2006 +0000 +++ b/util/dib3000-watch/dib3000.h Wed Nov 22 20:20:02 2006 +0000 @@ -1,3 +1,25 @@ +/* + * Tool for watching the dib3000*-demodulators, + * with an extended output. + * + * Copyright (C) 2005 by Patrick Boettcher <patrick.boettcher@xxxxxxx> + * + * 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. + * Or, point your browser to http://www.gnu.org/copyleft/gpl.html + */ #ifndef __DIB3000_H__ #define __DIB3000_H__
_______________________________________________ linux-dvb mailing list linux-dvb@xxxxxxxxxxx http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb