diff options
| author | Alexander Shiyan <shc_work@mail.ru> | 2012-08-06 11:42:32 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-08-16 15:12:25 -0400 |
| commit | f65444187a66bf54af32a10902877dd0326456d1 (patch) | |
| tree | 9458139d0c7dd538d68cf6fa02e5ad4542162d83 /include/linux/platform_data | |
| parent | 9574f36fb801035f6ab0fbb1b53ce2c12c17d100 (diff) | |
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: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/platform_data')
| -rw-r--r-- | include/linux/platform_data/max310x.h | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/include/linux/platform_data/max310x.h b/include/linux/platform_data/max310x.h new file mode 100644 index 000000000000..91648bf5fc5c --- /dev/null +++ b/include/linux/platform_data/max310x.h | |||
| @@ -0,0 +1,67 @@ | |||
| 1 | /* | ||
| 2 | * Maxim (Dallas) MAX3107/8 serial driver | ||
| 3 | * | ||
| 4 | * Copyright (C) 2012 Alexander Shiyan <shc_work@mail.ru> | ||
| 5 | * | ||
| 6 | * Based on max3100.c, by Christian Pellegrin <chripell@evolware.org> | ||
| 7 | * Based on max3110.c, by Feng Tang <feng.tang@intel.com> | ||
| 8 | * Based on max3107.c, by Aavamobile | ||
| 9 | * | ||
| 10 | * This program is free software; you can redistribute it and/or modify | ||
| 11 | * it under the terms of the GNU General Public License as published by | ||
| 12 | * the Free Software Foundation; either version 2 of the License, or | ||
| 13 | * (at your option) any later version. | ||
| 14 | */ | ||
| 15 | |||
| 16 | #ifndef _MAX310X_H_ | ||
| 17 | #define _MAX310X_H_ | ||
| 18 | |||
| 19 | /* | ||
| 20 | * Example board initialization data: | ||
| 21 | * | ||
| 22 | * static struct max310x_pdata max3107_pdata = { | ||
| 23 | * .driver_flags = MAX310X_EXT_CLK, | ||
| 24 | * .uart_flags[0] = MAX310X_ECHO_SUPRESS | MAX310X_AUTO_DIR_CTRL, | ||
| 25 | * .frequency = 3686400, | ||
| 26 | * .gpio_base = -1, | ||
| 27 | * }; | ||
| 28 | * | ||
| 29 | * static struct spi_board_info spi_device_max3107[] = { | ||
| 30 | * { | ||
| 31 | * .modalias = "max3107", | ||
| 32 | * .irq = IRQ_EINT3, | ||
| 33 | * .bus_num = 1, | ||
| 34 | * .chip_select = 1, | ||
| 35 | * .platform_data = &max3107_pdata, | ||
| 36 | * }, | ||
| 37 | * }; | ||
| 38 | */ | ||
| 39 | |||
| 40 | #define MAX310X_MAX_UARTS 1 | ||
| 41 | |||
| 42 | /* MAX310X platform data structure */ | ||
| 43 | struct max310x_pdata { | ||
| 44 | /* Flags global to driver */ | ||
| 45 | const u8 driver_flags:2; | ||
| 46 | #define MAX310X_EXT_CLK (0x00000001) /* External clock enable */ | ||
| 47 | #define MAX310X_AUTOSLEEP (0x00000002) /* Enable AutoSleep mode */ | ||
| 48 | /* Flags global to UART port */ | ||
| 49 | const u8 uart_flags[MAX310X_MAX_UARTS]; | ||
| 50 | #define MAX310X_LOOPBACK (0x00000001) /* Loopback mode enable */ | ||
| 51 | #define MAX310X_ECHO_SUPRESS (0x00000002) /* Enable echo supress */ | ||
| 52 | #define MAX310X_AUTO_DIR_CTRL (0x00000004) /* Enable Auto direction | ||
| 53 | * control (RS-485) | ||
| 54 | */ | ||
| 55 | /* Frequency (extrenal clock or crystal) */ | ||
| 56 | const int frequency; | ||
| 57 | /* GPIO base number (can be negative) */ | ||
| 58 | const int gpio_base; | ||
| 59 | /* Called during startup */ | ||
| 60 | void (*init)(void); | ||
| 61 | /* Called before finish */ | ||
| 62 | void (*exit)(void); | ||
| 63 | /* Suspend callback */ | ||
| 64 | void (*suspend)(int do_suspend); | ||
| 65 | }; | ||
| 66 | |||
| 67 | #endif | ||
