Commit f6544418 authored by Alexander Shiyan's avatar Alexander Shiyan Committed by Greg Kroah-Hartman

serial: New serial driver MAX310X

This driver is a replacement for a MAX3107 driver with a lot of
improvements and new features.
The main differences from the old version:
- Using the regmap.
- Using devm_XXX-related functions.
- The use of threaded IRQ with IRQF_ONESHOT flag allows the driver to
  the hardware that supports only level IRQ.
- Improved error handling of serial port, improved FIFO handling,
  improved hardware & software flow control.
- Advanced flags allows turn on RS-485 mode (Auto direction control).
- Ability to load multiple instances of drivers.
- Added support for MAX3108.
- GPIO support.
- Driver is quite ready for adding I2C support and support other ICs
  with compatible registers set (MAX3109, MAX14830).
Signed-off-by: default avatarAlexander Shiyan <shc_work@mail.ru>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9574f36f
......@@ -257,12 +257,19 @@ config SERIAL_MAX3100
help
MAX3100 chip support
config SERIAL_MAX3107
tristate "MAX3107 support"
config SERIAL_MAX310X
bool "MAX310X support"
depends on SPI
select SERIAL_CORE
select REGMAP_SPI if SPI
default n
help
MAX3107 chip support
This selects support for an advanced UART from Maxim (Dallas).
Supported ICs are MAX3107, MAX3108.
Each IC contains 128 words each of receive and transmit FIFO
that can be controlled through I2C or high-speed SPI.
Say Y here if you want to support this ICs.
config SERIAL_DZ
bool "DECstation DZ serial driver"
......
......@@ -28,7 +28,7 @@ obj-$(CONFIG_SERIAL_BFIN) += bfin_uart.o
obj-$(CONFIG_SERIAL_BFIN_SPORT) += bfin_sport_uart.o
obj-$(CONFIG_SERIAL_SAMSUNG) += samsung.o
obj-$(CONFIG_SERIAL_MAX3100) += max3100.o
obj-$(CONFIG_SERIAL_MAX3107) += max3107.o
obj-$(CONFIG_SERIAL_MAX310X) += max310x.o
obj-$(CONFIG_SERIAL_IP22_ZILOG) += ip22zilog.o
obj-$(CONFIG_SERIAL_MUX) += mux.o
obj-$(CONFIG_SERIAL_68328) += 68328serial.o
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*
* Maxim (Dallas) MAX3107/8 serial driver
*
* Copyright (C) 2012 Alexander Shiyan <shc_work@mail.ru>
*
* Based on max3100.c, by Christian Pellegrin <chripell@evolware.org>
* Based on max3110.c, by Feng Tang <feng.tang@intel.com>
* Based on max3107.c, by Aavamobile
*
* 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.
*/
#ifndef _MAX310X_H_
#define _MAX310X_H_
/*
* Example board initialization data:
*
* static struct max310x_pdata max3107_pdata = {
* .driver_flags = MAX310X_EXT_CLK,
* .uart_flags[0] = MAX310X_ECHO_SUPRESS | MAX310X_AUTO_DIR_CTRL,
* .frequency = 3686400,
* .gpio_base = -1,
* };
*
* static struct spi_board_info spi_device_max3107[] = {
* {
* .modalias = "max3107",
* .irq = IRQ_EINT3,
* .bus_num = 1,
* .chip_select = 1,
* .platform_data = &max3107_pdata,
* },
* };
*/
#define MAX310X_MAX_UARTS 1
/* MAX310X platform data structure */
struct max310x_pdata {
/* Flags global to driver */
const u8 driver_flags:2;
#define MAX310X_EXT_CLK (0x00000001) /* External clock enable */
#define MAX310X_AUTOSLEEP (0x00000002) /* Enable AutoSleep mode */
/* Flags global to UART port */
const u8 uart_flags[MAX310X_MAX_UARTS];
#define MAX310X_LOOPBACK (0x00000001) /* Loopback mode enable */
#define MAX310X_ECHO_SUPRESS (0x00000002) /* Enable echo supress */
#define MAX310X_AUTO_DIR_CTRL (0x00000004) /* Enable Auto direction
* control (RS-485)
*/
/* Frequency (extrenal clock or crystal) */
const int frequency;
/* GPIO base number (can be negative) */
const int gpio_base;
/* Called during startup */
void (*init)(void);
/* Called before finish */
void (*exit)(void);
/* Suspend callback */
void (*suspend)(int do_suspend);
};
#endif
......@@ -193,8 +193,8 @@
/* SH-SCI */
#define PORT_SCIFB 93
/* MAX3107 */
#define PORT_MAX3107 94
/* MAX310X */
#define PORT_MAX310X 94
/* High Speed UART for Medfield */
#define PORT_MFD 95
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment