summaryrefslogtreecommitdiff
path: root/firmware/target/arm/imx31/gigabeat-s/fmradio-i2c-gigabeat-s.c
diff options
context:
space:
mode:
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.c16
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 =
38void fmradio_i2c_init(void) 38void 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 }