summaryrefslogtreecommitdiff
path: root/firmware/target/arm
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm')
-rw-r--r--firmware/target/arm/imx233/sansa-fuzeplus/fmradio-i2c-fuzeplus.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/firmware/target/arm/imx233/sansa-fuzeplus/fmradio-i2c-fuzeplus.c b/firmware/target/arm/imx233/sansa-fuzeplus/fmradio-i2c-fuzeplus.c
index 5d146c4846..fb565dbdcf 100644
--- a/firmware/target/arm/imx233/sansa-fuzeplus/fmradio-i2c-fuzeplus.c
+++ b/firmware/target/arm/imx233/sansa-fuzeplus/fmradio-i2c-fuzeplus.c
@@ -48,6 +48,14 @@ static void stc_rds_callback(int bank, int pin, intptr_t user)
48 semaphore_release(&rds_sema); 48 semaphore_release(&rds_sema);
49} 49}
50 50
51static inline void enable_rds_irq(void)
52{
53 /* pin is set to low when a RDS packet has arrived, and stays low for a minimum of 5ms. Thus
54 * we should not trigger on low because otherwise we might trigger several times for the same
55 * message. Instead trigger on falling edge (we might miss the very first message). */
56 imx233_pinctrl_setup_irq(2, 27, true, false, false, &stc_rds_callback, 0);
57}
58
51/* Captures RDS data and processes it */ 59/* Captures RDS data and processes it */
52static void NORETURN_ATTR rds_thread(void) 60static void NORETURN_ATTR rds_thread(void)
53{ 61{
@@ -57,7 +65,7 @@ static void NORETURN_ATTR rds_thread(void)
57 si4700_rds_process(); 65 si4700_rds_process();
58 66
59 /* renable callback */ 67 /* renable callback */
60 imx233_pinctrl_setup_irq(2, 27, true, true, false, &stc_rds_callback, 0); 68 enable_rds_irq();
61 } 69 }
62} 70}
63 71
@@ -69,8 +77,7 @@ void si4700_rds_powerup(bool on)
69 imx233_pinctrl_acquire(2, 27, "tuner stc/rds"); 77 imx233_pinctrl_acquire(2, 27, "tuner stc/rds");
70 imx233_pinctrl_set_function(2, 27, PINCTRL_FUNCTION_GPIO); 78 imx233_pinctrl_set_function(2, 27, PINCTRL_FUNCTION_GPIO);
71 imx233_pinctrl_enable_gpio(2, 27, false); 79 imx233_pinctrl_enable_gpio(2, 27, false);
72 /* pin is set to 0 when an RDS packet has arrived */ 80 enable_rds_irq();
73 imx233_pinctrl_setup_irq(2, 27, true, true, false, &stc_rds_callback, 0);
74 } 81 }
75 else 82 else
76 { 83 {