diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2010-06-30 02:02:46 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2010-06-30 02:02:46 +0000 |
commit | e286b0bbc04a34c181978efce19c6d0814e228c0 (patch) | |
tree | 841288761e20dc9a7a25e5ba83306adf52547d65 /firmware/target/arm/imx31/gigabeat-s/fmradio-i2c-gigabeat-s.c | |
parent | f4a00174b50c209f2a23b7a73fe7cb544ef59d02 (diff) | |
download | rockbox-e286b0bbc04a34c181978efce19c6d0814e228c0.tar.gz rockbox-e286b0bbc04a34c181978efce19c6d0814e228c0.zip |
Remove atomic register bit manipulation functions from i.MX and s3c target code and introduce generic functions for ARM (bitmod32, bitset32, and bitclr32). Multiprocessor support is possible but just not implemented at the moment, only interrupt lockout.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27188 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/imx31/gigabeat-s/fmradio-i2c-gigabeat-s.c')
-rw-r--r-- | firmware/target/arm/imx31/gigabeat-s/fmradio-i2c-gigabeat-s.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/firmware/target/arm/imx31/gigabeat-s/fmradio-i2c-gigabeat-s.c b/firmware/target/arm/imx31/gigabeat-s/fmradio-i2c-gigabeat-s.c index f720921fad..39a2cdab04 100644 --- a/firmware/target/arm/imx31/gigabeat-s/fmradio-i2c-gigabeat-s.c +++ b/firmware/target/arm/imx31/gigabeat-s/fmradio-i2c-gigabeat-s.c | |||
@@ -38,14 +38,14 @@ static struct i2c_node si4700_i2c_node = | |||
38 | void fmradio_i2c_init(void) | 38 | void fmradio_i2c_init(void) |
39 | { | 39 | { |
40 | /* RST: LOW */ | 40 | /* RST: LOW */ |
41 | imx31_regclr32(&GPIO1_DR, (1 << 26)); | 41 | bitclr32(&GPIO1_DR, (1 << 26)); |
42 | /* RST: OUT */ | 42 | /* RST: OUT */ |
43 | imx31_regset32(&GPIO1_GDIR, (1 << 26)); | 43 | bitset32(&GPIO1_GDIR, (1 << 26)); |
44 | 44 | ||
45 | /* I2C2 SCL: IN, I2C2: SDA IN */ | 45 | /* I2C2 SCL: IN, I2C2: SDA IN */ |
46 | imx31_regclr32(&GPIO2_GDIR, (3 << 14)); | 46 | bitclr32(&GPIO2_GDIR, (3 << 14)); |
47 | /* I2C2 SCL LO, I2C2 SDA LO */ | 47 | /* I2C2 SCL LO, I2C2 SDA LO */ |
48 | imx31_regclr32(&GPIO2_DR, (3 << 14)); | 48 | bitclr32(&GPIO2_DR, (3 << 14)); |
49 | 49 | ||
50 | /* open-drain pins - external pullups on PCB. Pullup default but | 50 | /* open-drain pins - external pullups on PCB. Pullup default but |
51 | * disabled */ | 51 | * disabled */ |
@@ -73,17 +73,17 @@ void fmradio_i2c_enable(bool enable) | |||
73 | { | 73 | { |
74 | /* place in GPIO mode to hold SDIO low during RESET release, | 74 | /* place in GPIO mode to hold SDIO low during RESET release, |
75 | * SEN1 should be high already (pullup) and GPIO3 left alone */ | 75 | * SEN1 should be high already (pullup) and GPIO3 left alone */ |
76 | imx31_regset32(&GPIO2_GDIR, (1 << 15)); /* SDIO OUT */ | 76 | bitset32(&GPIO2_GDIR, (1 << 15)); /* SDIO OUT */ |
77 | /* I2C2_SDA => MCU2_15 */ | 77 | /* I2C2_SDA => MCU2_15 */ |
78 | iomuxc_set_pin_mux(IOMUXC_DCD_DTE1, | 78 | iomuxc_set_pin_mux(IOMUXC_DCD_DTE1, |
79 | IOMUXC_MUX_OUT_GPIO | IOMUXC_MUX_IN_GPIO); | 79 | IOMUXC_MUX_OUT_GPIO | IOMUXC_MUX_IN_GPIO); |
80 | /* enable CLK32KMCU clock */ | 80 | /* enable CLK32KMCU clock */ |
81 | mc13783_set(MC13783_POWER_CONTROL0, MC13783_CLK32KMCUEN); | 81 | mc13783_set(MC13783_POWER_CONTROL0, MC13783_CLK32KMCUEN); |
82 | /* enable the fm chip (release RESET) */ | 82 | /* enable the fm chip (release RESET) */ |
83 | imx31_regset32(&GPIO1_DR, (1 << 26)); | 83 | bitset32(&GPIO1_DR, (1 << 26)); |
84 | sleep(HZ/100); | 84 | sleep(HZ/100); |
85 | /* busmode should be selected - OK to release SDIO */ | 85 | /* busmode should be selected - OK to release SDIO */ |
86 | imx31_regclr32(&GPIO2_GDIR, (1 << 15)); /* SDIO IN */ | 86 | bitclr32(&GPIO2_GDIR, (1 << 15)); /* SDIO IN */ |
87 | /* restore pin mux (MCU2_15 => I2C2_SDA) */ | 87 | /* restore pin mux (MCU2_15 => I2C2_SDA) */ |
88 | iomuxc_set_pin_mux(IOMUXC_DCD_DTE1, | 88 | iomuxc_set_pin_mux(IOMUXC_DCD_DTE1, |
89 | IOMUXC_MUX_OUT_ALT2 | IOMUXC_MUX_IN_ALT2); | 89 | IOMUXC_MUX_OUT_ALT2 | IOMUXC_MUX_IN_ALT2); |
@@ -97,7 +97,7 @@ void fmradio_i2c_enable(bool enable) | |||
97 | we can diable the i2c module when not in use */ | 97 | we can diable the i2c module when not in use */ |
98 | i2c_enable_node(&si4700_i2c_node, false); | 98 | i2c_enable_node(&si4700_i2c_node, false); |
99 | /* disable the fm chip */ | 99 | /* disable the fm chip */ |
100 | imx31_regclr32(&GPIO1_DR, (1 << 26)); | 100 | bitclr32(&GPIO1_DR, (1 << 26)); |
101 | /* disable CLK32KMCU clock */ | 101 | /* disable CLK32KMCU clock */ |
102 | mc13783_clear(MC13783_POWER_CONTROL0, MC13783_CLK32KMCUEN); | 102 | mc13783_clear(MC13783_POWER_CONTROL0, MC13783_CLK32KMCUEN); |
103 | } | 103 | } |