Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

imx233/fuze+: rework i2c and fmradio_i2c init

Only enable fmradio_i2c once with _init() called from system.
Move actual i2c init to system for consistency.
Move tuner power pin setup to power instead of fmradio.

Change-Id: Idb56bfba5803f71b5d049f174c48d2afb969a6ea

+15 -11
+5 -1
firmware/target/arm/imx233/i2c-imx233.c
··· 53 53 semaphore_release(&i2c_sema); 54 54 } 55 55 56 - void i2c_init(void) 56 + void imx233_i2c_init(void) 57 57 { 58 58 imx233_reset_block(&HW_I2C_CTRL0); 59 59 /* setup pins (must be done when shutdown) */ ··· 145 145 __REG_SET(HW_I2C_CTRL0) = __BLOCK_CLKGATE; 146 146 mutex_unlock(&i2c_mutex); 147 147 return ret; 148 + } 149 + 150 + void i2c_init(void) 151 + { 148 152 } 149 153 150 154 int i2c_write(int device, const unsigned char* buf, int count)
+1 -1
firmware/target/arm/imx233/i2c-imx233.h
··· 126 126 I2C_SLAVE_NAK = -5 127 127 }; 128 128 129 - void i2c_init(void); 129 + void imx233_i2c_init(void); 130 130 /* start building a transfer, will acquire an exclusive lock */ 131 131 void imx233_i2c_begin(void); 132 132 /* add stage */
+1
firmware/target/arm/imx233/power-imx233.c
··· 27 27 #include "system-target.h" 28 28 #include "power-imx233.h" 29 29 #include "pinctrl-imx233.h" 30 + #include "fmradio_i2c.h" 30 31 31 32 struct current_step_bit_t 32 33 {
+2 -8
firmware/target/arm/imx233/sansa-fuzeplus/fmradio-i2c-fuzeplus.c
··· 85 85 .delay_thigh = 4 86 86 }; 87 87 88 - void fmradio_i2c_enable(bool enable) 88 + void fmradio_i2c_init(void) 89 89 { 90 - if(fmradio_i2c_bus == -1) 91 - fmradio_i2c_bus = i2c_add_node(&fmradio_i2c); 92 - imx233_set_pin_function(0, 29, PINCTRL_FUNCTION_GPIO); 93 90 imx233_set_pin_function(1, 24, PINCTRL_FUNCTION_GPIO); 94 91 imx233_set_pin_function(1, 22, PINCTRL_FUNCTION_GPIO); 95 - imx233_enable_gpio_output(1, 22, enable); 96 - imx233_enable_gpio_output(1, 24, enable); 97 - imx233_set_gpio_output(1, 22, enable); 98 - imx233_set_gpio_output(1, 24, enable); 92 + fmradio_i2c_bus = i2c_add_node(&fmradio_i2c); 99 93 } 100 94 101 95 int fmradio_i2c_write(unsigned char address, const unsigned char* buf, int count)
+1 -1
firmware/target/arm/imx233/sansa-fuzeplus/power-fuzeplus.c
··· 32 32 { 33 33 if(enable != tuner_enable) 34 34 { 35 - fmradio_i2c_enable(enable); 36 35 /* CE is B029 (active high) */ 36 + imx233_set_pin_function(0, 29, PINCTRL_FUNCTION_GPIO); 37 37 imx233_set_pin_drive_strength(0, 29, PINCTRL_DRIVE_4mA); 38 38 imx233_enable_gpio_output(0, 29, enable); 39 39 imx233_set_gpio_output(0, 29, enable);
+5
firmware/target/arm/imx233/system-imx233.c
··· 34 34 #include "lcd.h" 35 35 #include "backlight-target.h" 36 36 #include "button.h" 37 + #include "fmradio_i2c.h" 37 38 38 39 #define default_interrupt(name) \ 39 40 extern __attribute__((weak, alias("UIRQ"))) void name(void) ··· 213 214 imx233_dma_init(); 214 215 imx233_ssp_init(); 215 216 imx233_dcp_init(); 217 + imx233_i2c_init(); 218 + #if defined(SANSA_FUZEPLUS) && !defined(BOOTLOADER) 219 + fmradio_i2c_init(); 220 + #endif 216 221 } 217 222 218 223 bool imx233_us_elapsed(uint32_t ref, unsigned us_delay)