From 80a015266327b2287f7d417028f24ff36a6114db Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Thu, 21 Oct 2010 19:28:00 -0300 Subject: [PATCH] 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 --- f32x/c2-bitbang.c | 5 ++++- f32x/c2-om.c | 11 ++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/f32x/c2-bitbang.c b/f32x/c2-bitbang.c index 1b3eed1..3c00a91 100644 --- a/f32x/c2-bitbang.c +++ b/f32x/c2-bitbang.c @@ -16,6 +16,10 @@ */ +#include +#include + + /* ----- Bit-level operations ---------------------------------------------- */ @@ -106,7 +110,6 @@ static uint32_t c2_data_read(int bytes) static void c2_init(void) { - gpio_init(); gpio_input(C2D); gpio_output(C2CK); gpio_low(C2CK); diff --git a/f32x/c2-om.c b/f32x/c2-om.c index ceed350..8d9ba48 100644 --- a/f32x/c2-om.c +++ b/f32x/c2-om.c @@ -11,9 +11,6 @@ */ -#include -#include - #include "gpio-s3c24xx.h" #include "c2-drv.h" @@ -30,11 +27,15 @@ #include "c2-bitbang.c" -/* ----- Operations -------------------------------------------------------- */ +static void om_init(void) +{ + gpio_init(); + c2_init(); +} struct c2_ops c2_om = { - .init = c2_init, + .init = om_init, .reset = c2_reset, .addr_write = c2_addr_write, .addr_read = c2_addr_read,