1
0
mirror of git://projects.qi-hardware.com/f32xbase.git synced 2024-11-27 16:56:17 +02:00

Don't call gpio_init in c2_init, so that we can do additional setup work before

- f32x/c2-om.c: moved system includes to c2-bitbang.c
- f32x/c2-bitbang.c (c2_init): leave it to the upper layer to call gpio_init
- f32x/c2-om.c (om_init): call gpio_init, then c2_init
This commit is contained in:
Werner Almesberger 2010-10-21 19:28:00 -03:00
parent 4f743578ab
commit 80a0152663
2 changed files with 10 additions and 6 deletions

View File

@ -16,6 +16,10 @@
*/ */
#include <stdint.h>
#include <unistd.h>
/* ----- Bit-level operations ---------------------------------------------- */ /* ----- Bit-level operations ---------------------------------------------- */
@ -106,7 +110,6 @@ static uint32_t c2_data_read(int bytes)
static void c2_init(void) static void c2_init(void)
{ {
gpio_init();
gpio_input(C2D); gpio_input(C2D);
gpio_output(C2CK); gpio_output(C2CK);
gpio_low(C2CK); gpio_low(C2CK);

View File

@ -11,9 +11,6 @@
*/ */
#include <stdint.h>
#include <unistd.h>
#include "gpio-s3c24xx.h" #include "gpio-s3c24xx.h"
#include "c2-drv.h" #include "c2-drv.h"
@ -30,11 +27,15 @@
#include "c2-bitbang.c" #include "c2-bitbang.c"
/* ----- Operations -------------------------------------------------------- */ static void om_init(void)
{
gpio_init();
c2_init();
}
struct c2_ops c2_om = { struct c2_ops c2_om = {
.init = c2_init, .init = om_init,
.reset = c2_reset, .reset = c2_reset,
.addr_write = c2_addr_write, .addr_write = c2_addr_write,
.addr_read = c2_addr_read, .addr_read = c2_addr_read,