From bd08cbb81ad64a1646ff5309565747aa1946410c Mon Sep 17 00:00:00 2001 From: Rui Paulo Date: Sat, 12 Jul 2014 01:04:10 +0000 Subject: Move iic.h to sys/ so that it's automatically installed in /usr/include/sys. This lets us call iic(4) ioctls without needing the kernel source code and follows the same model of GPIO. MFC after: 3 weeks --- sys/dev/drm2/drm_dp_iic_helper.c | 2 +- sys/dev/drm2/drm_edid.c | 2 +- sys/dev/drm2/i915/intel_iic.c | 2 +- sys/dev/drm2/i915/intel_sdvo.c | 2 +- sys/dev/drm2/radeon/atombios_i2c.c | 2 +- sys/dev/drm2/radeon/radeon_i2c.c | 2 +- sys/dev/etherswitch/arswitch/arswitch.c | 2 +- sys/dev/etherswitch/arswitch/arswitch_7240.c | 2 +- sys/dev/etherswitch/arswitch/arswitch_8216.c | 2 +- sys/dev/etherswitch/arswitch/arswitch_8226.c | 2 +- sys/dev/etherswitch/arswitch/arswitch_8316.c | 2 +- sys/dev/etherswitch/arswitch/arswitch_8327.c | 2 +- sys/dev/etherswitch/arswitch/arswitch_9340.c | 2 +- sys/dev/etherswitch/arswitch/arswitch_phy.c | 2 +- sys/dev/etherswitch/arswitch/arswitch_reg.c | 2 +- sys/dev/etherswitch/rtl8366/rtl8366rb.c | 2 +- sys/dev/iicbus/iic.c | 2 +- sys/dev/iicbus/iic.h | 67 ---------------------------- sys/dev/iicbus/iicbus_if.m | 2 +- sys/dev/iicbus/iiconf.h | 2 +- sys/sys/iic.h | 67 ++++++++++++++++++++++++++++ 21 files changed, 86 insertions(+), 86 deletions(-) delete mode 100644 sys/dev/iicbus/iic.h create mode 100644 sys/sys/iic.h diff --git a/sys/dev/drm2/drm_dp_iic_helper.c b/sys/dev/drm2/drm_dp_iic_helper.c index c4e580307fbf..c9f4e6044573 100644 --- a/sys/dev/drm2/drm_dp_iic_helper.c +++ b/sys/dev/drm2/drm_dp_iic_helper.c @@ -26,7 +26,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include "iicbus_if.h" #include #include diff --git a/sys/dev/drm2/drm_edid.c b/sys/dev/drm2/drm_edid.c index 178ab740d288..49752982f3e9 100644 --- a/sys/dev/drm2/drm_edid.c +++ b/sys/dev/drm2/drm_edid.c @@ -34,7 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include "iicbus_if.h" diff --git a/sys/dev/drm2/i915/intel_iic.c b/sys/dev/drm2/i915/intel_iic.c index 412349c8d9d0..8412ea4d888b 100644 --- a/sys/dev/drm2/i915/intel_iic.c +++ b/sys/dev/drm2/i915/intel_iic.c @@ -61,7 +61,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include "iicbus_if.h" diff --git a/sys/dev/drm2/i915/intel_sdvo.c b/sys/dev/drm2/i915/intel_sdvo.c index 8cae7662d5dc..7ce9567dbfc6 100644 --- a/sys/dev/drm2/i915/intel_sdvo.c +++ b/sys/dev/drm2/i915/intel_sdvo.c @@ -37,7 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include "iicbus_if.h" diff --git a/sys/dev/drm2/radeon/atombios_i2c.c b/sys/dev/drm2/radeon/atombios_i2c.c index 40ba15be931e..2ba755d10a39 100644 --- a/sys/dev/drm2/radeon/atombios_i2c.c +++ b/sys/dev/drm2/radeon/atombios_i2c.c @@ -28,7 +28,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include #include "radeon.h" diff --git a/sys/dev/drm2/radeon/radeon_i2c.c b/sys/dev/drm2/radeon/radeon_i2c.c index 917286a14c18..6b2f6ec9e4c6 100644 --- a/sys/dev/drm2/radeon/radeon_i2c.c +++ b/sys/dev/drm2/radeon/radeon_i2c.c @@ -30,7 +30,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #include #include "radeon.h" diff --git a/sys/dev/etherswitch/arswitch/arswitch.c b/sys/dev/etherswitch/arswitch/arswitch.c index 24016e5a825f..04fbf26de7f6 100644 --- a/sys/dev/etherswitch/arswitch/arswitch.c +++ b/sys/dev/etherswitch/arswitch/arswitch.c @@ -47,7 +47,7 @@ #include #include -#include +#include #include #include #include diff --git a/sys/dev/etherswitch/arswitch/arswitch_7240.c b/sys/dev/etherswitch/arswitch/arswitch_7240.c index f3750bf7bb89..fa0480a38f67 100644 --- a/sys/dev/etherswitch/arswitch/arswitch_7240.c +++ b/sys/dev/etherswitch/arswitch/arswitch_7240.c @@ -45,7 +45,7 @@ #include #include -#include +#include #include #include #include diff --git a/sys/dev/etherswitch/arswitch/arswitch_8216.c b/sys/dev/etherswitch/arswitch/arswitch_8216.c index 72b232709b4d..c48efb5f2809 100644 --- a/sys/dev/etherswitch/arswitch/arswitch_8216.c +++ b/sys/dev/etherswitch/arswitch/arswitch_8216.c @@ -45,7 +45,7 @@ #include #include -#include +#include #include #include #include diff --git a/sys/dev/etherswitch/arswitch/arswitch_8226.c b/sys/dev/etherswitch/arswitch/arswitch_8226.c index 43d2281f2425..204b0378fcde 100644 --- a/sys/dev/etherswitch/arswitch/arswitch_8226.c +++ b/sys/dev/etherswitch/arswitch/arswitch_8226.c @@ -45,7 +45,7 @@ #include #include -#include +#include #include #include #include diff --git a/sys/dev/etherswitch/arswitch/arswitch_8316.c b/sys/dev/etherswitch/arswitch/arswitch_8316.c index 91dd72d90297..f859e2dd5318 100644 --- a/sys/dev/etherswitch/arswitch/arswitch_8316.c +++ b/sys/dev/etherswitch/arswitch/arswitch_8316.c @@ -45,7 +45,7 @@ #include #include -#include +#include #include #include #include diff --git a/sys/dev/etherswitch/arswitch/arswitch_8327.c b/sys/dev/etherswitch/arswitch/arswitch_8327.c index 3fc2bb02797c..7c1bd4723d69 100644 --- a/sys/dev/etherswitch/arswitch/arswitch_8327.c +++ b/sys/dev/etherswitch/arswitch/arswitch_8327.c @@ -45,7 +45,7 @@ #include #include -#include +#include #include #include #include diff --git a/sys/dev/etherswitch/arswitch/arswitch_9340.c b/sys/dev/etherswitch/arswitch/arswitch_9340.c index 4de76e2d9ec1..8f16e66d4b49 100644 --- a/sys/dev/etherswitch/arswitch/arswitch_9340.c +++ b/sys/dev/etherswitch/arswitch/arswitch_9340.c @@ -45,7 +45,7 @@ #include #include -#include +#include #include #include #include diff --git a/sys/dev/etherswitch/arswitch/arswitch_phy.c b/sys/dev/etherswitch/arswitch/arswitch_phy.c index 928ca03dbe43..5b73d6ff3af9 100644 --- a/sys/dev/etherswitch/arswitch/arswitch_phy.c +++ b/sys/dev/etherswitch/arswitch/arswitch_phy.c @@ -43,7 +43,7 @@ #include #include -#include +#include #include #include #include diff --git a/sys/dev/etherswitch/arswitch/arswitch_reg.c b/sys/dev/etherswitch/arswitch/arswitch_reg.c index 3251da8a2eec..6503910df878 100644 --- a/sys/dev/etherswitch/arswitch/arswitch_reg.c +++ b/sys/dev/etherswitch/arswitch/arswitch_reg.c @@ -44,7 +44,7 @@ #include #include -#include +#include #include #include #include diff --git a/sys/dev/etherswitch/rtl8366/rtl8366rb.c b/sys/dev/etherswitch/rtl8366/rtl8366rb.c index d14f4660130e..bbf981a0ded4 100644 --- a/sys/dev/etherswitch/rtl8366/rtl8366rb.c +++ b/sys/dev/etherswitch/rtl8366/rtl8366rb.c @@ -46,7 +46,7 @@ #include #include -#include +#include #include #include #include diff --git a/sys/dev/iicbus/iic.c b/sys/dev/iicbus/iic.c index 16d113ee6c78..5d63060a826e 100644 --- a/sys/dev/iicbus/iic.c +++ b/sys/dev/iicbus/iic.c @@ -37,10 +37,10 @@ #include #include #include +#include #include #include -#include #include "iicbus_if.h" diff --git a/sys/dev/iicbus/iic.h b/sys/dev/iicbus/iic.h deleted file mode 100644 index ab58abf7bf7a..000000000000 --- a/sys/dev/iicbus/iic.h +++ /dev/null @@ -1,67 +0,0 @@ -/*- - * Copyright (c) 1998 Nicolas Souchu - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - * - */ -#ifndef __IIC_H -#define __IIC_H - -#include - -/* Designed to be compatible with linux's struct i2c_msg */ -struct iic_msg -{ - uint16_t slave; - uint16_t flags; -#define IIC_M_WR 0 /* Fake flag for write */ -#define IIC_M_RD 0x0001 /* read vs write */ -#define IIC_M_NOSTOP 0x0002 /* do not send a I2C stop after message */ -#define IIC_M_NOSTART 0x0004 /* do not send a I2C start before message */ - uint16_t len; /* msg length */ - uint8_t * buf; -}; - -struct iiccmd { - u_char slave; - int count; - int last; - char *buf; -}; - -struct iic_rdwr_data { - struct iic_msg *msgs; - uint32_t nmsgs; -}; - -#define I2CSTART _IOW('i', 1, struct iiccmd) /* start condition */ -#define I2CSTOP _IO('i', 2) /* stop condition */ -#define I2CRSTCARD _IOW('i', 3, struct iiccmd) /* reset the card */ -#define I2CWRITE _IOW('i', 4, struct iiccmd) /* send data */ -#define I2CREAD _IOW('i', 5, struct iiccmd) /* receive data */ -#define I2CRDWR _IOW('i', 6, struct iic_rdwr_data) /* General read/write interface */ -#define I2CRPTSTART _IOW('i', 7, struct iiccmd) /* repeated start */ - -#endif diff --git a/sys/dev/iicbus/iicbus_if.m b/sys/dev/iicbus/iicbus_if.m index c57fac584216..d0d83a3c3bd1 100644 --- a/sys/dev/iicbus/iicbus_if.m +++ b/sys/dev/iicbus/iicbus_if.m @@ -27,7 +27,7 @@ # #include -#include +#include INTERFACE iicbus; diff --git a/sys/dev/iicbus/iiconf.h b/sys/dev/iicbus/iiconf.h index 092ba8de065e..68ca83febffa 100644 --- a/sys/dev/iicbus/iiconf.h +++ b/sys/dev/iicbus/iiconf.h @@ -29,7 +29,7 @@ #define __IICONF_H #include -#include +#include #define IICPRI (PZERO+8) /* XXX sleep/wakeup queue priority */ diff --git a/sys/sys/iic.h b/sys/sys/iic.h new file mode 100644 index 000000000000..ab58abf7bf7a --- /dev/null +++ b/sys/sys/iic.h @@ -0,0 +1,67 @@ +/*- + * Copyright (c) 1998 Nicolas Souchu + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + * + */ +#ifndef __IIC_H +#define __IIC_H + +#include + +/* Designed to be compatible with linux's struct i2c_msg */ +struct iic_msg +{ + uint16_t slave; + uint16_t flags; +#define IIC_M_WR 0 /* Fake flag for write */ +#define IIC_M_RD 0x0001 /* read vs write */ +#define IIC_M_NOSTOP 0x0002 /* do not send a I2C stop after message */ +#define IIC_M_NOSTART 0x0004 /* do not send a I2C start before message */ + uint16_t len; /* msg length */ + uint8_t * buf; +}; + +struct iiccmd { + u_char slave; + int count; + int last; + char *buf; +}; + +struct iic_rdwr_data { + struct iic_msg *msgs; + uint32_t nmsgs; +}; + +#define I2CSTART _IOW('i', 1, struct iiccmd) /* start condition */ +#define I2CSTOP _IO('i', 2) /* stop condition */ +#define I2CRSTCARD _IOW('i', 3, struct iiccmd) /* reset the card */ +#define I2CWRITE _IOW('i', 4, struct iiccmd) /* send data */ +#define I2CREAD _IOW('i', 5, struct iiccmd) /* receive data */ +#define I2CRDWR _IOW('i', 6, struct iic_rdwr_data) /* General read/write interface */ +#define I2CRPTSTART _IOW('i', 7, struct iiccmd) /* repeated start */ + +#endif -- cgit v1.2.3