Commit c7416967 authored by Russell King's avatar Russell King

[ARM] Ensure transmitter starts before leaving ssp_write_word()

Wait for BSY bit to be asserted before returning from
ssp_write_word().  This ensures that ssp_flush() will wait for
the transmitter to empty before returning.

Add ssp.h header.
parent 2d9a5998
......@@ -39,7 +39,8 @@ static void ssp_interrupt(int irq, void *dev_id, struct pt_regs *regs)
* @data: 16-bit, MSB justified data to write.
*
* Wait for a free entry in the SSP transmit FIFO, and write a data
* word to the SSP port.
* word to the SSP port. Wait for the SSP port to start sending
* the data.
*
* The caller is expected to perform the necessary locking.
*
......@@ -54,6 +55,9 @@ int ssp_write_word(u16 data)
Ser4SSDR = data;
while (!(Ser4SSSR & SSSR_BSY))
cpu_relax();
return 0;
}
......
/*
* ssp.h
*
* Copyright (C) 2003 Russell King, All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#ifndef SSP_H
#define SSP_H
struct ssp_state {
unsigned int cr0;
unsigned int cr1;
};
int ssp_write_word(u16 data);
int ssp_read_word(void);
void ssp_flush(void);
void ssp_enable(void);
void ssp_disable(void);
void ssp_save_state(struct ssp_state *ssp);
void ssp_restore_state(struct ssp_state *ssp);
int ssp_init(void);
void ssp_exit(void);
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment