/* tuner abstraction layer: read something from the tuner */ int si4700_get(int setting) { int val = -1; /* default for unsupported query */ if(!tuner_powered() && setting != RADIO_PRESENT) return -1; mutex_lock(&fmr_mutex); switch(setting) { case RADIO_PRESENT: val = tuner_present; break; case RADIO_TUNED: val = si4700_tuned(); break; case RADIO_STEREO: val = si4700_st(); break; case RADIO_RSSI: val = STATUSRSSI_RSSIr(si4700_read_reg(STATUSRSSI)); break; case RADIO_RSSI_MIN: val = RSSI_MIN; break; case RADIO_RSSI_MAX: val = RSSI_MAX; break; #ifdef HAVE_RDS_CAP case RADIO_EVENT: { #ifdef RDS_ISR_PROCESSING int oldlevel = disable_irq_save(); #endif val = rds_event; rds_event = 0; #ifdef RDS_ISR_PROCESSING restore_irq(oldlevel); #endif break; } #endif } mutex_unlock(&fmr_mutex); return val; }
/* tuner abstraction layer: read something from the tuner */ int si4700_get(int setting) { int val = -1; /* default for unsupported query */ switch(setting) { case RADIO_PRESENT: val = tuner_present ? 1 : 0; break; case RADIO_TUNED: val = si4700_tuned(); break; case RADIO_STEREO: val = si4700_st(); break; } return val; }