Merge tag 'docs-4.11' of git://git.lwn.net/linux
[linux-2.6-block.git] / arch / blackfin / include / asm / bfin_sport.h
CommitLineData
1394f032 1/*
3630ac34 2 * bfin_sport.h - interface to Blackfin SPORTs
1394f032 3 *
3630ac34 4 * Copyright 2004-2009 Analog Devices Inc.
1394f032 5 *
fb7b75ab 6 * Licensed under the GPL-2 or later.
1394f032 7 */
1394f032
BW
8#ifndef __BFIN_SPORT_H__
9#define __BFIN_SPORT_H__
10
fb7b75ab 11
3630ac34 12#include <linux/types.h>
2ba36450 13#include <uapi/asm/bfin_sport.h>
1394f032 14
3630ac34
MF
15/*
16 * All Blackfin system MMRs are padded to 32bits even if the register
17 * itself is only 16bits. So use a helper macro to streamline this.
18 */
19#define __BFP(m) u16 m; u16 __pad_##m
20struct sport_register {
21 __BFP(tcr1);
22 __BFP(tcr2);
23 __BFP(tclkdiv);
24 __BFP(tfsdiv);
25 union {
26 u32 tx32;
27 u16 tx16;
28 };
29 u32 __pad_tx;
30 union {
31 u32 rx32; /* use the anomaly wrapper below */
32 u16 rx16;
33 };
34 u32 __pad_rx;
35 __BFP(rcr1);
36 __BFP(rcr2);
37 __BFP(rclkdiv);
38 __BFP(rfsdiv);
39 __BFP(stat);
40 __BFP(chnl);
41 __BFP(mcmc1);
42 __BFP(mcmc2);
43 u32 mtcs0;
44 u32 mtcs1;
45 u32 mtcs2;
46 u32 mtcs3;
47 u32 mrcs0;
48 u32 mrcs1;
49 u32 mrcs2;
50 u32 mrcs3;
1394f032 51};
3630ac34
MF
52#undef __BFP
53
6f53dbbb
SJ
54struct bfin_snd_platform_data {
55 const unsigned short *pin_req;
56};
57
3630ac34
MF
58#define bfin_read_sport_rx32(base) \
59({ \
60 struct sport_register *__mmrs = (void *)base; \
61 u32 __ret; \
62 unsigned long flags; \
63 if (ANOMALY_05000473) \
64 local_irq_save(flags); \
65 __ret = __mmrs->rx32; \
66 if (ANOMALY_05000473) \
67 local_irq_restore(flags); \
68 __ret; \
69})
1394f032 70
fb7b75ab 71#endif