[Xenomai-git] Philippe Gerum : drivers/spi: introduce real-time SPI support
Module: xenomai-3 Branch: master Commit: b7e3bd434ff00403bfe971c531c467e42502386f URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=b7e3bd434ff00403bfe971c531c467e42502386f Author: Philippe GerumDate: Fri Jun 17 16:28:25 2016 +0200 drivers/spi: introduce real-time SPI support --- include/rtdm/Makefile.am |1 + include/rtdm/spi.h | 24 ++ include/rtdm/uapi/Makefile.am |1 + include/rtdm/uapi/rtdm.h |9 +- include/rtdm/uapi/spi.h| 40 +++ kernel/drivers/Kconfig |1 + kernel/drivers/Makefile|2 +- kernel/drivers/gpio/gpio-bcm2835.c | 18 +- kernel/drivers/spi/Kconfig | 20 ++ kernel/drivers/spi/Makefile|8 + kernel/drivers/spi/spi-bcm2835.c | 691 kernel/drivers/spi/spi-device.c| 180 ++ kernel/drivers/spi/spi-device.h| 53 +++ kernel/drivers/spi/spi-master.c| 423 ++ kernel/drivers/spi/spi-master.h| 81 + 15 files changed, 1535 insertions(+), 17 deletions(-) diff --git a/include/rtdm/Makefile.am b/include/rtdm/Makefile.am index c837a05..9198595 100644 --- a/include/rtdm/Makefile.am +++ b/include/rtdm/Makefile.am @@ -10,6 +10,7 @@ includesub_HEADERS += \ gpio.h \ ipc.h \ serial.h\ + spi.h \ testing.h \ udd.h endif diff --git a/include/rtdm/spi.h b/include/rtdm/spi.h new file mode 100644 index 000..339a862 --- /dev/null +++ b/include/rtdm/spi.h @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2016 Philippe Gerum + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ +#ifndef _RTDM_SPI_H +#define _RTDM_SPI_H + +#include +#include + +#endif /* !_RTDM_SPI_H */ diff --git a/include/rtdm/uapi/Makefile.am b/include/rtdm/uapi/Makefile.am index c288ff9..fec15db 100644 --- a/include/rtdm/uapi/Makefile.am +++ b/include/rtdm/uapi/Makefile.am @@ -10,6 +10,7 @@ includesub_HEADERS += \ gpio.h \ ipc.h \ serial.h\ + spi.h \ testing.h \ udd.h endif diff --git a/include/rtdm/uapi/rtdm.h b/include/rtdm/uapi/rtdm.h index c49378c..ee6de65 100644 --- a/include/rtdm/uapi/rtdm.h +++ b/include/rtdm/uapi/rtdm.h @@ -80,13 +80,8 @@ typedef int64_t nanosecs_rel_t; #define RTDM_CLASS_UDD 9 #define RTDM_CLASS_MEMORY 10 #define RTDM_CLASS_GPIO11 -/* -#define RTDM_CLASS_USB ? -#define RTDM_CLASS_FIREWIRE? -#define RTDM_CLASS_INTERBUS? -#define RTDM_CLASS_PROFIBUS? -#define ... -*/ +#define RTDM_CLASS_SPI 12 + #define RTDM_CLASS_MISC223 #define RTDM_CLASS_EXPERIMENTAL224 #define RTDM_CLASS_MAX 255 diff --git a/include/rtdm/uapi/spi.h b/include/rtdm/uapi/spi.h new file mode 100644 index 000..45bc92d --- /dev/null +++ b/include/rtdm/uapi/spi.h @@ -0,0 +1,40 @@ +/** + * @note Copyright (C) 2016 Philippe Gerum + * + * 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 _RTDM_UAPI_SPI_H +#define _RTDM_UAPI_SPI_H + +#include + +struct rtdm_spi_config { + __u32 speed_hz; + __u16 mode; + __u8 bits_per_word; +}; + +struct rtdm_spi_iobufs { + __u32 io_len; + __u32 i_offset; + __u32 o_offset; +}; + +#define SPI_RTIOC_SET_CONFIG _IOW(RTDM_CLASS_SPI, 0, struct rtdm_spi_config) +#define
[Xenomai-git] Philippe Gerum : drivers/spi: introduce real-time SPI support
Module: xenomai-3 Branch: stable-3.0.x Commit: b7e3bd434ff00403bfe971c531c467e42502386f URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=b7e3bd434ff00403bfe971c531c467e42502386f Author: Philippe GerumDate: Fri Jun 17 16:28:25 2016 +0200 drivers/spi: introduce real-time SPI support --- include/rtdm/Makefile.am |1 + include/rtdm/spi.h | 24 ++ include/rtdm/uapi/Makefile.am |1 + include/rtdm/uapi/rtdm.h |9 +- include/rtdm/uapi/spi.h| 40 +++ kernel/drivers/Kconfig |1 + kernel/drivers/Makefile|2 +- kernel/drivers/gpio/gpio-bcm2835.c | 18 +- kernel/drivers/spi/Kconfig | 20 ++ kernel/drivers/spi/Makefile|8 + kernel/drivers/spi/spi-bcm2835.c | 691 kernel/drivers/spi/spi-device.c| 180 ++ kernel/drivers/spi/spi-device.h| 53 +++ kernel/drivers/spi/spi-master.c| 423 ++ kernel/drivers/spi/spi-master.h| 81 + 15 files changed, 1535 insertions(+), 17 deletions(-) diff --git a/include/rtdm/Makefile.am b/include/rtdm/Makefile.am index c837a05..9198595 100644 --- a/include/rtdm/Makefile.am +++ b/include/rtdm/Makefile.am @@ -10,6 +10,7 @@ includesub_HEADERS += \ gpio.h \ ipc.h \ serial.h\ + spi.h \ testing.h \ udd.h endif diff --git a/include/rtdm/spi.h b/include/rtdm/spi.h new file mode 100644 index 000..339a862 --- /dev/null +++ b/include/rtdm/spi.h @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2016 Philippe Gerum + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ +#ifndef _RTDM_SPI_H +#define _RTDM_SPI_H + +#include +#include + +#endif /* !_RTDM_SPI_H */ diff --git a/include/rtdm/uapi/Makefile.am b/include/rtdm/uapi/Makefile.am index c288ff9..fec15db 100644 --- a/include/rtdm/uapi/Makefile.am +++ b/include/rtdm/uapi/Makefile.am @@ -10,6 +10,7 @@ includesub_HEADERS += \ gpio.h \ ipc.h \ serial.h\ + spi.h \ testing.h \ udd.h endif diff --git a/include/rtdm/uapi/rtdm.h b/include/rtdm/uapi/rtdm.h index c49378c..ee6de65 100644 --- a/include/rtdm/uapi/rtdm.h +++ b/include/rtdm/uapi/rtdm.h @@ -80,13 +80,8 @@ typedef int64_t nanosecs_rel_t; #define RTDM_CLASS_UDD 9 #define RTDM_CLASS_MEMORY 10 #define RTDM_CLASS_GPIO11 -/* -#define RTDM_CLASS_USB ? -#define RTDM_CLASS_FIREWIRE? -#define RTDM_CLASS_INTERBUS? -#define RTDM_CLASS_PROFIBUS? -#define ... -*/ +#define RTDM_CLASS_SPI 12 + #define RTDM_CLASS_MISC223 #define RTDM_CLASS_EXPERIMENTAL224 #define RTDM_CLASS_MAX 255 diff --git a/include/rtdm/uapi/spi.h b/include/rtdm/uapi/spi.h new file mode 100644 index 000..45bc92d --- /dev/null +++ b/include/rtdm/uapi/spi.h @@ -0,0 +1,40 @@ +/** + * @note Copyright (C) 2016 Philippe Gerum + * + * 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 _RTDM_UAPI_SPI_H +#define _RTDM_UAPI_SPI_H + +#include + +struct rtdm_spi_config { + __u32 speed_hz; + __u16 mode; + __u8 bits_per_word; +}; + +struct rtdm_spi_iobufs { + __u32 io_len; + __u32 i_offset; + __u32 o_offset; +}; + +#define SPI_RTIOC_SET_CONFIG _IOW(RTDM_CLASS_SPI, 0, struct rtdm_spi_config) +#define
[Xenomai-git] Philippe Gerum : drivers/spi: introduce real-time SPI support
Module: xenomai-3 Branch: wip/drivers Commit: b7e3bd434ff00403bfe971c531c467e42502386f URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=b7e3bd434ff00403bfe971c531c467e42502386f Author: Philippe GerumDate: Fri Jun 17 16:28:25 2016 +0200 drivers/spi: introduce real-time SPI support --- include/rtdm/Makefile.am |1 + include/rtdm/spi.h | 24 ++ include/rtdm/uapi/Makefile.am |1 + include/rtdm/uapi/rtdm.h |9 +- include/rtdm/uapi/spi.h| 40 +++ kernel/drivers/Kconfig |1 + kernel/drivers/Makefile|2 +- kernel/drivers/gpio/gpio-bcm2835.c | 18 +- kernel/drivers/spi/Kconfig | 20 ++ kernel/drivers/spi/Makefile|8 + kernel/drivers/spi/spi-bcm2835.c | 691 kernel/drivers/spi/spi-device.c| 180 ++ kernel/drivers/spi/spi-device.h| 53 +++ kernel/drivers/spi/spi-master.c| 423 ++ kernel/drivers/spi/spi-master.h| 81 + 15 files changed, 1535 insertions(+), 17 deletions(-) diff --git a/include/rtdm/Makefile.am b/include/rtdm/Makefile.am index c837a05..9198595 100644 --- a/include/rtdm/Makefile.am +++ b/include/rtdm/Makefile.am @@ -10,6 +10,7 @@ includesub_HEADERS += \ gpio.h \ ipc.h \ serial.h\ + spi.h \ testing.h \ udd.h endif diff --git a/include/rtdm/spi.h b/include/rtdm/spi.h new file mode 100644 index 000..339a862 --- /dev/null +++ b/include/rtdm/spi.h @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2016 Philippe Gerum + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ +#ifndef _RTDM_SPI_H +#define _RTDM_SPI_H + +#include +#include + +#endif /* !_RTDM_SPI_H */ diff --git a/include/rtdm/uapi/Makefile.am b/include/rtdm/uapi/Makefile.am index c288ff9..fec15db 100644 --- a/include/rtdm/uapi/Makefile.am +++ b/include/rtdm/uapi/Makefile.am @@ -10,6 +10,7 @@ includesub_HEADERS += \ gpio.h \ ipc.h \ serial.h\ + spi.h \ testing.h \ udd.h endif diff --git a/include/rtdm/uapi/rtdm.h b/include/rtdm/uapi/rtdm.h index c49378c..ee6de65 100644 --- a/include/rtdm/uapi/rtdm.h +++ b/include/rtdm/uapi/rtdm.h @@ -80,13 +80,8 @@ typedef int64_t nanosecs_rel_t; #define RTDM_CLASS_UDD 9 #define RTDM_CLASS_MEMORY 10 #define RTDM_CLASS_GPIO11 -/* -#define RTDM_CLASS_USB ? -#define RTDM_CLASS_FIREWIRE? -#define RTDM_CLASS_INTERBUS? -#define RTDM_CLASS_PROFIBUS? -#define ... -*/ +#define RTDM_CLASS_SPI 12 + #define RTDM_CLASS_MISC223 #define RTDM_CLASS_EXPERIMENTAL224 #define RTDM_CLASS_MAX 255 diff --git a/include/rtdm/uapi/spi.h b/include/rtdm/uapi/spi.h new file mode 100644 index 000..45bc92d --- /dev/null +++ b/include/rtdm/uapi/spi.h @@ -0,0 +1,40 @@ +/** + * @note Copyright (C) 2016 Philippe Gerum + * + * 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 _RTDM_UAPI_SPI_H +#define _RTDM_UAPI_SPI_H + +#include + +struct rtdm_spi_config { + __u32 speed_hz; + __u16 mode; + __u8 bits_per_word; +}; + +struct rtdm_spi_iobufs { + __u32 io_len; + __u32 i_offset; + __u32 o_offset; +}; + +#define SPI_RTIOC_SET_CONFIG _IOW(RTDM_CLASS_SPI, 0, struct rtdm_spi_config) +#define
[Xenomai-git] Philippe Gerum : drivers/spi: introduce real-time SPI support
Module: xenomai-3 Branch: wip/drivers Commit: 9147f8a23eb296456175803ff2045d7f0a8c454b URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=9147f8a23eb296456175803ff2045d7f0a8c454b Author: Philippe GerumDate: Fri Jun 17 16:28:25 2016 +0200 drivers/spi: introduce real-time SPI support --- include/rtdm/Makefile.am |1 + include/rtdm/spi.h | 24 ++ include/rtdm/uapi/Makefile.am |1 + include/rtdm/uapi/rtdm.h |9 +- include/rtdm/uapi/spi.h| 40 +++ kernel/drivers/Kconfig |1 + kernel/drivers/Makefile|2 +- kernel/drivers/gpio/gpio-bcm2835.c | 18 +- kernel/drivers/spi/Kconfig | 20 ++ kernel/drivers/spi/Makefile|8 + kernel/drivers/spi/spi-bcm2835.c | 691 kernel/drivers/spi/spi-device.c| 180 ++ kernel/drivers/spi/spi-device.h| 53 +++ kernel/drivers/spi/spi-master.c| 423 ++ kernel/drivers/spi/spi-master.h| 81 + 15 files changed, 1535 insertions(+), 17 deletions(-) diff --git a/include/rtdm/Makefile.am b/include/rtdm/Makefile.am index ad2c342..df5b551 100644 --- a/include/rtdm/Makefile.am +++ b/include/rtdm/Makefile.am @@ -8,6 +8,7 @@ includesub_HEADERS =\ ipc.h \ rtdm.h \ serial.h\ + spi.h \ testing.h \ udd.h diff --git a/include/rtdm/spi.h b/include/rtdm/spi.h new file mode 100644 index 000..339a862 --- /dev/null +++ b/include/rtdm/spi.h @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2016 Philippe Gerum + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library 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 + * Lesser General Public License for more details. + + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ +#ifndef _RTDM_SPI_H +#define _RTDM_SPI_H + +#include +#include + +#endif /* !_RTDM_SPI_H */ diff --git a/include/rtdm/uapi/Makefile.am b/include/rtdm/uapi/Makefile.am index d53f10c..96de2c3 100644 --- a/include/rtdm/uapi/Makefile.am +++ b/include/rtdm/uapi/Makefile.am @@ -8,5 +8,6 @@ includesub_HEADERS =\ ipc.h \ rtdm.h \ serial.h\ + spi.h \ testing.h \ udd.h diff --git a/include/rtdm/uapi/rtdm.h b/include/rtdm/uapi/rtdm.h index c49378c..ee6de65 100644 --- a/include/rtdm/uapi/rtdm.h +++ b/include/rtdm/uapi/rtdm.h @@ -80,13 +80,8 @@ typedef int64_t nanosecs_rel_t; #define RTDM_CLASS_UDD 9 #define RTDM_CLASS_MEMORY 10 #define RTDM_CLASS_GPIO11 -/* -#define RTDM_CLASS_USB ? -#define RTDM_CLASS_FIREWIRE? -#define RTDM_CLASS_INTERBUS? -#define RTDM_CLASS_PROFIBUS? -#define ... -*/ +#define RTDM_CLASS_SPI 12 + #define RTDM_CLASS_MISC223 #define RTDM_CLASS_EXPERIMENTAL224 #define RTDM_CLASS_MAX 255 diff --git a/include/rtdm/uapi/spi.h b/include/rtdm/uapi/spi.h new file mode 100644 index 000..45bc92d --- /dev/null +++ b/include/rtdm/uapi/spi.h @@ -0,0 +1,40 @@ +/** + * @note Copyright (C) 2016 Philippe Gerum + * + * 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 _RTDM_UAPI_SPI_H +#define _RTDM_UAPI_SPI_H + +#include + +struct rtdm_spi_config { + __u32 speed_hz; + __u16 mode; + __u8 bits_per_word; +}; + +struct rtdm_spi_iobufs { + __u32 io_len; + __u32 i_offset; + __u32 o_offset; +}; + +#define SPI_RTIOC_SET_CONFIG _IOW(RTDM_CLASS_SPI, 0, struct rtdm_spi_config) +#define SPI_RTIOC_GET_CONFIG