Lines Matching refs:core

180 static int si476x_core_parse_and_nag_about_error(struct si476x_core *core)  in si476x_core_parse_and_nag_about_error()  argument
186 if (core->revision != SI476X_REVISION_A10) { in si476x_core_parse_and_nag_about_error()
187 err = si476x_core_i2c_xfer(core, SI476X_I2C_RECV, in si476x_core_parse_and_nag_about_error()
236 dev_err(&core->client->dev, in si476x_core_parse_and_nag_about_error()
239 dev_err(&core->client->dev, in si476x_core_parse_and_nag_about_error()
266 static int si476x_core_send_command(struct si476x_core *core, in si476x_core_send_command() argument
274 struct i2c_client *client = core->client; in si476x_core_send_command()
293 err = si476x_core_i2c_xfer(core, SI476X_I2C_SEND, in si476x_core_send_command()
296 dev_err(&core->client->dev, in si476x_core_send_command()
304 atomic_set(&core->cts, 0); in si476x_core_send_command()
307 if (!wait_event_timeout(core->command, in si476x_core_send_command()
308 atomic_read(&core->cts), in si476x_core_send_command()
310 dev_warn(&core->client->dev, in si476x_core_send_command()
321 if (unlikely(!core->client->irq && command == CMD_POWER_UP)) { in si476x_core_send_command()
322 if (!wait_event_timeout(core->command, in si476x_core_send_command()
323 atomic_read(&core->cts), in si476x_core_send_command()
325 dev_warn(&core->client->dev, in si476x_core_send_command()
331 err = si476x_core_i2c_xfer(core, SI476X_I2C_RECV, resp, respn); in si476x_core_send_command()
333 dev_err(&core->client->dev, in si476x_core_send_command()
344 dev_err(&core->client->dev, in si476x_core_send_command()
346 err = si476x_core_parse_and_nag_about_error(core); in si476x_core_send_command()
356 static int si476x_cmd_clear_stc(struct si476x_core *core) in si476x_cmd_clear_stc() argument
367 switch (core->power_up_parameters.func) { in si476x_cmd_clear_stc()
369 err = si476x_core_cmd_fm_rsq_status(core, &args, NULL); in si476x_cmd_clear_stc()
372 err = si476x_core_cmd_am_rsq_status(core, &args, NULL); in si476x_cmd_clear_stc()
381 static int si476x_cmd_tune_seek_freq(struct si476x_core *core, in si476x_cmd_tune_seek_freq() argument
389 atomic_set(&core->stc, 0); in si476x_cmd_tune_seek_freq()
390 err = si476x_core_send_command(core, cmd, args, argn, resp, respn, in si476x_cmd_tune_seek_freq()
393 wait_event_killable(core->tuning, in si476x_cmd_tune_seek_freq()
394 atomic_read(&core->stc)); in si476x_cmd_tune_seek_freq()
395 si476x_cmd_clear_stc(core); in si476x_cmd_tune_seek_freq()
413 int si476x_core_cmd_func_info(struct si476x_core *core, in si476x_core_cmd_func_info() argument
419 err = si476x_core_send_command(core, CMD_FUNC_INFO, in si476x_core_cmd_func_info()
444 int si476x_core_cmd_set_property(struct si476x_core *core, in si476x_core_cmd_set_property() argument
456 return si476x_core_send_command(core, CMD_SET_PROPERTY, in si476x_core_cmd_set_property()
471 int si476x_core_cmd_get_property(struct si476x_core *core, u16 property) in si476x_core_cmd_get_property() argument
481 err = si476x_core_send_command(core, CMD_GET_PROPERTY, in si476x_core_cmd_get_property()
529 int si476x_core_cmd_dig_audio_pin_cfg(struct si476x_core *core, in si476x_core_cmd_dig_audio_pin_cfg() argument
543 return si476x_core_send_command(core, CMD_DIG_AUDIO_PIN_CFG, in si476x_core_cmd_dig_audio_pin_cfg()
578 int si476x_core_cmd_zif_pin_cfg(struct si476x_core *core, in si476x_core_cmd_zif_pin_cfg() argument
592 return si476x_core_send_command(core, CMD_ZIF_PIN_CFG, in si476x_core_cmd_zif_pin_cfg()
635 int si476x_core_cmd_ic_link_gpo_ctl_pin_cfg(struct si476x_core *core, in si476x_core_cmd_ic_link_gpo_ctl_pin_cfg() argument
649 return si476x_core_send_command(core, CMD_IC_LINK_GPO_CTL_PIN_CFG, in si476x_core_cmd_ic_link_gpo_ctl_pin_cfg()
669 int si476x_core_cmd_ana_audio_pin_cfg(struct si476x_core *core, in si476x_core_cmd_ana_audio_pin_cfg() argument
677 return si476x_core_send_command(core, CMD_ANA_AUDIO_PIN_CFG, in si476x_core_cmd_ana_audio_pin_cfg()
703 static int si476x_core_cmd_intb_pin_cfg_a10(struct si476x_core *core, in si476x_core_cmd_intb_pin_cfg_a10() argument
713 return si476x_core_send_command(core, CMD_INTB_PIN_CFG, in si476x_core_cmd_intb_pin_cfg_a10()
719 static int si476x_core_cmd_intb_pin_cfg_a20(struct si476x_core *core, in si476x_core_cmd_intb_pin_cfg_a20() argument
729 return si476x_core_send_command(core, CMD_INTB_PIN_CFG, in si476x_core_cmd_intb_pin_cfg_a20()
752 int si476x_core_cmd_am_rsq_status(struct si476x_core *core, in si476x_core_cmd_am_rsq_status() argument
763 err = si476x_core_send_command(core, CMD_AM_RSQ_STATUS, in si476x_core_cmd_am_rsq_status()
801 int si476x_core_cmd_fm_acf_status(struct si476x_core *core, in si476x_core_cmd_fm_acf_status() argument
813 err = si476x_core_send_command(core, CMD_FM_ACF_STATUS, in si476x_core_cmd_fm_acf_status()
837 int si476x_core_cmd_am_acf_status(struct si476x_core *core, in si476x_core_cmd_am_acf_status() argument
849 err = si476x_core_send_command(core, CMD_AM_ACF_STATUS, in si476x_core_cmd_am_acf_status()
885 int si476x_core_cmd_fm_seek_start(struct si476x_core *core, in si476x_core_cmd_fm_seek_start() argument
893 return si476x_cmd_tune_seek_freq(core, CMD_FM_SEEK_START, in si476x_core_cmd_fm_seek_start()
911 int si476x_core_cmd_fm_rds_status(struct si476x_core *core, in si476x_core_cmd_fm_rds_status() argument
923 err = si476x_core_send_command(core, CMD_FM_RDS_STATUS, in si476x_core_cmd_fm_rds_status()
977 int si476x_core_cmd_fm_rds_blockcount(struct si476x_core *core, in si476x_core_cmd_fm_rds_blockcount() argument
990 err = si476x_core_send_command(core, CMD_FM_RDS_BLOCKCOUNT, in si476x_core_cmd_fm_rds_blockcount()
1005 int si476x_core_cmd_fm_phase_diversity(struct si476x_core *core, in si476x_core_cmd_fm_phase_diversity() argument
1013 return si476x_core_send_command(core, CMD_FM_PHASE_DIVERSITY, in si476x_core_cmd_fm_phase_diversity()
1030 int si476x_core_cmd_fm_phase_div_status(struct si476x_core *core) in si476x_core_cmd_fm_phase_div_status() argument
1035 err = si476x_core_send_command(core, CMD_FM_PHASE_DIV_STATUS, in si476x_core_cmd_fm_phase_div_status()
1059 int si476x_core_cmd_am_seek_start(struct si476x_core *core, in si476x_core_cmd_am_seek_start() argument
1067 return si476x_cmd_tune_seek_freq(core, CMD_AM_SEEK_START, in si476x_core_cmd_am_seek_start()
1075 static int si476x_core_cmd_power_up_a10(struct si476x_core *core, in si476x_core_cmd_power_up_a10() argument
1079 const bool intsel = (core->pinmux.a1 == SI476X_A1_IRQ); in si476x_core_cmd_power_up_a10()
1080 const bool ctsen = (core->client->irq != 0); in si476x_core_cmd_power_up_a10()
1092 return si476x_core_send_command(core, CMD_POWER_UP, in si476x_core_cmd_power_up_a10()
1098 static int si476x_core_cmd_power_up_a20(struct si476x_core *core, in si476x_core_cmd_power_up_a20() argument
1102 const bool intsel = (core->pinmux.a1 == SI476X_A1_IRQ); in si476x_core_cmd_power_up_a20()
1103 const bool ctsen = (core->client->irq != 0); in si476x_core_cmd_power_up_a20()
1114 return si476x_core_send_command(core, CMD_POWER_UP, in si476x_core_cmd_power_up_a20()
1120 static int si476x_core_cmd_power_down_a10(struct si476x_core *core, in si476x_core_cmd_power_down_a10() argument
1125 return si476x_core_send_command(core, CMD_POWER_DOWN, in si476x_core_cmd_power_down_a10()
1131 static int si476x_core_cmd_power_down_a20(struct si476x_core *core, in si476x_core_cmd_power_down_a20() argument
1138 return si476x_core_send_command(core, CMD_POWER_DOWN, in si476x_core_cmd_power_down_a20()
1144 static int si476x_core_cmd_am_tune_freq_a10(struct si476x_core *core, in si476x_core_cmd_am_tune_freq_a10() argument
1156 return si476x_cmd_tune_seek_freq(core, CMD_AM_TUNE_FREQ, args, in si476x_core_cmd_am_tune_freq_a10()
1161 static int si476x_core_cmd_am_tune_freq_a20(struct si476x_core *core, in si476x_core_cmd_am_tune_freq_a20() argument
1172 return si476x_cmd_tune_seek_freq(core, CMD_AM_TUNE_FREQ, in si476x_core_cmd_am_tune_freq_a20()
1177 static int si476x_core_cmd_fm_rsq_status_a10(struct si476x_core *core, in si476x_core_cmd_fm_rsq_status_a10() argument
1188 err = si476x_core_send_command(core, CMD_FM_RSQ_STATUS, in si476x_core_cmd_fm_rsq_status_a10()
1230 static int si476x_core_cmd_fm_rsq_status_a20(struct si476x_core *core, in si476x_core_cmd_fm_rsq_status_a20() argument
1242 err = si476x_core_send_command(core, CMD_FM_RSQ_STATUS, in si476x_core_cmd_fm_rsq_status_a20()
1285 static int si476x_core_cmd_fm_rsq_status_a30(struct si476x_core *core, in si476x_core_cmd_fm_rsq_status_a30() argument
1297 err = si476x_core_send_command(core, CMD_FM_RSQ_STATUS, in si476x_core_cmd_fm_rsq_status_a30()
1347 static int si476x_core_cmd_fm_tune_freq_a10(struct si476x_core *core, in si476x_core_cmd_fm_tune_freq_a10() argument
1360 return si476x_cmd_tune_seek_freq(core, CMD_FM_TUNE_FREQ, in si476x_core_cmd_fm_tune_freq_a10()
1365 static int si476x_core_cmd_fm_tune_freq_a20(struct si476x_core *core, in si476x_core_cmd_fm_tune_freq_a20() argument
1376 return si476x_cmd_tune_seek_freq(core, CMD_FM_TUNE_FREQ, in si476x_core_cmd_fm_tune_freq_a20()
1381 static int si476x_core_cmd_agc_status_a20(struct si476x_core *core, in si476x_core_cmd_agc_status_a20() argument
1390 err = si476x_core_send_command(core, CMD_AGC_STATUS, in si476x_core_cmd_agc_status_a20()
1409 static int si476x_core_cmd_agc_status_a10(struct si476x_core *core, in si476x_core_cmd_agc_status_a10() argument
1418 err = si476x_core_send_command(core, CMD_AGC_STATUS, in si476x_core_cmd_agc_status_a10()
1433 typedef int (*tune_freq_func_t) (struct si476x_core *core,
1451 int (*intb_pin_cfg)(struct si476x_core *core,
1484 int si476x_core_cmd_power_up(struct si476x_core *core, in si476x_core_cmd_power_up() argument
1487 BUG_ON(core->revision > SI476X_REVISION_A30 || in si476x_core_cmd_power_up()
1488 core->revision == -1); in si476x_core_cmd_power_up()
1489 return si476x_cmds_vtable[core->revision].power_up(core, args); in si476x_core_cmd_power_up()
1493 int si476x_core_cmd_power_down(struct si476x_core *core, in si476x_core_cmd_power_down() argument
1496 BUG_ON(core->revision > SI476X_REVISION_A30 || in si476x_core_cmd_power_down()
1497 core->revision == -1); in si476x_core_cmd_power_down()
1498 return si476x_cmds_vtable[core->revision].power_down(core, args); in si476x_core_cmd_power_down()
1502 int si476x_core_cmd_fm_tune_freq(struct si476x_core *core, in si476x_core_cmd_fm_tune_freq() argument
1505 BUG_ON(core->revision > SI476X_REVISION_A30 || in si476x_core_cmd_fm_tune_freq()
1506 core->revision == -1); in si476x_core_cmd_fm_tune_freq()
1507 return si476x_cmds_vtable[core->revision].fm_tune_freq(core, args); in si476x_core_cmd_fm_tune_freq()
1511 int si476x_core_cmd_am_tune_freq(struct si476x_core *core, in si476x_core_cmd_am_tune_freq() argument
1514 BUG_ON(core->revision > SI476X_REVISION_A30 || in si476x_core_cmd_am_tune_freq()
1515 core->revision == -1); in si476x_core_cmd_am_tune_freq()
1516 return si476x_cmds_vtable[core->revision].am_tune_freq(core, args); in si476x_core_cmd_am_tune_freq()
1520 int si476x_core_cmd_fm_rsq_status(struct si476x_core *core, in si476x_core_cmd_fm_rsq_status() argument
1525 BUG_ON(core->revision > SI476X_REVISION_A30 || in si476x_core_cmd_fm_rsq_status()
1526 core->revision == -1); in si476x_core_cmd_fm_rsq_status()
1527 return si476x_cmds_vtable[core->revision].fm_rsq_status(core, args, in si476x_core_cmd_fm_rsq_status()
1532 int si476x_core_cmd_agc_status(struct si476x_core *core, in si476x_core_cmd_agc_status() argument
1536 BUG_ON(core->revision > SI476X_REVISION_A30 || in si476x_core_cmd_agc_status()
1537 core->revision == -1); in si476x_core_cmd_agc_status()
1538 return si476x_cmds_vtable[core->revision].agc_status(core, report); in si476x_core_cmd_agc_status()
1542 int si476x_core_cmd_intb_pin_cfg(struct si476x_core *core, in si476x_core_cmd_intb_pin_cfg() argument
1546 BUG_ON(core->revision > SI476X_REVISION_A30 || in si476x_core_cmd_intb_pin_cfg()
1547 core->revision == -1); in si476x_core_cmd_intb_pin_cfg()
1549 return si476x_cmds_vtable[core->revision].intb_pin_cfg(core, intb, a1); in si476x_core_cmd_intb_pin_cfg()