Lines Matching +full:inter +full:- +full:chip

1 // SPDX-License-Identifier: GPL-2.0-only
3 * drivers/mfd/si476x-cmd.c -- Subroutines implementing command
21 #include <linux/mfd/si476x-core.h>
177 if (core->revision != SI476X_REVISION_A10) { in si476x_core_parse_and_nag_about_error()
184 err = -EINVAL; in si476x_core_parse_and_nag_about_error()
188 err = -EINVAL; in si476x_core_parse_and_nag_about_error()
192 err = -EINVAL; in si476x_core_parse_and_nag_about_error()
196 err = -EINVAL; in si476x_core_parse_and_nag_about_error()
200 err = -EINVAL; in si476x_core_parse_and_nag_about_error()
203 cause = "Chip is busy"; in si476x_core_parse_and_nag_about_error()
204 err = -EBUSY; in si476x_core_parse_and_nag_about_error()
208 err = -EIO; in si476x_core_parse_and_nag_about_error()
212 err = -EINVAL; in si476x_core_parse_and_nag_about_error()
216 err = -EINVAL; in si476x_core_parse_and_nag_about_error()
220 err = -EINVAL; in si476x_core_parse_and_nag_about_error()
224 err = -EIO; in si476x_core_parse_and_nag_about_error()
227 dev_err(&core->client->dev, in si476x_core_parse_and_nag_about_error()
228 "[Chip error status]: %s\n", cause); in si476x_core_parse_and_nag_about_error()
230 dev_err(&core->client->dev, in si476x_core_parse_and_nag_about_error()
232 err = (err >= 0) ? -EIO : err; in si476x_core_parse_and_nag_about_error()
235 err = -EIO; in si476x_core_parse_and_nag_about_error()
242 * si476x_core_send_command() - sends a command to si476x and waits its
265 struct i2c_client *client = core->client; in si476x_core_send_command()
270 err = -ENOMEM; in si476x_core_send_command()
274 if (!client->adapter) { in si476x_core_send_command()
275 err = -ENODEV; in si476x_core_send_command()
282 dev_dbg(&client->dev, "Command:\n %*ph\n", argn + 1, data); in si476x_core_send_command()
287 dev_err(&core->client->dev, in si476x_core_send_command()
290 err = (err >= 0) ? -EIO : err; in si476x_core_send_command()
295 atomic_set(&core->cts, 0); in si476x_core_send_command()
298 if (!wait_event_timeout(core->command, in si476x_core_send_command()
299 atomic_read(&core->cts), in si476x_core_send_command()
301 dev_warn(&core->client->dev, in si476x_core_send_command()
312 if (unlikely(!core->client->irq && command == CMD_POWER_UP)) { in si476x_core_send_command()
313 if (!wait_event_timeout(core->command, in si476x_core_send_command()
314 atomic_read(&core->cts), in si476x_core_send_command()
316 dev_warn(&core->client->dev, in si476x_core_send_command()
324 dev_err(&core->client->dev, in si476x_core_send_command()
327 err = (err >= 0) ? -EIO : err; in si476x_core_send_command()
330 dev_dbg(&client->dev, "Response:\n %*ph\n", respn, resp); in si476x_core_send_command()
335 dev_err(&core->client->dev, in si476x_core_send_command()
336 "[CMD 0x%02x] Chip set error flag\n", command); in si476x_core_send_command()
342 err = -EBUSY; in si476x_core_send_command()
358 switch (core->power_up_parameters.func) { in si476x_cmd_clear_stc()
366 err = -EINVAL; in si476x_cmd_clear_stc()
380 atomic_set(&core->stc, 0); in si476x_cmd_tune_seek_freq()
384 wait_event_killable(core->tuning, in si476x_cmd_tune_seek_freq()
385 atomic_read(&core->stc)); in si476x_cmd_tune_seek_freq()
393 * si476x_core_cmd_func_info() - send 'FUNC_INFO' command to the device
415 info->firmware.major = resp[1]; in si476x_core_cmd_func_info()
416 info->firmware.minor[0] = resp[2]; in si476x_core_cmd_func_info()
417 info->firmware.minor[1] = resp[3]; in si476x_core_cmd_func_info()
419 info->patch_id = ((u16) resp[4] << 8) | resp[5]; in si476x_core_cmd_func_info()
420 info->func = resp[6]; in si476x_core_cmd_func_info()
427 * si476x_core_cmd_set_property() - send 'SET_PROPERTY' command to the device
455 * si476x_core_cmd_get_property() - send 'GET_PROPERTY' command to the device
484 * si476x_core_cmd_dig_audio_pin_cfg() - send 'DIG_AUDIO_PIN_CFG' command to
488 * #SI476X_DCLK_NOOP - do not modify the behaviour
489 * #SI476X_DCLK_TRISTATE - put the pin in tristate condition,
491 * #SI476X_DCLK_DAUDIO - set the pin to be a part of digital
494 * #SI476X_DFS_NOOP - do not modify the behaviour
495 * #SI476X_DFS_TRISTATE - put the pin in tristate condition,
497 * SI476X_DFS_DAUDIO - set the pin to be a part of digital
499 * @dout: - DOUT pin function configuration:
500 * SI476X_DOUT_NOOP - do not modify the behaviour
501 * SI476X_DOUT_TRISTATE - put the pin in tristate condition,
503 * SI476X_DOUT_I2S_OUTPUT - set this pin to be digital out on I2S
505 * SI476X_DOUT_I2S_INPUT - set this pin to be digital in on I2S
507 * @xout: - XOUT pin function configuration:
508 * SI476X_XOUT_NOOP - do not modify the behaviour
509 * SI476X_XOUT_TRISTATE - put the pin in tristate condition,
511 * SI476X_XOUT_I2S_INPUT - set this pin to be digital in on I2S
513 * SI476X_XOUT_MODE_SELECT - set this pin to be the input that
542 * si476x_core_cmd_zif_pin_cfg - send 'ZIF_PIN_CFG_COMMAND'
543 * @core: - device to send the command to
544 * @iqclk: - IQCL pin function configuration:
545 * SI476X_IQCLK_NOOP - do not modify the behaviour
546 * SI476X_IQCLK_TRISTATE - put the pin in tristate condition,
548 * SI476X_IQCLK_IQ - set pin to be a part of I/Q interface
550 * @iqfs: - IQFS pin function configuration:
551 * SI476X_IQFS_NOOP - do not modify the behaviour
552 * SI476X_IQFS_TRISTATE - put the pin in tristate condition,
554 * SI476X_IQFS_IQ - set pin to be a part of I/Q interface
556 * @iout: - IOUT pin function configuration:
557 * SI476X_IOUT_NOOP - do not modify the behaviour
558 * SI476X_IOUT_TRISTATE - put the pin in tristate condition,
560 * SI476X_IOUT_OUTPUT - set pin to be I out
561 * @qout: - QOUT pin function configuration:
562 * SI476X_QOUT_NOOP - do not modify the behaviour
563 * SI476X_QOUT_TRISTATE - put the pin in tristate condition,
565 * SI476X_QOUT_OUTPUT - set pin to be Q out
591 * si476x_core_cmd_ic_link_gpo_ctl_pin_cfg - send
593 * @core: - device to send the command to
594 * @icin: - ICIN pin function configuration:
595 * SI476X_ICIN_NOOP - do not modify the behaviour
596 * SI476X_ICIN_TRISTATE - put the pin in tristate condition,
598 * SI476X_ICIN_GPO1_HIGH - set pin to be an output, drive it high
599 * SI476X_ICIN_GPO1_LOW - set pin to be an output, drive it low
600 * SI476X_ICIN_IC_LINK - set the pin to be a part of Inter-Chip link
601 * @icip: - ICIP pin function configuration:
602 * SI476X_ICIP_NOOP - do not modify the behaviour
603 * SI476X_ICIP_TRISTATE - put the pin in tristate condition,
605 * SI476X_ICIP_GPO1_HIGH - set pin to be an output, drive it high
606 * SI476X_ICIP_GPO1_LOW - set pin to be an output, drive it low
607 * SI476X_ICIP_IC_LINK - set the pin to be a part of Inter-Chip link
608 * @icon: - ICON pin function configuration:
609 * SI476X_ICON_NOOP - do not modify the behaviour
610 * SI476X_ICON_TRISTATE - put the pin in tristate condition,
612 * SI476X_ICON_I2S - set the pin to be a part of audio
614 * SI476X_ICON_IC_LINK - set the pin to be a part of Inter-Chip link
615 * @icop: - ICOP pin function configuration:
616 * SI476X_ICOP_NOOP - do not modify the behaviour
617 * SI476X_ICOP_TRISTATE - put the pin in tristate condition,
619 * SI476X_ICOP_I2S - set the pin to be a part of audio
622 * SI476X_ICOP_IC_LINK - set the pin to be a part of Inter-Chip link
648 * si476x_core_cmd_ana_audio_pin_cfg - send 'ANA_AUDIO_PIN_CFG' to the
650 * @core: - device to send the command to
651 * @lrout: - LROUT pin function configuration:
652 * SI476X_LROUT_NOOP - do not modify the behaviour
653 * SI476X_LROUT_TRISTATE - put the pin in tristate condition,
655 * SI476X_LROUT_AUDIO - set pin to be audio output
656 * SI476X_LROUT_MPX - set pin to be MPX output
677 * si476x_core_cmd_intb_pin_cfg_a10 - send 'INTB_PIN_CFG' command to the device
678 * @core: - device to send the command to
679 * @intb: - INTB pin function configuration:
680 * SI476X_INTB_NOOP - do not modify the behaviour
681 * SI476X_INTB_TRISTATE - put the pin in tristate condition,
683 * SI476X_INTB_DAUDIO - set pin to be a part of digital
685 * SI476X_INTB_IRQ - set pin to be an interrupt request line
686 * @a1: - A1 pin function configuration:
687 * SI476X_A1_NOOP - do not modify the behaviour
688 * SI476X_A1_TRISTATE - put the pin in tristate condition,
690 * SI476X_A1_IRQ - set pin to be an interrupt request line
729 * si476x_core_cmd_am_rsq_status - send 'AM_RSQ_STATUS' command to the
731 * @core: - device to send the command to
732 * @rsqargs: - pointer to a structure containing a group of sub-args
734 * @report: - all signal quality information returned by the command
746 rsqargs->rsqack << 3 | rsqargs->attune << 2 | in si476x_core_cmd_am_rsq_status()
747 rsqargs->cancel << 1 | rsqargs->stcack, in si476x_core_cmd_am_rsq_status()
764 report->snrhint = 0x08 & resp[1]; in si476x_core_cmd_am_rsq_status()
765 report->snrlint = 0x04 & resp[1]; in si476x_core_cmd_am_rsq_status()
766 report->rssihint = 0x02 & resp[1]; in si476x_core_cmd_am_rsq_status()
767 report->rssilint = 0x01 & resp[1]; in si476x_core_cmd_am_rsq_status()
769 report->bltf = 0x80 & resp[2]; in si476x_core_cmd_am_rsq_status()
770 report->snr_ready = 0x20 & resp[2]; in si476x_core_cmd_am_rsq_status()
771 report->rssiready = 0x08 & resp[2]; in si476x_core_cmd_am_rsq_status()
772 report->afcrl = 0x02 & resp[2]; in si476x_core_cmd_am_rsq_status()
773 report->valid = 0x01 & resp[2]; in si476x_core_cmd_am_rsq_status()
775 report->readfreq = get_unaligned_be16(resp + 3); in si476x_core_cmd_am_rsq_status()
776 report->freqoff = resp[5]; in si476x_core_cmd_am_rsq_status()
777 report->rssi = resp[6]; in si476x_core_cmd_am_rsq_status()
778 report->snr = resp[7]; in si476x_core_cmd_am_rsq_status()
779 report->lassi = resp[9]; in si476x_core_cmd_am_rsq_status()
780 report->hassi = resp[10]; in si476x_core_cmd_am_rsq_status()
781 report->mult = resp[11]; in si476x_core_cmd_am_rsq_status()
782 report->dev = resp[12]; in si476x_core_cmd_am_rsq_status()
798 return -EINVAL; in si476x_core_cmd_fm_acf_status()
807 report->blend_int = resp[1] & SI476X_ACF_BLEND_INT; in si476x_core_cmd_fm_acf_status()
808 report->hblend_int = resp[1] & SI476X_ACF_HIBLEND_INT; in si476x_core_cmd_fm_acf_status()
809 report->hicut_int = resp[1] & SI476X_ACF_HICUT_INT; in si476x_core_cmd_fm_acf_status()
810 report->chbw_int = resp[1] & SI476X_ACF_CHBW_INT; in si476x_core_cmd_fm_acf_status()
811 report->softmute_int = resp[1] & SI476X_ACF_SOFTMUTE_INT; in si476x_core_cmd_fm_acf_status()
812 report->smute = resp[2] & SI476X_ACF_SMUTE; in si476x_core_cmd_fm_acf_status()
813 report->smattn = resp[3] & SI476X_ACF_SMATTN; in si476x_core_cmd_fm_acf_status()
814 report->chbw = resp[4]; in si476x_core_cmd_fm_acf_status()
815 report->hicut = resp[5]; in si476x_core_cmd_fm_acf_status()
816 report->hiblend = resp[6]; in si476x_core_cmd_fm_acf_status()
817 report->pilot = resp[7] & SI476X_ACF_PILOT; in si476x_core_cmd_fm_acf_status()
818 report->stblend = resp[7] & SI476X_ACF_STBLEND; in si476x_core_cmd_fm_acf_status()
834 return -EINVAL; in si476x_core_cmd_am_acf_status()
843 report->blend_int = resp[1] & SI476X_ACF_BLEND_INT; in si476x_core_cmd_am_acf_status()
844 report->hblend_int = resp[1] & SI476X_ACF_HIBLEND_INT; in si476x_core_cmd_am_acf_status()
845 report->hicut_int = resp[1] & SI476X_ACF_HICUT_INT; in si476x_core_cmd_am_acf_status()
846 report->chbw_int = resp[1] & SI476X_ACF_CHBW_INT; in si476x_core_cmd_am_acf_status()
847 report->softmute_int = resp[1] & SI476X_ACF_SOFTMUTE_INT; in si476x_core_cmd_am_acf_status()
848 report->smute = resp[2] & SI476X_ACF_SMUTE; in si476x_core_cmd_am_acf_status()
849 report->smattn = resp[3] & SI476X_ACF_SMATTN; in si476x_core_cmd_am_acf_status()
850 report->chbw = resp[4]; in si476x_core_cmd_am_acf_status()
851 report->hicut = resp[5]; in si476x_core_cmd_am_acf_status()
859 * si476x_core_cmd_fm_seek_start - send 'FM_SEEK_START' command to the
861 * @core: - device to send the command to
862 * @seekup: - if set the direction of the search is 'up'
863 * @wrap: - if set seek wraps when hitting band limit
887 * si476x_core_cmd_fm_rds_status - send 'FM_RDS_STATUS' command to the
889 * @core: - device to send the command to
890 * @status_only: - if set the data is not removed from RDSFIFO,
895 * @report: - all signal quality information returned by the command
925 report->rdstpptyint = 0x10 & resp[1]; in si476x_core_cmd_fm_rds_status()
926 report->rdspiint = 0x08 & resp[1]; in si476x_core_cmd_fm_rds_status()
927 report->rdssyncint = 0x02 & resp[1]; in si476x_core_cmd_fm_rds_status()
928 report->rdsfifoint = 0x01 & resp[1]; in si476x_core_cmd_fm_rds_status()
930 report->tpptyvalid = 0x10 & resp[2]; in si476x_core_cmd_fm_rds_status()
931 report->pivalid = 0x08 & resp[2]; in si476x_core_cmd_fm_rds_status()
932 report->rdssync = 0x02 & resp[2]; in si476x_core_cmd_fm_rds_status()
933 report->rdsfifolost = 0x01 & resp[2]; in si476x_core_cmd_fm_rds_status()
935 report->tp = 0x20 & resp[3]; in si476x_core_cmd_fm_rds_status()
936 report->pty = 0x1f & resp[3]; in si476x_core_cmd_fm_rds_status()
938 report->pi = get_unaligned_be16(resp + 4); in si476x_core_cmd_fm_rds_status()
939 report->rdsfifoused = resp[6]; in si476x_core_cmd_fm_rds_status()
941 report->ble[V4L2_RDS_BLOCK_A] = 0xc0 & resp[7]; in si476x_core_cmd_fm_rds_status()
942 report->ble[V4L2_RDS_BLOCK_B] = 0x30 & resp[7]; in si476x_core_cmd_fm_rds_status()
943 report->ble[V4L2_RDS_BLOCK_C] = 0x0c & resp[7]; in si476x_core_cmd_fm_rds_status()
944 report->ble[V4L2_RDS_BLOCK_D] = 0x03 & resp[7]; in si476x_core_cmd_fm_rds_status()
946 report->rds[V4L2_RDS_BLOCK_A].block = V4L2_RDS_BLOCK_A; in si476x_core_cmd_fm_rds_status()
947 report->rds[V4L2_RDS_BLOCK_A].msb = resp[8]; in si476x_core_cmd_fm_rds_status()
948 report->rds[V4L2_RDS_BLOCK_A].lsb = resp[9]; in si476x_core_cmd_fm_rds_status()
950 report->rds[V4L2_RDS_BLOCK_B].block = V4L2_RDS_BLOCK_B; in si476x_core_cmd_fm_rds_status()
951 report->rds[V4L2_RDS_BLOCK_B].msb = resp[10]; in si476x_core_cmd_fm_rds_status()
952 report->rds[V4L2_RDS_BLOCK_B].lsb = resp[11]; in si476x_core_cmd_fm_rds_status()
954 report->rds[V4L2_RDS_BLOCK_C].block = V4L2_RDS_BLOCK_C; in si476x_core_cmd_fm_rds_status()
955 report->rds[V4L2_RDS_BLOCK_C].msb = resp[12]; in si476x_core_cmd_fm_rds_status()
956 report->rds[V4L2_RDS_BLOCK_C].lsb = resp[13]; in si476x_core_cmd_fm_rds_status()
958 report->rds[V4L2_RDS_BLOCK_D].block = V4L2_RDS_BLOCK_D; in si476x_core_cmd_fm_rds_status()
959 report->rds[V4L2_RDS_BLOCK_D].msb = resp[14]; in si476x_core_cmd_fm_rds_status()
960 report->rds[V4L2_RDS_BLOCK_D].lsb = resp[15]; in si476x_core_cmd_fm_rds_status()
977 return -EINVAL; in si476x_core_cmd_fm_rds_blockcount()
985 report->expected = get_unaligned_be16(resp + 2); in si476x_core_cmd_fm_rds_blockcount()
986 report->received = get_unaligned_be16(resp + 4); in si476x_core_cmd_fm_rds_blockcount()
987 report->uncorrectable = get_unaligned_be16(resp + 6); in si476x_core_cmd_fm_rds_blockcount()
1009 * si476x_core_cmd_fm_phase_div_status() - get the phase diversity
1035 * si476x_core_cmd_am_seek_start - send 'FM_SEEK_START' command to the
1037 * @core: - device to send the command to
1038 * @seekup: - if set the direction of the search is 'up'
1039 * @wrap: - if set seek wraps when hitting band limit
1068 const bool intsel = (core->pinmux.a1 == SI476X_A1_IRQ); in si476x_core_cmd_power_up_a10()
1069 const bool ctsen = (core->client->irq != 0); in si476x_core_cmd_power_up_a10()
1072 0x3F & puargs->xcload, /* First two bits are reserved to be in si476x_core_cmd_power_up_a10()
1077 puargs->func << 4 | puargs->freq, in si476x_core_cmd_power_up_a10()
1091 const bool intsel = (core->pinmux.a1 == SI476X_A1_IRQ); in si476x_core_cmd_power_up_a20()
1092 const bool ctsen = (core->client->irq != 0); in si476x_core_cmd_power_up_a20()
1094 puargs->ibias6x << 7 | puargs->xstart, in si476x_core_cmd_power_up_a20()
1095 0x3F & puargs->xcload, /* First two bits are reserved to be in si476x_core_cmd_power_up_a20()
1097 ctsen << 7 | intsel << 6 | puargs->fastboot << 5 | in si476x_core_cmd_power_up_a20()
1098 puargs->xbiashc << 3 | puargs->xbias, in si476x_core_cmd_power_up_a20()
1099 puargs->func << 4 | puargs->freq, in si476x_core_cmd_power_up_a20()
1100 0x10 | puargs->xmode, in si476x_core_cmd_power_up_a20()
1125 pdargs->xosc, in si476x_core_cmd_power_down_a20()
1137 const int am_freq = tuneargs->freq; in si476x_core_cmd_am_tune_freq_a10()
1140 (tuneargs->hd << 6), in si476x_core_cmd_am_tune_freq_a10()
1153 const int am_freq = tuneargs->freq; in si476x_core_cmd_am_tune_freq_a20()
1156 (tuneargs->zifsr << 6) | (tuneargs->injside & 0x03), in si476x_core_cmd_am_tune_freq_a20()
1173 rsqargs->rsqack << 3 | rsqargs->attune << 2 | in si476x_core_cmd_fm_rsq_status_a10()
1174 rsqargs->cancel << 1 | rsqargs->stcack, in si476x_core_cmd_fm_rsq_status_a10()
1191 report->multhint = 0x80 & resp[1]; in si476x_core_cmd_fm_rsq_status_a10()
1192 report->multlint = 0x40 & resp[1]; in si476x_core_cmd_fm_rsq_status_a10()
1193 report->snrhint = 0x08 & resp[1]; in si476x_core_cmd_fm_rsq_status_a10()
1194 report->snrlint = 0x04 & resp[1]; in si476x_core_cmd_fm_rsq_status_a10()
1195 report->rssihint = 0x02 & resp[1]; in si476x_core_cmd_fm_rsq_status_a10()
1196 report->rssilint = 0x01 & resp[1]; in si476x_core_cmd_fm_rsq_status_a10()
1198 report->bltf = 0x80 & resp[2]; in si476x_core_cmd_fm_rsq_status_a10()
1199 report->snr_ready = 0x20 & resp[2]; in si476x_core_cmd_fm_rsq_status_a10()
1200 report->rssiready = 0x08 & resp[2]; in si476x_core_cmd_fm_rsq_status_a10()
1201 report->afcrl = 0x02 & resp[2]; in si476x_core_cmd_fm_rsq_status_a10()
1202 report->valid = 0x01 & resp[2]; in si476x_core_cmd_fm_rsq_status_a10()
1204 report->readfreq = get_unaligned_be16(resp + 3); in si476x_core_cmd_fm_rsq_status_a10()
1205 report->freqoff = resp[5]; in si476x_core_cmd_fm_rsq_status_a10()
1206 report->rssi = resp[6]; in si476x_core_cmd_fm_rsq_status_a10()
1207 report->snr = resp[7]; in si476x_core_cmd_fm_rsq_status_a10()
1208 report->lassi = resp[9]; in si476x_core_cmd_fm_rsq_status_a10()
1209 report->hassi = resp[10]; in si476x_core_cmd_fm_rsq_status_a10()
1210 report->mult = resp[11]; in si476x_core_cmd_fm_rsq_status_a10()
1211 report->dev = resp[12]; in si476x_core_cmd_fm_rsq_status_a10()
1212 report->readantcap = get_unaligned_be16(resp + 13); in si476x_core_cmd_fm_rsq_status_a10()
1213 report->assi = resp[15]; in si476x_core_cmd_fm_rsq_status_a10()
1214 report->usn = resp[16]; in si476x_core_cmd_fm_rsq_status_a10()
1226 rsqargs->primary << 4 | rsqargs->rsqack << 3 | in si476x_core_cmd_fm_rsq_status_a20()
1227 rsqargs->attune << 2 | rsqargs->cancel << 1 | in si476x_core_cmd_fm_rsq_status_a20()
1228 rsqargs->stcack, in si476x_core_cmd_fm_rsq_status_a20()
1245 report->multhint = 0x80 & resp[1]; in si476x_core_cmd_fm_rsq_status_a20()
1246 report->multlint = 0x40 & resp[1]; in si476x_core_cmd_fm_rsq_status_a20()
1247 report->snrhint = 0x08 & resp[1]; in si476x_core_cmd_fm_rsq_status_a20()
1248 report->snrlint = 0x04 & resp[1]; in si476x_core_cmd_fm_rsq_status_a20()
1249 report->rssihint = 0x02 & resp[1]; in si476x_core_cmd_fm_rsq_status_a20()
1250 report->rssilint = 0x01 & resp[1]; in si476x_core_cmd_fm_rsq_status_a20()
1252 report->bltf = 0x80 & resp[2]; in si476x_core_cmd_fm_rsq_status_a20()
1253 report->snr_ready = 0x20 & resp[2]; in si476x_core_cmd_fm_rsq_status_a20()
1254 report->rssiready = 0x08 & resp[2]; in si476x_core_cmd_fm_rsq_status_a20()
1255 report->afcrl = 0x02 & resp[2]; in si476x_core_cmd_fm_rsq_status_a20()
1256 report->valid = 0x01 & resp[2]; in si476x_core_cmd_fm_rsq_status_a20()
1258 report->readfreq = get_unaligned_be16(resp + 3); in si476x_core_cmd_fm_rsq_status_a20()
1259 report->freqoff = resp[5]; in si476x_core_cmd_fm_rsq_status_a20()
1260 report->rssi = resp[6]; in si476x_core_cmd_fm_rsq_status_a20()
1261 report->snr = resp[7]; in si476x_core_cmd_fm_rsq_status_a20()
1262 report->lassi = resp[9]; in si476x_core_cmd_fm_rsq_status_a20()
1263 report->hassi = resp[10]; in si476x_core_cmd_fm_rsq_status_a20()
1264 report->mult = resp[11]; in si476x_core_cmd_fm_rsq_status_a20()
1265 report->dev = resp[12]; in si476x_core_cmd_fm_rsq_status_a20()
1266 report->readantcap = get_unaligned_be16(resp + 13); in si476x_core_cmd_fm_rsq_status_a20()
1267 report->assi = resp[15]; in si476x_core_cmd_fm_rsq_status_a20()
1268 report->usn = resp[16]; in si476x_core_cmd_fm_rsq_status_a20()
1281 rsqargs->primary << 4 | rsqargs->rsqack << 3 | in si476x_core_cmd_fm_rsq_status_a30()
1282 rsqargs->attune << 2 | rsqargs->cancel << 1 | in si476x_core_cmd_fm_rsq_status_a30()
1283 rsqargs->stcack, in si476x_core_cmd_fm_rsq_status_a30()
1300 report->multhint = 0x80 & resp[1]; in si476x_core_cmd_fm_rsq_status_a30()
1301 report->multlint = 0x40 & resp[1]; in si476x_core_cmd_fm_rsq_status_a30()
1302 report->snrhint = 0x08 & resp[1]; in si476x_core_cmd_fm_rsq_status_a30()
1303 report->snrlint = 0x04 & resp[1]; in si476x_core_cmd_fm_rsq_status_a30()
1304 report->rssihint = 0x02 & resp[1]; in si476x_core_cmd_fm_rsq_status_a30()
1305 report->rssilint = 0x01 & resp[1]; in si476x_core_cmd_fm_rsq_status_a30()
1307 report->bltf = 0x80 & resp[2]; in si476x_core_cmd_fm_rsq_status_a30()
1308 report->snr_ready = 0x20 & resp[2]; in si476x_core_cmd_fm_rsq_status_a30()
1309 report->rssiready = 0x08 & resp[2]; in si476x_core_cmd_fm_rsq_status_a30()
1310 report->injside = 0x04 & resp[2]; in si476x_core_cmd_fm_rsq_status_a30()
1311 report->afcrl = 0x02 & resp[2]; in si476x_core_cmd_fm_rsq_status_a30()
1312 report->valid = 0x01 & resp[2]; in si476x_core_cmd_fm_rsq_status_a30()
1314 report->readfreq = get_unaligned_be16(resp + 3); in si476x_core_cmd_fm_rsq_status_a30()
1315 report->freqoff = resp[5]; in si476x_core_cmd_fm_rsq_status_a30()
1316 report->rssi = resp[6]; in si476x_core_cmd_fm_rsq_status_a30()
1317 report->snr = resp[7]; in si476x_core_cmd_fm_rsq_status_a30()
1318 report->issi = resp[8]; in si476x_core_cmd_fm_rsq_status_a30()
1319 report->lassi = resp[9]; in si476x_core_cmd_fm_rsq_status_a30()
1320 report->hassi = resp[10]; in si476x_core_cmd_fm_rsq_status_a30()
1321 report->mult = resp[11]; in si476x_core_cmd_fm_rsq_status_a30()
1322 report->dev = resp[12]; in si476x_core_cmd_fm_rsq_status_a30()
1323 report->readantcap = get_unaligned_be16(resp + 13); in si476x_core_cmd_fm_rsq_status_a30()
1324 report->assi = resp[15]; in si476x_core_cmd_fm_rsq_status_a30()
1325 report->usn = resp[16]; in si476x_core_cmd_fm_rsq_status_a30()
1327 report->pilotdev = resp[17]; in si476x_core_cmd_fm_rsq_status_a30()
1328 report->rdsdev = resp[18]; in si476x_core_cmd_fm_rsq_status_a30()
1329 report->assidev = resp[19]; in si476x_core_cmd_fm_rsq_status_a30()
1330 report->strongdev = resp[20]; in si476x_core_cmd_fm_rsq_status_a30()
1331 report->rdspi = get_unaligned_be16(resp + 21); in si476x_core_cmd_fm_rsq_status_a30()
1341 (tuneargs->hd << 6) | (tuneargs->tunemode << 4) in si476x_core_cmd_fm_tune_freq_a10()
1342 | (tuneargs->smoothmetrics << 2), in si476x_core_cmd_fm_tune_freq_a10()
1343 msb(tuneargs->freq), in si476x_core_cmd_fm_tune_freq_a10()
1344 lsb(tuneargs->freq), in si476x_core_cmd_fm_tune_freq_a10()
1345 msb(tuneargs->antcap), in si476x_core_cmd_fm_tune_freq_a10()
1346 lsb(tuneargs->antcap) in si476x_core_cmd_fm_tune_freq_a10()
1359 (tuneargs->hd << 6) | (tuneargs->tunemode << 4) in si476x_core_cmd_fm_tune_freq_a20()
1360 | (tuneargs->smoothmetrics << 2) | (tuneargs->injside), in si476x_core_cmd_fm_tune_freq_a20()
1361 msb(tuneargs->freq), in si476x_core_cmd_fm_tune_freq_a20()
1362 lsb(tuneargs->freq), in si476x_core_cmd_fm_tune_freq_a20()
1377 return -EINVAL; in si476x_core_cmd_agc_status_a20()
1386 report->mxhi = resp[1] & SI476X_AGC_MXHI; in si476x_core_cmd_agc_status_a20()
1387 report->mxlo = resp[1] & SI476X_AGC_MXLO; in si476x_core_cmd_agc_status_a20()
1388 report->lnahi = resp[1] & SI476X_AGC_LNAHI; in si476x_core_cmd_agc_status_a20()
1389 report->lnalo = resp[1] & SI476X_AGC_LNALO; in si476x_core_cmd_agc_status_a20()
1390 report->fmagc1 = resp[2]; in si476x_core_cmd_agc_status_a20()
1391 report->fmagc2 = resp[3]; in si476x_core_cmd_agc_status_a20()
1392 report->pgagain = resp[4]; in si476x_core_cmd_agc_status_a20()
1393 report->fmwblang = resp[5]; in si476x_core_cmd_agc_status_a20()
1405 return -EINVAL; in si476x_core_cmd_agc_status_a10()
1414 report->mxhi = resp[1] & SI476X_AGC_MXHI; in si476x_core_cmd_agc_status_a10()
1415 report->mxlo = resp[1] & SI476X_AGC_MXLO; in si476x_core_cmd_agc_status_a10()
1416 report->lnahi = resp[1] & SI476X_AGC_LNAHI; in si476x_core_cmd_agc_status_a10()
1417 report->lnalo = resp[1] & SI476X_AGC_LNALO; in si476x_core_cmd_agc_status_a10()
1476 BUG_ON(core->revision > SI476X_REVISION_A30 || in si476x_core_cmd_power_up()
1477 core->revision == -1); in si476x_core_cmd_power_up()
1478 return si476x_cmds_vtable[core->revision].power_up(core, args); in si476x_core_cmd_power_up()
1485 BUG_ON(core->revision > SI476X_REVISION_A30 || in si476x_core_cmd_power_down()
1486 core->revision == -1); in si476x_core_cmd_power_down()
1487 return si476x_cmds_vtable[core->revision].power_down(core, args); in si476x_core_cmd_power_down()
1494 BUG_ON(core->revision > SI476X_REVISION_A30 || in si476x_core_cmd_fm_tune_freq()
1495 core->revision == -1); in si476x_core_cmd_fm_tune_freq()
1496 return si476x_cmds_vtable[core->revision].fm_tune_freq(core, args); in si476x_core_cmd_fm_tune_freq()
1503 BUG_ON(core->revision > SI476X_REVISION_A30 || in si476x_core_cmd_am_tune_freq()
1504 core->revision == -1); in si476x_core_cmd_am_tune_freq()
1505 return si476x_cmds_vtable[core->revision].am_tune_freq(core, args); in si476x_core_cmd_am_tune_freq()
1514 BUG_ON(core->revision > SI476X_REVISION_A30 || in si476x_core_cmd_fm_rsq_status()
1515 core->revision == -1); in si476x_core_cmd_fm_rsq_status()
1516 return si476x_cmds_vtable[core->revision].fm_rsq_status(core, args, in si476x_core_cmd_fm_rsq_status()
1525 BUG_ON(core->revision > SI476X_REVISION_A30 || in si476x_core_cmd_agc_status()
1526 core->revision == -1); in si476x_core_cmd_agc_status()
1527 return si476x_cmds_vtable[core->revision].agc_status(core, report); in si476x_core_cmd_agc_status()
1535 BUG_ON(core->revision > SI476X_REVISION_A30 || in si476x_core_cmd_intb_pin_cfg()
1536 core->revision == -1); in si476x_core_cmd_intb_pin_cfg()
1538 return si476x_cmds_vtable[core->revision].intb_pin_cfg(core, intb, a1); in si476x_core_cmd_intb_pin_cfg()