This part of the tty tree (unfortunately with all the preceding patches as well) is a dependency for some of the OMAP cleanups, so we've pulled it in as a dependency based on agreement with Greg.
Showing the changes to include/linux/platform_data (2 of 169 files). Show all
Unified · Split
| @@ -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 | |
| @@ -0,0 +1,93 @@ | ||
| 1 | +/* | |
| 2 | + * NXP (Philips) SCC+++(SCN+++) serial driver | |
| 3 | + * | |
| 4 | + * Copyright (C) 2012 Alexander Shiyan <shc_work@mail.ru> | |
| 5 | + * | |
| 6 | + * Based on sc26xx.c, by Thomas Bogendörfer (tsbogend@alpha.franken.de) | |
| 7 | + * | |
| 8 | + * This program is free software; you can redistribute it and/or modify | |
| 9 | + * it under the terms of the GNU General Public License as published by | |
| 10 | + * the Free Software Foundation; either version 2 of the License, or | |
| 11 | + * (at your option) any later version. | |
| 12 | + */ | |
| 13 | + | |
| 14 | +#ifndef __SCCNXP_H | |
| 15 | +#define __SCCNXP_H | |
| 16 | + | |
| 17 | +#define SCCNXP_MAX_UARTS 2 | |
| 18 | + | |
| 19 | +/* Output lines */ | |
| 20 | +#define LINE_OP0 1 | |
| 21 | +#define LINE_OP1 2 | |
| 22 | +#define LINE_OP2 3 | |
| 23 | +#define LINE_OP3 4 | |
| 24 | +#define LINE_OP4 5 | |
| 25 | +#define LINE_OP5 6 | |
| 26 | +#define LINE_OP6 7 | |
| 27 | +#define LINE_OP7 8 | |
| 28 | + | |
| 29 | +/* Input lines */ | |
| 30 | +#define LINE_IP0 9 | |
| 31 | +#define LINE_IP1 10 | |
| 32 | +#define LINE_IP2 11 | |
| 33 | +#define LINE_IP3 12 | |
| 34 | +#define LINE_IP4 13 | |
| 35 | +#define LINE_IP5 14 | |
| 36 | +#define LINE_IP6 15 | |
| 37 | + | |
| 38 | +/* Signals */ | |
| 39 | +#define DTR_OP 0 /* DTR */ | |
| 40 | +#define RTS_OP 4 /* RTS */ | |
| 41 | +#define DSR_IP 8 /* DSR */ | |
| 42 | +#define CTS_IP 12 /* CTS */ | |
| 43 | +#define DCD_IP 16 /* DCD */ | |
| 44 | +#define RNG_IP 20 /* RNG */ | |
| 45 | + | |
| 46 | +#define DIR_OP 24 /* Special signal for control RS-485. | |
| 47 | + * Goes high when transmit, | |
| 48 | + * then goes low. | |
| 49 | + */ | |
| 50 | + | |
| 51 | +/* Routing control signal 'sig' to line 'line' */ | |
| 52 | +#define MCTRL_SIG(sig, line) ((line) << (sig)) | |
| 53 | + | |
| 54 | +/* | |
| 55 | + * Example board initialization data: | |
| 56 | + * | |
| 57 | + * static struct resource sc2892_resources[] = { | |
| 58 | + * DEFINE_RES_MEM(UART_PHYS_START, 0x10), | |
| 59 | + * DEFINE_RES_IRQ(IRQ_EXT2), | |
| 60 | + * }; | |
| 61 | + * | |
| 62 | + * static struct sccnxp_pdata sc2892_info = { | |
| 63 | + * .frequency = 3686400, | |
| 64 | + * .mctrl_cfg[0] = MCTRL_SIG(DIR_OP, LINE_OP0), | |
| 65 | + * .mctrl_cfg[1] = MCTRL_SIG(DIR_OP, LINE_OP1), | |
| 66 | + * }; | |
| 67 | + * | |
| 68 | + * static struct platform_device sc2892 = { | |
| 69 | + * .name = "sc2892", | |
| 70 | + * .id = -1, | |
| 71 | + * .resource = sc2892_resources, | |
| 72 | + * .num_resources = ARRAY_SIZE(sc2892_resources), | |
| 73 | + * .dev = { | |
| 74 | + * .platform_data = &sc2892_info, | |
| 75 | + * }, | |
| 76 | + * }; | |
| 77 | + */ | |
| 78 | + | |
| 79 | +/* SCCNXP platform data structure */ | |
| 80 | +struct sccnxp_pdata { | |
| 81 | + /* Frequency (extrenal clock or crystal) */ | |
| 82 | + int frequency; | |
| 83 | + /* Shift for A0 line */ | |
| 84 | + const u8 reg_shift; | |
| 85 | + /* Modem control lines configuration */ | |
| 86 | + const u32 mctrl_cfg[SCCNXP_MAX_UARTS]; | |
| 87 | + /* Called during startup */ | |
| 88 | + void (*init)(void); | |
| 89 | + /* Called before finish */ | |
| 90 | + void (*exit)(void); | |
| 91 | +}; | |
| 92 | + | |
| 93 | +#endif | |