|
136 | 136 | #define UART_EXAR_REGB_EECS BIT(5)
|
137 | 137 | #define UART_EXAR_REGB_EEDI BIT(6)
|
138 | 138 | #define UART_EXAR_REGB_EEDO BIT(7)
|
139 |
| -#define UART_EXAR_REGB_EE_ADDR_SIZE 6 |
140 |
| -#define UART_EXAR_REGB_EE_DATA_SIZE 16 |
141 | 139 |
|
142 | 140 | #define UART_EXAR_XR17C15X_PORT_OFFSET 0x200
|
143 | 141 | #define UART_EXAR_XR17V25X_PORT_OFFSET 0x200
|
@@ -270,94 +268,6 @@ static inline u8 exar_read_reg(struct exar8250 *priv, unsigned int reg)
|
270 | 268 | return readb(priv->virt + reg);
|
271 | 269 | }
|
272 | 270 |
|
273 |
| -static inline void exar_ee_select(struct exar8250 *priv) |
274 |
| -{ |
275 |
| - // Set chip select pin high to enable EEPROM reads/writes |
276 |
| - exar_write_reg(priv, UART_EXAR_REGB, UART_EXAR_REGB_EECS); |
277 |
| - // Min ~500ns delay needed between CS assert and EEPROM access |
278 |
| - udelay(1); |
279 |
| -} |
280 |
| - |
281 |
| -static inline void exar_ee_deselect(struct exar8250 *priv) |
282 |
| -{ |
283 |
| - exar_write_reg(priv, UART_EXAR_REGB, 0x00); |
284 |
| -} |
285 |
| - |
286 |
| -static inline void exar_ee_write_bit(struct exar8250 *priv, u8 bit) |
287 |
| -{ |
288 |
| - u8 value = UART_EXAR_REGB_EECS; |
289 |
| - |
290 |
| - if (bit) |
291 |
| - value |= UART_EXAR_REGB_EEDI; |
292 |
| - |
293 |
| - // Clock out the bit on the EEPROM interface |
294 |
| - exar_write_reg(priv, UART_EXAR_REGB, value); |
295 |
| - // 2us delay = ~500khz clock speed |
296 |
| - udelay(2); |
297 |
| - |
298 |
| - value |= UART_EXAR_REGB_EECK; |
299 |
| - |
300 |
| - exar_write_reg(priv, UART_EXAR_REGB, value); |
301 |
| - udelay(2); |
302 |
| -} |
303 |
| - |
304 |
| -static inline u8 exar_ee_read_bit(struct exar8250 *priv) |
305 |
| -{ |
306 |
| - u8 regb; |
307 |
| - u8 value = UART_EXAR_REGB_EECS; |
308 |
| - |
309 |
| - // Clock in the bit on the EEPROM interface |
310 |
| - exar_write_reg(priv, UART_EXAR_REGB, value); |
311 |
| - // 2us delay = ~500khz clock speed |
312 |
| - udelay(2); |
313 |
| - |
314 |
| - value |= UART_EXAR_REGB_EECK; |
315 |
| - |
316 |
| - exar_write_reg(priv, UART_EXAR_REGB, value); |
317 |
| - udelay(2); |
318 |
| - |
319 |
| - regb = exar_read_reg(priv, UART_EXAR_REGB); |
320 |
| - |
321 |
| - return (regb & UART_EXAR_REGB_EEDO ? 1 : 0); |
322 |
| -} |
323 |
| - |
324 |
| -/** |
325 |
| - * exar_ee_read() - Read a word from the EEPROM |
326 |
| - * @priv: Device's private structure |
327 |
| - * @ee_addr: Offset of EEPROM to read word from |
328 |
| - * |
329 |
| - * Read a single 16bit word from an Exar UART's EEPROM. |
330 |
| - * The type of the EEPROM is AT93C46D. |
331 |
| - * |
332 |
| - * Return: EEPROM word |
333 |
| - */ |
334 |
| -static u16 exar_ee_read(struct exar8250 *priv, u8 ee_addr) |
335 |
| -{ |
336 |
| - int i; |
337 |
| - u16 data = 0; |
338 |
| - |
339 |
| - exar_ee_select(priv); |
340 |
| - |
341 |
| - // Send read command (opcode 110) |
342 |
| - exar_ee_write_bit(priv, 1); |
343 |
| - exar_ee_write_bit(priv, 1); |
344 |
| - exar_ee_write_bit(priv, 0); |
345 |
| - |
346 |
| - // Send address to read from |
347 |
| - for (i = UART_EXAR_REGB_EE_ADDR_SIZE - 1; i >= 0; i--) |
348 |
| - exar_ee_write_bit(priv, ee_addr & BIT(i)); |
349 |
| - |
350 |
| - // Read data 1 bit at a time starting with a dummy bit |
351 |
| - for (i = UART_EXAR_REGB_EE_DATA_SIZE; i >= 0; i--) { |
352 |
| - if (exar_ee_read_bit(priv)) |
353 |
| - data |= BIT(i); |
354 |
| - } |
355 |
| - |
356 |
| - exar_ee_deselect(priv); |
357 |
| - |
358 |
| - return data; |
359 |
| -} |
360 |
| - |
361 | 271 | static void exar_eeprom_93cx6_reg_read(struct eeprom_93cx6 *eeprom)
|
362 | 272 | {
|
363 | 273 | struct exar8250 *priv = eeprom->data;
|
|
0 commit comments