From 336ea51af65c8511ba38f0c3ccfdf7634b87c12d Mon Sep 17 00:00:00 2001 From: Wolfram Sang Date: Thu, 18 Nov 2021 09:14:37 +0100 Subject: WIP: Samsung YPR0/1: switch to generic SI47xx polling Should work(tm). But I don't have the hardware, so it needs to be tested. Change-Id: Ic086434f570dcddacb5b7e7a1acce4b8cafc5c03 --- firmware/target/hosted/samsungypr/radio-ypr.c | 59 --------------------------- 1 file changed, 59 deletions(-) (limited to 'firmware/target') diff --git a/firmware/target/hosted/samsungypr/radio-ypr.c b/firmware/target/hosted/samsungypr/radio-ypr.c index 42d485231d..ef7fb84aa0 100644 --- a/firmware/target/hosted/samsungypr/radio-ypr.c +++ b/firmware/target/hosted/samsungypr/radio-ypr.c @@ -126,62 +126,3 @@ int fmradio_i2c_read(unsigned char address, unsigned char* buf, int count) (void)address; return read(radio_dev, buf, count); } - -#ifdef HAVE_RDS_CAP - -/* Register we are going to poll */ -#define STATUSRSSI (0xA) -#define STATUSRSSI_RDSR (0x1 << 15) - -/* Low-level RDS Support */ -static struct event_queue rds_queue; -static uint32_t rds_stack[DEFAULT_STACK_SIZE / sizeof(uint32_t)]; - -enum { - Q_POWERUP, -}; - -static void NORETURN_ATTR rds_thread(void) -{ - /* start up frozen */ - int timeout = TIMEOUT_BLOCK; - struct queue_event ev; - bool rds_rdy = false; - struct si4700_dbg_info radio_regs; - - while (true) { - queue_wait_w_tmo(&rds_queue, &ev, timeout); - switch (ev.id) { - case Q_POWERUP: - /* power up: timeout after 1 tick, else block indefinitely */ - timeout = ev.data ? 1 : TIMEOUT_BLOCK; - break; - case SYS_TIMEOUT: - /* Captures RDS data and processes it */ - si4700_dbg_info(&radio_regs); - bool rdsr = radio_regs.regs[STATUSRSSI] & STATUSRSSI_RDSR; - if (rdsr != rds_rdy) { - rds_rdy = rdsr; - if (rdsr) { - si4700_rds_process(); - } - } - break; - } - } -} - -/* true after full radio power up, and false before powering down */ -void si4700_rds_powerup(bool on) -{ - queue_post(&rds_queue, Q_POWERUP, on); -} - -/* One-time RDS init at startup */ -void si4700_rds_init(void) -{ - queue_init(&rds_queue, false); - create_thread(rds_thread, rds_stack, sizeof(rds_stack), 0, "rds" - IF_PRIO(, PRIORITY_PLAYBACK) IF_COP(, CPU)); -} -#endif /* HAVE_RDS_CAP */ -- cgit v1.2.3