summaryrefslogtreecommitdiff
path: root/include/linux/fs_uart_pd.h
blob: 36b61ff392779750a84d2176e27fbbafb0078a27 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*
 * Platform information definitions for the CPM Uart driver.
 *
 * 2006 (c) MontaVista Software, Inc.
 * Vitaly Bordug <vbordug@ru.mvista.com>
 *
 * This file is licensed under the terms of the GNU General Public License
 * version 2. This program is licensed "as is" without any warranty of any
 * kind, whether express or implied.
 */

#ifndef FS_UART_PD_H
#define FS_UART_PD_H

#include <asm/types.h>

enum fs_uart_id {
	fsid_smc1_uart,
	fsid_smc2_uart,
	fsid_scc1_uart,
	fsid_scc2_uart,
	fsid_scc3_uart,
	fsid_scc4_uart,
	fs_uart_nr,
};

static inline int fs_uart_id_scc2fsid(int id)
{
    return fsid_scc1_uart + id - 1;
}

static inline int fs_uart_id_fsid2scc(int id)
{
    return id - fsid_scc1_uart + 1;
}

static inline int fs_uart_id_smc2fsid(int id)
{
    return fsid_smc1_uart + id - 1;
}

static inline int fs_uart_id_fsid2smc(int id)
{
    return id - fsid_smc1_uart + 1;
}

struct fs_uart_platform_info {
        void(*init_ioports)(struct fs_uart_platform_info *);
	/* device specific information */
	int fs_no;		/* controller index */
	char fs_type[4];        /* controller type  */
	u32 uart_clk;
	u8 tx_num_fifo;
	u8 tx_buf_size;
	u8 rx_num_fifo;
	u8 rx_buf_size;
	u8 brg;
	u8 clk_rx;
	u8 clk_tx;
};

static inline int fs_uart_get_id(struct fs_uart_platform_info *fpi)
{
        if(strstr(fpi->fs_type, "SMC"))
                return fs_uart_id_smc2fsid(fpi->fs_no);
        if(strstr(fpi->fs_type, "SCC"))
                return fs_uart_id_scc2fsid(fpi->fs_no);
        return fpi->fs_no;
}

#endif
s are validMark Brown 2014-02-19mfd: tps65217: Naturalise cross-architecture discrepanciesLee Jones 2014-01-23drivers/mfd/tps65217.c: fix pointer-integer size mismatch warning in tps65217...David Howells 2014-01-06mfd: ti: Constify struct mfd_cell where possibleGeert Uytterhoeven 2013-10-23mfd: tps65217: Remove redundant of_match_ptrSachin Kamat 2012-12-16Merge tag 'mfd-3.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/...Linus Torvalds 2012-11-28mfd: remove use of __devexitBill Pemberton 2012-11-28mfd: remove use of __devinitBill Pemberton 2012-11-28mfd: remove use of __devexit_pBill Pemberton 2012-11-21mfd: tps65217: Set PMIC to shutdown on PWR_EN toggleColin Foe-Parker 2012-09-24mfd: Add backlight as subdevice to the tps65217Matthias Kaehlcke 2012-09-14mfd: core: Push irqdomain mapping out into devicesMark Brown 2012-08-22mfd: Move tps65217 regulator plat data handling to regulatorAnilKumar Ch 2012-07-12regulator: tps65217: Add device tree supportAnilKumar Ch 2012-05-20mfd: Staticise non-exported tps65217_update_bits()Mark Brown 2012-05-09mfd: Convert tps65217 to devm_regmap_init_i2c()Axel Lin 2012-03-06mfd: Add new mfd device for TPS65217AnilKumar Ch