Add sc16is7x2 driver
PATCH RESEND 1/1 Add sc16is7x2 driver
IRQ is now implemented with work queue (like max3100).
The problem is, that the sc16is7x2 has a low active irq. But with active low threaded_irqs, shared irqs are not allowed.
Please try this one and report errors.
Regards,
Manuel Stahl
PS: sorry that the patch is not inline, not sure how to configure thunderbird correctly
Add sc16is7x2 driver
This patch adds support for the sc16is7x2 SPI to UART chips. Each chip has two UARTs and 8 GPIOs.
---
drivers/serial/Kconfig | 9 + drivers/serial/Makefile | 1 + drivers/serial/sc16is7x2.c | 1063 ++++++++++++++++++++++++++++++++++++++ include/linux/serial_core.h | 6 +- include/linux/serial_sc16is7x2.h | 17 + 5 files changed, 1095 insertions(+), 1 deletions(-)
drivers/serial/Kconfig +9 -0
@@ -269,6 +269,15 @@ config SERIAL_8250_RM9K comment "Non-8250 serial port support" +config SERIAL_SC16IS7X2 + tristate "SC16IS7x2 chips" + depends on SPI_MASTER + select SERIAL_CORE + help + Selecting this option will add support for SC16IS7x2 SPI UARTs. + The GPIOs are exported via gpiolib interface. + If unsure, say N. + config SERIAL_AMBA_PL010 tristate "ARM AMBA PL010 serial port support" depends on ARM_AMBA && (BROKEN || !ARCH_VERSATILE)
drivers/serial/Makefile +1 -0
@@ -28,6 +28,7 @@ obj-$(CONFIG_SERIAL_8250_BOCA) += 8250_boca.o obj-$(CONFIG_SERIAL_8250_EXAR_ST16C554) += 8250_exar_st16c554.o obj-$(CONFIG_SERIAL_8250_HUB6) += 8250_hub6.o obj-$(CONFIG_SERIAL_8250_MCA) += 8250_mca.o +obj-$(CONFIG_SERIAL_SC16IS7X2) += sc16is7x2.o obj-$(CONFIG_SERIAL_AMBA_PL010) += amba-pl010.o obj-$(CONFIG_SERIAL_AMBA_PL011) += amba-pl011.o obj-$(CONFIG_SERIAL_CLPS711X) += clps711x.o
drivers/serial/sc16is7x2.c new file +1063 -0
1,063 lines not on this page · raw message
include/linux/serial_core.h +5 -1
@@ -45,7 +45,8 @@#define PORT_OCTEON 17/* Cavium OCTEON internal UART */ #define PORT_AR7 18/* Texas Instruments AR7 internal UART */ #define PORT_U6_16550A 19/* ST-Ericsson U6xxx internal UART */ -#define PORT_MAX_8250 19/* max port ID */ +#define PORT_SC16IS7X2 20/* SC16IS7x2 SPI UART */ +#define PORT_MAX_8250 20/* max port ID */ /* * ARM specific type numbers. These are not currently guaranteed
@@ -202,6 +203,9 @@/* VIA VT8500 SoC */ #define PORT_VT8500 97 +/* SC16IS7x2 SPI UART */ +#define PORT_SC16IS7X2 98 +#ifdef __KERNEL__#include <linux/compiler.h>
include/linux/serial_sc16is7x2.h new file +17 -0
@@ -0,0 +1,17 @@ +#ifndef LINUX_SPI_SC16IS752_H +#define LINUX_SPI_SC16IS752_H + +#define SC16IS7X2_NR_GPIOS 8 + +struct sc16is7x2_platform_data { +unsigned int uartclk; +/* uart line number of the first channel */ +unsigned uart_base; +/* number assigned to the first GPIO */ +unsigned gpio_base; +char *label; +/* list of GPIO names (array length = SC16IS7X2_NR_GPIOS) */ +const char *const *names; +}; + +#endif
Quoted 11 lines · On Fri, 07 Jan 2011 16:14:34 +0100 Manuel Stahl wrote:
IRQ is now implemented with work queue (like max3100).
The problem is, that the sc16is7x2 has a low active irq. But with active lowthreaded_irqs, shared irqs are not allowed.Please try this one and report errors.
Regards,
Manuel StahlPS: sorry that the patch is not inline, not sure how to configure thunderbird correctly
Please check to see if Documentation/email-clients.txt can help you, although it may be a bit outdated.
---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
Quoted 11 lines · Manuel Stahl
IRQ is now implemented with work queue (like max3100). The problem is, that the sc16is7x2 has a low active irq. But with active low
threaded_irqs, shared irqs are not allowed.Please try this one and report errors.
Regards,
Manuel StahlPS: sorry that the patch is not inline, not sure how to configure thunderbird correctly
Don't sign your emails, and that will help out in getting 'git am' to be able to accept this.
Care to retry with the signature?
include/linux/serial_sc16is7x2.h
Quoted 2 lines
include/linux/serial_sc16is7x2.h new file +0
-0
This should go in include/linux/platform_data/ instead of the "main" include/linux/ directory.
thanks,
greg k-h
Am 07.01.2011 16:14, schrieb Manuel Stahl:
Quoted 11 lines
IRQ is now implemented with work queue (like max3100).
The problem is, that the sc16is7x2 has a low active irq. But with active lowthreaded_irqs, shared irqs are not allowed.Please try this one and report errors.
Regards,
Manuel StahlPS: sorry that the patch is not inline, not sure how to configure thunderbird correctly
Hello Manuel,
There is a re-definition of PORT_SC16IS7X2 in serial_core.h First time it is 20, second time it is 98.
Regards,
Thomas
Quoted 10 lines · Thomas Weber
Am 07.01.2011 16:14, schrieb Manuel Stahl:
Quoted 9 lines
IRQ is now implemented with work queue (like max3100).
The problem is, that the sc16is7x2 has a low active irq. But with active lowthreaded_irqs, shared irqs are not allowed.Please try this one and report errors.
Regards,
Manuel Stahl
Quoted 7 lines
Quoted 2 lines
PS: sorry that the patch is not inline, not sure how to configure thunderbird correctly
Hello Manuel,
There is a re-definition of
PORT_SC16IS7X2inserial_core.hFirst time it is 20, second time it is 98.
A sorry, forgot to delete the line with 20.
Can someone already confirm that the this version works more reliably than the last one?
Regards,
Manuel Stahl
begin:vcard
fn:Manuel Stahl
n:Stahl;Manuel
email;internet:[email protected]
tel;work:+49 911 58061-6419
x-mozilla-html:FALSE
version:2.1
end:vcard
2011/1/12 Manuel Stahl <[email protected]>:
Quoted 21 lines · Thomas Weber
Quoted 12 lines
Am 07.01.2011 16:14, schrieb Manuel Stahl:
Quoted 10 lines
IRQ is now implemented with work queue (like max3100).
The problem is, that the sc16is7x2 has a low active irq. But with active lowthreaded_irqs, shared irqs are not allowed.Please try this one and report errors.
Regards,
Manuel StahlQuoted 7 lines
Quoted 2 lines
PS: sorry that the patch is not inline, not sure how to configure thunderbird correctly
Hello Manuel,
There is a re-definition of
PORT_SC16IS7X2inserial_core.hFirst time it is 20, second time it is 98.
Quoted 8 lines
A sorry, forgot to delete the line with 20.
Can someone already confirm that the this version works more reliably than the last one?
Regards,
Manuel Stahl
Hello Manuel,
Johannes reworked the patch and tested it. He is at school in the moment, but he told me that it works now. Can you send a fixed patch?
Thomas