Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
exar7300.c
Go to the documentation of this file.
1 /*
2  * SBE 2T3E3 synchronous serial card driver for Linux
3  *
4  * Copyright (C) 2009-2010 Krzysztof Halasa <[email protected]>
5  *
6  * This program is free software; you can redistribute it and/or modify it
7  * under the terms of version 2 of the GNU General Public License
8  * as published by the Free Software Foundation.
9  *
10  * This code is based on a driver written by SBE Inc.
11  */
12 
13 #include "2t3e3.h"
14 #include "ctrl.h"
15 
16 void exar7300_init(struct channel *sc)
17 {
19 
20  /* enable line decodeer and encoder */
26 }
27 
29 {
30  u32 val;
31 
32  switch (mode) {
37  break;
38  default:
39  return;
40  }
41 
44  val |= mode;
46 }
47 
49 {
50  u32 val;
51 
52  switch (type) {
57  break;
58  default:
59  return;
60  }
61 
65 
66  switch (type) {
70  break;
74  break;
75  default:
76  return;
77  }
78 
80 }
81 
82 
84 {
85  if (sc->p.transmit_all_ones == mode)
86  return;
87 
88  switch (mode) {
89  case SBE_2T3E3_ON:
92  break;
93  case SBE_2T3E3_OFF:
96  break;
97  default:
98  return;
99  }
100 
101  sc->p.transmit_all_ones = mode;
102 }
103 
105 {
106  if (sc->p.receive_equalization == mode)
107  return;
108 
109  switch (mode) {
110  case SBE_2T3E3_OFF:
113  break;
114  case SBE_2T3E3_ON:
117  break;
118  default:
119  return;
120  }
121 
123 }
124 
126 {
127  if (sc->p.line_build_out == mode)
128  return;
129 
130  switch (mode) {
131  case SBE_2T3E3_OFF:
135  break;
136  case SBE_2T3E3_ON:
140  break;
141  default:
142  return;
143  }
144 
145  sc->p.line_build_out = mode;
146 }
147 
148 /* TODO - what about encoder in raw mode??? disable it too? */
150 {
151  switch (mode) {
152  case SBE_2T3E3_OFF:
157  break;
158  case SBE_2T3E3_ON:
163  break;
164  }
165 }